Ejemplo n.º 1
0
        public void UnitMenuDiscard(Game_Unit unit, int index)
        {
            TactileLibrary.Item_Data discarded_item =
                unit.actor.whole_inventory[index];
            if (Global.battalion.convoy_ready_for_sending)
            {
                Global.game_battalions.add_item_to_convoy(discarded_item);
                set_item_sent_popup(discarded_item, 240);
            }
            else
            {
                set_item_drop_popup(discarded_item, 240);
            }

            unit.actor.discard_item(index);
            unit.actor.organize_items();

            // If the inventory is still too full after discarding,
            // the discard menu just goes inactive until the map popup closes
            if (unit.actor.too_many_items)
            {
                UnitMenu = UnitMenuManager.ReopenDiscard(this);
            }
            else
            {
                UnitMenu = null;
                if (!Global.game_system.preparations)
                {
                    Global.game_temp.menuing = false;
                }
                Global.game_temp.discard_menuing      = false;
                Global.game_temp.force_send_to_convoy = false;
            }
        }
Ejemplo n.º 2
0
        public void UnitMenuPromotionChoice(Game_Unit unit, int promotionId)
        {
            UnitMenu = null;
            Global.game_temp.menuing = false;

            Global.game_system.Class_Changer   = unit.id;
            Global.game_system.Class_Change_To = promotionId;
        }
Ejemplo n.º 3
0
    protected override void mapBindings()
    {
        base.mapBindings();

        GameObject managers  = GameObject.Find("Managers");
        GameObject resources = GameObject.Find("Resources");
        GameObject ui        = GameObject.Find("UI");

        injectionBinder.Bind <IRootContext>().ToValue(this).ToSingleton();

        EventManager eventManager = managers.GetComponent <EventManager>();

        injectionBinder.Bind <IEventManager>().ToValue(eventManager).ToSingleton();

        GameManager gameManager = managers.GetComponent <GameManager>();

        injectionBinder.Bind <IGameManager>().ToValue(gameManager).ToSingleton();

        BoardManager boardManager = managers.GetComponent <BoardManager>();

        injectionBinder.Bind <IBoardManager>().ToValue(boardManager).ToSingleton();

        UnitMaterialManager unitMaterialManager = resources.GetComponent <UnitMaterialManager>();

        injectionBinder.Bind <IUnitMaterialManager>().ToValue(unitMaterialManager).ToSingleton();

        UnitImageManager unitImageManager = resources.GetComponent <UnitImageManager>();

        injectionBinder.Bind <IUnitImageManager>().ToValue(unitImageManager).ToSingleton();

        UnitManager unitManager = managers.GetComponent <UnitManager>();

        injectionBinder.Bind <IUnitManager>().ToValue(unitManager).ToSingleton();

        SelectionManager selectionManager = managers.GetComponent <SelectionManager>();

        injectionBinder.Bind <ISelectionManager>().ToValue(selectionManager).ToSingleton();

        CoverManager coverManager = managers.GetComponent <CoverManager>();

        injectionBinder.Bind <ICoverManager>().ToValue(coverManager).ToSingleton();

        IWinManager winManager = managers.GetComponent <WinManager>();

        injectionBinder.Bind <IWinManager>().ToValue(winManager).ToSingleton();

        UnitMenuManager unitMenuManager = ui.GetComponent <UnitMenuManager>();

        Inject(unitMenuManager);

        UnitTutorialMenu unitTutorialMenu = ui.GetComponent <UnitTutorialMenu>();

        Inject(unitTutorialMenu);

        ContinueScript continueScript = ui.GetComponent <ContinueScript>();

        Inject(continueScript);
    }
Ejemplo n.º 4
0
        protected virtual void clear_menus()
        {
            close_map_menu();

            MapMenu  = null;
            UnitMenu = null;

            Map_Save_Confirm_Window = null;
        }
Ejemplo n.º 5
0
        // Close
        protected void close_unit_menu(bool move_range_visible = true)
        {
            UnitMenu = null;
            if (move_range_visible)
            {
                Global.game_map.move_range_visible = true;
            }

            // Reset context sensitive values on unit menu close
            Global.game_temp.ResetContextSensitiveUnitControl();
        }
Ejemplo n.º 6
0
        protected virtual bool update_menu_unit()
        {
            if (UnitMenu != null)
            {
                UnitMenu.Update();
                if (UnitMenu != null && UnitMenu.Finished)
                {
                    UnitMenu = null;
                }
                return(true);
            }

            return(false);
        }
Ejemplo n.º 7
0
 protected override void call_promotion_choice_menu()
 {
     UnitMenu = UnitMenuManager.PromotionChoice(
         this, Global.game_system.Class_Changer, true, true);
     //Global.game_system.play_se(System_Sounds.Open); //@Debug
 }
Ejemplo n.º 8
0
 protected virtual void call_promotion_choice_menu()
 {
     UnitMenu = UnitMenuManager.PromotionChoice(this, Global.game_system.Class_Changer);
 }
Ejemplo n.º 9
0
 protected virtual void open_unit_menu()
 {
     UnitMenu = UnitMenuManager.CommandMenu(this);
 }
Ejemplo n.º 10
0
 public void resume_arena()
 {
     UnitMenu = UnitMenuManager.ResumeArena(this);
 }
Ejemplo n.º 11
0
 protected void preview_shop()
 {
     UnitMenu = UnitMenuManager.PreviewShop(this, Global.game_map.get_shop());
 }
Ejemplo n.º 12
0
 protected void open_discard_menu()
 {
     Global.game_system.play_se(System_Sounds.Open);
     UnitMenu = UnitMenuManager.Discard(this);
 }
Ejemplo n.º 13
0
 protected void open_status_menu()
 {
     Global.game_system.play_se(System_Sounds.Confirm);
     UnitMenu = UnitMenuManager.StatusScreen(this);
 }