예제 #1
0
        protected virtual void initialize_sprites()
        {
            // Black Screen
            Black_Screen           = new Sprite();
            Black_Screen.texture   = Global.Content.Load <Texture2D>(@"Graphics/White_Square");
            Black_Screen.dest_rect = new Rectangle(0, 0, Config.WINDOW_WIDTH, Config.WINDOW_HEIGHT);
            Black_Screen.tint      = new Color(0, 0, 0, 255);
            // Background
            Background         = new Menu_Background();
            Background.texture = Global.Content.Load <Texture2D>(@"Graphics/Pictures/Preparation_Background");
            (Background as Menu_Background).vel  = new Vector2(0, -1 / 3f);
            (Background as Menu_Background).tile = new Vector2(1, 2);
            Background.stereoscopic = Config.MAPMENU_BG_DEPTH;
            // Supply Window
            initialize_supply_window();
            Supply_Window.manual_cursor_draw = true;
            Supply_Window.stereoscopic       = Config.CONVOY_SUPPLY_DEPTH;
            Supply_Window.arrow_stereoscopic = Config.CONVOY_ARROWS_DEPTH;
            Supply_Window.help_stereoscopic  = Config.CONVOY_HELP_DEPTH;

            Stock_Banner              = new Sprite();
            Stock_Banner.texture      = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Preparations_Screen");
            Stock_Banner.loc          = new Vector2(232, 8);
            Stock_Banner.src_rect     = new Rectangle(0, 64, 88, 24);
            Stock_Banner.offset       = new Vector2(0, 2);
            Stock_Banner.stereoscopic = Config.CONVOY_STOCK_DEPTH;

            HelpFooter              = new Prep_Items_Help_Footer();
            HelpFooter.loc          = new Vector2(0, Config.WINDOW_HEIGHT - 18);
            HelpFooter.stereoscopic = Config.CONVOY_INPUTHELP_DEPTH + 1;
        }
예제 #2
0
 public SupportViewerMenu() : base()
 {
     // Window
     Window = new WindowSupportViewerActorList();
     // Background
     Background         = new Menu_Background();
     Background.texture = Global.Content.Load <Texture2D>(
         @"Graphics\Pictures\Preparation_Background");
     (Background as Menu_Background).vel  = new Vector2(0, -1 / 3f);
     (Background as Menu_Background).tile = new Vector2(1, 2);
     Background.stereoscopic = Config.MAPMENU_BG_DEPTH;
     // Face Window
     FaceWindow                = new Prepartions_Item_Window(false);
     FaceWindow.width          = 128;
     FaceWindow.height         = 72;
     FaceWindow.loc            = new Vector2(24, 8);
     FaceWindow.color_override = 0;
     // Face
     AuguryFace = new Face_Sprite(AUGURY_FACE);
     AuguryFace.convo_placement_offset = true;
     AuguryFace.loc = FaceWindow.loc + new Vector2(
         FaceWindow.width / 2, FaceWindow.height + FACE_CLIP_BOTTOM - 2);
     AuguryFace.mirrored   = true;
     AuguryFace.expression = 1;
     AuguryFace.blink(3);
     AuguryFace.phase_in();
     // Text Box
     TextBox     = new Text_Window(152, 48);
     TextBox.loc = FaceWindow.loc + new Vector2(112, 16);
     TextBox.SetSpeakerArrow(24, SpeakerArrowSide.Left);
     TextBox.opacity = 255;
     TextBox.text_set("Select whose conversation\nyou want to read.");
 }
예제 #3
0
        public CreditsMenu()
        {
            // Background
            Background         = new Menu_Background();
            Background.texture = Global.Content.Load <Texture2D>(
                @"Graphics\Pictures\Preparation_Background");
            (Background as Menu_Background).vel  = new Vector2(0, -1 / 4f);
            (Background as Menu_Background).tile = new Vector2(1, 2);
            Background.tint         = new Color(160, 160, 160, 255);
            Background.stereoscopic = Config.MAPMENU_BG_DEPTH;

            // Credits
            CreditsText = new List <TextSprite>();
            Vector2 loc = Vector2.Zero;

            foreach (var credit in Constants.Credits.CREDITS)
            {
                if (!string.IsNullOrEmpty(credit.Role) || credit.Names.Any())
                {
                    // Role
                    var role = new TextSprite(
                        Config.UI_FONT, Global.Content, "Yellow",
                        loc,
                        credit.Role);

                    CreditsText.Add(role);
                    loc += new Vector2(0, role.CharHeight * Lines(credit.Role));

                    // Names
                    foreach (string name in credit.Names)
                    {
                        var nameText = new TextSprite(
                            Config.UI_FONT, Global.Content, "White",
                            loc + new Vector2(16, 0),
                            name);

                        CreditsText.Add(nameText);
                        loc += new Vector2(0, nameText.CharHeight * Lines(name));
                    }
                }

                loc += new Vector2(0, 16);
            }

            DataHeight = (int)loc.Y - 16;

            // Scrollbar
            if (this.MaxScroll > 0)
            {
                int height = Config.WINDOW_HEIGHT - (int)(BASE_OFFSET.Y * 2);
                Scrollbar     = new Scroll_Bar(height - 16, DataHeight, height, 0);
                Scrollbar.loc = new Vector2(Config.WINDOW_WIDTH - BASE_OFFSET.X, BASE_OFFSET.Y + 8);
            }

            // Full Credits Button
            if (!string.IsNullOrEmpty(Constants.Credits.FULL_CREDITS_LINK))
            {
                CreateFullCreditsButton();
            }
        }
