StorageExpansion.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using UnityEngine;
  2. using GadgetCore.API;
  3. using GadgetCore.API.ConfigMenu;
  4. using UnityEngine.SceneManagement;
  5. namespace StorageExpansion
  6. {
  7. [Gadget("StorageExpansion", LoadBefore: new string[] { "QuickStack" })]
  8. public class StorageExpansion : Gadget<StorageExpansion>
  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. Core.settingSizeEnum = Config.ReadEnum("StorageSize", StorageSizeEnum.Large, requiresRestart: true, comments: new string[] { "How large should your storage be?", "!! Restart required !!" });
  22. Config.Save();
  23. }
  24. public override string GetModDescription()
  25. {
  26. return "Increases the available storage space.";
  27. }
  28. protected override void Initialize()
  29. {
  30. Logger.Log("Storage Expansion v" + Info.Mod.Version);
  31. Core.logger = Logger;
  32. SceneManager.sceneLoaded += OnSceneLoaded;
  33. }
  34. internal static void OnSceneLoaded(Scene scene, LoadSceneMode mode)
  35. {
  36. if (scene.buildIndex == 1)
  37. {
  38. }
  39. }
  40. }
  41. }