From 28c61e706828bf8faff3530464dc43d664edecec Mon Sep 17 00:00:00 2001 From: wolfreak99 Date: Mon, 20 Feb 2017 12:15:54 -0500 Subject: [PATCH] Prepare scenario options sync --- data/language/en-GB.txt | 1 + src/openrct2/editor.c | 74 +++++++++++++++++++ src/openrct2/editor.h | 27 +++++++ src/openrct2/game.c | 1 + src/openrct2/game.h | 1 + src/openrct2/localisation/string_ids.h | 2 + src/openrct2/network/NetworkAction.cpp | 5 ++ src/openrct2/network/network.cpp | 1 + .../windows/editor_scenario_options.c | 2 + src/openrct2/windows/top_toolbar.c | 1 - 10 files changed, 114 insertions(+), 1 deletion(-) diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index ded1be152b..711cd27a14 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -4348,6 +4348,7 @@ STR_6036 :{SMALLFONT}{BLACK}Clear STR_6037 :Please select a valid RCT1 directory STR_6038 :{SMALLFONT}{BLACK}If you have RCT1 installed, set this option to its directory to load scenarios, music, etc. STR_6039 :{SMALLFONT}{BLACK}Quick demolish ride +STR_6040 :Edit Scenario Options ############# # Scenarios # diff --git a/src/openrct2/editor.c b/src/openrct2/editor.c index 12b15013e2..ab471f83a4 100644 --- a/src/openrct2/editor.c +++ b/src/openrct2/editor.c @@ -42,6 +42,7 @@ #include "world/park.h" #include "world/scenery.h" #include "world/sprite.h" +#include "network/network.h" uint8 _editorSelectedRides[128]; uint8 _editorSelectedSmallScenery[252]; @@ -534,3 +535,76 @@ bool editor_check_park() return true; } + +void game_command_edit_scenario_options(sint32* eax, sint32* ebx, sint32* ecx, sint32* edx, sint32* esi, sint32* edi, sint32* ebp) +{ + if (*ebx & GAME_COMMAND_FLAG_APPLY) { + switch (*ecx) { + case EDIT_SCENARIOOPTIONS_SETNOMONEY: + + break; + case EDIT_SCENARIOOPTIONS_SETINITIALCASH: + + break; + case EDIT_SCENARIOOPTIONS_SETINITIALLOAN: + + break; + case EDIT_SCENARIOOPTIONS_SETMAXIMUMLOANSIZE: + + break; + case EDIT_SCENARIOOPTIONS_SETANNUALINTERESTRATE: + + break; + case EDIT_SCENARIOOPTIONS_SETFORBIDMARKETINGCAMPAIGNS: + + break; + case EDIT_SCENARIOOPTIONS_SETAVERAGECASHPERGUEST: + + break; + case EDIT_SCENARIOOPTIONS_SETGUESTINITIALHAPPINESS: + + break; + case EDIT_SCENARIOOPTIONS_SETGUESTINITIALHUNGER: + + break; + case EDIT_SCENARIOOPTIONS_SETGUESTINITIALTHIRST: + + break; + case EDIT_SCENARIOOPTIONS_SETGUESTSPREFERLESSINTENSERIDES: + + break; + case EDIT_SCENARIOOPTIONS_SETGUESTSPREFERMOREINTENSERIDES: + + break; + case EDIT_SCENARIOOPTIONS_SETCOSTTOBUYLAND: + + break; + case EDIT_SCENARIOOPTIONS_SETCOSTTOBUYCONSTRUCTIONRIGHTS: + + break; + case EDIT_SCENARIOOPTIONS_SETPARKCHARGEMETHOD: + + break; + case EDIT_SCENARIOOPTIONS_SETPARKCHARGEENTRYFEE: + + break; + case EDIT_SCENARIOOPTIONS_SETFORBIDTREEREMOVAL: + + break; + case EDIT_SCENARIOOPTIONS_SETFORBIDLANDSCAPECHANGES: + + break; + case EDIT_SCENARIOOPTIONS_SETFORBIDHIGHCONSTRUCTION: + + break; + case EDIT_SCENARIOOPTIONS_SETPARKRATINGHIGHERDIFFICULTLEVEL: + + break; + case EDIT_SCENARIOOPTIONS_SETGUESTGENERATIONHIGHERDIFFICULTLEVEL: + + break; + } + window_invalidate_by_class(WC_EDITOR_SCENARIO_OPTIONS); + } + *ebx = 0; +} diff --git a/src/openrct2/editor.h b/src/openrct2/editor.h index 7466c0264c..e6f0eeff45 100644 --- a/src/openrct2/editor.h +++ b/src/openrct2/editor.h @@ -31,6 +31,31 @@ typedef enum { EDITOR_STEP_TRACK_DESIGNS_MANAGER // 7 } RCT2_EDITOR_STEP; +enum +{ + EDIT_SCENARIOOPTIONS_SETNOMONEY, + EDIT_SCENARIOOPTIONS_SETINITIALCASH, + EDIT_SCENARIOOPTIONS_SETINITIALLOAN, + EDIT_SCENARIOOPTIONS_SETMAXIMUMLOANSIZE, + EDIT_SCENARIOOPTIONS_SETANNUALINTERESTRATE, + EDIT_SCENARIOOPTIONS_SETFORBIDMARKETINGCAMPAIGNS, + EDIT_SCENARIOOPTIONS_SETAVERAGECASHPERGUEST, + EDIT_SCENARIOOPTIONS_SETGUESTINITIALHAPPINESS, + EDIT_SCENARIOOPTIONS_SETGUESTINITIALHUNGER, + EDIT_SCENARIOOPTIONS_SETGUESTINITIALTHIRST, + EDIT_SCENARIOOPTIONS_SETGUESTSPREFERLESSINTENSERIDES, + EDIT_SCENARIOOPTIONS_SETGUESTSPREFERMOREINTENSERIDES, + EDIT_SCENARIOOPTIONS_SETCOSTTOBUYLAND, + EDIT_SCENARIOOPTIONS_SETCOSTTOBUYCONSTRUCTIONRIGHTS, + EDIT_SCENARIOOPTIONS_SETPARKCHARGEMETHOD, + EDIT_SCENARIOOPTIONS_SETPARKCHARGEENTRYFEE, + EDIT_SCENARIOOPTIONS_SETFORBIDTREEREMOVAL, + EDIT_SCENARIOOPTIONS_SETFORBIDLANDSCAPECHANGES, + EDIT_SCENARIOOPTIONS_SETFORBIDHIGHCONSTRUCTION, + EDIT_SCENARIOOPTIONS_SETPARKRATINGHIGHERDIFFICULTLEVEL, + EDIT_SCENARIOOPTIONS_SETGUESTGENERATIONHIGHERDIFFICULTLEVEL, +}; + extern uint8 * gEditorSelectedObjects[OBJECT_ENTRY_GROUP_COUNT]; void editor_load(); @@ -46,4 +71,6 @@ sint32 editor_check_object_selection(); bool editor_check_object_group_at_least_one_selected(sint32 objectType); +void game_command_edit_scenario_options(sint32* eax, sint32* ebx, sint32* ecx, sint32* edx, sint32* esi, sint32* edi, sint32* ebp); + #endif diff --git a/src/openrct2/game.c b/src/openrct2/game.c index f70e54a23d..f3c72911dc 100644 --- a/src/openrct2/game.c +++ b/src/openrct2/game.c @@ -1247,4 +1247,5 @@ GAME_COMMAND_POINTER* new_game_command_table[GAME_COMMAND_COUNT] = { game_command_pickup_staff, game_command_balloon_press, game_command_modify_tile, + game_command_edit_scenario_options, }; diff --git a/src/openrct2/game.h b/src/openrct2/game.h index d58b282484..fe41d82d94 100644 --- a/src/openrct2/game.h +++ b/src/openrct2/game.h @@ -93,6 +93,7 @@ enum GAME_COMMAND { GAME_COMMAND_PICKUP_STAFF, GAME_COMMAND_BALLOON_PRESS, GAME_COMMAND_MODIFY_TILE, + GAME_COMMAND_EDIT_SCENARIO_OPTIONS, GAME_COMMAND_COUNT }; diff --git a/src/openrct2/localisation/string_ids.h b/src/openrct2/localisation/string_ids.h index 0386647a8b..4fa0fe7e3b 100644 --- a/src/openrct2/localisation/string_ids.h +++ b/src/openrct2/localisation/string_ids.h @@ -3696,6 +3696,8 @@ enum { STR_QUICK_DEMOLISH_RIDE = 6039, + STR_ACTION_EDIT_SCENARIO_OPTIONS = 6040, + // Have to include resource strings (from scenarios and objects) for the time being now that language is partially working STR_COUNT = 32768 }; diff --git a/src/openrct2/network/NetworkAction.cpp b/src/openrct2/network/NetworkAction.cpp index 812b4766fe..a3d1c4cd57 100644 --- a/src/openrct2/network/NetworkAction.cpp +++ b/src/openrct2/network/NetworkAction.cpp @@ -226,6 +226,11 @@ const std::vector NetworkActions::Actions = { GAME_COMMAND_MODIFY_TILE } + }, { + STR_ACTION_EDIT_SCENARIO_OPTIONS, "PERMISSION_EDIT_SCENARIO_OPTIONS", + { + GAME_COMMAND_EDIT_SCENARIO_OPTIONS + } } }; diff --git a/src/openrct2/network/network.cpp b/src/openrct2/network/network.cpp index a81ee5fc9d..6efd69232e 100644 --- a/src/openrct2/network/network.cpp +++ b/src/openrct2/network/network.cpp @@ -750,6 +750,7 @@ void Network::SetupDefaultGroups() user->ToggleActionPermission(18); // Cheat user->ToggleActionPermission(20); // Passwordless login user->ToggleActionPermission(21); // Modify Tile + user->ToggleActionPermission(22); // Edit Scenario Options user->Id = 2; group_list.push_back(std::move(user)); SetDefaultGroup(1); diff --git a/src/openrct2/windows/editor_scenario_options.c b/src/openrct2/windows/editor_scenario_options.c index efd8f6fae3..23515f5a80 100644 --- a/src/openrct2/windows/editor_scenario_options.c +++ b/src/openrct2/windows/editor_scenario_options.c @@ -14,6 +14,8 @@ *****************************************************************************/ #pragma endregion +#include "../editor.h" +#include "../game.h" #include "../interface/themes.h" #include "../interface/widget.h" #include "../interface/window.h" diff --git a/src/openrct2/windows/top_toolbar.c b/src/openrct2/windows/top_toolbar.c index 35b51f622a..effe5dd24d 100644 --- a/src/openrct2/windows/top_toolbar.c +++ b/src/openrct2/windows/top_toolbar.c @@ -3065,7 +3065,6 @@ void top_toolbar_init_debug_menu(rct_window* w, rct_widget* widget) if (network_get_mode() != NETWORK_MODE_NONE) { dropdown_set_disabled(DDIDX_OBJECT_SELECTION, true); dropdown_set_disabled(DDIDX_INVENTIONS_LIST, true); - dropdown_set_disabled(DDIDX_SCENARIO_OPTIONS, true); } dropdown_set_checked(DDIDX_DEBUG_PAINT, window_find_by_class(WC_DEBUG_PAINT) != NULL);