public Window_Prep_PickUnits_Unit(int total_units, int unit_count, int other_units)
        {
            this.loc = new Vector2((Config.WINDOW_WIDTH - this.Width), 20);

            TalkIcon         = new Icon_Sprite();
            TalkIcon.texture = Global.Content.Load <Texture2D>(@"Graphics/Characters/TalkIcon");
            TalkIcon.loc     = new Vector2(0, -Constants.Map.TILE_SIZE / 4);
            TalkIcon.size    = new Vector2(32, 32);
            TalkIcon.columns = 5;
            TalkIcon.index   = 0;
            TalkIcon.visible = false;

            for (int i = 0; i < UnitNodes.Count(); i++)
            {
                int id = Global.battalion.actors[i];
                if (Global.game_state.CanActorTalk(id))
                {
                    TalkIndices.Add(i);
                }
            }

            Total_Units = total_units;
            Unit_Count  = unit_count;
            Other_Units = other_units;
            refresh_unit_counts();
        }
예제 #2
0
 public Item_Display()
 {
     Icon      = new Icon_Sprite();
     Icon.size = new Vector2(Config.ITEM_ICON_SIZE, Config.ITEM_ICON_SIZE);
     Name      = new TextSprite();
     Name.SetFont(Config.UI_FONT);
 }
예제 #3
0
 public Unit_Page_1(Game_Unit unit)
 {
     // Class
     Class     = new TextSprite();
     Class.loc = new Vector2(0, 0);
     Class.SetFont(Config.UI_FONT, Global.Content, "White");
     Class.text = unit.actor.class_name;
     // Lvl
     Lvl     = new RightAdjustedText();
     Lvl.loc = new Vector2(88, 0);
     Lvl.SetFont(Config.UI_FONT, Global.Content, "Blue");
     Lvl.text = unit.actor.level.ToString();
     // Exp
     Exp     = new RightAdjustedText();
     Exp.loc = new Vector2(108, 0);
     Exp.SetFont(Config.UI_FONT, Global.Content, "Blue");
     Exp.text = unit.actor.can_level() ? unit.actor.exp.ToString() : "--";
     // Hp
     Hp     = new RightAdjustedText();
     Hp.loc = new Vector2(128, 0);
     Hp.SetFont(Config.UI_FONT, Global.Content, "Blue");
     Hp.text = unit.actor.hp.ToString();
     // Slash
     Slash     = new TextSprite();
     Slash.loc = new Vector2(129, 0);
     Slash.SetFont(Config.UI_FONT, Global.Content, "White");
     Slash.text = "/";
     // MaxHp
     MaxHp     = new RightAdjustedText();
     MaxHp.loc = new Vector2(152, 0);
     MaxHp.SetFont(Config.UI_FONT, Global.Content, "Blue");
     MaxHp.text = unit.actor.maxhp.ToString();
     // Affinity
     Affinity_Icon         = new Icon_Sprite();
     Affinity_Icon.texture = Global.Content.Load <Texture2D>(@"Graphics/Icons/Affinity Icons");
     Affinity_Icon.size    = new Vector2(16, 16);
     Affinity_Icon.loc     = new Vector2(160, 0);
     Affinity_Icon.index   = (int)unit.actor.affin;
     // Status_Icons
     Status_Icons = new List <Status_Icon_Sprite>();
     for (int i = 0; i < Math.Min(STATUS_ICONS_AT_ONCE, unit.actor.states.Count); i++)
     {
         Status_Icons.Add(new Status_Icon_Sprite());
         Status_Icons[Status_Icons.Count - 1].texture = Global.Content.Load <Texture2D>(@"Graphics/Icons/Statuses");
         Status_Icons[Status_Icons.Count - 1].size    = new Vector2(16, 16);
         Status_Icons[Status_Icons.Count - 1].loc     = new Vector2(
             175 + (i * 16) + ((STATUS_ICONS_AT_ONCE - Math.Min(STATUS_ICONS_AT_ONCE, unit.actor.states.Count)) * 8), 0);
         Status_Icons[Status_Icons.Count - 1].index   = Global.data_statuses[unit.actor.states[i]].Image_Index;
         Status_Icons[Status_Icons.Count - 1].counter = unit.actor.state_turns_left(unit.actor.states[i]);
     }
 }
