Пример #1
0
        private void create_window(bool mainMenu, IO.Suspend_Info suspend_file_info)
        {
            Window        = new System_Color_Window();
            Window.height = 80;
            Window.offset = new Vector2(16, 8);

            Window.width = 208;
            if (Window is System_Color_Window)
            {
                (Window as System_Color_Window).color_override =
                    Constants.Difficulty.DIFFICULTY_COLOR_REDIRECT[suspend_file_info.difficulty];
            }
        }
Пример #2
0
        public Suspend_Info_Panel(bool mainMenu, IO.Suspend_Info suspend_file_info)
        {
            this.offset = new Vector2(-12, -4);

            create_window(mainMenu, suspend_file_info);

            Lord_Mini = new Miniface();
            Lord_Mini.set_actor(suspend_file_info.lord_actor_face);
            Lord_Mini.loc = new Vector2(24, 0);

            Turn_Label     = new TextSprite();
            Turn_Label.loc = new Vector2(48, 16);
            Turn_Label.SetFont(Config.UI_FONT, Global.Content, "Yellow");
            Units_Label     = new TextSprite();
            Units_Label.loc = new Vector2(112, 16);
            Units_Label.SetFont(Config.UI_FONT, Global.Content, "Yellow");
            Units_Label.text = "Units";
            Save_Label       = new TextSprite();
            Save_Label.loc   = new Vector2(0, 48);
            Save_Label.SetFont(Config.UI_FONT, Global.Content, "Yellow");
            Save_Label.text = "File";

            Chapter     = new TextSprite();
            Chapter.loc = new Vector2(48, 0);
            Chapter.SetFont(Config.UI_FONT, Global.Content, "Yellow");
            Chapter.text = !Global.data_chapters.ContainsKey(suspend_file_info.chapter_id) ?
                           suspend_file_info.chapter_id :
                           Global.data_chapters[suspend_file_info.chapter_id].FileSelectName;
            Turn     = new RightAdjustedText();
            Turn.loc = new Vector2(88, 16);
            Turn.SetFont(Config.UI_FONT, Global.Content, "Blue");
            Units     = new RightAdjustedText();
            Units.loc = new Vector2(152, 16);
            Units.SetFont(Config.UI_FONT, Global.Content, "Blue");
            Units.text = suspend_file_info.units.ToString();
            Gold       = new RightAdjustedText();
            Gold.loc   = new Vector2(140, 32);
            Gold.SetFont(Config.UI_FONT, Global.Content, "Blue");
            Gold.text = suspend_file_info.gold.ToString();
            Save      = new RightAdjustedText();
            Save.loc  = new Vector2(40, 48);
            Save.SetFont(Config.UI_FONT, Global.Content, "Blue");
            Save.text = suspend_file_info.save_id.ToString();
            Mode      = new TextSprite();
            Mode.loc  = new Vector2(80, 48);
            Mode.SetFont(Config.UI_FONT, Global.Content, "Blue");
            Mode.text = suspend_file_info.difficulty.ToString();
            Style     = new TextSprite();
            Style.loc = new Vector2(120, 48);
            Style.SetFont(Config.UI_FONT, Global.Content, "Blue");
            Style.text = suspend_file_info.style.ToString();//.Substring(0, Math.Min(3, suspend_file_info.style.ToString().Length)); //Debug

            if (suspend_file_info.home_base)
            {
                Turn_Label.text     = "Home Base";
                Units_Label.visible = false;
                Units.visible       = false;
            }
            else if (suspend_file_info.preparations)
            {
                Turn_Label.text = "Preparations";
            }
            else
            {
                Turn_Label.text = "Turn";
                Turn.text       = suspend_file_info.turn.ToString();
            }

            Counter     = new Play_Time_Counter(suspend_file_info.playtime);
            Counter.loc = new Vector2(-4, 32);

            Gold_G          = new Sprite();
            Gold_G.texture  = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Data_Screen");
            Gold_G.loc      = new Vector2(140, 32);
            Gold_G.src_rect = new Rectangle(0, 160, 16, 16);

            Screenshot         = new Sprite();
            Screenshot.texture = suspend_file_info.Screenshot;
            Screenshot.loc     = new Vector2(0, 0);
            Screenshot.scale   = new Vector2(0.25f, 0.25f);
        }