Пример #1
0
        // Open status menu opened from pick units/organize
        protected void overviewMenu_Status(object sender, EventArgs e)
        {
            var overviewMenu = (sender as Window_Prep_Unit_Overview);
            int actorId      = overviewMenu.actor_id;

            var statusMenu = new Window_Status(Global.battalion.actors, actorId, true);

            statusMenu.Closed += statusMenu_Closed;
            AddMenu(statusMenu);
        }
Пример #2
0
        // Open status screen from unit menu
        void unitMenu_Status(object sender, EventArgs e)
        {
            Global.game_temp.menu_call        = false;
            Global.game_temp.status_menu_call = false;

            var        unitWindow = (Menus.Peek() as Window_Unit);
            List <int> team       = unitWindow.team;
            int        index      = team.IndexOf(Global.game_temp.status_unit_id);

            index = Math.Max(0, index);

            var statusMenu = new Window_Status(team, index);

            statusMenu.Closed += statusMenu_Closed;
            AddMenu(statusMenu);
        }
Пример #3
0
        public Prep_Stats_Window(Game_Unit unit)
        {
            // Stats Window
            initialize_window();

            // Stat Labels
            Stats = new List <StatusPrimaryStatUINode>();
            for (int i = 0; i < 8; i++)
            {
                string label, help_label;

                var stat_label = (Stat_Labels)i;

                Vector2 loc = new Vector2(8 + (i / 4) * SPACING(), 8 + (i % 4) * 16);
                PrimaryStatState.label(stat_label, out label, out help_label);

                Func <Game_Unit, PrimaryStatState> stat_formula = (Game_Unit stat_unit) =>
                {
                    return(new PrimaryStatState(stat_unit, stat_label));
                };

                Func <Game_Unit, Color> label_color = null;
                if (Window_Status.show_stat_colors(stat_label))
                {
                    label_color = (Game_Unit color_unit) =>
                    {
                        return(color_unit.actor.stat_color(stat_label));
                    };
                }

                Stats.Add(new StatusPrimaryStatUINode(
                              help_label, label, stat_formula, label_color, 40));
                Stats.Last().loc          = loc;
                Stats.Last().stereoscopic = Config.STATUS_LEFT_WINDOW_DEPTH;

                if (stat_label == Stat_Labels.Pow)
                {
                    PowNode = Stats.Last() as StatusStatUINode;
                }
            }

            set_images(unit);
        }
Пример #4
0
        // Open status screen from items menu
        protected void preparationsMenu_Status(object sender, EventArgs e)
        {
            Global.game_temp.menu_call        = false;
            Global.game_temp.status_menu_call = false;

            if (!(sender is PreparationsBaseMenu))
            {
                if (sender is Window_Prep_Items)
                {
                    throw new NotImplementedException();
                }
            }
            var itemsMenu = (sender as PreparationsBaseMenu);
            int actorId   = itemsMenu.ActorId;

            var statusMenu = new Window_Status(Global.battalion.actors, actorId, true);

            statusMenu.Closed += statusMenu_Closed;
            AddMenu(statusMenu);
        }
Пример #5
0
        // Open status screen from unit menu
        void unitMenu_Status(object sender, EventArgs e)
        {
            Global.game_temp.menu_call        = false;
            Global.game_temp.status_menu_call = false;
            // @Debug: team should be generated from the units shown in the Unit screen
            List <int> team = new List <int>();
            {
                // Only list units that are on the map or rescued (rescued units can be off map)
                team.AddRange(Global.game_map.teams[Global.game_temp.status_team]
                              .Where(x => x == Global.game_temp.status_unit_id ||
                                     !Global.game_map.is_off_map(Global.game_map.units[x].loc) ||
                                     Global.game_map.units[x].is_rescued));
            }
            int index = team.IndexOf(Global.game_temp.status_unit_id);

            index = Math.Max(0, index);

            var statusMenu = new Window_Status(team, index);

            statusMenu.Closed += statusMenu_Closed;
            AddMenu(statusMenu);
        }