Пример #1
0
        public override void Load()
        {
            HamstarHelpersMod.Instance = this;

            this.LoadConfigs();

            if (!this.HasUnhandledExceptionLogger && this.Config.DebugModeUnhandledExceptionLogging)
            {
                this.HasUnhandledExceptionLogger            = true;
                AppDomain.CurrentDomain.UnhandledException += HamstarHelpersMod.UnhandledLogger;
            }

            this.LoadHelpers = new TmlHelpers.LoadHelpers();
            this.Promises    = new Promises();

            this.Timers                    = new Timers();
            this.LogHelpers                = new DebugHelpers.LogHelpers();
            this.ModMetaDataManager        = new TmlHelpers.ModMetaDataManager();
            this.BuffHelpers               = new BuffHelpers.BuffHelpers();
            this.NetHelpers                = new NetHelpers.NetHelpers();
            this.ItemIdentityHelpers       = new ItemHelpers.ItemIdentityHelpers();
            this.NPCIdentityHelpers        = new NPCHelpers.NPCIdentityHelpers();
            this.ProjectileIdentityHelpers = new ProjectileHelpers.ProjectileIdentityHelpers();
            this.BuffIdentityHelpers       = new BuffHelpers.BuffIdentityHelpers();
            this.NPCBannerHelpers          = new NPCHelpers.NPCBannerHelpers();
            this.RecipeHelpers             = new RecipeHelpers.RecipeHelpers();
            this.TmlPlayerHelpers          = new TmlHelpers.TmlPlayerHelpers();
            this.WorldHelpers              = new WorldHelpers.WorldHelpers();
            this.ControlPanel              = new UIControlPanel();
            this.ModLockHelpers            = new TmlHelpers.ModHelpers.ModLockHelpers();
            this.EntityGroups              = new EntityGroups();
            this.PlayerMessages            = new PlayerMessages();
            this.Inbox           = new InboxControl();
            this.ModVersionGet   = new ModVersionGet();
            this.ServerBrowser   = new ServerBrowserReporter();
            this.MenuItemMngr    = new MenuItemManager();
            this.MenuUIMngr      = new MenuUIManager();
            this.OldMenuItemMngr = new Utilities.Menu.OldMenuItemManager();
            this.MusicHelpers    = new MusicHelpers();

#pragma warning disable 612, 618
            TmlHelpers.AltNPCInfo.DataInitialize();
            TmlHelpers.AltProjectileInfo.DataInitialize();
#pragma warning restore 612, 618

            if (!this.Config.DisableControlPanelHotkey)
            {
                this.ControlPanelHotkey = this.RegisterHotKey("Mod Helpers Control Panel", "O");
            }

            this.LoadModData();
        }
Пример #2
0
        public void UnloadModules()
        {
            this.Loadables.OnModsUnload();

            this.Loadables                  = null;
            this.ReflectionHelpers          = null;
            this.PacketProtocolMngr         = null;
            this.ExceptionMngr              = null;
            this.Timers                     = null;
            this.LogHelpers                 = null;
            this.ModFeaturesHelpers         = null;
            this.BuffHelpers                = null;
            this.NetHelpers                 = null;
            this.NPCAttributeHelpers        = null;
            this.ProjectileAttributeHelpers = null;
            this.BuffIdentityHelpers        = null;
            this.NPCBannerHelpers           = null;
            this.RecipeFinderHelpers        = null;
            this.RecipeGroupHelpers         = null;
            this.PlayerHooks                = null;
            this.LoadHelpers                = null;
            this.GetModInfo                 = null;
            this.GetModTags                 = null;
            this.WorldStateHelpers          = null;
            this.ModLock                    = null;
            this.EntityGroups               = null;
            this.AnimatedColors             = null;
            this.AnimatedTextures           = null;
            this.PlayerMessages             = null;
            this.Inbox                 = null;
            this.ControlPanel          = null;
            this.MenuItemMngr          = null;
            this.MenuContextMngr       = null;
            this.MusicHelpers          = null;
            this.PlayerIdentityHelpers = null;
            this.LoadHooks             = null;
            this.CustomLoadHooks       = null;
            this.DataStore             = null;
            this.CustomHotkeys         = null;
            this.XnaHelpers            = null;
            this.Server                = null;
            //this.PlayerDataMngr = null;
            this.SupportInfo          = null;
            this.RecipeHack           = null;
            this.ModListHelpers       = null;
            this.ItemAttributeHelpers = null;
            this.WorldTimeHooks       = null;

            this.ControlPanelHotkey = null;
            this.DataDumpHotkey     = null;
        }
