internal SupportUINode( string helpLabel, int actorId, int targetActorId, string str, int width) : base(helpLabel) { Size = new Vector2(width, 16); Text = new TextSprite(); Text.draw_offset = new Vector2(16, 0); Text.SetFont(Tactile.Config.UI_FONT, Global.Content, "White"); Text.text = str; // Map Sprite MapSprite = new Character_Sprite(); MapSprite.facing_count = 3; MapSprite.frame_count = 3; MapSprite.draw_offset = new Vector2(8, 16); MapSprite.mirrored = Constants.Team.flipped_map_sprite(Constants.Team.PLAYER_TEAM); Rank = new RightAdjustedText(); Rank.draw_offset = new Vector2(104, 0); Rank.SetFont(Tactile.Config.UI_FONT + "L", Tactile.Config.UI_FONT); if (DisplayedActor(targetActorId)) { set_map_sprite_texture(true, MapSpriteName(targetActorId)); Text.SetColor(Global.Content, SupportEnabled(actorId, targetActorId) ? "White" : "Grey"); Rank.SetColor(Global.Content, SupportEnabled(actorId, targetActorId) ? "White" : "Grey"); Rank.text = RankText(actorId, targetActorId); Icon_Sprite icon = new Icon_Sprite(); icon.texture = Global.Content.Load <Texture2D>(@"Graphics/Icons/Affinity Icons"); icon.size = new Vector2(16, 16); icon.index = GetAffinity(targetActorId); Affinity = icon; } else { set_map_sprite_texture(false, MapSpriteName(targetActorId)); Text.SetColor(Global.Content, "Grey"); Rank.SetColor(Global.Content, "Grey"); Rank.text = Constants.Support.SUPPORT_LETTERS[0]; TextSprite affinity = new TextSprite(); affinity.SetFont(Tactile.Config.UI_FONT, Global.Content, "Grey"); affinity.text = "--"; Affinity = affinity; } MapSprite.frame = Global.game_system.unit_anim_idle_frame; Affinity.draw_offset = new Vector2(64, 0); }
internal void refresh_rank(Difficulty_Modes mode) { if (Difficulty.IsNothing || mode == Difficulty) { Rank.SetColor(Global.Content, "Yellow"); } else { Rank.SetColor(Global.Content, "Grey"); } }
private void refresh_unit_counts() { bool maxed = Unit_Count == Total_Units; Units_Left.text = (Total_Units - Unit_Count).ToString(); Units_Selected.text = (Unit_Count + Other_Units).ToString(); Units_Total.text = (Total_Units + Other_Units).ToString(); Units_Left.SetColor(Global.Content, maxed ? "Grey" : "Blue"); Units_Selected.SetColor(Global.Content, maxed ? "Green" : "Blue"); Units_Total.SetColor(Global.Content, maxed ? "Green" : "Blue"); }
protected virtual void set_text_color(bool useable, bool buyable) { change_text_color(useable ? "White" : "Grey"); Uses.SetColor(Global.Content, useable ? "Blue" : "Grey"); Slash.SetColor(Global.Content, buyable ? "Blue" : "Grey"); Use_Max.SetColor(Global.Content, buyable ? "Blue" : "Grey"); Convoy.SetColor(Global.Content, "Blue"); }