|
|
@@ -3,6 +3,7 @@ using GadgetCore.API;
|
|
|
using UnityEngine.SceneManagement;
|
|
|
using System.Reflection;
|
|
|
using GadgetCore.API.ConfigMenu;
|
|
|
+using System;
|
|
|
|
|
|
namespace ShipDecorations
|
|
|
{
|
|
|
@@ -13,6 +14,7 @@ namespace ShipDecorations
|
|
|
public const string CONFIG_VERSION = "1.0"; // Increment this whenever you change your mod's config file.
|
|
|
|
|
|
public override IGadgetConfigMenu GetConfigMenu() { return null; }
|
|
|
+ protected override void LoadConfig() { Config.Reset(); Config.Save(); }
|
|
|
|
|
|
public override string GetModDescription()
|
|
|
{
|
|
|
@@ -30,24 +32,24 @@ namespace ShipDecorations
|
|
|
AddToList(ItemUtil.CreatePlacableDecoItem("cTreantHeadPlant.png", "iTreantHeadPlant.png", "Treant Plant"), 10000);
|
|
|
AddToList(ItemUtil.CreatePlacableSlideDoorItem("cDoor.png", "cDoorOpen.png", "iDoor.png", "Door"), 5000);
|
|
|
|
|
|
- SceneManager.sceneLoaded += OnSceneLoaded;
|
|
|
+ // SceneManager.sceneLoaded += OnSceneLoaded;
|
|
|
}
|
|
|
|
|
|
internal static void OnSceneLoaded(Scene scene, LoadSceneMode mode)
|
|
|
{
|
|
|
if (scene.buildIndex == 1)
|
|
|
{
|
|
|
- var i = GadgetCoreAPI.CreateMarketStand(ItemRegistry.GetItem(Core.itemStoreList[0]), new Vector2(-138f - 2 * 4, -7.49f), 1000);
|
|
|
- call(i.GetComponent<KylockeStand>(), "Awake");
|
|
|
+ try
|
|
|
+ {
|
|
|
+ // GameObject obj = GadgetCoreAPI.CreateMarketStand(ItemRegistry.GetItem(Core.itemStoreList[0]), new Vector2(-138f - 2 * 4, -7.49f), 100);
|
|
|
+ // // NetworkView network = obj.GetComponent<NetworkView>();
|
|
|
+ // // network.viewID = NetworkViewID.unassigned;
|
|
|
+ // // obj.GetComponent<KylockeStand>().Awake();
|
|
|
+ }
|
|
|
+ catch (Exception e) { Core.logger.LogConsole(e.Message); }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private static object call<T>(T __instance, string meth, object[] o = null)
|
|
|
- {
|
|
|
- MethodInfo dynMethod = __instance.GetType().GetMethod(meth, BindingFlags.NonPublic | BindingFlags.Instance);
|
|
|
- return dynMethod.Invoke(__instance, o ?? new object[0]);
|
|
|
- }
|
|
|
-
|
|
|
private void AddToList(int id, int price)
|
|
|
{
|
|
|
Core.itemStoreList.Add(id);
|