Merge pull request #5398 from stevecotton/unused_editor_start_pos
Remove the editor's unused set_starting_position dialog
This commit is contained in:
commit
77c60a11f4
12 changed files with 2 additions and 413 deletions
|
@ -1,192 +0,0 @@
|
|||
#textdomain wesnoth-lib
|
||||
|
||||
[window]
|
||||
id = "editor_set_starting_position"
|
||||
description = "Map editor dialog for setting player starting positions."
|
||||
|
||||
[resolution]
|
||||
definition = "default"
|
||||
|
||||
automatic_placement = true
|
||||
vertical_placement = "center"
|
||||
horizontal_placement = "center"
|
||||
|
||||
maximum_width = 500
|
||||
maximum_height = 600
|
||||
|
||||
[linked_group]
|
||||
id = "players"
|
||||
fixed_width = true
|
||||
[/linked_group]
|
||||
|
||||
[linked_group]
|
||||
id = "locations"
|
||||
fixed_width = true
|
||||
[/linked_group]
|
||||
|
||||
[tooltip]
|
||||
id = "tooltip"
|
||||
[/tooltip]
|
||||
|
||||
[helptip]
|
||||
id = "tooltip"
|
||||
[/helptip]
|
||||
|
||||
[grid]
|
||||
|
||||
[row]
|
||||
grow_factor = 0
|
||||
|
||||
[column]
|
||||
grow_factor = 1
|
||||
|
||||
border = "all"
|
||||
border_size = 5
|
||||
horizontal_alignment = "left"
|
||||
|
||||
[label]
|
||||
id = "title"
|
||||
definition = "title"
|
||||
label = _ "Choose Player"
|
||||
[/label]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[row]
|
||||
grow_factor = 0
|
||||
|
||||
[column]
|
||||
grow_factor = 0
|
||||
|
||||
border = "all"
|
||||
border_size = 5
|
||||
horizontal_alignment = "left"
|
||||
|
||||
[label]
|
||||
id = "message"
|
||||
definition = "default"
|
||||
label = _ "Which player should start here?"
|
||||
wrap = true
|
||||
[/label]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[row]
|
||||
grow_factor = 1
|
||||
|
||||
[column]
|
||||
grow_factor = 1
|
||||
|
||||
horizontal_grow = true
|
||||
vertical_grow = true
|
||||
|
||||
border = "all"
|
||||
border_size = 5
|
||||
|
||||
[listbox]
|
||||
id = "listbox"
|
||||
definition = "default"
|
||||
|
||||
[list_definition]
|
||||
|
||||
[row]
|
||||
|
||||
[column]
|
||||
vertical_grow = true
|
||||
horizontal_grow = true
|
||||
[toggle_panel]
|
||||
definition = "default"
|
||||
return_value_id = "ok"
|
||||
[grid]
|
||||
[row]
|
||||
[column]
|
||||
grow_factor = 1
|
||||
horizontal_grow = true
|
||||
border = "all"
|
||||
border_size = 5
|
||||
[label]
|
||||
id = "player"
|
||||
definition = "default"
|
||||
linked_group = "players"
|
||||
[/label]
|
||||
[/column]
|
||||
[column]
|
||||
grow_factor = 1
|
||||
horizontal_grow = true
|
||||
border = "all"
|
||||
border_size = 5
|
||||
[label]
|
||||
id = "location"
|
||||
definition = "default"
|
||||
linked_group = "locations"
|
||||
[/label]
|
||||
[/column]
|
||||
[/row]
|
||||
[/grid]
|
||||
[/toggle_panel]
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[/list_definition]
|
||||
|
||||
[/listbox]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[row]
|
||||
grow_factor = 0
|
||||
|
||||
[column]
|
||||
horizontal_alignment = "right"
|
||||
|
||||
[grid]
|
||||
|
||||
[row]
|
||||
grow_factor = 0
|
||||
|
||||
[column]
|
||||
border = "all"
|
||||
border_size = 5
|
||||
horizontal_alignment = "right"
|
||||
|
||||
[button]
|
||||
id = "ok"
|
||||
definition = "default"
|
||||
label = _ "OK"
|
||||
[/button]
|
||||
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
border = "all"
|
||||
border_size = 5
|
||||
horizontal_alignment = "right"
|
||||
|
||||
[button]
|
||||
id = "cancel"
|
||||
definition = "default"
|
||||
label = _ "Cancel"
|
||||
[/button]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[/grid]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[/grid]
|
||||
|
||||
[/resolution]
|
||||
|
||||
[/window]
|
|
@ -541,8 +541,6 @@
|
|||
<Unit filename="../../src/gui/dialogs/editor/new_map.hpp" />
|
||||
<Unit filename="../../src/gui/dialogs/editor/resize_map.cpp" />
|
||||
<Unit filename="../../src/gui/dialogs/editor/resize_map.hpp" />
|
||||
<Unit filename="../../src/gui/dialogs/editor/set_starting_position.cpp" />
|
||||
<Unit filename="../../src/gui/dialogs/editor/set_starting_position.hpp" />
|
||||
<Unit filename="../../src/gui/dialogs/end_credits.cpp" />
|
||||
<Unit filename="../../src/gui/dialogs/end_credits.hpp" />
|
||||
<Unit filename="../../src/gui/dialogs/file_dialog.cpp" />
|
||||
|
|
|
@ -593,8 +593,6 @@
|
|||
<Unit filename="../../src/gui/dialogs/editor/new_map.hpp" />
|
||||
<Unit filename="../../src/gui/dialogs/editor/resize_map.cpp" />
|
||||
<Unit filename="../../src/gui/dialogs/editor/resize_map.hpp" />
|
||||
<Unit filename="../../src/gui/dialogs/editor/set_starting_position.cpp" />
|
||||
<Unit filename="../../src/gui/dialogs/editor/set_starting_position.hpp" />
|
||||
<Unit filename="../../src/gui/dialogs/end_credits.cpp" />
|
||||
<Unit filename="../../src/gui/dialogs/end_credits.hpp" />
|
||||
<Unit filename="../../src/gui/dialogs/file_dialog.cpp" />
|
||||
|
|
|
@ -591,8 +591,6 @@
|
|||
<Unit filename="../../src/gui/dialogs/editor/new_map.hpp" />
|
||||
<Unit filename="../../src/gui/dialogs/editor/resize_map.cpp" />
|
||||
<Unit filename="../../src/gui/dialogs/editor/resize_map.hpp" />
|
||||
<Unit filename="../../src/gui/dialogs/editor/set_starting_position.cpp" />
|
||||
<Unit filename="../../src/gui/dialogs/editor/set_starting_position.hpp" />
|
||||
<Unit filename="../../src/gui/dialogs/end_credits.cpp" />
|
||||
<Unit filename="../../src/gui/dialogs/end_credits.hpp" />
|
||||
<Unit filename="../../src/gui/dialogs/file_dialog.cpp" />
|
||||
|
|
|
@ -1618,13 +1618,6 @@
|
|||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Test_Debug|x64'">$(IntDir)Gui\Dialogs\Editor\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Test_Release|x64'">$(IntDir)Gui\Dialogs\Editor\</ObjectFileName>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\gui\dialogs\editor\set_starting_position.cpp">
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)Gui\Dialogs\Editor\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='ReleaseDEBUG|x64'">$(IntDir)Gui\Dialogs\Editor\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)Gui\Dialogs\Editor\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Test_Debug|x64'">$(IntDir)Gui\Dialogs\Editor\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Test_Release|x64'">$(IntDir)Gui\Dialogs\Editor\</ObjectFileName>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\gui\dialogs\edit_label.cpp">
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)Gui\Dialogs\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='ReleaseDEBUG|x64'">$(IntDir)Gui\Dialogs\</ObjectFileName>
|
||||
|
@ -3831,7 +3824,6 @@
|
|||
<ClInclude Include="..\..\src\gui\dialogs\editor\generator_settings.hpp" />
|
||||
<ClInclude Include="..\..\src\gui\dialogs\editor\new_map.hpp" />
|
||||
<ClInclude Include="..\..\src\gui\dialogs\editor\resize_map.hpp" />
|
||||
<ClInclude Include="..\..\src\gui\dialogs\editor\set_starting_position.hpp" />
|
||||
<ClInclude Include="..\..\src\gui\dialogs\edit_label.hpp" />
|
||||
<ClInclude Include="..\..\src\gui\dialogs\edit_text.hpp" />
|
||||
<ClInclude Include="..\..\src\gui\dialogs\end_credits.hpp" />
|
||||
|
@ -4201,4 +4193,4 @@
|
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
|
@ -737,9 +737,6 @@
|
|||
<ClCompile Include="..\..\src\gui\dialogs\editor\resize_map.cpp">
|
||||
<Filter>Gui\Dialogs\Editor</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\gui\dialogs\editor\set_starting_position.cpp">
|
||||
<Filter>Gui\Dialogs\Editor</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\gui\dialogs\multiplayer\faction_select.cpp">
|
||||
<Filter>Gui\Dialogs\Multiplayer</Filter>
|
||||
</ClCompile>
|
||||
|
@ -2189,9 +2186,6 @@
|
|||
<ClInclude Include="..\..\src\gui\dialogs\editor\resize_map.hpp">
|
||||
<Filter>Gui\Dialogs\Editor</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\gui\dialogs\editor\set_starting_position.hpp">
|
||||
<Filter>Gui\Dialogs\Editor</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\gui\dialogs\multiplayer\faction_select.hpp">
|
||||
<Filter>Gui\Dialogs\Multiplayer</Filter>
|
||||
</ClInclude>
|
||||
|
@ -3123,4 +3117,4 @@
|
|||
<Filter>Tests\Utils</Filter>
|
||||
</CustomBuild>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
|
@ -437,8 +437,6 @@
|
|||
46F92E362174F6A400602C1C /* generator_settings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46F92CED2174F6A300602C1C /* generator_settings.cpp */; };
|
||||
46F92E372174F6A400602C1C /* edit_label.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46F92CEE2174F6A300602C1C /* edit_label.cpp */; };
|
||||
46F92E382174F6A400602C1C /* edit_label.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46F92CEE2174F6A300602C1C /* edit_label.cpp */; };
|
||||
46F92E392174F6A400602C1C /* set_starting_position.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46F92CEF2174F6A300602C1C /* set_starting_position.cpp */; };
|
||||
46F92E3A2174F6A400602C1C /* set_starting_position.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46F92CEF2174F6A300602C1C /* set_starting_position.cpp */; };
|
||||
46F92E3B2174F6A400602C1C /* edit_side.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46F92CF12174F6A300602C1C /* edit_side.cpp */; };
|
||||
46F92E3C2174F6A400602C1C /* edit_side.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46F92CF12174F6A300602C1C /* edit_side.cpp */; };
|
||||
46F92E3D2174F6A400602C1C /* new_map.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46F92CF22174F6A300602C1C /* new_map.cpp */; };
|
||||
|
@ -1808,12 +1806,10 @@
|
|||
46F92CE72174F6A300602C1C /* edit_label.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = edit_label.hpp; sourceTree = "<group>"; };
|
||||
46F92CE82174F6A300602C1C /* resize_map.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = resize_map.hpp; sourceTree = "<group>"; };
|
||||
46F92CE92174F6A300602C1C /* generator_settings.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = generator_settings.hpp; sourceTree = "<group>"; };
|
||||
46F92CEA2174F6A300602C1C /* set_starting_position.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = set_starting_position.hpp; sourceTree = "<group>"; };
|
||||
46F92CEB2174F6A300602C1C /* custom_tod.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = custom_tod.hpp; sourceTree = "<group>"; };
|
||||
46F92CEC2174F6A300602C1C /* resize_map.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = resize_map.cpp; sourceTree = "<group>"; };
|
||||
46F92CED2174F6A300602C1C /* generator_settings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = generator_settings.cpp; sourceTree = "<group>"; };
|
||||
46F92CEE2174F6A300602C1C /* edit_label.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = edit_label.cpp; sourceTree = "<group>"; };
|
||||
46F92CEF2174F6A300602C1C /* set_starting_position.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = set_starting_position.cpp; sourceTree = "<group>"; };
|
||||
46F92CF02174F6A300602C1C /* edit_scenario.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = edit_scenario.hpp; sourceTree = "<group>"; };
|
||||
46F92CF12174F6A300602C1C /* edit_side.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = edit_side.cpp; sourceTree = "<group>"; };
|
||||
46F92CF22174F6A300602C1C /* new_map.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = new_map.cpp; sourceTree = "<group>"; };
|
||||
|
@ -3702,8 +3698,6 @@
|
|||
46F92CE42174F6A300602C1C /* new_map.hpp */,
|
||||
46F92CEC2174F6A300602C1C /* resize_map.cpp */,
|
||||
46F92CE82174F6A300602C1C /* resize_map.hpp */,
|
||||
46F92CEF2174F6A300602C1C /* set_starting_position.cpp */,
|
||||
46F92CEA2174F6A300602C1C /* set_starting_position.hpp */,
|
||||
);
|
||||
path = editor;
|
||||
sourceTree = "<group>";
|
||||
|
@ -5554,7 +5548,6 @@
|
|||
46F92E832174F6A400602C1C /* grid.cpp in Sources */,
|
||||
91FBBADB1CB6D1B700470BFE /* markov_generator.cpp in Sources */,
|
||||
91C55DA41CC078820040012E /* context_free_grammar_generator.cpp in Sources */,
|
||||
46F92E392174F6A400602C1C /* set_starting_position.cpp in Sources */,
|
||||
46F92D912174F6A300602C1C /* gui_definition.cpp in Sources */,
|
||||
916B7E941CC151FA00811097 /* race.cpp in Sources */,
|
||||
918C8A1E1D05F9AA009744A0 /* chat_command_handler.cpp in Sources */,
|
||||
|
@ -5672,7 +5665,6 @@
|
|||
91E356361CACC47F00774252 /* test_commandline_options.cpp in Sources */,
|
||||
91E356371CACC47F00774252 /* test_config.cpp in Sources */,
|
||||
91E356381CACC47F00774252 /* test_config_cache.cpp in Sources */,
|
||||
46F92E3A2174F6A400602C1C /* set_starting_position.cpp in Sources */,
|
||||
46F92E182174F6A400602C1C /* mp_alerts_options.cpp in Sources */,
|
||||
91E356391CACC47F00774252 /* test_filesystem.cpp in Sources */,
|
||||
46F92DE62174F6A400602C1C /* terrain_layers.cpp in Sources */,
|
||||
|
|
|
@ -186,7 +186,6 @@ gui/dialogs/editor/generate_map.cpp
|
|||
gui/dialogs/editor/generator_settings.cpp
|
||||
gui/dialogs/editor/new_map.cpp
|
||||
gui/dialogs/editor/resize_map.cpp
|
||||
gui/dialogs/editor/set_starting_position.cpp
|
||||
gui/dialogs/end_credits.cpp
|
||||
gui/dialogs/file_dialog.cpp
|
||||
gui/dialogs/folder_create.cpp
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "editor/action/mouse/mouse_action.hpp"
|
||||
|
||||
#include "gettext.hpp"
|
||||
#include "gui/dialogs/editor/set_starting_position.hpp"
|
||||
#include "editor/palette/terrain_palettes.hpp"
|
||||
|
||||
namespace editor {
|
||||
|
|
|
@ -1,122 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2011 - 2018 by Iris Morelle <shadowm2006@gmail.com>
|
||||
Part of the Battle for Wesnoth Project https://www.wesnoth.org/
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY.
|
||||
|
||||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#define GETTEXT_DOMAIN "wesnoth-editor"
|
||||
|
||||
#include "gui/dialogs/editor/set_starting_position.hpp"
|
||||
|
||||
#include "formatter.hpp"
|
||||
#include "formula/string_utils.hpp"
|
||||
#include "gettext.hpp"
|
||||
#include "gui/auxiliary/find_widget.hpp"
|
||||
#include "gui/widgets/listbox.hpp"
|
||||
#include "gui/widgets/settings.hpp"
|
||||
#include "gui/widgets/window.hpp"
|
||||
#include "map/location.hpp"
|
||||
|
||||
namespace gui2
|
||||
{
|
||||
namespace dialogs
|
||||
{
|
||||
|
||||
/*WIKI
|
||||
* @page = GUIWindowDefinitionWML
|
||||
* @order = 2_editor_set_starting_position
|
||||
*
|
||||
* == Editor set starting position ==
|
||||
*
|
||||
* Map editor dialog for setting player starting positions.
|
||||
*
|
||||
* @begin{table}{dialog_widgets}
|
||||
*
|
||||
* listbox & & listbox & m &
|
||||
* Listbox displaying player choices. $
|
||||
*
|
||||
* -player & & styled_widget & m &
|
||||
* Widget which shows a player item label. $
|
||||
*
|
||||
* -location & & styled_widget & m &
|
||||
* Widget which shows the coordinates to the current
|
||||
* starting position for a player if it exists. $
|
||||
*
|
||||
* ok & & button & m &
|
||||
* OK button. $
|
||||
*
|
||||
* cancel & & button & m &
|
||||
* Cancel button. $
|
||||
*
|
||||
* @end{table}
|
||||
*/
|
||||
|
||||
REGISTER_DIALOG(editor_set_starting_position)
|
||||
|
||||
editor_set_starting_position::editor_set_starting_position(
|
||||
unsigned current_player,
|
||||
unsigned maximum_players,
|
||||
const std::vector<map_location>& starting_positions)
|
||||
: selection_(std::min(current_player, maximum_players))
|
||||
, starting_positions_(starting_positions)
|
||||
{
|
||||
if(starting_positions_.size() != maximum_players) {
|
||||
starting_positions_.resize(maximum_players);
|
||||
}
|
||||
}
|
||||
|
||||
void editor_set_starting_position::pre_show(window& window)
|
||||
{
|
||||
listbox& list = find_widget<listbox>(&window, "listbox", false);
|
||||
window.keyboard_capture(&list);
|
||||
|
||||
std::map<std::string, string_map> data;
|
||||
string_map column;
|
||||
|
||||
column["label"] = _("player^None");
|
||||
data.emplace("player", column);
|
||||
list.add_row(data);
|
||||
|
||||
for(unsigned i = 0; i < starting_positions_.size(); ++i) {
|
||||
const map_location& player_pos = starting_positions_[i];
|
||||
|
||||
data.clear();
|
||||
|
||||
utils::string_map symbols;
|
||||
symbols["player_number"] = std::to_string(i + 1);
|
||||
|
||||
column["label"] = utils::interpolate_variables_into_string(
|
||||
_("Player $player_number"), &symbols);
|
||||
data.emplace("player", column);
|
||||
|
||||
if(player_pos.valid()) {
|
||||
column["label"] = (formatter() << "(" << player_pos.wml_x() << ", "
|
||||
<< player_pos.wml_y() << ")").str();
|
||||
data.emplace("location", column);
|
||||
}
|
||||
|
||||
list.add_row(data);
|
||||
}
|
||||
|
||||
list.select_row(selection_);
|
||||
}
|
||||
|
||||
void editor_set_starting_position::post_show(window& window)
|
||||
{
|
||||
if(get_retval() != retval::OK) {
|
||||
return;
|
||||
}
|
||||
|
||||
listbox& list = find_widget<listbox>(&window, "listbox", false);
|
||||
selection_ = list.get_selected_row();
|
||||
}
|
||||
} // namespace dialogs
|
||||
} // namespace gui2
|
|
@ -1,55 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2011 - 2018 by Iris Morelle <shadowm2006@gmail.com>
|
||||
Part of the Battle for Wesnoth Project https://www.wesnoth.org/
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY.
|
||||
|
||||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "gui/dialogs/modal_dialog.hpp"
|
||||
|
||||
#include <vector>
|
||||
|
||||
struct map_location;
|
||||
|
||||
namespace gui2
|
||||
{
|
||||
namespace dialogs
|
||||
{
|
||||
|
||||
class editor_set_starting_position : public modal_dialog
|
||||
{
|
||||
public:
|
||||
editor_set_starting_position(
|
||||
unsigned current_player,
|
||||
unsigned maximum_players,
|
||||
const std::vector<map_location>& starting_positions);
|
||||
|
||||
unsigned result() const
|
||||
{
|
||||
return selection_;
|
||||
}
|
||||
|
||||
private:
|
||||
unsigned selection_;
|
||||
std::vector<map_location> starting_positions_;
|
||||
|
||||
/** Inherited from modal_dialog, implemented by REGISTER_DIALOG. */
|
||||
virtual const std::string& window_id() const override;
|
||||
|
||||
/** Inherited from modal_dialog. */
|
||||
virtual void pre_show(window& window) override;
|
||||
|
||||
/** Inherited from modal_dialog. */
|
||||
virtual void post_show(window& window) override;
|
||||
};
|
||||
} // namespace dialogs
|
||||
} // namespace gui2
|
|
@ -54,7 +54,6 @@
|
|||
#include "gui/dialogs/editor/generator_settings.hpp"
|
||||
#include "gui/dialogs/editor/new_map.hpp"
|
||||
#include "gui/dialogs/editor/resize_map.hpp"
|
||||
#include "gui/dialogs/editor/set_starting_position.hpp"
|
||||
#include "gui/dialogs/end_credits.hpp"
|
||||
#include "gui/dialogs/file_dialog.hpp"
|
||||
#include "gui/dialogs/folder_create.hpp"
|
||||
|
@ -434,7 +433,6 @@ BOOST_AUTO_TEST_CASE(test_gui2)
|
|||
test<editor_generate_map>();
|
||||
test<editor_new_map>();
|
||||
test<editor_resize_map>();
|
||||
test<editor_set_starting_position>();
|
||||
//test<end_credits>();
|
||||
test<faction_select>();
|
||||
test<file_dialog>();
|
||||
|
@ -1033,16 +1031,6 @@ struct dialog_tester<editor_new_map>
|
|||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct dialog_tester<editor_set_starting_position>
|
||||
{
|
||||
std::vector<map_location> locations;
|
||||
editor_set_starting_position* create()
|
||||
{
|
||||
return new editor_set_starting_position(0, 0, locations);
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct dialog_tester<editor_resize_map>
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue