// Depending on what menu we are in, we update what is currently displayed after we scroll on something private void UpdateMenuContext() { // If we do not have this saved at this point, we will save a reference to these. if (playerInventory == null) { playerInventory = GameManager.Instance.PlayerReference.GetComponent <PlayerInventory>(); } switch (currentState) { case BattleMenuStates.MAIN: // Updates the description box based on the highlighted action if (currentMenuIndex == 0) { descText.text = "Perform a standard attack on the selected enemy."; } else if (currentMenuIndex == 1) { descText.text = "Perform a special attack on the selected enemy."; } else { descText.text = "Use a battle item to heal oneself or another party member."; } break; case BattleMenuStates.ATTACK_TARGET: case BattleMenuStates.SPECIAL_TARGET: descText.text = "Select a target."; break; case BattleMenuStates.ITEM_TARGET: descText.text = "Who to use this on?"; break; case BattleMenuStates.SPECIAL: descText.text = ((CharacterData)battleController.GetCurrentCharacterInTurnOrder().battleData).demonData.attackList[currentMenuIndex].attackDescription; break; case BattleMenuStates.ITEM: if (playerInventory.GetItemAtIndex(currentMenuIndex) != null) { descText.text = playerInventory.GetItemAtIndex(currentMenuIndex).SpecifiedItem.itemDescription; } else { descText.text = "No items available..."; } break; } }
// Depending on what menu we are in, we update what is currently displayed after we scroll on something private void UpdateMenuContext() { switch (currentState) { case MenuStates.ITEM: // We update the item description if (currentSubMenuState == SubMenuStates.HIDDEN) { if (currentMenuIndex < playerInventory.GetItemInventorySize()) { itemMenuObject.transform.GetChild(2).GetComponentInChildren <TextMeshProUGUI>().text = playerInventory.GetItemAtIndex(currentMenuIndex).SpecifiedItem.itemDescription; } } else if (currentSubMenuState == SubMenuStates.SUB1) { InventoryParty currParty = playerInventory.GetInventoryCharacterAtIndex(currentMenuIndex); itemMenuObject.transform.GetChild(2).GetComponentInChildren <TextMeshProUGUI>().text = "Select a target to use this on."; itemMenuObject.transform.GetChild(3).GetComponentInChildren <TextMeshProUGUI>().text = "HP: " + currParty.CurrentHealthPoints + "/" + currParty.ReturnModdedStat("MaxHP") + "\nSP: " + currParty.CurrentSkillPoints + "/" + currParty.ReturnModdedStat("MaxSP"); } break; case MenuStates.PARTY: // We update the party description if (currentMenuIndex < playerInventory.GetPartyInvetorySize()) { partyMenuObject.transform.GetChild(1).GetComponentInChildren <TextMeshProUGUI>().text = playerInventory.GetInventoryCharacterAtIndex(currentMenuIndex).SpecifiedCharacter.characterName; } break; case MenuStates.GEAR: // We update the gear description if (currentMenuIndex < playerInventory.GetGearInventorySize()) { gearMenuObject.transform.GetChild(1).GetComponentInChildren <TextMeshProUGUI>().text = playerInventory.GetGearAtIndex(currentMenuIndex).SpecifiedGear.gearDescription; } break; case MenuStates.LINK: // We update the link description if (currentMenuIndex < playerInventory.GetLinkInventorySize()) { linkMenuObject.transform.GetChild(1).GetComponentInChildren <TextMeshProUGUI>().text = playerInventory.GetLinkAtIndex(currentMenuIndex).SpecifiedLink.linkDescription; } break; } }