| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- using UnityEngine;
- using GadgetCore.API;
- namespace ScrapYard
- {
- [Gadget("ScrapYard")]
- public class ScrapYard : Gadget<ScrapYard>
- {
- public const string MOD_VERSION = "1.0"; // Set this to the version of your mod.
- public const string CONFIG_VERSION = "1.0"; // Increment this whenever you change your mod's config file.
- protected override void LoadConfig()
- {
- Config.Load();
- string fileVersion = Config.ReadString("ConfigVersion", CONFIG_VERSION, comments: "The Config Version (not to be confused with mod version)");
- if (fileVersion != CONFIG_VERSION)
- {
- Config.Reset();
- Config.WriteString("ConfigVersion", CONFIG_VERSION, comments: "The Config Version (not to be confused with mod version)");
- }
- Config.Save();
- }
- public override string GetModDescription()
- {
- return "A mod that adds a scryp yard planet.";
- }
- protected override void Initialize()
- {
- Logger.Log("ScrapYard v" + Info.Mod.Version);
- Core.logger = Logger;
- Texture2D texturePlanetIcon = GadgetCoreAPI.LoadTexture2D("planetScrapYard.png", false);
- Texture2D texturePlanetPrevIcon = GadgetCoreAPI.LoadTexture2D("planetScrapYardPrev.png", false);
- Texture2D texturePortalSign = GadgetCoreAPI.LoadTexture2D("signScrapYard.png", false);
- Texture2D textureBG= GadgetCoreAPI.LoadTexture2D("bgScrapYard.png", false);
- Texture2D textureParalex0 = GadgetCoreAPI.LoadTexture2D("bScrapYardbg0.png", false);
- Texture2D textureParalex1 = GadgetCoreAPI.LoadTexture2D("bScrapYardbg1.png", false);
- Texture2D textureParalex2 = GadgetCoreAPI.LoadTexture2D("bScrapYardbg2.png", false);
- Texture2D textureParalex3 = GadgetCoreAPI.LoadTexture2D("bScrapYardbg3.png", false);
- Texture2D textureEntrance = GadgetCoreAPI.LoadTexture2D("entranceScrapYard.png", false);
- Texture2D textureSmallSide = GadgetCoreAPI.LoadTexture2D("sideSmallScrapYard.png", false);
- Texture2D textureBigSide = GadgetCoreAPI.LoadTexture2D("sideBigScrapYard.png", false);
- Texture2D textureMid0 = GadgetCoreAPI.LoadTexture2D("midScrapYardChunk0.png", false);
- Texture2D textureMid1 = GadgetCoreAPI.LoadTexture2D("midScrapYardChunk1.png", false);
- PlanetInfo scrapYardPlanet = new PlanetInfo(PlanetType.NORMAL, "Scrap Yard", new GadgetCore.Util.Tuple<int, int>[] { new GadgetCore.Util.Tuple<int, int>(1, 100) });
- scrapYardPlanet.SetPortalInfo(texturePortalSign, texturePlanetPrevIcon, texturePlanetIcon);
- scrapYardPlanet.SetBackgroundInfo(textureBG, textureParalex0, textureParalex1, textureParalex2, textureParalex3);
- scrapYardPlanet.SetTerrainInfo(textureEntrance, textureBG, textureMid0, textureMid1, textureBigSide, textureSmallSide);
- scrapYardPlanet.Register("Scrap Yard");
- //PlanetRegistry.SetVanillaExitPortalWeight(0, scrapYardPlanet.GetID(), 1000);
- }
- }
- }
|