MoreLights.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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.3"; // 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.itemIDs = new int[11];
  22. Core.itemIDs[1] = ItemUtil.CreatePlacableLightItem("cTurquoiseLamp.png", "iTurquoiseLamp.png", "Turquoise Light", new Color(0f, 0.6f, 0.35f, 1));
  23. Core.itemIDs[2] = ItemUtil.CreatePlacableLightItem("cGreenLamp.png", "iGreenLamp.png", "Green Light", new Color(0.1f, 0.6f, 0, 1));
  24. Core.itemIDs[3] = ItemUtil.CreatePlacableLightItem("cLightGreenLamp.png", "iLightGreenLamp.png", "Light Green Light", new Color(0.28f, 0.4f, 0, 1));
  25. Core.itemIDs[4] = ItemUtil.CreatePlacableLightItem("cYellowLamp.png", "iYellowLamp.png", "Yellow Light", new Color(0.9f, 0.75f, 0, 1));
  26. Core.itemIDs[5] = ItemUtil.CreatePlacableLightItem("cLightOrangeLamp.png", "iLightOrangeLamp.png", "Light Orange Light", new Color(0.55f, 0.2f, 0, 1));
  27. Core.itemIDs[6] = ItemUtil.CreatePlacableLightItem("cOrangeLamp.png", "iOrangeLamp.png", "Orange Light", new Color(0.65f, 0.15f, 0, 1));
  28. Core.itemIDs[7] = ItemUtil.CreatePlacableLightItem("cDarkOrangeLamp.png", "iDarkOrangeLamp.png", "Dark Orange Light", new Color(0.63f, 0.08f, 0, 1));
  29. Core.itemIDs[8] = ItemUtil.CreatePlacableLightItem("cPinkLamp.png", "iPinkLamp.png", "Pink Light", new Color(0.7f, 0, 0.3f, 1));
  30. Core.itemIDs[9] = ItemUtil.CreatePlacableLightItem("cPurpleLamp.png", "iPurpleLamp.png", "Purple Light", new Color(0.5f, 0, 0.6f, 1));
  31. Core.itemIDs[10] = ItemUtil.CreatePlacableLightItem("cDarkPurpleLamp.png", "iDarkPurpleLamp.png", "Dark Purple Light", new Color(0.28f, 0.0f, 0.7f, 1));
  32. Core.itemIDs[0] = ItemUtil.CreatePlacableLightItem("cWhiteLamp.png", "iWhiteLamp.png", "White Light", new Color(0.8f, 0.8f, 0.8f, 1));
  33. foreach (var e in ShopPlatform.DefaultObjects.GetShopPlatformEntries())
  34. {
  35. if (e.ItemID == 2401 || e.ItemID == 2402)
  36. {
  37. ShopPlatform.DefaultObjects.RemoveShopPlatformEntry(e);
  38. }
  39. }
  40. var lightsPlatform = new ShopPlatform("Lights", spacingType: ShopPlatformSpacingType.Near).Register();
  41. lightsPlatform.AddShopPlatformEntry(new ShopPlatformEntry(Core.itemIDs[0], 1000));
  42. lightsPlatform.AddShopPlatformEntry(new ShopPlatformEntry(Core.itemIDs[3], 1000));
  43. lightsPlatform.AddShopPlatformEntry(new ShopPlatformEntry(Core.itemIDs[4], 1000));
  44. lightsPlatform.AddShopPlatformEntry(new ShopPlatformEntry(Core.itemIDs[5], 1000));
  45. lightsPlatform.AddShopPlatformEntry(new ShopPlatformEntry(Core.itemIDs[6], 1000));
  46. lightsPlatform.AddShopPlatformEntry(new ShopPlatformEntry(Core.itemIDs[7], 1000));
  47. lightsPlatform.AddShopPlatformEntry(new ShopPlatformEntry(2402, 1000));
  48. lightsPlatform.AddShopPlatformEntry(new ShopPlatformEntry(Core.itemIDs[8], 1000));
  49. lightsPlatform.AddShopPlatformEntry(new ShopPlatformEntry(Core.itemIDs[9], 1000));
  50. lightsPlatform.AddShopPlatformEntry(new ShopPlatformEntry(Core.itemIDs[10], 1000));
  51. lightsPlatform.AddShopPlatformEntry(new ShopPlatformEntry(2401, 1000));
  52. lightsPlatform.AddShopPlatformEntry(new ShopPlatformEntry(Core.itemIDs[1], 1000));
  53. lightsPlatform.AddShopPlatformEntry(new ShopPlatformEntry(Core.itemIDs[2], 1000));
  54. }
  55. }
  56. }