MoreLights.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using GadgetCore.API;
  2. using GadgetCore.API.ConfigMenu;
  3. using ScrapYard.API;
  4. using UnityEngine;
  5. namespace MoreLights
  6. {
  7. [Gadget("MoreLights", LoadAfter: new string[] { "ScrapYard" }, Dependencies: new string[] { "ScrapYard" })]
  8. public class MoreLights : Gadget<MoreLights>
  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. public override string GetModDescription()
  14. {
  15. return "A mod that adds some more lights.";
  16. }
  17. protected override void Initialize()
  18. {
  19. Logger.Log("More Lights v" + Info.Mod.Version);
  20. Core.logger = Logger;
  21. Core.itemGreenLampId = ItemUtil.CreatePlacableLightItem("cGreenLamp.png", "iGreenLamp.png", "Green Light", new Color(0.1f, 0.6f, 0, 1));
  22. Core.itemYellowLampId = ItemUtil.CreatePlacableLightItem("cYellowLamp.png", "iYellowLamp.png", "Yellow Light", new Color(0.9f, 0.75f, 0, 1));
  23. Core.itemOrangeLampId = ItemUtil.CreatePlacableLightItem("cOrangeLamp.png", "iOrangeLamp.png", "Orange Light", new Color(0.7f, 0.15f, 0, 1));
  24. Core.itemPurpleLampId = ItemUtil.CreatePlacableLightItem("cPurpleLamp.png", "iPurpleLamp.png", "Purple Light", new Color(0.5f, 0, 0.6f, 1));
  25. Core.itemWhiteLampId = ItemUtil.CreatePlacableLightItem("cWhiteLamp.png", "iWhiteLamp.png", "White Light", new Color(0.8f, 0.8f, 0.8f, 1));
  26. foreach (var e in ShopPlatform.DefaultObjects.GetShopPlatformEntries())
  27. {
  28. if(e.ItemID == 2401 || e.ItemID == 2402)
  29. {
  30. ShopPlatform.DefaultObjects.RemoveShopPlatformEntry(e);
  31. }
  32. }
  33. var lightsPlatform = new ShopPlatform("Lights").Register();
  34. lightsPlatform.AddShopPlatformEntry(new ShopPlatformEntry(Core.itemWhiteLampId, 1000));
  35. lightsPlatform.AddShopPlatformEntry(new ShopPlatformEntry(Core.itemYellowLampId, 1000));
  36. lightsPlatform.AddShopPlatformEntry(new ShopPlatformEntry(Core.itemOrangeLampId, 1000));
  37. lightsPlatform.AddShopPlatformEntry(new ShopPlatformEntry(2402, 1000));
  38. lightsPlatform.AddShopPlatformEntry(new ShopPlatformEntry(Core.itemPurpleLampId, 1000));
  39. lightsPlatform.AddShopPlatformEntry(new ShopPlatformEntry(2401, 1000));
  40. lightsPlatform.AddShopPlatformEntry(new ShopPlatformEntry(Core.itemGreenLampId, 1000));
  41. }
  42. }
  43. }