public override void AddRecipeGroups() { if (!Main.dedServ) { try { itemBrowser = new ItemBrowser(this); itemBrowser.SetDefaultPosition(new Vector2(80, 300)); itemBrowser.Visible = false; npcBrowser = new NPCBrowser(this); npcBrowser.SetDefaultPosition(new Vector2(30, 180)); npcBrowser.Visible = false; recipeBrowser = new RecipeBrowserWindow(this); recipeBrowser.SetDefaultPosition(new Vector2(30, 180)); recipeBrowser.Visible = false; extendedCheatMenu = new ExtendedCheatMenu(this); extendedCheatMenu.SetDefaultPosition(new Vector2(120, 180)); extendedCheatMenu.Visible = false; paintToolsHotbar = new PaintToolsHotbar(this); // paintToolsHotbar.SetDefaultPosition(new Microsoft.Xna.Framework.Vector2(120, 180)); paintToolsHotbar.Visible = false; paintToolsHotbar.Hide(); paintToolsUI = new PaintToolsUI(this); paintToolsUI.SetDefaultPosition(new Vector2(30, 180)); paintToolsUI.Visible = false; quickTeleportHotbar = new QuickTeleportHotbar(this); quickTeleportHotbar.Visible = false; quickTeleportHotbar.Hide(); quickClearHotbar = new QuickClearHotbar(this); quickClearHotbar.Visible = false; quickClearHotbar.Hide(); npcButchererHotbar = new NPCButchererHotbar(this); npcButchererHotbar.Visible = false; npcButchererHotbar.Hide(); //eventManagerHotbar = new EventManagerHotbar(this); //eventManagerHotbar.Visible = false; //eventManagerHotbar.Hide(); hotbar = new Hotbar(this); //hotbar.Position = new Microsoft.Xna.Framework.Vector2(120, 180); hotbar.Visible = true; hotbar.Hide(); } catch (Exception e) { ErrorLogger.Log(e.ToString()); } } }
public override void Unload() { itemBrowser = null; npcBrowser = null; instance = null; ToggleCheatSheetHotbarHotKey = null; RecipeBrowserWindow.recipeView = null; RecipeBrowserWindow.lookupItemSlot = null; }
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; }
public override void AddRecipeGroups() { if (!Main.dedServ) { try { itemBrowser = new ItemBrowser(this); itemBrowser.SetDefaultPosition(new Vector2(80, 300)); itemBrowser.Visible = false; npcBrowser = new NPCBrowser(this); npcBrowser.SetDefaultPosition(new Vector2(30, 180)); npcBrowser.Visible = false; // recipeBrowser = new RecipeBrowserWindow(this); // recipeBrowser.SetDefaultPosition(new Vector2(30, 180)); // recipeBrowser.Visible = false; // extendedCheatMenu = new ExtendedCheatMenu(this); // extendedCheatMenu.SetDefaultPosition(new Vector2(120, 180)); // extendedCheatMenu.Visible = false; // paintToolsHotbar = new PaintToolsHotbar(this); // paintToolsHotbar.SetDefaultPosition(new Microsoft.Xna.Framework.Vector2(120, 180)); // paintToolsHotbar.Visible = false; // paintToolsHotbar.Hide(); // paintToolsUI = new PaintToolsUI(this); // paintToolsUI.SetDefaultPosition(new Vector2(30, 180)); // paintToolsUI.Visible = false; // quickTeleportHotbar = new QuickTeleportHotbar(this); // quickTeleportHotbar.Visible = false; // quickTeleportHotbar.Hide(); // quickClearHotbar = new QuickClearHotbar(this); // quickClearHotbar.Visible = false; // quickClearHotbar.Hide(); // npcButchererHotbar = new NPCButchererHotbar(this); // npcButchererHotbar.Visible = false; // npcButchererHotbar.Hide(); //eventManagerHotbar = new EventManagerHotbar(this); //eventManagerHotbar.Visible = false; //eventManagerHotbar.Hide(); hotbar = new Hotbar(this); //hotbar.Position = new Microsoft.Xna.Framework.Vector2(120, 180); hotbar.Visible = true; if (!ModContent.GetInstance <CheatSheetClientConfig>().HotbarShownByDefault) { hotbar.Hide(); } else { hotbar.Show(); } } catch (Exception e) { Logger.Error(e.ToString()); } } }
public override void HandlePacket(BinaryReader reader, int whoAmI) { CheatSheetMessageType msgType = (CheatSheetMessageType)reader.ReadByte(); string key; switch (msgType) { case CheatSheetMessageType.SpawnNPC: int npcType = reader.ReadInt32(); int netID = reader.ReadInt32(); NPCSlot.HandleNPC(npcType, netID, true, whoAmI); key = "Mods.CheatSheet.MobBrowser.SpawnNPCNotification"; NetMessage.BroadcastChatMessage(NetworkText.FromKey(key, netID, Netplay.Clients[whoAmI].Name), Color.Azure); //message = "Spawned " + netID + " by " + Netplay.Clients[whoAmI].Name; //NetMessage.SendData(25, -1, -1, message, 255, Color.Azure.R, Color.Azure.G, Color.Azure.B, 0); break; case CheatSheetMessageType.QuickClear: int clearType = reader.ReadInt32(); switch (clearType) { case 0: key = "Mods.CheatSheet.QuickClear.ItemClearNotification"; //message = "Items were cleared by "; break; case 1: key = "Mods.CheatSheet.QuickClear.ProjectileClearNotification"; //message = "Projectiles were cleared by "; break; default: key = ""; break; } //message += Netplay.Clients[whoAmI].Name; QuickClearHotbar.HandleQuickClear(clearType, true, whoAmI); NetMessage.BroadcastChatMessage(NetworkText.FromKey(key, Netplay.Clients[whoAmI].Name), Color.Azure); //NetMessage.SendData(25, -1, -1, message, 255, Color.Azure.R, Color.Azure.G, Color.Azure.B, 0); break; case CheatSheetMessageType.VacuumItems: Hotbar.HandleVacuum(true, whoAmI); key = "Mods.CheatSheet.Vacuum.VacuumNotification"; NetMessage.BroadcastChatMessage(NetworkText.FromKey(key, Netplay.Clients[whoAmI].Name), Color.Azure); //message = "Items on the ground were vacuumed by " + Netplay.Clients[whoAmI].Name; //NetMessage.SendData(25, -1, -1, message, 255, Color.Azure.R, Color.Azure.G, Color.Azure.B, 0); break; case CheatSheetMessageType.ButcherNPCs: NPCButchererHotbar.HandleButcher(reader.ReadInt32(), true); key = "Mods.CheatSheet.Butcherer.ButcherNotification"; NetMessage.BroadcastChatMessage(NetworkText.FromKey(key, Netplay.Clients[whoAmI].Name), Color.Azure); //message = "NPCs were butchered by " + Netplay.Clients[whoAmI].Name; //NetMessage.SendData(25, -1, -1, message, 255, Color.Azure.R, Color.Azure.G, Color.Azure.B, 0); break; case CheatSheetMessageType.TeleportPlayer: QuickTeleportHotbar.HandleTeleport(reader.ReadInt32(), true, whoAmI); break; case CheatSheetMessageType.SetSpawnRate: SpawnRateMultiplier.HandleSetSpawnRate(reader, whoAmI); break; case CheatSheetMessageType.SpawnRateSet: SpawnRateMultiplier.HandleSpawnRateSet(reader, whoAmI); break; case CheatSheetMessageType.RequestFilterNPC: int netID2 = reader.ReadInt32(); bool desired = reader.ReadBoolean(); NPCBrowser.FilterNPC(netID2, desired); ConfigurationLoader.SaveSetting(); var packet = GetPacket(); packet.Write((byte)CheatSheetMessageType.InformFilterNPC); packet.Write(netID2); packet.Write(desired); packet.Send(); break; case CheatSheetMessageType.InformFilterNPC: int netID3 = reader.ReadInt32(); bool desired2 = reader.ReadBoolean(); NPCBrowser.FilterNPC(netID3, desired2); NPCBrowser.needsUpdate = true; break; //case CheatSheetMessageType.RequestToggleNPCSpawn: // NPCSlot.HandleFilterRequest(reader.ReadInt32(), reader.ReadInt32(), true); // break; default: Logger.Warn("Unknown Message type: " + msgType); break; } }