CombatChipChest.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using GadgetCore.API;
  2. using GadgetCore.API.ConfigMenu;
  3. using ScrapYard.API;
  4. using UnityEngine;
  5. namespace CombatChipChest
  6. {
  7. [Gadget("CombatChipChest", LoadAfter: new string[] { "ScrapYard" }, Dependencies: new string[] { "ScrapYard" })]
  8. public class CombatChipChest : Gadget<CombatChipChest>
  9. {
  10. public const string MOD_VERSION = "1.2"; // 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. public override IGadgetConfigMenu GetConfigMenu() { return null; }
  13. protected override void LoadConfig() { Config.Reset(); Config.Save(); }
  14. public override string GetModDescription()
  15. {
  16. return "A mod that adds a combat chip chest block for your ship.";
  17. }
  18. protected override void Initialize()
  19. {
  20. Logger.Log("Combat Chip Chest v" + Info.Mod.Version);
  21. Core.logger = Logger;
  22. var tile = ItemUtil.CreatePlacableItem("cCombatSimulator.png", "iCombatSimulator.png", "Combat Chest");
  23. Core.itemCombatChipChestId = tile.Item.GetID();
  24. Core.npcID = tile.GetID();
  25. var asset = GadgetCoreAPI.LoadAssetBundle("menucombat");
  26. var menuCombat = UnityEngine.Object.Instantiate((GameObject)asset.LoadAsset("assets/resources/menucombat.prefab"));
  27. menuCombat.transform.localPosition = new Vector3(0, 0, -3);
  28. menuCombat.AddComponent<MenuOpenEventScript>();
  29. Core.menu = new MenuInfo(MenuType.CHIP, menuCombat, tile);
  30. Core.menu.Register("Combat Chip Chest");
  31. ShopPlatform.DefaultObjects.AddShopPlatformEntry(new ShopPlatformEntry(Core.itemCombatChipChestId, 1000));
  32. }
  33. }
  34. }