// 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(); }
public void RegisterButton(Texture2D texture, Action buttonClickedAction, Func <string> tooltip) { ButtonClicked.Add(buttonClickedAction); ButtonTexture.Add(texture); ButtonTooltip.Add(tooltip); //ErrorLogger.Log("1 "+ButtonClicked.Count); //ErrorLogger.Log("2 "+ ButtonTexture.Count); //ErrorLogger.Log("3 "+ ButtonTooltip.Count); }
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; }
// 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; }
public void Write(WorldPacket data) { data.WriteInt32(ResponseID); data.WriteInt32(ChoiceArtFileID); data.WriteInt32(Flags); data.WriteUInt32(WidgetSetID); data.WriteUInt32(UiTextureAtlasElementID); data.WriteUInt32(SoundKitID); data.WriteUInt8(GroupID); data.WriteBits(Answer.GetByteCount(), 9); data.WriteBits(Header.GetByteCount(), 9); data.WriteBits(SubHeader.GetByteCount(), 7); data.WriteBits(ButtonTooltip.GetByteCount(), 9); data.WriteBits(Description.GetByteCount(), 11); data.WriteBits(Confirmation.GetByteCount(), 7); data.WriteBit(RewardQuestID.HasValue); data.WriteBit(Reward.HasValue); data.FlushBits(); if (Reward.HasValue) { Reward.Value.Write(data); } data.WriteString(Answer); data.WriteString(Header); data.WriteString(SubHeader); data.WriteString(ButtonTooltip); data.WriteString(Description); data.WriteString(Confirmation); if (RewardQuestID.HasValue) { data.WriteUInt32(RewardQuestID.Value); } }