protected void initialize(int weapon, int newRank, bool battle_scene) { 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; } // Text Text = new TextSprite( Config.UI_FONT, Global.Content, "White", new Vector2(8, 8), "Weapon Level increased to "); // Weapon rank Rank = new TextSprite(); Rank.loc = Text.loc + new Vector2(Text.text_width, 0); Rank.SetFont(Config.UI_FONT + "L", Global.Content, "Blue", Config.UI_FONT); Rank.text = TactileLibrary.Data_Weapon.WLVL_LETTERS[newRank]; // Weapon type icon Icon = new Weapon_Type_Icon(); Icon.index = weapon; Icon.loc = Rank.loc + new Vector2(Rank.text_width, 0); }
protected override void initialize_sprites() { // Window Window_Img = new System_Color_Window(); Window_Img.width = this.Width; Window_Img.height = this.Height + 12; Window_Img.offset = new Vector2(0, 8); // UI Nodes refresh_nodes(); Rows = (int)Math.Ceiling(Global.battalion.actors.Count / (float)this.Columns); // Scrollbar if (Rows > this.VisibleRows) { Scrollbar = new Scroll_Bar(this.VisibleRows * this.RowSize - 16, Rows, this.VisibleRows, 0); Scrollbar.loc = this.ScrollbarLoc; Scrollbar.UpArrowClicked += Scrollbar_UpArrowClicked; Scrollbar.DownArrowClicked += Scrollbar_DownArrowClicked; } // Unit Header Unit_Header = new Pick_Units_Header(this.Width + 8); Unit_Header.loc = new Vector2(-8, -20); // Cursor Selected_Cursor = new Hand_Cursor(); Selected_Cursor.loc = cursor_loc() + new Vector2(8, 4); Selected_Cursor.tint = new Color(192, 192, 192, 255); }
public Gold_Gain_Popup(int value) { Timer_Max = 113; Width += 8; Got = new TextSprite(); Got.loc = new Vector2(Width, 8); Got.SetFont(Config.UI_FONT, Global.Content, "White"); Got.text = value >= 0 ? "Got " : ""; Width += Font_Data.text_width(Got.text); Amount = new TextSprite(); Amount.loc = new Vector2(Width, 8); Amount.SetFont(Config.UI_FONT, Global.Content, "Blue"); Amount.text = Math.Abs(value).ToString(); Width += Font_Data.text_width(Amount.text); Gold = new TextSprite(); Gold.loc = new Vector2(Width, 8); Gold.SetFont(Config.UI_FONT, Global.Content, "White"); Gold.text = value >= 0 ? " gold." : " gold was stolen."; Width += Font_Data.text_width(Gold.text); Width += 8 + (Width % 8 != 0 ? (8 - Width % 8) : 0); Window = new System_Color_Window(); Window.width = Width; Window.height = 32; loc = new Vector2((Config.WINDOW_WIDTH - Width) / 2, 80); }
private void create_window(int width, bool mainMenu) { Window = new System_Color_Window(); Window.height = 32; Window.offset = new Vector2(16, 8); Window.width = width; }
protected virtual void initialize_window() { Stats_Window = new System_Color_Window(); Stats_Window.loc = new Vector2(0, 0); Stats_Window.width = WIDTH(); Stats_Window.height = HEIGHT(); Stats_Window.stereoscopic = Config.STATUS_LEFT_WINDOW_DEPTH; }
protected virtual void initialize_window() { Stats_Window = new Prepartions_Item_Window(true); Stats_Window.loc = new Vector2(0, 0); Stats_Window.width = WIDTH - 8; Stats_Window.height = HEIGHT - 8; Stats_Window.stereoscopic = Config.STATUS_LEFT_WINDOW_DEPTH; Stats_Window.offset = new Vector2(-4, 32 - 4); }
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]; } }
public StatsPanel(Game_Actor actor) { // Face set_face(actor); Info_Window = new System_Color_Window(); Info_Window.width = 120; Info_Window.height = 64; Info_Window.loc = loc + new Vector2(160, Config.WINDOW_HEIGHT - 88); Info_Window.loc = new Vector2(0, 0); // Stats for (int i = 0; i < 4; i++) { Stat_Labels.Add(new TextSprite()); Stat_Labels[i].loc = new Vector2(10 + (i % 2) * 58, 24 + (i / 2) * 16); Stat_Labels[i].SetFont(Config.UI_FONT, Global.Content, "White"); } Stat_Labels[0].text = "Atk"; Stat_Labels[1].text = "Crit"; Stat_Labels[2].text = "Hit"; Stat_Labels[3].text = "AS"; //Stat_Labels[3].text = "Avoid"; //Debug Stat_Labels.Add(new TextSprite()); Stat_Labels[4].loc = new Vector2(40, 8); Stat_Labels[4].SetFont(Config.UI_FONT, Global.Content, "White"); Stat_Labels[4].text = "Affi"; for (int i = 0; i < 4; i++) { Stats.Add(new RightAdjustedText()); Stats[i].loc = new Vector2(46 + (i % 2) * 62, 24 + (i / 2) * 16); Stats[i].SetFont(Config.UI_FONT, Global.Content, "Blue"); } for (int i = 0; i < 4; i++) { Arrows.Add(new Weapon_Triangle_Arrow()); Arrows[i].loc = new Vector2(34 + (i % 2) * 62, 28 + (i / 2) * 16 - 4); } // Weapon Type Icon Type_Icon = new Weapon_Type_Icon(); Type_Icon.loc = new Vector2(56, 8); // Description Item_Description = new TextSprite(); Item_Description.loc = new Vector2(8, 8); Item_Description.SetFont(Config.UI_FONT, Global.Content, "White"); // Weapon Triangle WTHelp = new WeaponTriangleHelpSet(); WTHelp.loc = new Vector2(-24, 16 + 8); }
protected override void initialize_sprites() { // Window Window_Img = new System_Color_Window(); Window_Img.width = this.Width; Window_Img.height = this.Height + 12; Window_Img.offset = new Vector2(0, 8); // UI Nodes refresh_nodes(); Rows = (int)Math.Ceiling(Global.battalion.actors.Count / (float)this.Columns); // Scrollbar if (Rows > this.VisibleRows) { Scrollbar = new Scroll_Bar(this.VisibleRows * this.RowSize - 16, Rows, this.VisibleRows, 0); Scrollbar.loc = this.ScrollbarLoc; Scrollbar.UpArrowClicked += Scrollbar_UpArrowClicked; Scrollbar.DownArrowClicked += Scrollbar_DownArrowClicked; } // Unit Header Unit_Header = new Pick_Units_Header(this.Width + 8); Unit_Header.loc = new Vector2(-8, -20); // Labels Pick_Label = new TextSprite(); Pick_Label.loc = new Vector2(4, -12); Pick_Label.SetFont(Config.UI_FONT, Global.Content, "White"); Pick_Label.text = "Pick"; More_Units_Label = new TextSprite(); More_Units_Label.loc = new Vector2(44, -12); More_Units_Label.SetFont(Config.UI_FONT, Global.Content, "White"); More_Units_Label.text = "more units"; Slash_Label = new TextSprite(); Slash_Label.loc = new Vector2(108, -12); Slash_Label.SetFont(Config.UI_FONT, Global.Content, "White"); Slash_Label.text = "/"; // Data Units_Left = new RightAdjustedText(); Units_Left.loc = new Vector2(40, -12); Units_Left.SetFont(Config.UI_FONT, Global.Content, "Blue"); Units_Selected = new RightAdjustedText(); Units_Selected.loc = new Vector2(108, -12); Units_Selected.SetFont(Config.UI_FONT, Global.Content, "Blue"); Units_Total = new RightAdjustedText(); Units_Total.loc = new Vector2(132, -12); Units_Total.SetFont(Config.UI_FONT, Global.Content, "Blue"); }
private void initialize_images() { // Face Face1 = new Face_Sprite(actor1.face_name, true); if (actor1.generic_face) { Face1.recolor_country(actor1.name_full); } Face1.expression = Face1.status_frame; Face1.phase_in(); Face1.loc = new Vector2(loc.X + SPACING / 2, loc.Y + 12 + (int)Math.Max(0, (Face1.src_rect.Height - Face1.eyes_offset.Y) - 40) / 2); Face1.mirrored = true; // Face Face2 = new Face_Sprite(actor2.face_name, true); if (actor2.generic_face) { Face2.recolor_country(actor2.name_full); } Face2.expression = Face2.status_frame; Face2.phase_in(); Face2.loc = new Vector2((int)loc.X + SPACING + SPACING / 2, loc.Y + 12 + (int)Math.Max(0, (Face2.src_rect.Height - Face2.eyes_offset.Y) - 40) / 2); Grey_Cursor = new Hand_Cursor(); Grey_Cursor.visible = false; Grey_Cursor.draw_offset = new Vector2(-12, 0); Window1 = new System_Color_Window(); Window1.width = SPACING; Window1.height = Num * 16 + 16; Window1.loc = loc; Window2 = new System_Color_Window(); Window2.width = SPACING; Window2.height = Num * 16 + 16; Window2.loc = loc + new Vector2(SPACING, 0); Equipped_Tag1 = new TextSprite(); Equipped_Tag1.SetFont(Config.UI_FONT, Global.Content, "White"); Equipped_Tag1.text = "$"; Equipped_Tag2 = new TextSprite(); Equipped_Tag2.SetFont(Config.UI_FONT, Global.Content, "White"); Equipped_Tag2.text = "$"; Glowing_Line = new Unit_Line_Cursor(SPACING - 16); }
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."; }
public MainMenuChoicePanel(string text) { ResetOffset(); ChoiceText = new TextSprite(); ChoiceText.SetFont(Config.UI_FONT, Global.Content, "Yellow"); ChoiceText.stereoscopic = Config.TITLE_CHOICE_DEPTH; ChoiceText.text = text; WindowPanel window; window = new System_Color_Window(); window.height = 12; window.offset = new Vector2(16, 12); window.loc = new Vector2(-4, 16); window.width = PANEL_WIDTH; window.stereoscopic = Config.TITLE_MENU_DEPTH; Window = window; Size = new Vector2(PANEL_WIDTH - 8, 16); }
private void create_opponent_window() { Window = new System_Color_Window(); Window.width = 136; Window.height = 48; Window.loc = new Vector2(Config.WINDOW_WIDTH / 2 - Window.width / 2, 88); // Labels for (int i = 0; i < Labels.Length - 1; i++) { Labels[i] = new TextSprite(); Labels[i].loc = Window.loc + new Vector2(8 + 56 * (i % 2), 8 + 16 * (i / 2)); Labels[i].SetFont(Config.UI_FONT, Global.Content, "White"); } Labels[4] = new RightAdjustedText(); Labels[4].loc = Window.loc + new Vector2(8 + 40, 8); Labels[4].SetFont(Config.UI_FONT, Global.Content, "Blue"); Labels[0].text = "Lv"; Labels[1].text = opponent.actor.class_name; Labels[2].text = "Enemy"; Labels[3].text = opponent.actor.weapon.Name; Labels[4].text = opponent.actor.level.ToString(); }
public Difficulty_Info_Panel(Difficulty_Modes difficulty) { var window = new System_Color_Window(); window.width = WIDTH; window.height = 48; window.color_override = Constants.Difficulty.DIFFICULTY_COLOR_REDIRECT[difficulty]; window.small = true; Window = window; Size = new Vector2(WIDTH, Window.height); Difficulty = new TextSprite(); Difficulty.loc = new Vector2(24, -8); Difficulty.SetFont(Config.UI_FONT, Global.Content, "Yellow"); Difficulty.text = difficulty.ToString(); Description = new TextSprite(); Description.loc = new Vector2(16, 8); Description.SetFont(Config.UI_FONT, Global.Content, "Blue"); Description.text = Global.system_text["Difficulty " + difficulty.ToString()]; active = false; }
public Mode_Style_Info_Panel(Mode_Styles style) { var window = new System_Color_Window(); window.width = WIDTH; window.height = 48; window.color_override = Constants.Difficulty.STYLE_COLOR_REDIRECT[style]; window.small = true; Window = window; Size = new Vector2(WIDTH, Window.height); Style = new TextSprite(); Style.loc = new Vector2(24, -8); Style.SetFont(Config.UI_FONT, Global.Content, "Yellow"); Style.text = style.ToString(); Description = new TextSprite(); Description.loc = new Vector2(16, 8); Description.SetFont(Config.UI_FONT, Global.Content, "Blue"); Description.text = Global.system_text["Style " + style.ToString()]; active = false; }
protected void set_window(bool battle_scene) { if (battle_scene) { texture = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Combat_Popup"); } else { if (Global.game_system.preparations && !Global.game_system.Preparation_Events_Ready) { Window = new WindowPanel(Global.Content.Load <Texture2D>( @"Graphics/Windowskins/Preparations_Item_Options_Window")); Window.width = Width - 8; Window.height = 24; Window.offset = new Vector2(-4, -4); } else { Window = new System_Color_Window(); Window.width = Width; Window.height = 32; } } }
protected virtual void initialize_sprites() { // Window Window_Img = new Prepartions_Item_Window(false); Window_Img.width = this.Width; Window_Img.height = this.Height; refresh_nodes(); Rows = (int)Math.Ceiling(ActorList.Count / (float)this.Columns); // Scrollbar if (Rows > this.VisibleRows) { Scrollbar = new Scroll_Bar(this.VisibleRows * this.RowSize - 16, Rows, this.VisibleRows, 0); Scrollbar.loc = this.ScrollbarLoc; Scrollbar.UpArrowClicked += Scrollbar_UpArrowClicked; Scrollbar.DownArrowClicked += Scrollbar_DownArrowClicked; } // Cursor Selected_Cursor = new Hand_Cursor(); Selected_Cursor.loc = cursor_loc() + new Vector2(8, 4); Selected_Cursor.tint = new Color(192, 192, 192, 255); }
public Status_Page_3() { var nodes = new List <StatusUINode>(); // Bonuses Window Bonuses_Window = new System_Color_Window(); Bonuses_Window.loc = new Vector2(8, 80); Bonuses_Window.width = 144; Bonuses_Window.height = 112; Bonuses_Window.stereoscopic = Config.STATUS_LEFT_WINDOW_DEPTH; // Status Label nodes.Add(new StatusTextUINode( "Cond", (Game_Unit unit) => "Status")); nodes.Last().loc = Bonuses_Window.loc + new Vector2(16, 8); (nodes.Last() as StatusTextUINode).set_color("Yellow"); nodes.Last().Size = new Vector2(32, 16); nodes.Last().stereoscopic = Config.STATUS_LEFT_WINDOW_DEPTH; // Statuses for (int i = 0; i < ACTOR_STATUSES; i++) { int j = i; Vector2 loc = Bonuses_Window.loc + new Vector2(48 + i * 16, 8); nodes.Add(new StatusStateUINode( string.Format("Status{0}", i + 1), (Game_Unit unit) => { if (unit.actor.states.Count <= j) { return(new Tuple <int, int>(-1, 0)); } int id = unit.actor.states[j]; int turns = unit.actor.state_turns_left(id); return(new Tuple <int, int>(id, turns)); })); nodes.Last().loc = loc; nodes.Last().stereoscopic = Config.STATUS_LEFT_WINDOW_DEPTH; } // Bond nodes.Add(new StatusLabeledTextUINode( "Bond", "Bond", (Game_Unit unit) => { if (unit.actor.bond > 0) { return(Global.game_actors[unit.actor.bond].name); } else { return("-----"); } }, 52, true)); nodes.Last().loc = Bonuses_Window.loc + new Vector2(32 + 4, 2 * 16 + 4); (nodes.Last() as StatusTextUINode).set_color("White"); nodes.Last().Size = new Vector2(80, 16); nodes.Last().stereoscopic = Config.STATUS_LEFT_WINDOW_DEPTH; // Bonuses for (int i = 0; i < 6; i++) { string help_label; string label; Func <Game_Unit, string> stat_formula; switch (i) { // Atk case 0: default: help_label = "BAtk"; label = "Atk"; stat_formula = (Game_Unit unit) => unit.support_bonus(Combat_Stat_Labels.Dmg, true).ToString(); break; // Hit case 1: help_label = "BHit"; label = "Hit"; stat_formula = (Game_Unit unit) => unit.support_bonus(Combat_Stat_Labels.Hit, true).ToString(); break; // Crit case 2: help_label = "BCrt"; label = "Crit"; stat_formula = (Game_Unit unit) => unit.support_bonus(Combat_Stat_Labels.Crt, true).ToString(); break; // Def case 3: help_label = "BDef"; label = "Def"; stat_formula = (Game_Unit unit) => unit.support_bonus(Combat_Stat_Labels.Def, true).ToString(); break; // Avoid case 4: help_label = "BAvo"; label = "Avoid"; stat_formula = (Game_Unit unit) => unit.support_bonus(Combat_Stat_Labels.Avo, true).ToString(); break; // Dodge case 5: help_label = "BDod"; label = "Dodge"; stat_formula = (Game_Unit unit) => unit.support_bonus(Combat_Stat_Labels.Dod, true).ToString(); break; } Vector2 loc = Bonuses_Window.loc + new Vector2(20 + (i / 3) * 56, 56 + (i % 3) * 16); nodes.Add(new StatusStatUINode(help_label, label, stat_formula)); nodes.Last().loc = loc; nodes.Last().stereoscopic = Config.STATUS_LEFT_WINDOW_DEPTH; } // Bonus Bg Bonus_Bg = new Status_Bonus_Background(); Bonus_Bg.loc = Bonuses_Window.loc + new Vector2(8, 24); Bonus_Bg.stereoscopic = Config.STATUS_LEFT_WINDOW_DEPTH; // Supports Window Supports_Window = new System_Color_Window(); Supports_Window.loc = new Vector2(168, 80); Supports_Window.width = 144; Supports_Window.height = 112; Supports_Window.stereoscopic = Config.STATUS_RIGHT_WINDOW_DEPTH; // Affinity nodes.Add(new StatusAffinityUINode( "Affin", (Game_Unit unit) => unit.actor.affin)); nodes.Last().loc = Supports_Window.loc + new Vector2(40, 8); nodes.Last().stereoscopic = Config.STATUS_RIGHT_WINDOW_DEPTH; // Supports Supports = new Status_Support_List(); Supports.loc = Supports_Window.loc + new Vector2(32, 24); Supports.stereoscopic = Config.STATUS_RIGHT_WINDOW_DEPTH; // Support Bg Support_Bg = new Status_Support_Background(); Support_Bg.loc = Supports_Window.loc + new Vector2(8, 24); Support_Bg.stereoscopic = Config.STATUS_RIGHT_WINDOW_DEPTH; StatusPageNodes = new UINodeSet <StatusUINode>(nodes); init_design(); }
public Status_Page_1() { var nodes = new List <StatusUINode>(); // Stats Window Stats_Window = new System_Color_Window(); Stats_Window.loc = new Vector2(8, 80); Stats_Window.width = 144; Stats_Window.height = 112; Stats_Window.stereoscopic = Config.STATUS_LEFT_WINDOW_DEPTH; // Stats for (int i = 0; i < 6; i++) { string help_label; string label; var stat_label = (Stat_Labels)i + 1; Vector2 loc = Stats_Window.loc + new Vector2(8, i * 16 + 8); PrimaryStatState.label((Stat_Labels)i + 1, out label, out help_label); Func <Game_Unit, PrimaryStatState> stat_formula = (Game_Unit unit) => { return(new PrimaryStatState(unit, stat_label)); }; Func <Game_Unit, Color> label_color = null; if (Window_Status.show_stat_colors(stat_label)) { label_color = (Game_Unit unit) => { if (unit.average_stat_hue_shown) { return(unit.actor.stat_color(stat_label)); } return(Color.White); }; } nodes.Add(new StatusPrimaryStatUINode( help_label, label, stat_formula, label_color, 40)); nodes.Last().loc = loc; nodes.Last().stereoscopic = Config.STATUS_LEFT_WINDOW_DEPTH; #if DEBUG nodes.Last().set_cheat(stat_cheat(stat_label)); #endif if (stat_label == Stat_Labels.Pow) { PowNode = nodes.Last() as StatusStatUINode; } } // Move nodes.Add(new StatusPrimaryStatUINode( "Move", "Move", (Game_Unit unit) => { if (unit.immobile) { return new PrimaryStatState { Stat = 0, Bonus = 0, Cap = unit.stat_cap(Stat_Labels.Mov), NullStat = true, } } ; return(new PrimaryStatState { Stat = unit.base_mov, Bonus = unit.mov - unit.base_mov, Cap = unit.stat_cap(Stat_Labels.Mov), }); }, null, 40)); nodes.Last().loc = Stats_Window.loc + new Vector2(72, 0 * 16 + 8); nodes.Last().stereoscopic = Config.STATUS_LEFT_WINDOW_DEPTH; #if DEBUG nodes.Last().set_cheat(stat_cheat(Stat_Labels.Mov)); #endif // Con nodes.Add(new StatusPrimaryStatUINode( "Con", "Con", (Game_Unit unit) => { return(new PrimaryStatState { Stat = unit.actor.stat(Stat_Labels.Con), Bonus = Math.Min(unit.stat_bonus(Stat_Labels.Con), unit.actor.cap_base_difference(Stat_Labels.Con)), Cap = unit.stat_cap(Stat_Labels.Con), IsCapped = unit.actor.get_capped(Stat_Labels.Con) }); }, null, 40)); nodes.Last().loc = Stats_Window.loc + new Vector2(72, 1 * 16 + 8); nodes.Last().stereoscopic = Config.STATUS_LEFT_WINDOW_DEPTH; #if DEBUG nodes.Last().set_cheat(stat_cheat(Stat_Labels.Con)); #endif // Aid nodes.Add(new StatusAidUINode( "Aid", "Aid", (Game_Unit unit) => { return(unit.aid().ToString()); }, (Game_Unit unit) => { if (unit.actor.actor_class.Class_Types.Contains(ClassTypes.FDragon)) { return(3); } else if (unit.actor.actor_class.Class_Types.Contains(ClassTypes.Flier)) { return(2); } else if (unit.actor.actor_class.Class_Types.Contains(ClassTypes.Cavalry)) { return(1); } else { return(0); } }, 40)); nodes.Last().loc = Stats_Window.loc + new Vector2(72, 2 * 16 + 8); nodes.Last().stereoscopic = Config.STATUS_LEFT_WINDOW_DEPTH; // Trv nodes.Add(new StatusTravelerUINode( "Trv", "Trv", (Game_Unit unit) => { if (unit.is_rescued) { return(Global.game_map.units[unit.rescued].actor.name); } else if (unit.is_rescuing) { return(Global.game_map.units[unit.rescuing].actor.name); } return("---"); }, (Game_Unit unit) => { if (!unit.is_rescuing) { return(0); } return(Global.game_map.units[unit.rescuing].team); }, 24)); nodes.Last().loc = Stats_Window.loc + new Vector2(72, 3 * 16 + 8); nodes.Last().stereoscopic = Config.STATUS_LEFT_WINDOW_DEPTH; // Type nodes.Add(new StatusClassTypesUINode( "Type", "Type", (Game_Unit unit) => { return(unit.actor.class_types); }, 24)); nodes.Last().loc = Stats_Window.loc + new Vector2(72, 4 * 16 + 8); nodes.Last().stereoscopic = Config.STATUS_LEFT_WINDOW_DEPTH; // Rating nodes.Add(new StatusLabeledTextUINode( "Rating", "Rating", (Game_Unit unit) => { return(unit.rating().ToString()); }, 32)); nodes.Last().loc = Stats_Window.loc + new Vector2(72, 5 * 16 + 8); nodes.Last().Size = new Vector2(64, 16); nodes.Last().stereoscopic = Config.STATUS_LEFT_WINDOW_DEPTH; // Items Window Items_Window = new System_Color_Window(); Items_Window.loc = new Vector2(168, 80); Items_Window.width = 144; Items_Window.height = Global.ActorConfig.NumItems * 16 + 16; Items_Window.stereoscopic = Config.STATUS_RIGHT_WINDOW_DEPTH; // Skill Bg SiegeBg = new Status_Support_Background(); SiegeBg.loc = Items_Window.loc + new Vector2( 8, 8 + (Global.ActorConfig.NumItems - 1) * 16); SiegeBg.stereoscopic = Config.STATUS_RIGHT_WINDOW_DEPTH; SiegeBg.visible = false; // Items for (int i = 0; i < Global.ActorConfig.NumItems; i++) { int j = i; Vector2 loc = Items_Window.loc + new Vector2(8, i * 16 + 8); nodes.Add(new StatusItemUINode( string.Format("Item{0}", i + 1), (Game_Unit unit) => { return(new ItemState { Item = unit.actor.items[j], Drops = unit.drops_item && j == unit.actor.num_items - 1, Equipped = unit.actor.equipped - 1 == j }); })); nodes.Last().loc = loc; nodes.Last().stereoscopic = Config.STATUS_RIGHT_WINDOW_DEPTH; Func <Game_Unit, DirectionFlags, bool> item_cheat = (unit, dir) => { // Uses if (dir.HasFlag(DirectionFlags.Up) || dir.HasFlag(DirectionFlags.Down)) { if (unit.actor.items[j].non_equipment || unit.actor.items[j].infinite_uses) { return(false); } int uses = unit.actor.items[j].Uses; if (dir.HasFlag(DirectionFlags.Up)) { uses++; } else { uses--; } uses = Math.Max(Math.Min( uses, unit.actor.items[j].max_uses), 1); if (uses == unit.actor.items[j].Uses) { return(false); } unit.actor.items[j].Uses = uses; return(true); } else { // Change item if (unit.actor.items[j].is_weapon) { List <int> weapon_keys = Global.data_weapons.Keys.ToList(); int index = weapon_keys.IndexOf(unit.actor.items[j].Id); if (dir.HasFlag(DirectionFlags.Right)) { index++; } else if (dir.HasFlag(DirectionFlags.Left)) { index--; } else { return(false); } index = (index + weapon_keys.Count) % weapon_keys.Count; unit.actor.items[j].Id = weapon_keys[index]; unit.actor.setup_items(false); } else { List <int> item_keys = Global.data_items.Keys.ToList(); int index = item_keys.IndexOf(unit.actor.items[j].Id); if (dir.HasFlag(DirectionFlags.Right)) { index++; } else if (dir.HasFlag(DirectionFlags.Left)) { index--; } else { return(false); } index = (index + item_keys.Count) % item_keys.Count; unit.actor.items[j].Id = item_keys[index]; } if (unit.actor.items[j].infinite_uses) { unit.actor.items[j].Uses = -1; } else { if (unit.actor.items[j].Uses == -1) { unit.actor.items[j].Uses = 1; } } return(true); } }; #if DEBUG nodes.Last().set_cheat(item_cheat); #endif } // Siege engine Vector2 siege_loc = Items_Window.loc + new Vector2(8, (Global.ActorConfig.NumItems - 1) * 16 + 8 + 2); nodes.Add(new StatusSiegeItemUINode( string.Format("Item{0}", Global.ActorConfig.NumItems + 1), (Game_Unit unit) => { Item_Data siege = new Item_Data(); if (!unit.actor.is_full_items && unit.is_on_siege()) { siege = unit.items[Siege_Engine.SiegeInventoryIndex]; } return(new ItemState { Item = siege, Drops = false, Equipped = false }); })); nodes.Last().loc = siege_loc; nodes.Last().stereoscopic = Config.STATUS_RIGHT_WINDOW_DEPTH; StatusPageNodes = new UINodeSet <StatusUINode>(nodes); init_design(); }
private void InitializeImages() { Window_Img = new SystemWindowHeadered(); Window_Img.width = this.Width; Window_Img.set_lines(4); 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 = Ranking.turns.ToString(); Text[Text.Count - 3].text = Ranking.combat.ToString(); Text[Text.Count - 2].text = Ranking.exp.ToString(); Text[Text.Count - 1].text = Ranking.score.ToString(); Arrows = new List <Weapon_Triangle_Arrow>(); if (PreviousRanking == null) { Window_Img.tint = new Color(192, 192, 192, 255); } else { for (int i = 4; i >= 1; i--) { var text = Text[Text.Count - i]; text.loc.X -= 4; var arrow = new Weapon_Triangle_Arrow(); arrow.loc = text.loc + new Vector2(-12, 0); arrow.stereoscopic = Config.RANKING_WINDOW_DEPTH; Arrows.Add(arrow); } CompareRanking(0, Ranking.turns, PreviousRanking.turns); CompareRanking(1, Ranking.combat, PreviousRanking.combat); CompareRanking(2, Ranking.exp, PreviousRanking.exp); CompareRanking(3, Ranking.score, PreviousRanking.score); } }
protected virtual void initialize_window() { Window_Img = new System_Color_Window(); }
public Status_Page_2() { var nodes = new List <StatusUINode>(); // Skills Window Skills_Window = new System_Color_Window(); Skills_Window.loc = new Vector2(8, 96); Skills_Window.width = 144; Skills_Window.height = 96; Skills_Window.stereoscopic = Config.STATUS_LEFT_WINDOW_DEPTH; // WLvls Window int max_wlvl_index = 0; if (Global.weapon_types.Any(x => x.DisplayedInStatus)) { max_wlvl_index = Global.weapon_types .Where(x => x.DisplayedInStatus) .Max(x => x.StatusIndex); } // @Debug: this doesn't really do what it's supposed to, // and the window height will be set in set_images() anyway int wlvl_rows = (max_wlvl_index / WLVL_COLUMNS) + 1; WLvls_Window = new System_Color_Window(); WLvls_Window.loc = new Vector2(168, 96); WLvls_Window.width = 144; WLvls_Window.height = (wlvl_rows + 1) * 16; // 96; //Debug WLvls_Window.stereoscopic = Config.STATUS_RIGHT_WINDOW_DEPTH; // Skill Bg Skill_Bg = new Status_Support_Background(); Skill_Bg.loc = Skills_Window.loc + new Vector2(8, 8 + ACTOR_SKILLS * 16); Skill_Bg.stereoscopic = Config.STATUS_RIGHT_WINDOW_DEPTH; // Skills for (int i = 0; i < ACTOR_SKILLS; i++) { int j = i; Vector2 loc = Skills_Window.loc + new Vector2(8, 8 + (Config.SKILL_ICON_SIZE - 16) / 2 + i * Config.SKILL_ICON_SIZE); nodes.Add(new StatusSkillUINode( string.Format("Skill{0}", i + 1), (Game_Unit unit) => { if (unit.actor.skills.Count <= j) { return(new SkillState()); } var skill = Global.data_skills[unit.actor.skills[j]]; float charge = -1f; if (Game_Unit.MASTERIES.Contains(skill.Abstract)) { charge = unit.mastery_charge_percent(skill.Abstract); } return(new SkillState { Skill = skill, Charge = charge }); })); nodes.Last().loc = loc; nodes.Last().draw_offset = new Vector2( 0, -(Config.SKILL_ICON_SIZE - 16) / 2); nodes.Last().stereoscopic = Config.STATUS_LEFT_WINDOW_DEPTH; #if DEBUG // Charges skill gauges Func <Game_Unit, DirectionFlags, bool> skill_cheat = (unit, dir) => { if (unit.actor.skills.Count > j) { var skill = Global.data_skills[unit.actor.skills[j]]; if (Game_Unit.MASTERIES.Contains(skill.Abstract)) { int charge = 0; if (dir.HasFlag(DirectionFlags.Right)) { charge = 1; } else if (dir.HasFlag(DirectionFlags.Left)) { charge = -1; } unit.charge_masteries(skill.Abstract, charge * Game_Unit.MASTERY_RATE_NEW_TURN); return(charge != 0); } } return(false); }; nodes.Last().set_cheat(skill_cheat); #endif } for (int i = 0; i < ITEM_SKILLS; i++) { int j = i; Vector2 loc = Skills_Window.loc + new Vector2(8 + (Config.SKILL_ICON_SIZE - 16) / 2 + i * Config.SKILL_ICON_SIZE, 72 + 2); nodes.Add(new StatusSkillIconUINode( string.Format("Item Skill{0}", i + 1), (Game_Unit unit) => { if (unit.actor.item_skills.Count <= j) { return(new SkillState()); } var skill = Global.data_skills[unit.actor.item_skills[j]]; float charge = -1f; if (Game_Unit.MASTERIES.Contains(skill.Abstract)) { charge = unit.mastery_charge_percent(skill.Abstract); } return(new SkillState { Skill = skill, Charge = charge }); })); nodes.Last().loc = loc; nodes.Last().draw_offset = new Vector2( 0, -(Config.SKILL_ICON_SIZE - 16) / 2); nodes.Last().stereoscopic = Config.STATUS_LEFT_WINDOW_DEPTH; } // WLvls foreach (var weapon_type in Global.weapon_types) { if (!weapon_type.DisplayedInStatus) { continue; } nodes.Add(weapon_type_icon(weapon_type, weapon_type.StatusIndex)); } StatusPageNodes = new UINodeSet <StatusUINode>(nodes); init_design(); }
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(); }
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(); }