Skip to content

Commit

Permalink
Merge branch 'master' into coroutine_experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
loonycyborg committed Dec 30, 2020
2 parents 893b569 + 204357c commit b0808b9
Show file tree
Hide file tree
Showing 19 changed files with 98 additions and 439 deletions.
4 changes: 3 additions & 1 deletion data/core/editor/help.cfg
Expand Up @@ -105,9 +105,10 @@ The paste tool also has some clipboard-manipulation functions:" +
[topic]
id=editor_tool_starting
title= _ "Starting Locations Tool"
# po: the parts about "10" being shown as "Player 10" use the translatable string "Player $side_num" in the wesnoth-editor textdomain
text= "<img>src=icons/action/editor-tool-starting-position_60.png align=left box=yes</img>" + _ "Defines the side leader starting position.
This tool sets the side leaders’ default starting locations, and named special locations. Both types of location are enabled in both <ref>dst='..editor_mode_terrain' text='Terrain Editor'</ref> and Scenario Editor modes. The location names are shown as a list in the editor palette, clicking on the map will place that name on a hex, each location can only be placed on a single hex, and the editor will only allow one location per hex.
This tool sets the side leaders’ default starting locations, and named special locations. Both types of location are enabled in both <ref>dst='..editor_mode_terrain' text='Terrain Editor'</ref> and <ref>dst='..editor_mode_scenario' text='Scenario Editor'</ref> modes. The location names are shown as a list in the editor palette, clicking on the map will place that name on a hex, each location can only be placed on a single hex, and the editor will only allow one location per hex.
To add named special locations, click “Add” at the bottom of the editor palette, and enter the name. These names must start with a letter and may contain numbers and underscores.
Expand Down Expand Up @@ -351,6 +352,7 @@ In scenario mode, the button accesses an editor for individual schedules for <re
[topic]
id=editor_palette
title= _ "Editor Palette"
# po: the “Player 1”, “Player 2”, ... list is translated using "Player $side_num" in the wesnoth-editor textdomain
text= _ "The editor palette contains the applicable items you may use with the currently selected tool. For example, the Paint tool will display a full list of all available terrains, and the unit tool will provide a list of available units. When using the Starting Locations Tool, the palette changes to a list of “Player 1”, “Player 2”, etc.
<bold>text='Filter'</bold>
Expand Down
192 changes: 0 additions & 192 deletions data/gui/window/editor_set_starting_position.cfg

This file was deleted.

2 changes: 0 additions & 2 deletions projectfiles/CodeBlocks-SCons/wesnoth.cbp
Expand Up @@ -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" />
Expand Down
2 changes: 0 additions & 2 deletions projectfiles/CodeBlocks/tests.cbp
Expand Up @@ -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" />
Expand Down
2 changes: 0 additions & 2 deletions projectfiles/CodeBlocks/wesnoth.cbp
Expand Up @@ -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" />
Expand Down
10 changes: 1 addition & 9 deletions projectfiles/VC16/wesnoth.vcxproj
Expand Up @@ -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>
Expand Down Expand Up @@ -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" />
Expand Down Expand Up @@ -4201,4 +4193,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
8 changes: 1 addition & 7 deletions projectfiles/VC16/wesnoth.vcxproj.filters
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -3123,4 +3117,4 @@
<Filter>Tests\Utils</Filter>
</CustomBuild>
</ItemGroup>
</Project>
</Project>
Expand Up @@ -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 */; };
Expand Down Expand Up @@ -1807,12 +1805,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>"; };
Expand Down Expand Up @@ -3700,8 +3696,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>";
Expand Down Expand Up @@ -5552,7 +5546,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 */,
Expand Down Expand Up @@ -5670,7 +5663,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 */,
Expand Down
1 change: 0 additions & 1 deletion source_lists/wesnoth
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/editor/action/mouse/mouse_action.cpp
Expand Up @@ -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 {
Expand Down
11 changes: 10 additions & 1 deletion src/game_board.cpp
Expand Up @@ -214,11 +214,20 @@ void game_board::side_drop_to(int side_num, team::CONTROLLER ctrl, team::PROXY_C
if (leader.valid()) leader->rename(ctrl.to_string() + std::to_string(side_num));
}

void game_board::side_change_controller(int side_num, bool is_local, const std::string& pname) {
void game_board::side_change_controller(int side_num, bool is_local, const std::string& pname, const std::string& controller_type) {
team &tm = get_team(side_num);

tm.set_local(is_local);

// only changing the type of controller
if(controller_type == team::CONTROLLER::enum_to_string(team::CONTROLLER::AI) && !tm.is_ai()) {
tm.make_ai();
return;
} else if(controller_type == team::CONTROLLER::enum_to_string(team::CONTROLLER::HUMAN) && !tm.is_human()) {
tm.make_human();
return;
}

if (pname.empty() || !tm.is_human()) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/game_board.hpp
Expand Up @@ -155,7 +155,7 @@ class game_board : public display_context
// Manipulator from playturn

void side_drop_to (int side_num, team::CONTROLLER ctrl, team::PROXY_CONTROLLER proxy = team::PROXY_CONTROLLER::PROXY_HUMAN);
void side_change_controller (int side_num, bool is_local, const std::string& pname = "");
void side_change_controller (int side_num, bool is_local, const std::string& pname, const std::string& controller_type);

// Manipulator from actionwml

Expand Down

0 comments on commit b0808b9

Please sign in to comment.