예제 #4
0
        public SettingsTopMenu() : base()
        {
            Vector2       loc      = new Vector2(Config.WINDOW_WIDTH / 2 - 40, 32);
            List <string> settings = GetSettingsStrings();

            // Window
            Window               = new Window_Command(loc, 72, settings);
            Window.text_offset   = new Vector2(8, 0);
            Window.glow          = true;
            Window.bar_offset    = new Vector2(-8, 0);
            Window.WindowVisible = false;
            Window.stereoscopic  = Config.PREPMAIN_WINDOW_DEPTH;

            // Version Number
            VersionNumber     = new TextSprite();
            VersionNumber.loc = new Vector2(8, Config.WINDOW_HEIGHT - 16);
            VersionNumber.SetFont(Config.UI_FONT, Global.Content, "White");
            VersionNumber.text = string.Format("v {0}", Global.RUNNING_VERSION);
#if PRERELEASE || DEBUG
            VersionNumber.text += " - Private Beta";
#endif
            VersionNumber.stereoscopic = Config.MAPCOMMAND_WINDOW_DEPTH;

            // Background
            Background              = new Menu_Background();
            Background.texture      = Global.Content.Load <Texture2D>(@"Graphics/Pictures/Status_Background");
            Background.vel          = new Vector2(-0.25f, 0);
            Background.tile         = new Vector2(3, 2);
            Background.tint         = new Color(128, 128, 128, 255);
            Background.stereoscopic = Config.MAPMENU_BG_DEPTH;
        }
예제 #5
0
        protected virtual void initialize_sprites()
        {
            // Black Screen
            Black_Screen           = new Sprite();
            Black_Screen.texture   = Global.Content.Load <Texture2D>(@"Graphics/White_Square");
            Black_Screen.dest_rect = new Rectangle(0, 0, Config.WINDOW_WIDTH, Config.WINDOW_HEIGHT);
            Black_Screen.tint      = new Color(0, 0, 0, 255);
            // Background
            Background         = new Menu_Background();
            Background.texture = Global.Content.Load <Texture2D>(@"Graphics/Pictures/Preparation_Background");
            (Background as Menu_Background).vel  = new Vector2(0, -1 / 3f);
            (Background as Menu_Background).tile = new Vector2(1, 2);
            Background.stereoscopic = Config.PREP_BG_DEPTH;

            Backing_1              = new Sprite();
            Backing_1.texture      = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Preparations_Screen");
            Backing_1.loc          = new Vector2(24, 160);
            Backing_1.src_rect     = new Rectangle(0, 112, 104, 32);
            Backing_1.tint         = new Color(224, 224, 224, 128);
            Backing_1.stereoscopic = Config.PREPUNIT_INPUTHELP_DEPTH;

            refresh_input_help();

            refresh();
        }
        public SupportViewerActorMenu(int actorId, IHasCancelButton menu) : base(menu)
        {
            ActorId = actorId;
            Window  = new WindowCommandSupportViewerActor(
                ActorId,
                new Vector2(Config.WINDOW_WIDTH - 152, 16));

            // Background
            Background         = new Menu_Background();
            Background.texture = Global.Content.Load <Texture2D>(
                @"Graphics\Pictures\Preparation_Background");
            (Background as Menu_Background).vel  = new Vector2(0, -1 / 3f);
            (Background as Menu_Background).tile = new Vector2(1, 2);
            Background.stereoscopic = Config.MAPMENU_BG_DEPTH;
            // Face Window
            FaceWindow                = new Prepartions_Item_Window(false);
            FaceWindow.width          = 128;
            FaceWindow.height         = 96;
            FaceWindow.loc            = new Vector2(24, 16);
            FaceWindow.color_override = 0;
            // Face
            string filename = "";

            if (Global.data_actors.ContainsKey(ActorId))
            {
                filename = Global.data_actors[ActorId].Name;
            }
            Face = new Face_Sprite(filename);
            Face.convo_placement_offset = true;
            Face.loc = FaceWindow.loc + new Vector2(
                FaceWindow.width / 2, FaceWindow.height + FACE_CLIP_BOTTOM - 2);
            Face.mirrored = true;
            if (Global.face_data.ContainsKey(filename))
            {
                Face.expression = Global.face_data[filename].StatusFrame;
            }
            Face.blink(3);
            Face.phase_in();
            // Name Banner
            NameBanner = new Sprite(
                Global.Content.Load <Texture2D>(@"Graphics/Pictures/Portrait_bg"));
            NameBanner.src_rect    = new Rectangle(0, 114 + 25 * 0, 93, 25);
            NameBanner.loc         = FaceWindow.loc + new Vector2(FaceWindow.width / 2 - 48, FaceWindow.height);
            NameBanner.draw_offset = new Vector2(2, 0);
            // Name
            Name = new TextSprite(
                Config.UI_FONT, Global.Content, "White",
                NameBanner.loc + new Vector2(48, 4),
                Global.data_actors[ActorId].Name.Split(Global.ActorConfig.ActorNameDelimiter)[0]);
            Name.offset.X = (int)System.Math.Ceiling(Name.text_width / 2f);
        }