Пример #3
0
        public override void Unload()
        {
            this.UnloadModData();

            this.Promises.FulfillModUnloadPromises();

            try {
                if (this.HasUnhandledExceptionLogger)
                {
                    this.HasUnhandledExceptionLogger            = false;
                    AppDomain.CurrentDomain.UnhandledException -= HamstarHelpersMod.UnhandledLogger;
                }
            } catch { }

            this.ExceptionMngr             = null;
            this.Timers                    = null;
            this.ConfigJson                = null;
            this.PacketProtocols           = null;
            this.LogHelpers                = null;
            this.ModMetaDataManager        = null;
            this.BuffHelpers               = null;
            this.NetHelpers                = null;
            this.ItemIdentityHelpers       = null;
            this.NPCIdentityHelpers        = null;
            this.ProjectileIdentityHelpers = null;
            this.BuffIdentityHelpers       = null;
            this.NPCBannerHelpers          = null;
            this.RecipeHelpers             = null;
            this.TmlPlayerHelpers          = null;
            this.LoadHelpers               = null;
            this.ModVersionGet             = null;
            this.WorldHelpers              = null;
            this.ModLockHelpers            = null;
            this.EntityGroups              = null;
            this.AnimatedColors            = null;
            this.PlayerMessages            = null;
            this.Inbox = null;
            this.ControlPanelHotkey = null;
            this.ControlPanel       = null;
            this.ServerBrowser      = null;
            this.MenuItemMngr       = null;
            this.MenuUIMngr         = null;
            this.OldMenuItemMngr    = null;
            this.MusicHelpers       = null;
            this.Promises           = null;

            HamstarHelpersMod.Instance = null;
        }
        public void UnloadOuter()
        {
            this.ReflectionHelpers         = null;
            this.PacketProtocolMngr        = null;
            this.ExceptionMngr             = null;
            this.Timers                    = null;
            this.ConfigJson                = null;
            this.LogHelpers                = null;
            this.ModFeaturesHelpers        = null;
            this.BuffHelpers               = null;
            this.NetHelpers                = null;
            this.ItemIdentityHelpers       = null;
            this.NPCIdentityHelpers        = null;
            this.ProjectileIdentityHelpers = null;
            this.BuffIdentityHelpers       = null;
            this.NPCBannerHelpers          = null;
            this.RecipeIdentityHelpers     = null;
            this.RecipeGroupHelpers        = null;
            this.PlayerHooks               = null;
            this.LoadHelpers               = null;
            this.GetModInfo                = null;
            this.GetModTags                = null;
            this.WorldStateHelpers         = null;
            this.ModLock                   = null;
            this.EntityGroups              = null;
            this.AnimatedColors            = null;
            this.PlayerMessages            = null;
            this.Inbox                 = null;
            this.ControlPanel          = null;
            this.MenuItemMngr          = null;
            this.MenuContextMngr       = null;
            this.MusicHelpers          = null;
            this.PlayerIdentityHelpers = null;
            this.CustomEntMngr         = null;
            this.Promises              = null;
            this.DataStore             = null;
            this.CustomHotkeys         = null;
            this.XnaHelpers            = null;
            this.ServerInfo            = null;
            //this.PlayerDataMngr = null;
            this.SupportInfo    = null;
            this.RecipeHack     = null;
            this.ModListHelpers = null;

            this.ControlPanelHotkey = null;
            this.DataDumpHotkey     = null;
        }
Пример #5
0
        private void LoadModules()
        {
            this.Loadables.OnModsLoad();

            this.ReflectionHelpers = new ReflectionHelpers();
            this.DataStore         = new DataStore();
            this.LoadHooks         = new LoadHooks();
            this.CustomLoadHooks   = new CustomLoadHooks();
            this.LoadHelpers       = new LoadHelpers();

            this.Timers             = new Timers();
            this.LogHelpers         = new LogHelpers();
            this.ModFeaturesHelpers = new ModFeaturesHelpers();
            this.PacketProtocolMngr = new PacketProtocolManager();

            this.BuffHelpers                = new BuffHelpers();
            this.NetHelpers                 = new NetPlayHelpers();
            this.NPCAttributeHelpers        = new NPCAttributeHelpers();
            this.ProjectileAttributeHelpers = new ProjectileAttributeHelpers();
            this.BuffIdentityHelpers        = new BuffAttributesHelpers();
            this.NPCBannerHelpers           = new NPCBannerHelpers();
            this.RecipeFinderHelpers        = new RecipeFinderHelpers();
            this.RecipeGroupHelpers         = new RecipeGroupHelpers();
            this.PlayerHooks                = new ExtendedPlayerHooks();
            this.WorldTimeHooks             = new WorldTimeHooks();
            this.WorldStateHelpers          = new WorldStateHelpers();
            this.ControlPanel               = new UIControlPanel();
            this.ModLock               = new ModLockService();
            this.EntityGroups          = new EntityGroups();
            this.PlayerMessages        = new PlayerMessages();
            this.Inbox                 = new InboxControl();
            this.GetModInfo            = new GetModInfo();
            this.GetModTags            = new GetModTags();
            this.MenuItemMngr          = new MenuItemManager();
            this.MenuContextMngr       = new MenuContextServiceManager();
            this.MusicHelpers          = new MusicHelpers();
            this.PlayerIdentityHelpers = new PlayerIdentityHelpers();
            this.CustomHotkeys         = new CustomHotkeys();
            this.XnaHelpers            = new XNAHelpers();
            this.Server                = new Server();
            //this.PlayerDataMngr = new PlayerDataManager();
            this.SupportInfo          = new SupportInfoDisplay();
            this.RecipeHack           = new RecipeHack();
            this.ModListHelpers       = new ModListHelpers();
            this.ItemAttributeHelpers = new ItemAttributeHelpers();
        }