public static MIOpenList <T> CreateMIOpenList(string menuText, MenuItemBundle parentBundle, IList <T> gameElements) { MIOpenList <T> newMI = new MIOpenList <T>(menuText, parentBundle); newMI.SetGameElement(gameElements); return(newMI); }
public static MenuItemBundle CreateBundle(GERoom room, MenuItemBundle parent) { MenuItemBundle newBundle = new MenuItemBundle(room.NameText.GetText(), parent); //Action menuitems foreach (GEMenuItem action in room.MenuItems.Values) { newBundle.AddMenuItem(new MIGameElementAction(action.MenuName.GetText(), newBundle, action)); action.OnActivationChange += newBundle.RefreshOnEvent; } //Items menuitem newBundle.AddMenuItem(MIOpenList <GEItem> .CreateMIOpenList(LabelUtility.Instance.GetLabel(LabelNames.ITEMS), newBundle, room.Items.Values)); //NPC menuitem newBundle.AddMenuItem(MIOpenList <GENpc> .CreateMIOpenList(LabelUtility.Instance.GetLabel(LabelNames.NPCS), newBundle, room.Npcs.Values)); //Props menuItem List <GEProperty> propsToShow = GEProperty.GetPropertiesWithNames(room.Properties.Values); if (propsToShow.Count != 0) { newBundle.AddMenuItem(new MIShowDescription(LabelUtility.Instance.GetLabel(LabelNames.ROOMPROPS), newBundle, () => GEProperty.GetPropertyDescText(propsToShow))); } //Back menuitem newBundle.AddMenuItem(new MIBack(parent)); return(newBundle); }
public BaseMenuItemBundle() : base(LabelUtility.Instance.GetLabel(LabelNames.MENU), null) { inventoryMenu = MIOpenList <GEItem> .CreateMIOpenList(LabelUtility.Instance.GetLabel(LabelNames.INVENTORY), this, ObjectManager.CurrentGEM.Player.Items.Values); List <GEProperty> propsToShow = GEProperty.GetPropertiesWithNames(ObjectManager.CurrentGEM.Player.Properties.Values); if (propsToShow.Count != 0) { propertiesMenu = new MIShowDescription(LabelUtility.Instance.GetLabel(LabelNames.PLAYERPROPS), this, () => GEProperty.GetPropertyDescText(propsToShow)); } }
public void SetRoom(GERoom room) { if (roomMenu != null) { roomMenu.DestroyGO(); } if (gotoMenu != null) { gotoMenu.DestroyGO(); } roomMenu = new MIOpenBundle <GERoom>(room.NameText.GetText(), room, this); gotoMenu = MIOpenList <GENeighbour> .CreateMIOpenList(LabelUtility.Instance.GetLabel(LabelNames.GONEXTROOM), this, room.Neighbours.Values); }
private void RefreshInventoryMenu() { if (inventoryMenu != null) { inventoryMenu.DestroyGO(); } inventoryMenu = MIOpenList <GEItem> .CreateMIOpenList(LabelUtility.Instance.GetLabel(LabelNames.INVENTORY), this, ObjectManager.CurrentGEM.Player.Items.Values); inventoryMenu.SetActive(true); inventoryMenu.SetPositionNumber(0); if (!isActive) { inventoryMenu.SetActive(false); } }