1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-18 12:33:17 +01:00

Disallow opening problematic windows in multiplayer

This commit is contained in:
Margen67
2021-08-19 00:04:49 -10:00
committed by GitHub
parent 223b926f8c
commit a371d1ff11
2 changed files with 27 additions and 5 deletions

View File

@@ -3455,6 +3455,7 @@ static void top_toolbar_init_cheats_menu(rct_window* w, rct_widget* widget)
{
Dropdown::SetDisabled(DDIDX_OBJECT_SELECTION, true);
Dropdown::SetDisabled(DDIDX_INVENTIONS_LIST, true);
Dropdown::SetDisabled(DDIDX_OBJECTIVE_OPTIONS, true);
}
if (gScreenFlags & SCREEN_FLAGS_EDITOR)

View File

@@ -1172,13 +1172,27 @@ static int32_t cc_open(InteractiveConsole& console, const arguments_t& argv)
bool invalidTitle = false;
if (argv[0] == "object_selection" && invalidArguments(&invalidTitle, !title))
{
// Only this window should be open for safety reasons
window_close_all();
context_open_window(WC_EDITOR_OBJECT_SELECTION);
if (network_get_mode() != NETWORK_MODE_NONE)
{
console.WriteLineError("Cannot open this window in multiplayer mode.");
}
else
{
// Only this window should be open for safety reasons
window_close_all();
context_open_window(WC_EDITOR_OBJECT_SELECTION);
}
}
else if (argv[0] == "inventions_list" && invalidArguments(&invalidTitle, !title))
{
context_open_window(WC_EDITOR_INVENTION_LIST);
if (network_get_mode() != NETWORK_MODE_NONE)
{
console.WriteLineError("Cannot open this window in multiplayer mode.");
}
else
{
context_open_window(WC_EDITOR_INVENTION_LIST);
}
}
else if (argv[0] == "scenario_options" && invalidArguments(&invalidTitle, !title))
{
@@ -1186,7 +1200,14 @@ static int32_t cc_open(InteractiveConsole& console, const arguments_t& argv)
}
else if (argv[0] == "objective_options" && invalidArguments(&invalidTitle, !title))
{
context_open_window(WC_EDITOR_OBJECTIVE_OPTIONS);
if (network_get_mode() != NETWORK_MODE_NONE)
{
console.WriteLineError("Cannot open this window in multiplayer mode.");
}
else
{
context_open_window(WC_EDITOR_OBJECTIVE_OPTIONS);
}
}
else if (argv[0] == "options")
{