/* Mod unloading function */ public override void Unload() { if (!Main.dedServ) { StandInterface = null; StandoUI = null; //BonusManager.UnLoad(); CutSceneManager.UnLoad(); } mod = null; StandSummonHT = null; SpecialAbilityHT = null; StandClientConfig = null; SwitchStandControlHT = null; SpecialAbilityManager.UnLoad(); }
/* Mod loading */ public override void Load() { mod = this; // mod mod.Logger.Info("Starting loading..."); /* Try to get steam info */ try { usingSteam = Steamworks.SteamAPI.IsSteamRunning(); if (usingSteam) { SteamId = Steamworks.SteamUser.GetSteamID().m_SteamID; // klass mod.Logger.Info("Steam login = true"); } else { mod.Logger.Warn("Steam login = false"); } } catch (Exception e) { usingSteam = false; SteamId = 0; mod.Logger.Warn("Steam login = false"); mod.Logger.Error(e.Message); } /* Register hotkeys */ StandSummonHT = RegisterHotKey("Summon Stand", "Insert"); SpecialAbilityHT = RegisterHotKey("Special ability", "P"); SwitchStandControlHT = RegisterHotKey("Switch stand control mode", "Home"); /* Loading special abilities */ SpecialAbilityManager.Load(); SpecialAbilityManager.AddAbility("ZaWardo", new ZaWardo()); SpecialAbilityManager.AddAbility("SCA", new SilverChariotAbility()); /* Client only loading */ if (!Main.dedServ) { /* Interface loading */ StandInterface = new UserInterface(); StandoUI = new StandUI(); StandoUI.Activate(); StandInterface.SetState(StandoUI); /* Cut scene */ CutSceneManager.Load(); CutSceneManager.AddScene("Test", new CutScenes.TestCSc()); /* Red dolphin shader */ GameShaders.Misc["RedDolphin"] = new MiscShaderData(new Ref <Effect>(GetEffect("Effects/RedDolphin")), "RedDolphine"); /* Bonus manager (not needed) */ /*try * { * BonusManager.Init(); * * if (BonusManager.UpdateBonuses()) * Logger.Info("Bonuses loaded"); * * BonusManager.UnLoad(); * } * catch (Exception e) * { * mod.Logger.Warn("DB error: " + e.Message); * }*/ } mod.Logger.Info("Load successful"); }