public override void Enter(Crawler crawler) { success = false; PopupMenu menu = crawler.FindNode("Modals").GetNode <PopupMenu>("AbilitiesMenu"); menu.Clear(); menu.AddSeparator("Attacks"); attackData = crawler.Model.GetPlayer().species.attacks; for (int i = 0; i < attackData.Count; i++) { menu.AddItem(attackData[i].ResourceName, i); } menu.AddSeparator("Abilities"); abilities = crawler.Model.GetPlayer().species.abilities; for (int i = 0; i < abilities.Count; i++) { menu.AddItem(abilities[i], i + bigNumber); } menu.Popup_(); }
public void SetEntity(CharacterEntity entity) { this.entity = entity; GetNode <CharacterIcon>("Body/Left/CharacterIcon").SetCharacter(entity); actions = entity.AllowedActions(); if (actions.Contains(VillageAction.QUEST)) { actions.Remove(VillageAction.QUEST); } popup.Clear(); foreach (VillageAction action in actions) { popup.AddItem(VillageActionExtensions.ActionText(action, entity.ageGroup).Item1.ToString(), id: (int)action); } }
public override void Enter(Crawler crawler) { success = false; PopupMenu menu = crawler.FindNode("Modals").GetNode <PopupMenu>("ItemsMenu"); menu.Clear(); menu.AddSeparator("Inventory"); if (crawler.Model.GetPlayer().inventory is InventoryItem item) { string name = item.data.ResourceName; menu.AddItem($"{item.data.ResourceName} ({item.uses}/{item.data.maxUses})", 0); } else { menu.AddItem("Nothing :(", 100); menu.SetItemDisabled(1, true); } menu.Popup_(); }
private void _on_ActivateItemButton_pressed() { if (_selectedItem == null) { return; } if (_activateItemPopup.Visible) { _activateItemPopup.Hide(); } else { _activateItemPopup.Show(); } _activateItemPopup.Clear(); foreach (var partyMember in _game.PartyController.Party) { _activateItemPopup.AddItem(partyMember.Name); } }