예제 #7
0
        protected void initialize_sprites()
        {
            // Black Screen
            Black_Screen         = new Sprite();
            Black_Screen.texture = Global.Content.Load <Texture2D>(
                @"Graphics/White_Square");
            Black_Screen.dest_rect = new Rectangle(0, 0, Config.WINDOW_WIDTH, Config.WINDOW_HEIGHT);
            Black_Screen.tint      = new Color(0, 0, 0, 255);
            // Background
            Background         = new Menu_Background();
            Background.texture = Global.Content.Load <Texture2D>(
                @"Graphics/Pictures/Status_Background");
            (Background as Menu_Background).vel  = new Vector2(-0.25f, 0);
            (Background as Menu_Background).tile = new Vector2(3, 2);
            Background.stereoscopic = Config.MAPMENU_BG_DEPTH;
            // Cancel Button
            CancelButton              = Button_Description.button(Inputs.B, 32);
            CancelButton.loc          = new Vector2(32, Config.WINDOW_HEIGHT - 24);
            CancelButton.description  = "Cancel";
            CancelButton.stereoscopic = Config.MAPCOMMAND_HELP_DEPTH;

            RankingIcons         = new Sprite();
            RankingIcons.texture = Global.Content.Load <Texture2D>(
                @"Graphics/Pictures/RankingIcons");
            RankingIcons.loc = DATA_OFFSET + new Vector2(48, -16);

            DataBackground         = new Sprite();
            DataBackground.texture = Global.Content.Load <Texture2D>(
                @"Graphics/White_Square");
            DataBackground.dest_rect = new Rectangle(
                0, (int)DATA_OFFSET.Y,
                Config.WINDOW_WIDTH, ROWS * 16);
            DataBackground.tint = new Color(0, 0, 0, 128);

            // Style
            StyleText     = new TextSprite();
            StyleText.loc = new Vector2(
                Config.WINDOW_WIDTH - 112, Config.WINDOW_HEIGHT - 24);
            StyleText.SetFont(Config.UI_FONT, Global.Content, "Blue");
            StyleText.text         = Global.game_system.Style.ToString();
            StyleText.stereoscopic = Config.DATA_LEADER_DEPTH;
            // Difficulty
            DifficultyText     = new TextSprite();
            DifficultyText.loc = new Vector2(
                Config.WINDOW_WIDTH - 56, Config.WINDOW_HEIGHT - 24);
            DifficultyText.SetFont(Config.UI_FONT, Global.Content, "Blue");
            DifficultyText.text         = Difficulty.ToString();
            DifficultyText.stereoscopic = Config.DATA_LEADER_DEPTH;

            refresh_rankings(Chapter);
        }
예제 #8
0
        protected void initialize_sprites(int id1, int id2)
        {
            // Black Screen
            Black_Screen           = new Sprite();
            Black_Screen.texture   = Global.Content.Load <Texture2D>(@"Graphics/White_Square");
            Black_Screen.dest_rect = new Rectangle(0, 0, Config.WINDOW_WIDTH, Config.WINDOW_HEIGHT);
            Black_Screen.tint      = new Color(0, 0, 0, 255);
            // Background
            Background         = new Menu_Background();
            Background.texture = Global.Content.Load <Texture2D>(@"Graphics/Pictures/Preparation_Background");
            (Background as Menu_Background).vel  = new Vector2(0, -1 / 3f);
            (Background as Menu_Background).tile = new Vector2(1, 2);
            Background.stereoscopic = Config.MAPMENU_BG_DEPTH;
            // Trade Window
            Trade_Window                   = new Window_Trade(id1, id2, -1);
            Trade_Window.glow              = true;
            Trade_Window.stereoscopic      = Config.PREPTRADE_WINDOWS_DEPTH;
            Trade_Window.face_stereoscopic = Config.PREPTRADE_FACES_DEPTH;
            Trade_Window.help_stereoscopic = Config.PREPTRADE_HELP_DEPTH;
            //
            Banner_1              = new Sprite();
            Banner_1.texture      = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Preparations_Screen");
            Banner_1.loc          = new Vector2(0, 0);
            Banner_1.src_rect     = new Rectangle(0, 40, 56, 24);
            Banner_1.offset       = new Vector2(56, 1);
            Banner_1.tint         = new Color(224, 224, 224, 192);
            Banner_1.mirrored     = true;
            Banner_1.stereoscopic = Config.PREPTRADE_NAMES_DEPTH;
            Banner_2              = new Sprite();
            Banner_2.texture      = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Preparations_Screen");
            Banner_2.loc          = new Vector2(264, 0);
            Banner_2.src_rect     = new Rectangle(0, 40, 56, 24);
            Banner_2.offset       = new Vector2(0, 1);
            Banner_2.tint         = new Color(224, 224, 224, 192);
            Banner_2.stereoscopic = Config.PREPTRADE_NAMES_DEPTH;
            Name_1     = new TextSprite();
            Name_1.loc = Banner_1.loc + new Vector2(24, 0);
            Name_1.SetFont(Config.UI_FONT, Global.Content, "White");
            Name_1.text         = Global.game_actors[id1].name;
            Name_1.offset       = new Vector2(Font_Data.text_width(Name_1.text) / 2, 0);
            Name_1.stereoscopic = Config.PREPTRADE_NAMES_DEPTH;
            Name_2     = new TextSprite();
            Name_2.loc = Banner_2.loc + new Vector2(32, 0);
            Name_2.SetFont(Config.UI_FONT, Global.Content, "White");
            Name_2.text         = Global.game_actors[id2].name;
            Name_2.offset       = new Vector2(Font_Data.text_width(Name_2.text) / 2, 0);
            Name_2.stereoscopic = Config.PREPTRADE_NAMES_DEPTH;

            refresh_input_help();
        }
