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); }
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); }
private void create_command_window(Supply_Command_Window type) { List <string> commands; switch (type) { case Supply_Command_Window.Give: commands = new List <string> { "Give" }; break; case Supply_Command_Window.Take: commands = new List <string> { "Take" }; break; case Supply_Command_Window.Restock: commands = new List <string> { "Restock" }; break; default: if (this.restock_blocked) { commands = new List <string> { "Give", "Take" } } ; else { commands = new List <string> { "Give", "Restock", "Take" } }; break; } int width = 56; int i = Math.Max(0, (int)type - 1); Vector2 loc = new Vector2( (64 + 12) + ((i % 2) * (width - 16)), (36 - 2) + ((i / 2) * 16)); //Vector2 loc = new Vector2( //Debug // (64 + 36), // (36 - 2)); Command_Window = new Window_Command(loc, width, commands); Command_Window.set_columns(this.restock_blocked ? 1 : 2); Command_Window.glow_width = width - 8; Command_Window.glow = true; Command_Window.bar_offset = new Vector2(-8, 0); Command_Window.text_offset = new Vector2(0, -4); Command_Window.size_offset = new Vector2(-8, -8); Command_Window.greyed_cursor = type != Supply_Command_Window.All; Command_Window.active = type == Supply_Command_Window.All; Command_Window.texture = Global.Content.Load <Texture2D>(@"Graphics/Windowskins/Preparations_Item_Options_Window"); Command_Window.immediate_index = 0; Command_Window.color_override = 0; Command_Window.stereoscopic = Config.CONVOY_WINDOW_DEPTH; }