protected override Window_Command NewWindow() { List <string> strs = new List <string> { "Trade", "List", "Convoy", "Give All", "Optimize" }; var commandWindow = new Window_Command(new Vector2(Config.WINDOW_WIDTH - 128, Config.WINDOW_HEIGHT - 100), 56, strs); if (Global.battalion.actors.Count <= 1) { commandWindow.set_text_color(0, "Grey"); } if (Global.battalion.actors.Count <= 1 && Global.battalion.convoy_id == -1) { commandWindow.set_text_color(1, "Grey"); } if (Global.battalion.convoy_id == -1) { commandWindow.set_text_color(2, "Grey"); commandWindow.set_text_color(3, "Grey"); commandWindow.set_text_color(4, "Grey"); } commandWindow.size_offset = new Vector2(0, -8); commandWindow.text_offset = new Vector2(0, -4); commandWindow.glow_width = 56 - 8; commandWindow.glow = true; commandWindow.bar_offset = new Vector2(-8, 0); commandWindow.texture = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Preparations_Item_Options_Window"); commandWindow.color_override = 0; commandWindow.set_columns(2); commandWindow.stereoscopic = Config.PREPITEM_WINDOW_DEPTH; return(commandWindow); }
// Selected an item in the reinforcements menu void reinforcementsMenu_Selected(object sender, EventArgs e) { var reinforcementsMenu = sender as ReinforcementsMenu; List <string> commands = new List <string> { "Edit", "Add", "Paste", "Delete" }; var reinforcementsOptionsWindow = new Window_Command( reinforcementsMenu.WindowLoc + new Vector2(WindowCommandReinforcements.WIDTH + 8, 0), 80, commands); if (ReinforcementData.Count == 0) { reinforcementsOptionsWindow.set_text_color(0, "Grey"); reinforcementsOptionsWindow.set_text_color(3, "Grey"); } var reinforcementsOptionsMenu = new CommandMenu(reinforcementsOptionsWindow); reinforcementsOptionsMenu.Selected += reinforcementsOptionsMenu_Selected; reinforcementsOptionsMenu.Canceled += reinforcementsOptionsMenu_Canceled; AddMenu(reinforcementsOptionsMenu); }
protected override void refresh_item_window() { base.refresh_item_window(); Command_Window.set_text_color(0, can_give ? "White" : "Grey"); if (this.restock_blocked) { Command_Window.set_text_color(1, can_take ? "White" : "Grey"); } else { Command_Window.set_text_color(1, can_restock ? "White" : "Grey"); Command_Window.set_text_color(2, can_take ? "White" : "Grey"); } }
private Window_Command NewUnitWindow(List <string> commands, int width) { var window = new Window_Command( new Vector2(8 + (Global.player.is_on_left() ? (Config.WINDOW_WIDTH - (width + 16)) : 0), 24), width, commands); window.stereoscopic = Config.MAPCOMMAND_WINDOW_DEPTH; window.help_stereoscopic = Config.MAPCOMMAND_HELP_DEPTH; for (int i = 0; i < commands.Count; i++) { // Trade, Give/Take if (IndexRedirect[i] == 4 || IndexRedirect[i] == 6) { window.set_text_color(i, "Green"); } // Supply if (IndexRedirect[i] == 18) { window.set_text_color(i, "Green"); } // Talk if (IndexRedirect[i] == 8 && Constants.Gameplay.TALKING_IS_FREE_ACTION) { window.set_text_color(i, "Green"); } // Disabled commands if (Disabled.Contains(IndexRedirect[i])) { window.set_text_color(i, "Grey"); } } // Automatically selects a specific menu option if (Global.game_temp.SelectedMoveMenuChoice.IsSomething) { if (IndexRedirect.Contains(Global.game_temp.SelectedMoveMenuChoice)) { window.immediate_index = IndexRedirect.IndexOf(Global.game_temp.SelectedMoveMenuChoice); } } return(window); }
private void RefreshPreviousChapterSelected() { if (ChapterCommandWindow != null) { if (PreviousChapterSelectionIncomplete()) { ChapterCommandWindow.set_text_color(0, "Grey"); ChapterCommandWindow.set_text_color(1, "Yellow"); } else { ChapterCommandWindow.set_text_color(0, "White"); if (ActiveChapterCommands.Contains(ChapterCommands.SelectPrevious)) { ChapterCommandWindow.set_text_color(1, "White"); } } } }
public virtual void refresh() { // Does augury exist? if (Global.game_state.augury_event_exists()) { CommandWindow.set_text_color(2, "White"); } else { CommandWindow.set_text_color(2, "Grey"); } // Objective text Goal.text = Global.game_system.Objective_Text; Goal.offset = new Vector2(Font_Data.text_width(Goal.text) / 2, 0); // Info window // Rating float rating_factor; float player_rating = Global.battalion.deployed_average_rating; float enemy_rating = Global.battalion.enemy_rating; EnemyAvgLvl.SetColor(Global.Content, "Yellow"); rating_factor = (float)Math.Log(Global.battalion.enemy_threat, 2); int r = (int)(255 * MathHelper.Clamp(1 + rating_factor, 0, 1)); int g = (int)(255 * MathHelper.Clamp(1 - rating_factor, 0, 1)); EnemyAvgLvl.tint = new Color(r, g, 255); rating_factor = Global.battalion.enemy_threat; EnemyAvgLvl.text = string.Format("{0}x", rating_factor.ToString("0.00")); // Funds Funds.text = Global.battalion.gold.ToString(); }
protected virtual Window_Command NewWindow() { List <string> strs = new List <string> { "Trade", "List", "Convoy", "Give All", "Use", "Restock", "Optimize" }; if (Global.game_system.home_base || (Global.battalion.has_convoy && Global.game_battalions.active_convoy_shop != null)) { strs.Add("Shop"); } var commandWindow = new Window_Command(new Vector2(Config.WINDOW_WIDTH - 128, Config.WINDOW_HEIGHT - 100), 56, strs); if (Global.battalion.actors.Count <= 1) { commandWindow.set_text_color(0, "Grey"); } if (Global.battalion.actors.Count <= 1 && !Global.battalion.has_convoy) { commandWindow.set_text_color(1, "Grey"); } if (!Global.battalion.has_convoy) { commandWindow.set_text_color(2, "Grey"); commandWindow.set_text_color(6, "Grey"); commandWindow.set_text_color(7, "Grey"); } else if (Global.game_battalions.active_convoy_shop == null) { commandWindow.set_text_color(7, "Grey"); } commandWindow.size_offset = new Vector2(0, -8); commandWindow.text_offset = new Vector2(0, -4); commandWindow.glow_width = 56 - 8; commandWindow.glow = true; commandWindow.bar_offset = new Vector2(-8, 0); commandWindow.texture = Global.Content.Load <Texture2D>( @"Graphics\Windowskins\Preparations_Item_Options_Window"); commandWindow.color_override = 0; commandWindow.set_columns(2); commandWindow.stereoscopic = Config.PREPITEM_WINDOW_DEPTH; return(commandWindow); }
internal void SetTextColor(int index, string color) { Window.set_text_color(index, color); }