public ReinforcementDetailWindow()
        {
            Window        = new System_Color_Window();
            Window.offset = new Vector2(8, 8);
            Window.width  = 136;
            Window.height = 80;

            var text = new TextSprite();

            text.SetFont(Config.UI_FONT, Global.Content, "White");
            MapSprite     = new MapSpriteUINode("", text, 48);
            MapSprite.loc = new Vector2(0, 0);

            Level     = new TextSprite();
            Level.loc = new Vector2(88, 0);
            Level.SetFont(Config.UI_FONT + "L", Global.Content, "Blue", Config.UI_FONT);
            Level.SetTextFontColor(0, "Yellow");
            Level.SetTextFontColor(2, "Blue");
            Identifier = new TextSprite(Config.UI_FONT,
                                        Global.Content, "White",
                                        new Vector2(0, 16));
            Build = new TextSprite(Config.UI_FONT,
                                   Global.Content, "Blue",
                                   new Vector2(88, 16));
            Mission = new TextSprite(Config.UI_FONT,
                                     Global.Content, "White",
                                     new Vector2(0, 32));

            Inventory     = new Unit_Info_Inventory();
            Inventory.loc = new Vector2(0, 48);
        }
예제 #2
0
        protected override void supply_window_index_changed()
        {
            if (!Supply_Window.can_take)
            {
                HelpFooter.refresh(this.unit, null);

                Owner.text = "Owner: ---";
                Owner.SetTextFontColor(7, "Grey");
            }
            else
            {
                HelpFooter.refresh(
                    this.unit, Supply_Window.active_item.get_item());

                string name;
                if (Supply_Window.active_item.Convoy)
                {
                    name = "Convoy";
                    Owner.SetTextFontColor(7, "Yellow");
                }
                else
                {
                    name = Global.game_actors[Supply_Window.active_item.ActorId].name;
                    Owner.SetTextFontColor(7, "White");
                }
                Owner.text = string.Format("Owner: {0}", name);
            }
        }
예제 #3
0
        public override void update_sprites()
        {
            LoadText.clear_text_colors();
            int timer = LoadTimer / 4;

            if (timer > 0)
            {
                LoadText.SetTextFontColor(0, "White");
            }
            LoadText.SetTextFontColor(timer, "Green");
            LoadText.SetTextFontColor(timer + 1, "White");

            if (LoadingComplete)
            {
                FadeOutTimer++;
                int alpha = (FADE_OUT_TIME - FadeOutTimer) * 255 / FADE_OUT_TIME;
                LoadText.opacity = alpha;
            }

            LoadText.update();


#if WINDOWTEST
            //Yeti
            if (Global.Input.triggered(Inputs.A))
            {
                WindowIndex = (WindowIndex + 1) % WINDOWS.Length;
                change_window();
            }
            Window.width  = Math.Max(0, (int)Global.Input.mousePosition.X / 8 * 8 - 8);
            Window.height = Math.Max(0, (int)Global.Input.mousePosition.Y / 8 * 8 - 8);

            LoremText.loc = new Vector2(8, 8);
            if (WINDOWS[WindowIndex].Item2 != null)
            {
                LoremText.loc = new Vector2(WINDOWS[WindowIndex].Item2[0],
                                            WINDOWS[WindowIndex].Item2[3]);
            }
            LoremText.loc += Window.loc;

            ScissorRect = new Rectangle(
                (int)LoremText.loc.X, (int)LoremText.loc.Y,
                Window.body_width, Window.body_height);

            ScissorRect.Width = Math.Min(
                ScissorRect.Width, Config.WINDOW_WIDTH - ScissorRect.X);
            ScissorRect.Height = Math.Min(
                ScissorRect.Height, Config.WINDOW_HEIGHT - ScissorRect.Y);

            LoadText.text = string.Format("{0}, {1}", Window.width, Window.height);
#endif
        }
예제 #4
0
        public Game_Updated_Banner(bool open_already_opened)
        {
            texture = Global.Content.Load <Texture2D>(@"Graphics/White_Square");
            loc     = new Vector2(0, Config.WINDOW_HEIGHT - 32);
            tint    = new Color(0, 0, 0, 128);
            scale   = new Vector2(Config.WINDOW_WIDTH, HEIGHT) / 16f;

            FadeInTimer   = open_already_opened ? FADE_IN_TIME : 0;
            ScissorHeight = open_already_opened ? HEIGHT : 0;

            Text             = new TextSprite();
            Text.draw_offset = new Vector2(0, (HEIGHT - 16) / 2);
            Text.SetFont(Config.CONVO_FONT);
            // Set message
            // Version
            Text.SetTextFontColor(0, "White");
            Text.text  = "New version is available!";
            Text.text += SPACES_GAP;
            // Download link
            Text.text += string.Format("Download v{0} ({1}-{2}-{3}) at ",
                                       Global.UpdateVersion, Global.UpdateDate.Year, Global.UpdateDate.Month, Global.UpdateDate.Day);
            Text.SetTextFontColor("Blue");
            Text.text += Global.UpdateUri;
            Text.text += SPACES_GAP;
            // Description
            if (!string.IsNullOrEmpty(Global.UpdateDescription))
            {
                Text.SetTextFontColor("White");
                Text.text += Global.UpdateDescription;
                Text.text += SPACES_GAP;
            }

            TextWidth    = Text.text_width;
            TextWidth    = TextWidth + (TextWidth % 8 == 0 ? 0 : (8 - TextWidth % 8));
            TextPosition = (SCROLL_SPEED < 0 ? -1 : 1) * (TextWidth - 80);
        }
예제 #5
0
        protected override void initialize_sprites()
        {
            base.initialize_sprites();

            // Face
            Face = new Face_Sprite(this.actor.face_name, true);
            if (this.actor.generic_face)
            {
                Face.recolor_country(this.actor.name_full);
            }
            Face.expression = Face.status_frame;
            Face.phase_in();
            Face.loc = this.item_window_loc + new Vector2(144 / 2, 12 +
                                                          (int)Math.Max(0, ((Face.src_rect.Height - Face.eyes_offset.Y) - 48) * 0.75f));
            Face.stereoscopic = Config.PREPTRADE_NAMES_DEPTH;
            Face.mirrored     = true;

            Nameplate              = new Sprite();
            Nameplate.texture      = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Preparations_Screen");
            Nameplate.loc          = new Vector2(0, 0);
            Nameplate.src_rect     = new Rectangle(0, 40, 56, 24);
            Nameplate.offset       = new Vector2(56, 1);
            Nameplate.tint         = new Color(224, 224, 224, 192);
            Nameplate.mirrored     = true;
            Nameplate.stereoscopic = Config.PREPTRADE_NAMES_DEPTH;
            Name     = new TextSprite();
            Name.loc = Nameplate.loc + new Vector2(24, 0);
            Name.SetFont(Config.UI_FONT, Global.Content, "White");
            Name.text         = this.actor.name;
            Name.offset       = new Vector2(Font_Data.text_width(Name.text) / 2, 0);
            Name.stereoscopic = Config.PREPTRADE_NAMES_DEPTH;

            Owner     = new TextSprite();
            Owner.loc = Stock_Banner.loc + new Vector2(8, 0);
            Owner.SetFont(Config.UI_FONT);
            Owner.SetTextFontColor(0, "White");
            Owner.text         = "Owner: ";
            Owner.stereoscopic = Config.PREPTRADE_NAMES_DEPTH;
        }