|
@@ -10,7 +10,7 @@ namespace ScrapYard
|
|
|
[Gadget("ScrapYard")]
|
|
[Gadget("ScrapYard")]
|
|
|
public class 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 MOD_VERSION = "1.2"; // 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.
|
|
public const string CONFIG_VERSION = "1.0"; // Increment this whenever you change your mod's config file.
|
|
|
|
|
|
|
|
protected override void LoadConfig()
|
|
protected override void LoadConfig()
|
|
@@ -61,6 +61,8 @@ namespace ScrapYard
|
|
|
|
|
|
|
|
Texture2D textureScrapTrophy = GadgetCoreAPI.LoadTexture2D("iScrapTrophy.png");
|
|
Texture2D textureScrapTrophy = GadgetCoreAPI.LoadTexture2D("iScrapTrophy.png");
|
|
|
|
|
|
|
|
|
|
+ Logger.Log("Loaded Textures");
|
|
|
|
|
+
|
|
|
PlanetInfo scrapYardPlanet = new PlanetInfo(PlanetType.SPECIAL, "Scrap Yard", new GadgetCore.Util.Tuple<int, int>[] { new GadgetCore.Util.Tuple<int, int>(1, 100) });
|
|
PlanetInfo scrapYardPlanet = new PlanetInfo(PlanetType.SPECIAL, "Scrap Yard", new GadgetCore.Util.Tuple<int, int>[] { new GadgetCore.Util.Tuple<int, int>(1, 100) });
|
|
|
scrapYardPlanet.SetPortalInfo(texturePortalSign, texturePlanetPrevIcon, texturePlanetIcon);
|
|
scrapYardPlanet.SetPortalInfo(texturePortalSign, texturePlanetPrevIcon, texturePlanetIcon);
|
|
|
scrapYardPlanet.SetBackgroundInfo(textureParalex, textureParalex0, textureParalex1, textureParalex2, textureParalex3);
|
|
scrapYardPlanet.SetBackgroundInfo(textureParalex, textureParalex0, textureParalex1, textureParalex2, textureParalex3);
|
|
@@ -71,6 +73,8 @@ namespace ScrapYard
|
|
|
|
|
|
|
|
scrapYardPlanet.PortalUses = -1;
|
|
scrapYardPlanet.PortalUses = -1;
|
|
|
|
|
|
|
|
|
|
+ Logger.Log("Created Planet");
|
|
|
|
|
+
|
|
|
new ItemInfo(ItemType.GENERIC, "Scrap Trophy", "A rusty trophy.\nUsed for purchasing\nspecial items.", textureScrapTrophy).Register("Scrap Trophy");
|
|
new ItemInfo(ItemType.GENERIC, "Scrap Trophy", "A rusty trophy.\nUsed for purchasing\nspecial items.", textureScrapTrophy).Register("Scrap Trophy");
|
|
|
|
|
|
|
|
{ // Scrap Yard Bulding
|
|
{ // Scrap Yard Bulding
|
|
@@ -247,6 +251,8 @@ namespace ScrapYard
|
|
|
tile.OnInteract += OnInteractStand;
|
|
tile.OnInteract += OnInteractStand;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ Logger.Log("Created Prefabes");
|
|
|
|
|
+
|
|
|
// Setting up default shop platforms
|
|
// Setting up default shop platforms
|
|
|
new ShopPlatform("Default Objects", ShopPlatformSpacingType.Near).Register();
|
|
new ShopPlatform("Default Objects", ShopPlatformSpacingType.Near).Register();
|
|
|
new ShopPlatform("Default Blocks", ShopPlatformSpacingType.Near).Register();
|
|
new ShopPlatform("Default Blocks", ShopPlatformSpacingType.Near).Register();
|
|
@@ -273,7 +279,11 @@ namespace ScrapYard
|
|
|
|
|
|
|
|
ShopPlatform.DefaultWalls.AddShopPlatformEntry(new ShopPlatformEntry(2200, 50));
|
|
ShopPlatform.DefaultWalls.AddShopPlatformEntry(new ShopPlatformEntry(2200, 50));
|
|
|
|
|
|
|
|
|
|
+ Logger.Log("Added Default Objects to the Planet");
|
|
|
|
|
+
|
|
|
SceneManager.sceneLoaded += OnSceneLoaded;
|
|
SceneManager.sceneLoaded += OnSceneLoaded;
|
|
|
|
|
+
|
|
|
|
|
+ Logger.Log("Added Scene Hook");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
internal static void OnSceneLoaded(Scene scene, LoadSceneMode mode)
|
|
internal static void OnSceneLoaded(Scene scene, LoadSceneMode mode)
|
|
@@ -283,6 +293,7 @@ namespace ScrapYard
|
|
|
try
|
|
try
|
|
|
{
|
|
{
|
|
|
var storageMenu = GameObject.Find("Ship").transform.Find("SHIPPLACES").transform.Find("mech").localPosition = new Vector3(-130f, -5.23f, 0.6f);
|
|
var storageMenu = GameObject.Find("Ship").transform.Find("SHIPPLACES").transform.Find("mech").localPosition = new Vector3(-130f, -5.23f, 0.6f);
|
|
|
|
|
+ Core.logger.Log("Moved the Mech");
|
|
|
}
|
|
}
|
|
|
catch (System.Exception e) { Core.logger.LogError(e.Message); }
|
|
catch (System.Exception e) { Core.logger.LogError(e.Message); }
|
|
|
}
|
|
}
|
|
@@ -293,10 +304,20 @@ namespace ScrapYard
|
|
|
|
|
|
|
|
private IEnumerator OnInteractStand()
|
|
private IEnumerator OnInteractStand()
|
|
|
{
|
|
{
|
|
|
- PlayerScript.curInteractObj.SendMessage("Request");
|
|
|
|
|
- canInteractField.SetValue(InstanceTracker.PlayerScript, true);
|
|
|
|
|
- interactingField.SetValue(InstanceTracker.PlayerScript, false);
|
|
|
|
|
- InstanceTracker.PlayerScript.w.SetActive(true);
|
|
|
|
|
|
|
+ Core.logger.Log("Start Interaction Stand");
|
|
|
|
|
+ try
|
|
|
|
|
+ {
|
|
|
|
|
+ PlayerScript.curInteractObj.SendMessage("Request");
|
|
|
|
|
+ Core.logger.Log("Requested Item");
|
|
|
|
|
+ canInteractField.SetValue(InstanceTracker.PlayerScript, true);
|
|
|
|
|
+ interactingField.SetValue(InstanceTracker.PlayerScript, false);
|
|
|
|
|
+ InstanceTracker.PlayerScript.w.SetActive(true);
|
|
|
|
|
+ Core.logger.Log("Finished Interaction Stand");
|
|
|
|
|
+ }
|
|
|
|
|
+ catch(System.Exception e)
|
|
|
|
|
+ {
|
|
|
|
|
+ Core.logger.Log(e);
|
|
|
|
|
+ }
|
|
|
yield break;
|
|
yield break;
|
|
|
}
|
|
}
|
|
|
|
|
|