예제 #9
0
        protected virtual void InitializeSprites()
        {
            // Black Screen
            Black_Screen         = new Sprite();
            Black_Screen.texture = Global.Content.Load <Texture2D>(
                @"Graphics\White_Square");
            Black_Screen.dest_rect = new Rectangle(0, 0, Config.WINDOW_WIDTH, Config.WINDOW_HEIGHT);
            Black_Screen.tint      = new Color(0, 0, 0, 255);
            // Background
            Background         = new Menu_Background();
            Background.texture = Global.Content.Load <Texture2D>(
                @"Graphics\Pictures\Preparation_Background");
            (Background as Menu_Background).vel  = new Vector2(0, -1 / 3f);
            (Background as Menu_Background).tile = new Vector2(1, 2);
            Background.stereoscopic = Config.MAPMENU_BG_DEPTH;
            // Unit Window
            SetUnitWindow();
            UnitWindow.stereoscopic  = Config.PREPITEM_BATTALION_DEPTH;
            UnitWindow.IndexChanged += UnitWindow_IndexChanged;
            // Choose Unit Window
            ChooseUnitWindow = new WindowPanel(Global.Content.Load <Texture2D>(
                                                   @"Graphics\Windowskins\Preparations_Item_Options_Window"));
            ChooseUnitWindow.loc          = new Vector2(Config.WINDOW_WIDTH - 120, Config.WINDOW_HEIGHT - 80);
            ChooseUnitWindow.width        = 80;
            ChooseUnitWindow.height       = 40;
            ChooseUnitWindow.stereoscopic = Config.PREPITEM_WINDOW_DEPTH;

            ChooseUnitLabel     = new TextSprite();
            ChooseUnitLabel.loc = new Vector2(12, 4);
            ChooseUnitLabel.SetFont(Config.UI_FONT, Global.Content, "White");
            SetLabel("Choose unit");
            ChooseUnitLabel.stereoscopic = Config.PREPITEM_WINDOW_DEPTH;

            RefreshInputHelp();

            refresh();
        }
예제 #10
0
        protected void initialize_sprites()
        {
            // Black Screen
            Black_Screen           = new Sprite();
            Black_Screen.texture   = Global.Content.Load <Texture2D>(@"Graphics/White_Square");
            Black_Screen.dest_rect = new Rectangle(0, 0, Config.WINDOW_WIDTH, Config.WINDOW_HEIGHT);
            Black_Screen.tint      = new Color(0, 0, 0, 255);
            // Banner
            Banner                   = new MenuScreenBanner();
            Banner.width             = 120;
            Banner.loc               = new Vector2(OPTIONS_OFFSET, 8);
            Banner.stereoscopic      = Config.OPTIONS_BANNER_DEPTH;
            Banner_Text              = new Sprite();
            Banner_Text.texture      = Global.Content.Load <Texture2D>(@"Graphics/Pictures/Banner_Text");
            Banner_Text.src_rect     = new Rectangle(0, 0, 96, 16);
            Banner_Text.loc          = new Vector2(OPTIONS_OFFSET + 24 + 2, 8 + 8);
            Banner_Text.stereoscopic = Config.OPTIONS_BANNER_DEPTH;
            // Background
            Background         = new Menu_Background();
            Background.texture = Global.Content.Load <Texture2D>(@"Graphics/Pictures/Option_Background");
            (Background as Menu_Background).vel  = new Vector2(-0.25f, 0);
            (Background as Menu_Background).tile = new Vector2(3, 1);
            Background.stereoscopic = Config.MAPMENU_BG_DEPTH;
            // Description Window
            Description_Window              = new System_Color_Window();
            Description_Window.loc          = new Vector2(60, 156);
            Description_Window.width        = 200;
            Description_Window.height       = 24;
            Description_Window.small        = true;
            Description_Window.stereoscopic = Config.OPTIONS_DESC_DEPTH;
            // Description
            Description     = new TextSprite();
            Description.loc = new Vector2(72, 160);
            Description.SetFont(Config.UI_FONT, Global.Content, "White");
            Description.stereoscopic = Config.OPTIONS_DESC_DEPTH;
            // Solo Anim Button Icon
            Solo_Icon     = new SoloAnim_Button();
            Solo_Icon.loc = new Vector2(
                CHOICES_OFFSET + 20 +
                OptionsConfig.OPTIONS_DATA[(int)Constants.Options.Animation_Mode]
                .Options[(int)Constants.Animation_Modes.Solo].Offset,
                16 * (int)Constants.Options.Animation_Mode) +
                            new Vector2(Data_Scissor_Rect.X, Data_Scissor_Rect.Y);
            Solo_Icon.stereoscopic = Config.OPTIONS_OPTIONS_DEPTH;
            // Page Arrows
            Up_Page_Arrow                = new Page_Arrow();
            Up_Page_Arrow.loc            = new Vector2(CHOICES_OFFSET - 4, Data_Scissor_Rect.Y - 4);
            Up_Page_Arrow.angle          = MathHelper.PiOver2;
            Up_Page_Arrow.stereoscopic   = Config.OPTIONS_ARROWS_DEPTH;
            Down_Page_Arrow              = new Page_Arrow();
            Down_Page_Arrow.loc          = new Vector2(CHOICES_OFFSET - 4, Data_Scissor_Rect.Y + Data_Scissor_Rect.Height + 4);
            Down_Page_Arrow.mirrored     = true;
            Down_Page_Arrow.angle        = MathHelper.PiOver2;
            Down_Page_Arrow.stereoscopic = Config.OPTIONS_ARROWS_DEPTH;

            Up_Page_Arrow.ArrowClicked   += Up_Page_Arrow_ArrowClicked;
            Down_Page_Arrow.ArrowClicked += Down_Page_Arrow_ArrowClicked;

            // UI Nodes
            List <OptionsUINode> nodes = new List <OptionsUINode>();

            // Options
            for (int index = 0; index < OptionsConfig.OPTIONS_DATA.Length; index++)
            {
                Vector2 loc = new Vector2(OPTIONS_OFFSET + 16, index * 16) +
                              new Vector2(Data_Scissor_Rect.X, Data_Scissor_Rect.Y);

                nodes.Add(new OptionsUINode(index));
                nodes[index].stereoscopic = Config.OPTIONS_OPTIONS_DEPTH;
                nodes[index].loc          = loc;
            }

            OptionsNodes = new PartialRangeVisibleUINodeSet <OptionsUINode>(nodes);
            OptionsNodes.CursorMoveSound = System_Sounds.Menu_Move1;

            OptionsCursor              = new UICursor <OptionsUINode>(OptionsNodes);
            OptionsCursor.draw_offset  = new Vector2(-(16 + 12), 0);
            OptionsCursor.stereoscopic = Config.OPTIONS_CURSOR_DEPTH;
            // Settings
            List <SettingUINode> settings_nodes = new List <SettingUINode>();

            SettingsGroups = new List <List <SettingUINode> >();
            foreach (var option_node in OptionsNodes)
            {
                int i              = (int)option_node.Option;
                var option         = OptionsConfig.OPTIONS_DATA[i];
                var settings_group = new List <SettingUINode>();

                if (option.Gauge)
                {
                    Vector2 loc = new Vector2(CHOICES_OFFSET, i * 16) +
                                  new Vector2(Data_Scissor_Rect.X, Data_Scissor_Rect.Y);

                    var node = new SettingGaugeUINode(option.Options[0].Name,
                                                      option.GaugeWidth, option.GaugeMin, option.GaugeMax, option.gauge_offset);
                    node.stereoscopic = Config.OPTIONS_OPTIONS_DEPTH;
                    node.loc          = loc;
                    settings_nodes.Add(node);
                    settings_group.Add(node);
                }
                else
                {
                    for (int j = 0; j < option.Options.Length; j++)
                    {
                        Vector2 loc = new Vector2(CHOICES_OFFSET + option.Options[j].Offset, i * 16) +
                                      new Vector2(Data_Scissor_Rect.X, Data_Scissor_Rect.Y);

                        var node = new SettingUINode(option.Options[j].Name);
                        node.stereoscopic = Config.OPTIONS_OPTIONS_DEPTH;
                        node.loc          = loc;
                        settings_nodes.Add(node);
                        settings_group.Add(node);
                    }
                }

                SettingsGroups.Add(settings_group);
            }

            SettingsNodes = new PartialRangeVisibleUINodeSet <SettingUINode>(settings_nodes);
            SettingsNodes.CursorMoveSound = System_Sounds.Menu_Move2;
            SettingsNodes.set_active_node(SettingsNodes[this.current_setting]);

            SettingsCursor                     = new UICursor <SettingUINode>(SettingsNodes);
            SettingsCursor.draw_offset         = new Vector2(-16, 0);
            SettingsCursor.min_distance_y      = 4;
            SettingsCursor.override_distance_y = 16;
            SettingsCursor.stereoscopic        = Config.OPTIONS_CURSOR_DEPTH;
            SettingsCursor.move_to_target_loc();

            // Scrollbar

            /* //Debug
             * Scrollbar = new Scroll_Bar(
             *  ROWS_AT_ONCE * 16 - 16, OptionsConfig.OPTIONS_DATA.Length, ROWS_AT_ONCE, 0);
             * Scrollbar.loc = new Vector2(Data_Scissor_Rect.Width - 12, Data_Scissor_Rect.Y + 8);
             *
             * Scrollbar.UpArrowClicked += Scrollbar_UpArrowClicked;
             * Scrollbar.DownArrowClicked += Scrollbar_DownArrowClicked;*/

            create_cancel_button();

            refresh_arrow_visibility();
            update_loc();
        }
