예제 #1
0
        // to do: debugmode, stat

        public override void Load()
        {
            // Since we are using hooks not in older versions, and since ItemID.Count changed, we need to do this.
            if (ModLoader.version < new Version(0, 10))
            {
                throw new Exception("\nThis mod uses functionality only present in the latest tModLoader. Please update tModLoader to use this mod\n\n");
            }
            instance = this;

            ButtonClicked.Clear();
            ButtonTexture.Clear();
            ButtonTooltip.Clear();

            ToggleCheatSheetHotbarHotKey = RegisterHotKey("Toggle Cheat Sheet Hotbar", "K");

            if (Main.rand == null)
            {
                Main.rand = new Terraria.Utilities.UnifiedRandom();
            }

            ModTranslation text = CreateTranslation("ButcherNotification");

            text.SetDefault("NPCs were butchered by {0}");
            AddTranslation(text);
            text = CreateTranslation("VacuumNotification");
            text.SetDefault("Items on the ground were vacuumed by {0}");
            AddTranslation(text);
            text = CreateTranslation("SpawnNPCNotification");
            text.SetDefault("Spawned {0} by {1}");
            AddTranslation(text);
            text = CreateTranslation("VolcanoWarning");
            text.SetDefault("Did you hear something....A Volcano! Find Cover!");
            AddTranslation(text);
        }
예제 #2
0
        // to do: debugmode, stat

        public override void Load()
        {
            // Since we are using hooks not in older versions, and since ItemID.Count changed, we need to do this.
            if (ModLoader.version < new Version(0, 10, 1, 3))
            {
                throw new Exception("\nThis mod uses functionality only present in the latest tModLoader. Please update tModLoader to use this mod\n\n");
            }
            instance = this;

            ButtonClicked.Clear();
            ButtonTexture.Clear();
            ButtonTooltip.Clear();

            ToggleCheatSheetHotbarHotKey = RegisterHotKey("Toggle Cheat Sheet Hotbar", "K");

            if (Main.rand == null)
            {
                Main.rand = new Terraria.Utilities.UnifiedRandom();
            }

            FieldInfo translationsField = typeof(Mod).GetField("translations", BindingFlags.Instance | BindingFlags.NonPublic);

            translations = (Dictionary <string, ModTranslation>)translationsField.GetValue(this);
            //LoadTranslations();
        }
예제 #3
0
        public override void Unload()
        {
            ButtonClicked.Clear();
            ButtonTexture.Clear();
            ButtonTooltip.Clear();

            GenericItemSlot.backgroundTexture     = null;
            NPCSlot.backgroundTexture             = null;
            NPCSlot.filteredBackgroundTexture     = null;
            RecipeQuerySlot.backgroundTexture     = null;
            RecipeQuerySlot.backgroundTextureFake = null;
            RecipeSlot.backgroundTexture          = null;
            RecipeSlot.selectedBackgroundTexture  = null;
            Slot.backgroundTexture          = null;
            PaintToolsSlot.CurrentSelect    = null;
            AllItemsMenu.singleSlotArray    = null;
            UI.UICheckbox.checkboxTexture   = null;
            UI.UICheckbox.checkmarkTexture  = null;
            UI.UIScrollBar.ScrollbarTexture = null;
            UI.UIScrollView.ScrollbgTexture = null;
            UI.UITextbox.textboxBackground  = null;
            //UI.UIView.closeTexture = null;
            ItemBrowser.bCategories         = null;
            RecipeBrowserWindow.ingredients = null;
            RecipeBrowserWindow.bCategories = null;
            NPCBrowser.tooltipNpc           = null;
            NPCBrowser.hoverNpc             = null;
            NPCBrowser.bCategories          = null;
            if (itemBrowser != null)
            {
                itemBrowser.itemView = null;
            }
            itemBrowser   = null;
            npcBrowser    = null;
            recipeBrowser = null;
            if (hotbar != null)
            {
                hotbar.buttonView?.RemoveAllChildren();
                hotbar.buttonView = null;
                hotbar            = null;
            }
            instance = null;
            ToggleCheatSheetHotbarHotKey          = null;
            RecipeBrowserWindow.recipeView        = null;
            RecipeBrowserWindow.lookupItemSlot    = null;
            ConfigurationTool.cheatSheet          = null;
            ConfigurationTool.configurationWindow = null;
            Hotbar.loginTexture        = null;
            Hotbar.logoutTexture       = null;
            ConfigurationTool.button   = null;
            SpawnRateMultiplier.button = null;
            MinionSlotBooster.button   = null;
            LightHack.button           = null;
            GodMode.button             = null;
        }
예제 #4
0
        // to do: debugmode, stat

        public override void Load()
        {
            // Since we are using hooks not in older versions, and since ItemID.Count changed, we need to do this.
            if (ModLoader.version < new Version(0, 11, 5))
            {
                throw new Exception("\nThis mod uses functionality only present in the latest tModLoader. Please update tModLoader to use this mod\n\n");
            }
            instance = this;

            ButtonClicked.Clear();
            ButtonTexture.Clear();
            ButtonTooltip.Clear();

            ToggleCheatSheetHotbarHotKey = RegisterHotKey("Toggle Cheat Sheet Hotbar", "K");

            if (Main.rand == null)
            {
                Main.rand = new Terraria.Utilities.UnifiedRandom();
            }

            FieldInfo translationsField = typeof(Mod).GetField("translations", BindingFlags.Instance | BindingFlags.NonPublic);

            translations = (Dictionary <string, ModTranslation>)translationsField.GetValue(this);
            //LoadTranslations();

            // set all to true on load
            herosPermissions[PaintTools_Permission] = true;
            herosPermissions[ModifySpawnRateMultiplier_Permission] = true;
            herosPermissions[RecipeBrowser_Permission]             = true;
            herosPermissions[MinionBooster_Permission]             = true;
            herosPermissions[ClearItemNPCProjectile_Permission]    = true;
            herosPermissions[ExtraAccessories_Permission]          = true;
            herosPermissions[Vacuum_Permission]               = true;
            herosPermissions[NPCButcher_Permission]           = true;
            herosPermissions[CheatSheetExtensions_Permission] = true;
            herosPermissions[QuickTeleport_Permission]        = true;

            GenericItemSlot.backgroundTexture     = Main.inventoryBack9Texture;
            NPCSlot.backgroundTexture             = Main.inventoryBack9Texture;
            NPCSlot.filteredBackgroundTexture     = Main.inventoryBack5Texture;
            RecipeQuerySlot.backgroundTexture     = Main.inventoryBack9Texture;
            RecipeQuerySlot.backgroundTextureFake = Main.inventoryBack8Texture;
            RecipeSlot.backgroundTexture          = Main.inventoryBack9Texture;
            RecipeSlot.selectedBackgroundTexture  = Main.inventoryBack15Texture;
            Slot.backgroundTexture = Main.inventoryBack9Texture;
        }