protected void initialize_sprites()
        {
            CommandWindow = new Window_Command_Supply(
                this.loc + new Vector2(0, 8), WIDTH, ROWS);
            CommandWindow.glow               = true;
            CommandWindow.glow_width         = WIDTH - 24;
            CommandWindow.manual_cursor_draw = true;
            // Weapon Type Icons
            for (int i = 0; i < this.supply_type_count; i++)
            {
                Type_Icons.Add(new Weapon_Type_Icon());
                Type_Icons[i].loc   = new Vector2(i * 12 + 4, 0);
                Type_Icons[i].index = Global.weapon_types[SupplyWeaponTypes[i]].IconIndex;
            }
            // Arrows
            Left_Arrow                = new Page_Arrow();
            Left_Arrow.loc            = new Vector2(0, 0);
            Left_Arrow.ArrowClicked  += Left_Arrow_ArrowClicked;
            Right_Arrow               = new Page_Arrow();
            Right_Arrow.loc           = new Vector2(144, 0);
            Right_Arrow.mirrored      = true;
            Right_Arrow.ArrowClicked += Right_Arrow_ArrowClicked;

            refresh(true);
        }
 public Window_WorldMap_Data()
 {
     Window          = new Sprite(Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Worldmap_Window"));
     Window.src_rect = new Rectangle(0, 0, 136, 64);
     Window.tint     = new Color(224, 224, 224, 224);
     Labels          = new Sprite(Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Worldmap_Window"));
     Labels.src_rect = new Rectangle(0, 64, 136, 64);
     // Chapter
     Chapter     = new TextSprite();
     Chapter.loc = new Vector2(8, 8);
     Chapter.SetFont(Config.UI_FONT, Global.Content, "White");
     // Lord_Lvl
     Lord_Lvl     = new RightAdjustedText();
     Lord_Lvl.loc = new Vector2(128, 8);
     Lord_Lvl.SetFont(Config.UI_FONT, Global.Content, "Blue");
     // Mode
     Mode     = new TextSprite();
     Mode.loc = new Vector2(12, 24);
     Mode.SetFont(Config.UI_FONT, Global.Content, "Blue");
     // Unit_Count
     Unit_Count     = new RightAdjustedText();
     Unit_Count.loc = new Vector2(40, 40);
     Unit_Count.SetFont(Config.UI_FONT, Global.Content, "Blue");
     // Gold
     Gold     = new RightAdjustedText();
     Gold.loc = new Vector2(120, 40);
     Gold.SetFont(Config.UI_FONT, Global.Content, "Blue");
     // Lord
     Lord_Sprite              = new Character_Sprite();
     Lord_Sprite.loc          = new Vector2(88, 24);
     Lord_Sprite.facing_count = 3;
     Lord_Sprite.frame_count  = 3;
     Lord_Sprite.mirrored     = Constants.Team.flipped_map_sprite(
         Constants.Team.PLAYER_TEAM);
     // Arrows
     Left_Arrow           = new Page_Arrow();
     Left_Arrow.loc       = new Vector2(0, 24);
     Right_Arrow          = new Page_Arrow();
     Right_Arrow.loc      = new Vector2(WIDTH, 24);
     Right_Arrow.mirrored = true;
 }
Beispiel #3
0
        public Convo_Backlog()
        {
            Active = false;
            for (int i = 0; i < Text.Length; i++)
            {
                Text[i]     = new TextSprite();
                Text[i].loc = new Vector2(24, LineY(i));
                Text[i].SetFont(Config.CONVO_FONT);
                Text[i].stereoscopic = Config.CONVO_BACKLOG_DEPTH;
            }
            Black_Fill           = new Sprite();
            Black_Fill.texture   = 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);

            UpArrow            = new Page_Arrow();
            UpArrow.loc        = new Vector2(Config.WINDOW_WIDTH / 2 + 8, 4);
            UpArrow.angle      = MathHelper.PiOver2;
            DownArrow          = new Page_Arrow();
            DownArrow.loc      = new Vector2(Config.WINDOW_WIDTH / 2 + 8, Config.WINDOW_HEIGHT - 4);
            DownArrow.mirrored = true;
            DownArrow.angle    = MathHelper.PiOver2;
        }
Beispiel #4
0
        private void initialize(int fileId)
        {
            Cursor                   = new Hand_Cursor();
            Cursor.draw_offset       = new Vector2(-8, 4);
            Cursor.stereoscopic      = Config.TITLE_MENU_DEPTH;
            Move_Cursor              = new Hand_Cursor();
            Move_Cursor.draw_offset  = new Vector2(-8, 4);
            Move_Cursor.tint         = new Color(160, 160, 160, 255);
            Move_Cursor.stereoscopic = Config.TITLE_MENU_DEPTH;

            for (int i = 0; i < Panels.Length; i++)
            {
                Panels[i] = new StartGame_Info_Panel(Page * Config.SAVES_PER_PAGE + i + 1, PANEL_WIDTH);
                Panels[i].stereoscopic = Config.TITLE_MENU_DEPTH;
            }

            refresh_panel_locations();
            PanelNodes = new UINodeSet <StartGame_Info_Panel>(Panels);
            PanelNodes.CursorMoveSound  = System_Sounds.Menu_Move1;
            PanelNodes.WrapVerticalMove = true;

            // Page Arrows
            Left_Page_Arrow                = new Page_Arrow();
            Left_Page_Arrow.loc            = new Vector2(-4, 68);
            Left_Page_Arrow.stereoscopic   = Config.TITLE_MENU_DEPTH - 1;
            Left_Page_Arrow.ArrowClicked  += Left_Page_Arrow_ArrowClicked;
            Right_Page_Arrow               = new Page_Arrow();
            Right_Page_Arrow.loc           = new Vector2(PANEL_WIDTH - 4, 68);
            Right_Page_Arrow.mirrored      = true;
            Right_Page_Arrow.stereoscopic  = Config.TITLE_MENU_DEPTH - 1;
            Right_Page_Arrow.ArrowClicked += Right_Page_Arrow_ArrowClicked;

            create_cancel_button();

            this.file_id = fileId;
        }
        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.vel          = new Vector2(-0.25f, 0);
            Background.tile         = new Vector2(3, 2);
            Background.stereoscopic = Config.MAPMENU_BG_DEPTH;

            // UI Nodes
            TopPanelNodes = new List <StatusUINode>();
            // Top Panel //
            // Top Panel
            Top_Panel = new Status_Top_Panel_Bg(new List <Texture2D> {
                Global.Content.Load <Texture2D>(@"Graphics/Pictures/Portrait_bg"),
                Global.Content.Load <Texture2D>(@"Graphics/Windowskins/WindowPanel")
            });
            Top_Panel.stereoscopic = Config.STATUS_TOP_PANEL_DEPTH;
            // Face Bg
            Face_Bg              = new Menu_Background();// Sprite(); //Debug
            Face_Bg.texture      = Global.Content.Load <Texture2D>(@"Graphics/Pictures/Portrait_bg");
            Face_Bg.loc          = new Vector2(4, 4);
            Face_Bg.src_rect     = new Rectangle(12, 4, 8, 8);
            Face_Bg.tile         = new Vector2(11, 9);
            Face_Bg.stereoscopic = Config.STATUS_FACE_BG_DEPTH;
            // Map Sprite
            Map_Sprite              = new Character_Sprite();
            Map_Sprite.draw_offset  = MAP_SPRITE_LOC + new Vector2(16, 16);
            Map_Sprite.facing_count = 3;
            Map_Sprite.frame_count  = 3;
            Map_Sprite.stereoscopic = Config.STATUS_TOP_PANEL_DEPTH;
            // Map Sprite Platform
            Platform              = new Sprite();
            Platform.texture      = Global.Content.Load <Texture2D>(@"Graphics/Characters/StatusPlatform");
            Platform.loc          = MAP_SPRITE_LOC;
            Platform.stereoscopic = Config.STATUS_TOP_PANEL_DEPTH;
            // Name
            TopPanelNodes.Add(new StatusTextUINode(
                                  "Name",
                                  (Game_Unit unit) => unit.name, true));
            TopPanelNodes.Last().loc          = new Vector2(112, 4);
            TopPanelNodes.Last().draw_offset  = new Vector2(34, 0);
            TopPanelNodes.Last().Size         = new Vector2(68, 16);
            TopPanelNodes.Last().stereoscopic = Config.STATUS_TOP_PANEL_DEPTH;

            // Class Name
            TopPanelNodes.Add(new StatusTextUINode(
                                  "Class",
                                  (Game_Unit unit) => unit.actor.class_name));
            TopPanelNodes.Last().loc          = new Vector2(104, 24);
            TopPanelNodes.Last().Size         = new Vector2(72, 16);
            TopPanelNodes.Last().stereoscopic = Config.STATUS_TOP_PANEL_DEPTH;

            // Lives
            TopPanelNodes.Add(new StatusLivesUINode("Lives"));
            TopPanelNodes.Last().loc          = new Vector2(180, 60);
            TopPanelNodes.Last().stereoscopic = Config.STATUS_TOP_PANEL_DEPTH;
            // LV/HP/etc

            TopPanelNodes.Add(new StatusStatLargeLabelUINode(
                                  "Lvl", "LV", (Game_Unit unit) => unit.actor.level.ToString(), 32));
            TopPanelNodes.Last().loc          = new Vector2(104, 40);
            TopPanelNodes.Last().stereoscopic = Config.STATUS_TOP_PANEL_DEPTH;
            Func <Game_Unit, DirectionFlags, bool> lvl_cheat = (unit, dir) =>
            {
                int lvl_gain = 0;
                if (dir.HasFlag(DirectionFlags.Right))
                {
                    lvl_gain = 1;
                }
                else if (dir.HasFlag(DirectionFlags.Left))
                {
                    lvl_gain = -1;
                }
                unit.actor.level += lvl_gain;
                unit.queue_move_range_update();
                return(lvl_gain != 0);
            };

#if DEBUG
            TopPanelNodes.Last().set_cheat(lvl_cheat);
#endif

            TopPanelNodes.Add(new StatusStatUINode(
                                  "Exp", "$", (Game_Unit unit) =>
                                  unit.actor.can_level() ? unit.actor.exp.ToString() : "--", 24));
            TopPanelNodes.Last().loc          = new Vector2(136, 40);
            TopPanelNodes.Last().stereoscopic = Config.STATUS_TOP_PANEL_DEPTH;
            Func <Game_Unit, DirectionFlags, bool> exp_cheat = (unit, dir) =>
            {
                int exp_gain = 0;
                if (dir.HasFlag(DirectionFlags.Right))
                {
                    exp_gain = 1;
                }
                else if (dir.HasFlag(DirectionFlags.Left))
                {
                    exp_gain = -1;
                }
                unit.actor.exp = (int)MathHelper.Clamp(
                    unit.actor.exp + exp_gain,
                    0, Global.ActorConfig.ExpToLvl - 1);
                return(exp_gain != 0);
            };
#if DEBUG
            TopPanelNodes.Last().set_cheat(exp_cheat);
#endif

            Func <Game_Unit, Color> label_color = null;
            if (show_stat_colors(Stat_Labels.Hp))
            {
                label_color = (Game_Unit unit) =>
                {
                    if (unit.average_stat_hue_shown)
                    {
                        return(unit.actor.stat_color(Stat_Labels.Hp));
                    }

                    return(Color.White);
                };
            }
            TopPanelNodes.Add(new StatusHpUINode(
                                  "Hp",
                                  "HP",
                                  (Game_Unit unit) =>
            {
                if (unit.actor.hp >=
                    Math.Pow(10, Global.BattleSceneConfig.StatusHpCounterValues))
                {
                    return("--");
                }
                else
                {
                    return(unit.actor.hp.ToString());
                }
            },
                                  (Game_Unit unit) =>
            {
                if (unit.actor.maxhp >=
                    Math.Pow(10, Global.BattleSceneConfig.StatusHpCounterValues))
                {
                    return("--");
                }
                else
                {
                    return(unit.actor.maxhp.ToString());
                }
            },
                                  label_color));
            TopPanelNodes.Last().loc          = new Vector2(104, 56);
            TopPanelNodes.Last().stereoscopic = Config.STATUS_TOP_PANEL_DEPTH;
#if DEBUG
            TopPanelNodes.Last().set_cheat(
                Status_Page_1.stat_cheat(Stat_Labels.Hp));
#endif

            // Battle Stat Labels
            Battle_Stat_Labels = new List <TextSprite>();
            for (int i = 0; i < 1; i++)
            {
                Battle_Stat_Labels.Add(new TextSprite());
                Battle_Stat_Labels[i].loc = new Vector2(204 + (i / 4) * 56, 8 + (i % 4) * 16);
                Battle_Stat_Labels[i].SetFont(Config.UI_FONT, Global.Content, "Yellow");
                Battle_Stat_Labels[i].text         = "doop";
                Battle_Stat_Labels[i].stereoscopic = Config.STATUS_TOP_PANEL_DEPTH;
            }
            Battle_Stat_Labels[0].SetColor(Global.Content, "White");
            Battle_Stat_Labels[0].text = "Battle Stats";
            // Battle Stats
            for (int i = 1; i < 8; i++)
            {
                string help_label;
                string label;
                Func <Game_Unit, string> stat_formula;
                switch (i)
                {
                // Atk
                case 1:
                default:
                    help_label   = "Atk";
                    label        = "Atk";
                    stat_formula = (Game_Unit unit) =>
                    {
                        var stats = new BattlerStats(unit.id);
                        if (!stats.has_non_staff_weapon)
                        {
                            return("--");
                        }
                        return(stats.dmg().ToString());
                    };
                    break;

                // Hit
                case 2:
                    help_label   = "Hit";
                    label        = "Hit";
                    stat_formula = (Game_Unit unit) =>
                    {
                        var stats = new BattlerStats(unit.id);
                        if (!stats.has_non_staff_weapon)
                        {
                            return("--");
                        }
                        return(stats.hit().ToString());
                    };
                    break;

                // Dodge
                case 7:
                    help_label   = "Dodge";
                    label        = "Dodge";
                    stat_formula = (Game_Unit unit) =>
                    {
                        var stats = new BattlerStats(unit.id);
                        return(stats.dodge().ToString());
                    };
                    break;

                // Range
                case 4:
                    help_label   = "Range";
                    label        = "Rng";
                    stat_formula = (Game_Unit unit) =>
                    {
                        if (unit.actor.weapon == null ||
                            unit.actor.weapon.is_staff())
                        {
                            return("--");
                        }

                        Data_Weapon weapon    = unit.actor.weapon;
                        int         min_range = unit.min_range();
                        int         max_range = unit.max_range();
                        if (min_range == max_range)
                        {
                            return(min_range.ToString());
                        }
                        else
                        {
                            return(string.Format("{0}-{1}", min_range, max_range));
                        }
                    };
                    break;

                // Crit
                case 3:
                    help_label   = "Crit";
                    label        = "Crit";
                    stat_formula = (Game_Unit unit) =>
                    {
                        var stats = new BattlerStats(unit.id);
                        if (!stats.has_non_staff_weapon || !stats.can_crit())
                        {
                            return("--");
                        }
                        return(stats.crt().ToString());
                    };
                    break;

                // Avoid
                case 6:
                    help_label   = "Avoid";
                    label        = "Avoid";
                    stat_formula = (Game_Unit unit) =>
                    {
                        var stats = new BattlerStats(unit.id);
                        return(stats.avo().ToString());
                    };
                    break;

                // AS
                case 5:
                    help_label   = "AS";
                    label        = "AS";
                    stat_formula = (Game_Unit unit) => unit.atk_spd().ToString();
                    break;
                }

                Vector2 loc = new Vector2(204 + (i / 4) * 56, 8 + (i % 4) * 16);

                TopPanelNodes.Add(new StatusStatUINode(help_label, label, stat_formula));
                TopPanelNodes.Last().loc          = loc;
                TopPanelNodes.Last().stereoscopic = Config.STATUS_TOP_PANEL_DEPTH;
            }
            // Rescue Icon
            Rescue_Icon              = new Sprite();
            Rescue_Icon.texture      = Global.Content.Load <Texture2D>(@"Graphics/Characters/RescueIcon");
            Rescue_Icon.loc          = new Vector2(103, -5);
            Rescue_Icon.stereoscopic = Config.STATUS_TOP_PANEL_DEPTH;
            // Pages //
            Pages.Add(new Status_Page_1());
            Pages.Add(new Status_Page_2());
            Pages.Add(new Status_Page_3());
            // Page Arrows
            Left_Page_Arrow                = new Page_Arrow();
            Left_Page_Arrow.loc            = new Vector2(4, 84);
            Left_Page_Arrow.stereoscopic   = Config.STATUS_ARROW_DEPTH;
            Left_Page_Arrow.ArrowClicked  += Left_Page_Arrow_ArrowClicked;
            Right_Page_Arrow               = new Page_Arrow();
            Right_Page_Arrow.loc           = new Vector2(Config.WINDOW_WIDTH - 4, 84);
            Right_Page_Arrow.mirrored      = true;
            Right_Page_Arrow.stereoscopic  = Config.STATUS_ARROW_DEPTH;
            Right_Page_Arrow.ArrowClicked += Right_Page_Arrow_ArrowClicked;

            create_cancel_button();

            set_images();
        }