MonsterNests.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using UnityEngine;
  2. using GadgetCore.API;
  3. using GadgetCore.Util;
  4. using GadgetCore.API.ConfigMenu;
  5. namespace MonsterNests
  6. {
  7. [Gadget("MonsterNests")]
  8. public class MonsterNests : Gadget<MonsterNests>
  9. {
  10. public const string MOD_VERSION = "1.0"; // Set this to the version of your mod.
  11. public const string CONFIG_VERSION = "1.0"; // Increment this whenever you change your mod's config file.
  12. protected override void LoadConfig()
  13. {
  14. Config.Load();
  15. string fileVersion = Config.ReadString("ConfigVersion", CONFIG_VERSION, comments: "The Config Version (not to be confused with mod version)");
  16. if (fileVersion != CONFIG_VERSION)
  17. {
  18. Config.Reset();
  19. Config.WriteString("ConfigVersion", CONFIG_VERSION, comments: "The Config Version (not to be confused with mod version)");
  20. }
  21. Config.Reset();
  22. Config.Save();
  23. }
  24. public override IGadgetConfigMenu GetConfigMenu() { return null; }
  25. public override string GetModDescription()
  26. {
  27. return "A mod that adds some monster nests.";
  28. }
  29. protected override void Initialize()
  30. {
  31. Logger.Log("Monster Nests v" + Info.Mod.Version);
  32. Core.logger = Logger;
  33. Texture2D textureBugspotBig = GadgetCoreAPI.LoadTexture2D("bugspotBig.png");
  34. Texture2D textureSpiderEgg = GadgetCoreAPI.LoadTexture2D("spiderEgg.png");
  35. Texture2D textureGoldenShroom = GadgetCoreAPI.LoadTexture2D("goldenShroom.png");
  36. Core.objectBugspotBig = new ObjectInfo(ObjectType.BUGSPOT, new Item(31, 1, 0, 0, 0, new int[3], new int[3]), 22, textureBugspotBig).Register("bugspotBig");
  37. Core.objectSpiderEgg = new ObjectInfo(ObjectType.ORE, new Item(3, 1, 0, 0, 0, new int[3], new int[3]), 22, textureSpiderEgg).Register("spiderEgg");
  38. Core.objectGoldenShroom = new ObjectInfo(ObjectType.PLANT, new Item(12, 1, 0, 0, 0, new int[3], new int[3]), 22, textureGoldenShroom).Register("goldenShroom");
  39. }
  40. }
  41. }