예제 #4
0
        protected void initialize(List <int> skill_ids, bool battle_scene)
        {
#if DEBUG
            if (skill_ids.Count > 1)
            {
            }   //throw new System.Exception();
#endif
            Width     = 80 + skill_ids.Count * Config.SKILL_ICON_SIZE;
            Timer_Max = 97;
            if (battle_scene)
            {
                texture = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Combat_Popup");
            }
            else
            {
                Window        = new System_Color_Window();
                Window.width  = Width;
                Window.height = 32;
            }

            // Skill icons
            Icons = new List <Icon_Sprite>();
            for (int i = 0; i < skill_ids.Count; i++)
            {
                var icon = new Icon_Sprite();
                if (Global.content_exists(@"Graphics/Icons/" + Global.data_skills[skill_ids[i]].Image_Name))
                {
                    icon.texture = Global.Content.Load <Texture2D>(@"Graphics/Icons/" + Global.data_skills[skill_ids[i]].Image_Name);
                }
                icon.size  = new Vector2(Config.SKILL_ICON_SIZE, Config.SKILL_ICON_SIZE);
                icon.loc   = (new Vector2(16) - icon.size / 2) + new Vector2(Config.SKILL_ICON_SIZE * i, 0);
                icon.index = Global.data_skills[skill_ids[i]].Image_Index;
                Icons.Add(icon);
            }
            // Text
            Text     = new TextSprite();
            Text.loc = new Vector2(8 + skill_ids.Count * Config.SKILL_ICON_SIZE, 8);
            Text.SetFont(Config.UI_FONT, Global.Content, "White");
            Text.text = "Skill acquired.";
        }
예제 #5
0
        public Window_Ranking(Game_Ranking ranking)
        {
            Ranking = ranking;

            Banner                 = new Sprite(Global.Content.Load <Texture2D>(@"Graphics/Pictures/Ranking_Banner"));
            Banner.loc             = new Vector2(0, 24);
            Banner.visible         = false;
            Banner.stereoscopic    = Config.RANKING_BANNER_DEPTH;
            Black_Fill             = new Sprite(Global.Content.Load <Texture2D>(@"Graphics/White_Square"));
            Black_Fill.dest_rect   = new Rectangle(0, 0, Config.WINDOW_WIDTH, Config.WINDOW_HEIGHT);
            Black_Fill.tint        = new Color(0, 0, 0, 0);
            White_Screen           = new Sprite(Global.Content.Load <Texture2D>(@"Graphics/White_Square"));
            White_Screen.dest_rect = new Rectangle(0, 0, Config.WINDOW_WIDTH, Config.WINDOW_HEIGHT);
            White_Screen.tint      = new Color(0, 0, 0, 0);
            Burst              = new Ranking_Burst();
            Burst.loc          = new Vector2(Config.WINDOW_WIDTH / 2, Config.WINDOW_HEIGHT / 2 + 16);
            Burst.tint         = new Color(0, 0, 0, 0);
            Burst.stereoscopic = Config.RANKING_BURST_DEPTH;
            Rank         = new Icon_Sprite();
            Rank.texture = Global.Content.Load <Texture2D>(@"Graphics/Pictures/Ranking_Letters");
            Rank.size    = new Vector2(144, 144);
            Rank.columns = 4;
            Rank.loc     = new Vector2(104, 128);
            Rank.offset  = new Vector2(72, 72);
            Rank.index   = Ranking.ranking_index;
            Rank.tint    = new Color(0, 0, 0, 0);

            Window_Img       = new SystemWindowHeadered();
            Window_Img.width = 120;
            Window_Img.set_lines(4);
            Window_Img.loc          = new Vector2(320, 80);
            Window_Img.stereoscopic = Config.RANKING_WINDOW_DEPTH;
            Text = new List <TextSprite>();
            // Chapter name and difficulty
            var name = new TextSprite(
                Config.UI_FONT, Global.Content, "Yellow",
                new Vector2(12, 8),
                Global.data_chapters[ranking.ChapterId].ShortName);

            name.stereoscopic = Config.RANKING_WINDOW_DEPTH;
            Text.Add(name);
            var difficulty = new RightAdjustedText(
                Config.UI_FONT, Global.Content, "Blue",
                new Vector2(Window_Img.width - 12, 8),
                ranking.Difficulty.ToString());

            difficulty.stereoscopic = Config.RANKING_WINDOW_DEPTH;
            Text.Add(difficulty);

            for (int i = 0; i < 4; i++)
            {
                var label = new TextSprite();
                label.loc = new Vector2(8, 24 + i * 16);
                label.SetFont(Config.UI_FONT, Global.Content, "Yellow");
                label.stereoscopic = Config.RANKING_WINDOW_DEPTH;
                Text.Add(label);
            }
            Text[Text.Count - 4].text = "Turns";
            Text[Text.Count - 3].text = "Combat";
            Text[Text.Count - 2].text = "Experience";
            Text[Text.Count - 1].text = "Total";
            //Text[3].text = "MVP";
            for (int i = 0; i < 4; i++)
            {
                var value = new RightAdjustedText();
                value.loc = new Vector2(Window_Img.width - 8, 24 + i * 16);
                value.SetFont(Config.UI_FONT, Global.Content, "Blue");
                value.stereoscopic = Config.RANKING_WINDOW_DEPTH;
                Text.Add(value);
            }
            Text[Text.Count - 4].text = "0";
            Text[Text.Count - 3].text = "0";
            Text[Text.Count - 2].text = "0";
            Text[Text.Count - 1].text = "0";
            update();
        }