public void ToggleInv()
{
if (Main.ingameOptionsWindow)
IngameOptions.Close();
else if (Main.achievementsWindow)
AchievementsUI.Close();
else if (CaptureManager.Instance.Active)
CaptureManager.Instance.Active = false;
else if (this.talkNPC >= 0)
{
this.talkNPC = -1;
Main.npcChatCornerItem = 0;
Main.npcChatText = "";
Main.PlaySound(11, -1, -1, 1);
}
else if (this.sign >= 0)
{
this.sign = -1;
Main.editSign = false;
Main.npcChatText = "";
Main.PlaySound(11, -1, -1, 1);
}
else if (Main.clothesWindow)
Main.CancelClothesWindow(false);
else if (!Main.playerInventory)
{
Recipe.FindRecipes();
Main.playerInventory = true;
Main.EquipPageSelected = 0;
Main.PlaySound(10, -1, -1, 1);
}
else
{
Main.playerInventory = false;
Main.EquipPageSelected = 0;
Main.PlaySound(11, -1, -1, 1);
if (!ItemSlot.Options.HighlightNewItems)
return;
foreach (Item obj in this.inventory)
obj.newAndShiny = false;
}
}