Ejemplo n.º 1
0
        protected void AddItemMenu(bool returningToItemUse = false)
        {
            var itemsMenu = new Window_Prep_Items(returningToItemUse);

            itemsMenu.UnitSelected  += ItemsMenu_UnitSelected;
            itemsMenu.Status        += preparationsMenu_Status;
            itemsMenu.TradeSelected += ItemsMenu_TradeSelected;
            itemsMenu.Trade         += itemsMenu_Trade;
            itemsMenu.Convoy        += itemsMenu_Convoy;
            itemsMenu.Use           += ItemsMenu_Use;
            itemsMenu.List          += itemsMenu_List;
            itemsMenu.Shop          += itemsMenu_Shop;
            itemsMenu.Closed        += menu_Closed;
            AddMenu(itemsMenu);

            if (returningToItemUse)
            {
                Global.game_map.completely_remove_unit(Global.game_map.last_added_unit.id);

                // Add unit menu
                AddItemCommandMenu(itemsMenu, null, true);

                // Add use menu
                if (itemsMenu.actor.has_items)
                {
                    RemoveTopMenu();
                    AddUseMenu(itemsMenu);
                }

                var fadeMenu = PromotionFadeMenu.PromotionEndFade();
                fadeMenu.Finished += menu_Closed;
                AddMenu(fadeMenu);
            }
        }
Ejemplo n.º 2
0
        private void AddUseMenu(Window_Prep_Items itemsMenu, CommandMenu itemCommandMenu = null)
        {
            itemsMenu.StartUse();
            var useMenu = itemsMenu.GetUseMenu();

            if (itemCommandMenu != null)
            {
                useMenu.SetCursorLoc(itemCommandMenu.CurrentCursorLoc);
            }

            useMenu.Selected += UseMenu_Selected;
            useMenu.Canceled += UseMenu_Canceled;
            AddMenu(useMenu);
        }
Ejemplo n.º 3
0
        private void AddItemCommandMenu(Window_Prep_Items itemsMenu, ItemUseMenu useMenu = null, bool toUseItem = false)
        {
            var itemCommandMenu = itemsMenu.GetCommandMenu();

            if (toUseItem)
            {
                itemCommandMenu.ToUseItem();
            }
            if (useMenu != null)
            {
                itemCommandMenu.SetCursorLoc(useMenu.CurrentCursorLoc);
            }

            itemCommandMenu.Selected += ItemCommandMenu_Selected;
            itemCommandMenu.Canceled += ItemCommandMenu_Canceled;
            AddMenu(itemCommandMenu);
        }