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));
        }
    }
示例#2
0
    public static MenuItemBundle CreateBundle(GEItem item, MenuItemBundle parent)
    {
        MenuItemBundle newBundle = new MenuItemBundle(item.ItemName.GetText(), parent);

        if (item.Equipable && !item.IsEquipped)
        {
            newBundle.AddMenuItem(new MIEquip(item, newBundle));
        }
        foreach (GEMenuItem action in item.MenuItems.Values)
        {
            newBundle.AddMenuItem(new MIGameElementAction(action.MenuName.GetText(), newBundle, action));
            action.OnActivationChange += newBundle.RefreshOnEvent;
        }
        //Props menuItem
        List <GEProperty> propsToShow = GEProperty.GetPropertiesWithNames(item.Properties.Values);

        if (propsToShow.Count != 0)
        {
            newBundle.AddMenuItem(new MIShowDescription(LabelUtility.Instance.GetLabel(LabelNames.ITEMPROPS), newBundle, () => GEProperty.GetPropertyDescText(propsToShow)));
        }

        newBundle.AddMenuItem(new MIBack(parent));
        Description.GetInstance().AddDescriptionText(item.Description.GetText());
        return(newBundle);
    }
示例#3
0
    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);
    }
示例#4
0
    //Creates the menuitem set that is shown for an NPC
    public static MenuItemBundle CreateBundle(GENpc npc, MenuItemBundle parent)
    {
        MenuItemBundle newBundle = new MenuItemBundle(npc.NameText.GetText(), parent);

        foreach (GEMenuItem action in npc.MenuItems.Values)
        {
            newBundle.AddMenuItem(new MIGameElementAction(action.MenuName.GetText(), newBundle, action));
            action.OnActivationChange += newBundle.RefreshOnEvent;
        }
        //Props menuItem
        List <GEProperty> propsToShow = GEProperty.GetPropertiesWithNames(npc.Properties.Values);

        if (propsToShow.Count != 0)
        {
            newBundle.AddMenuItem(new MIShowDescription(LabelUtility.Instance.GetLabel(LabelNames.NPCPROPS), newBundle, () => GEProperty.GetPropertyDescText(propsToShow)));
        }

        //newBundle.AddMenuItem(new MIShowDescription(LabelUtility.Instance.GetLabel(LabelNames.SHOWDESCRUPTION), newBundle, npc.DescText.GetText()));

        //FIXME: this runs only once, when the bundle is created. Feature or bug? We might not want it to see more thane once tho...
        Description.GetInstance().AddDescriptionText(npc.DescText.GetText());


        newBundle.AddMenuItem(new MIConversation(LabelUtility.Instance.GetLabel(LabelNames.STARTCONVERSATION), parent, npc));


        newBundle.AddMenuItem(new MIBack(parent));

        return(newBundle);
    }