예제 #11
0
        private void initialize_sprites()
        {
            // Black Screen
            Black_Screen           = new Sprite();
            Black_Screen.texture   = Global.Content.Load <Texture2D>(@"Graphics/White_Square");
            Black_Screen.dest_rect = new Rectangle(0, 0, Config.WINDOW_WIDTH, Config.WINDOW_HEIGHT);
            Black_Screen.tint      = new Color(0, 0, 0, 255);
            // Banner
            Banner = new TextSprite();
            string str = Global.data_chapters[Global.game_state.chapter_id].FullName;

            Banner.loc = new Vector2(Config.WINDOW_WIDTH, 32) / 2 - new Vector2(Font_Data.text_width(str, Config.CHAPTER_FONT) / 2, 8);
            Banner.SetFont(Config.CHAPTER_FONT, Global.Content, "Data");
            Banner.text         = str;
            Banner.stereoscopic = Config.DATA_BANNER_DEPTH;

            int alpha = 7 * 16;

            BannerBg              = new Sprite();
            BannerBg.texture      = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Data_Screen");
            BannerBg.loc          = new Vector2(64, 0);
            BannerBg.src_rect     = new Rectangle(0, 176, 192, 32);
            BannerBg.tint         = new Color(alpha, alpha, alpha, 256 - alpha);
            BannerBg.stereoscopic = Config.DATA_BANNER_DEPTH;
            // Unit Bg
            UnitBg              = new Sprite();
            UnitBg.texture      = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Data_Screen");
            UnitBg.loc          = new Vector2(132, 120);
            UnitBg.src_rect     = new Rectangle(0, 272, 128, 72);
            UnitBg.tint         = new Color(alpha, alpha, alpha, 256 - alpha);
            UnitBg.stereoscopic = Config.DATA_LEADER_DEPTH;
            // File Bg
            FileBg              = new Sprite();
            FileBg.texture      = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Data_Screen");
            FileBg.loc          = new Vector2(260, 128);
            FileBg.src_rect     = new Rectangle(0, 208, 56, 64);
            FileBg.tint         = new Color(alpha, alpha, alpha, 256 - alpha);
            FileBg.stereoscopic = Config.DATA_LEADER_DEPTH;
            // Background
            Background         = new Menu_Background();
            Background.texture = Global.Content.Load <Texture2D>(@"Graphics/Pictures/Status_Background");
            (Background as Menu_Background).vel  = new Vector2(-0.25f, 0);
            (Background as Menu_Background).tile = new Vector2(3, 2);
            Background.stereoscopic = Config.MAPMENU_BG_DEPTH;
            // Cursor
            Cursor = new Data_Team_Cursor();
            Cursor.stereoscopic = Config.DATA_TEAMS_DEPTH;
            // Objective Window
            Objective_Window              = new Sprite();
            Objective_Window.texture      = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Data_Screen");
            Objective_Window.loc          = new Vector2(132, 32);
            Objective_Window.src_rect     = new Rectangle(32, 0, 184, 96);
            Objective_Window.stereoscopic = Config.DATA_WINDOW_DEPTH;
            // Game Data Window
            Game_Data_Window              = new Sprite();
            Game_Data_Window.texture      = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Data_Screen");
            Game_Data_Window.loc          = new Vector2(324, 120);
            Game_Data_Window.src_rect     = new Rectangle(104, 96, 112, 72);
            Game_Data_Window.stereoscopic = Config.DATA_DATA_DEPTH;
            // Team Windows/Text
            int y = 0;

            for (int i = 1; i <= Constants.Team.NUM_TEAMS; i++)
            {
                if (Global.game_map.teams[i].Count > 0)
                {
                    List <int>            groups      = new List <int>();
                    Dictionary <int, int> group_sizes = new Dictionary <int, int>();
                    foreach (int id in Global.game_map.teams[i])
                    {
                        if (!groups.Contains(Global.game_map.units[id].group))
                        {
                            groups.Add(Global.game_map.units[id].group);
                            group_sizes.Add(Global.game_map.units[id].group, 0);
                        }
                        group_sizes[Global.game_map.units[id].group]++;
                    }
                    Groups.Add(new KeyValuePair <int, int>(i, groups.Count));
                    Team_Windows.Add(new Data_Team_Window(i, group_sizes.Count));
                    Team_Windows[Team_Windows.Count - 1].loc          = TEAM_WINDOW_LOC + new Vector2(0, 0 + y);
                    Team_Windows[Team_Windows.Count - 1].stereoscopic = Config.DATA_TEAMS_DEPTH;
                    groups.Sort();
                    for (int j = 0; j < groups.Count; j++)
                    {
                        Group_Names.Add(new TextSprite());
                        Group_Names[Group_Names.Count - 1].loc = TEAM_WINDOW_LOC + new Vector2(4, y + 12 + j * 16);
                        Group_Names[Group_Names.Count - 1].SetFont(Config.UI_FONT, Global.Content, "White");
                        Group_Names[Group_Names.Count - 1].text         = Global.game_map.group_name(i, groups[j]);
                        Group_Names[Group_Names.Count - 1].stereoscopic = Config.DATA_TEAMS_DEPTH;
                        Group_Counts.Add(new RightAdjustedText());
                        Group_Counts[Group_Names.Count - 1].loc = TEAM_WINDOW_LOC + new Vector2(112, y + 12 + j * 16);
                        Group_Counts[Group_Names.Count - 1].SetFont(Config.UI_FONT, Global.Content, "Blue");
                        Group_Counts[Group_Names.Count - 1].text         = group_sizes[groups[j]].ToString();
                        Group_Counts[Group_Names.Count - 1].stereoscopic = Config.DATA_TEAMS_DEPTH;
                    }
                    y += (group_sizes.Count + 1) * 16;
                }
            }
            // Game Data Window
            RankingWindow              = new Data_Ranking_Window();
            RankingWindow.loc          = new Vector2(320, 32);
            RankingWindow.width        = 120;
            RankingWindow.height       = 80;
            RankingWindow.stereoscopic = Config.DATA_TEAMS_DEPTH;
            // Counter
            Counter              = new Play_Time_Counter();
            Counter.loc          = Game_Data_Window.loc + new Vector2(12, 48);
            Counter.stereoscopic = Config.DATA_DATA_DEPTH;
            // Labels
            Objective_Label              = new Sprite();
            Objective_Label.texture      = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Data_Screen");
            Objective_Label.loc          = Objective_Window.loc + new Vector2(16 - 2, 12 - 2);
            Objective_Label.src_rect     = new Rectangle(0, 96, 56, 16);
            Objective_Label.stereoscopic = Config.DATA_WINDOW_DEPTH;
            Defeat_Label              = new Sprite();
            Defeat_Label.texture      = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Data_Screen");
            Defeat_Label.loc          = Objective_Window.loc + new Vector2(16 - 2, 44 - 2);
            Defeat_Label.src_rect     = new Rectangle(56, 96, 40, 16);
            Defeat_Label.stereoscopic = Config.DATA_WINDOW_DEPTH;

            Turn_Label               = new Sprite();
            Turn_Label.texture       = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Data_Screen");
            Turn_Label.loc           = Game_Data_Window.loc + new Vector2(8, 8);
            Turn_Label.src_rect      = new Rectangle(0, 112, 32, 16);
            Turn_Label.stereoscopic  = Config.DATA_DATA_DEPTH;
            Funds_Label              = new Sprite();
            Funds_Label.texture      = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Data_Screen");
            Funds_Label.loc          = Game_Data_Window.loc + new Vector2(8, 24);
            Funds_Label.src_rect     = new Rectangle(0, 128, 32, 16);
            Funds_Label.stereoscopic = Config.DATA_DATA_DEPTH;
            Gold_G              = new Sprite();
            Gold_G.texture      = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Data_Screen");
            Gold_G.loc          = Game_Data_Window.loc + new Vector2(88 + 5, 24);
            Gold_G.src_rect     = new Rectangle(0, 160, 16, 16);
            Gold_G.stereoscopic = Config.DATA_DATA_DEPTH;

            Lv_Label              = new Sprite();
            Lv_Label.texture      = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Data_Screen");
            Lv_Label.loc          = UnitBg.loc + new Vector2(8, 40 + 0 - 2);
            Lv_Label.src_rect     = new Rectangle(32, 112, 16, 16);
            Lv_Label.stereoscopic = Config.DATA_LEADER_DEPTH;
            Hp_Label              = new Sprite();
            Hp_Label.texture      = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Data_Screen");
            Hp_Label.loc          = UnitBg.loc + new Vector2(8, 40 + 12 - 2);
            Hp_Label.src_rect     = new Rectangle(48, 112, 24, 16);
            Hp_Label.stereoscopic = Config.DATA_LEADER_DEPTH;
            TextSprite hp_slash = new TextSprite(); // why is this done so //@Yeti

            hp_slash.loc = UnitBg.loc + new Vector2(44, 40 + 12);
            hp_slash.SetFont(Config.UI_FONT, Global.Content, "Yellow");
            hp_slash.text            = "/";
            Hp_Slash                 = hp_slash;
            Hp_Slash.stereoscopic    = Config.DATA_LEADER_DEPTH;
            RatingLabel              = new Sprite();
            RatingLabel.texture      = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Data_Screen");
            RatingLabel.loc          = UnitBg.loc + new Vector2(72, 40 + 12 - 2);
            RatingLabel.src_rect     = new Rectangle(72, 112, 24, 16);
            RatingLabel.stereoscopic = Config.DATA_LEADER_DEPTH;

            RankingLabel     = new TextSprite();
            RankingLabel.loc = RankingWindow.loc + new Vector2(24, 8);
            RankingLabel.SetFont(Config.UI_FONT, Global.Content, "Yellow");
            RankingLabel.text         = "Progress";
            RankingLabel.stereoscopic = Config.DATA_TEAMS_DEPTH;
            TurnsRankLabel            = new TextSprite();
            TurnsRankLabel.loc        = RankingWindow.loc + new Vector2(8, 24);
            TurnsRankLabel.SetFont(Config.UI_FONT, Global.Content, "Yellow");
            TurnsRankLabel.text         = "Turns";
            TurnsRankLabel.stereoscopic = Config.DATA_TEAMS_DEPTH;
            CombatRankLabel             = new TextSprite();
            CombatRankLabel.loc         = RankingWindow.loc + new Vector2(8, 40);
            CombatRankLabel.SetFont(Config.UI_FONT, Global.Content, "Yellow");
            CombatRankLabel.text         = "Combat";
            CombatRankLabel.stereoscopic = Config.DATA_TEAMS_DEPTH;
            ExpRankLabel     = new TextSprite();
            ExpRankLabel.loc = RankingWindow.loc + new Vector2(8, 56);
            ExpRankLabel.SetFont(Config.UI_FONT, Global.Content, "Yellow");
            ExpRankLabel.text         = "Exp";
            ExpRankLabel.stereoscopic = Config.DATA_TEAMS_DEPTH;

            FileLabel     = new TextSprite();
            FileLabel.loc = FileBg.loc + new Vector2(8, 40);
            FileLabel.SetFont(Config.UI_FONT, Global.Content, "Yellow");
            FileLabel.text         = "File";
            FileLabel.stereoscopic = Config.DATA_LEADER_DEPTH;

            // Victory Text
            Victory_Text     = new TextSprite();
            Victory_Text.loc = Objective_Window.loc + new Vector2(68, 12);
            Victory_Text.SetFont(Config.UI_FONT, Global.Content, "White");
            Victory_Text.text         = Global.game_system.Victory_Text;
            Victory_Text.stereoscopic = Config.DATA_WINDOW_DEPTH;
            // Loss Text
            Loss_Text     = new TextSprite();
            Loss_Text.loc = Objective_Window.loc + new Vector2(68, 44);
            Loss_Text.SetFont(Config.UI_FONT, Global.Content, "White");
            Loss_Text.text         = Global.game_system.Loss_Text;
            Loss_Text.stereoscopic = Config.DATA_WINDOW_DEPTH;

            // Turn Text
            Turn     = new RightAdjustedText();
            Turn.loc = Game_Data_Window.loc + new Vector2(100, 8);
            Turn.SetFont(Config.UI_FONT, Global.Content, "Blue");
            Turn.text         = Global.game_system.chapter_turn.ToString();
            Turn.stereoscopic = Config.DATA_DATA_DEPTH;
            // Funds Text
            Funds     = new RightAdjustedText();
            Funds.loc = Game_Data_Window.loc + new Vector2(92, 24);
            Funds.SetFont(Config.UI_FONT, Global.Content, "Blue");
            Funds.text         = Global.battalion.gold.ToString();
            Funds.stereoscopic = Config.DATA_DATA_DEPTH;

            // Leader Name
            Leader_Name     = new TextSprite();
            Leader_Name.loc = UnitBg.loc + new Vector2(32 + 24, 12);
            Leader_Name.SetFont(Config.UI_FONT, Global.Content, "White");
            Leader_Name.stereoscopic = Config.DATA_LEADER_DEPTH;
            // Level
            Lvl     = new RightAdjustedText();
            Lvl.loc = UnitBg.loc + new Vector2(68, 40 + 0);
            Lvl.SetFont(Config.UI_FONT, Global.Content, "Blue");
            Lvl.stereoscopic = Config.DATA_LEADER_DEPTH;
            // Hp
            Hp     = new RightAdjustedText();
            Hp.loc = UnitBg.loc + new Vector2(44, 40 + 12);
            Hp.SetFont(Config.UI_FONT, Global.Content, "Blue");
            Hp.stereoscopic = Config.DATA_LEADER_DEPTH;
            // Hp Max
            Hp_Max     = new RightAdjustedText();
            Hp_Max.loc = UnitBg.loc + new Vector2(68, 40 + 12);
            Hp_Max.SetFont(Config.UI_FONT, Global.Content, "Blue");
            Hp_Max.stereoscopic = Config.DATA_LEADER_DEPTH;
            // Rating
            Rating     = new RightAdjustedText();
            Rating.loc = UnitBg.loc + new Vector2(120, 40 + 12);
            Rating.SetFont(Config.UI_FONT, Global.Content, "Blue");
            Rating.stereoscopic = Config.DATA_LEADER_DEPTH;
            // Map Sprite
            Map_Sprite = new Character_Sprite();
            Map_Sprite.facing_count = 3;
            Map_Sprite.frame_count  = 3;
            Map_Sprite.loc          = UnitBg.loc + new Vector2(20, 24);
            Map_Sprite.stereoscopic = Config.DATA_LEADER_DEPTH;
            // Miniface
            Face              = new Miniface();
            Face.loc          = UnitBg.loc + new Vector2(104, 8);
            Face.stereoscopic = Config.DATA_LEADER_DEPTH;
            // Weapon
            LeaderWeapon              = new Item_Display();
            LeaderWeapon.loc          = UnitBg.loc + new Vector2(8, 28);
            LeaderWeapon.stereoscopic = Config.DATA_LEADER_DEPTH;

            // File number
            FileNumber     = new RightAdjustedText();
            FileNumber.loc = FileBg.loc + new Vector2(40, 40);
            FileNumber.SetFont(Config.UI_FONT, Global.Content, "Blue");
            FileNumber.text         = Global.current_save_id.ToString();
            FileNumber.stereoscopic = Config.DATA_LEADER_DEPTH;
            // Style
            StyleText     = new TextSprite();
            StyleText.loc = FileBg.loc + new Vector2(8, 8);
            StyleText.SetFont(Config.UI_FONT, Global.Content, "Blue");
            StyleText.text         = Global.game_system.Style.ToString();
            StyleText.stereoscopic = Config.DATA_LEADER_DEPTH;
            // Difficulty
            DifficultyText     = new TextSprite();
            DifficultyText.loc = FileBg.loc + new Vector2(8, 24);
            DifficultyText.SetFont(Config.UI_FONT, Global.Content, "Blue");
            DifficultyText.text         = Global.game_system.Difficulty_Mode.ToString();
            DifficultyText.stereoscopic = Config.DATA_LEADER_DEPTH;

            // Rank Letters
            TotalRankLetter     = new TextSprite();
            TotalRankLetter.loc = RankingWindow.loc + new Vector2(88, 8);
            TotalRankLetter.SetFont(Config.UI_FONT + "L", Global.Content, "Blue", Config.UI_FONT);
            TotalRankLetter.stereoscopic = Config.DATA_TEAMS_DEPTH;
            TurnsRankLetter     = new TextSprite();
            TurnsRankLetter.loc = RankingWindow.loc + new Vector2(104, 24);
            TurnsRankLetter.SetFont(Config.UI_FONT + "L", Global.Content, "Blue", Config.UI_FONT);
            TurnsRankLetter.stereoscopic = Config.DATA_TEAMS_DEPTH;
            CombatRankLetter             = new TextSprite();
            CombatRankLetter.loc         = RankingWindow.loc + new Vector2(104, 40);
            CombatRankLetter.SetFont(Config.UI_FONT + "L", Global.Content, "Blue", Config.UI_FONT);
            CombatRankLetter.stereoscopic = Config.DATA_TEAMS_DEPTH;
            ExpRankLetter     = new TextSprite();
            ExpRankLetter.loc = RankingWindow.loc + new Vector2(104, 56);
            ExpRankLetter.SetFont(Config.UI_FONT + "L", Global.Content, "Blue", Config.UI_FONT);
            ExpRankLetter.stereoscopic = Config.DATA_TEAMS_DEPTH;
            // Rank Gauges
            TurnsBar               = new Stat_Bar();
            TurnsBar.loc           = RankingWindow.loc + new Vector2(40, 32);
            TurnsBar.offset        = new Vector2(-2, 0);
            TurnsBar.bar_width     = RANKING_BAR_LENGTH;
            TurnsBar.stereoscopic  = Config.DATA_TEAMS_DEPTH;
            CombatBar              = new Stat_Bar();
            CombatBar.loc          = RankingWindow.loc + new Vector2(40, 48);
            CombatBar.offset       = new Vector2(-2, 0);
            CombatBar.bar_width    = RANKING_BAR_LENGTH;
            CombatBar.stereoscopic = Config.DATA_TEAMS_DEPTH;
            ExpBar              = new Stat_Bar();
            ExpBar.loc          = RankingWindow.loc + new Vector2(40, 64);
            ExpBar.offset       = new Vector2(-2, 0);
            ExpBar.bar_width    = RANKING_BAR_LENGTH;
            ExpBar.stereoscopic = Config.DATA_TEAMS_DEPTH;

            // Page Arrows
            Left_Page_Arrow               = new Page_Arrow();
            Left_Page_Arrow.loc           = new Vector2(4, 72);
            Left_Page_Arrow.stereoscopic  = Config.DATA_BANNER_DEPTH;
            Right_Page_Arrow              = new Page_Arrow();
            Right_Page_Arrow.loc          = new Vector2(Config.WINDOW_WIDTH - 4, 72);
            Right_Page_Arrow.mirrored     = true;
            Right_Page_Arrow.stereoscopic = Config.DATA_BANNER_DEPTH;

            refresh_rank();
            set_images();
        }