1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-18 20:43:04 +01:00

Fix #7367: 'invalid name for park' shown when opening a scenario (#7394)

Apply extra changes from my own implementation of ParkSetNameAction
which re-introduces logging and calls the action directly from the UI
layer.
This commit is contained in:
Ted John
2018-04-10 17:14:32 +01:00
committed by GitHub
parent dc673a64d8
commit 1cd88a1641
4 changed files with 75 additions and 25 deletions

View File

@@ -17,6 +17,7 @@
#include <openrct2-ui/interface/Dropdown.h>
#include <openrct2-ui/windows/Window.h>
#include <openrct2/actions/ParkSetNameAction.hpp>
#include <openrct2/Context.h>
#include <openrct2/core/Util.hpp>
#include <openrct2/Game.h>
@@ -794,11 +795,14 @@ static void window_editor_objective_options_main_textinput(rct_window *w, rct_wi
switch (widgetIndex) {
case WIDX_PARK_NAME:
park_set_name(text);
{
auto action = ParkSetNameAction(text);
GameActions::Execute(&action);
if (gS6Info.name[0] == '\0')
format_string(gS6Info.name, 64, gParkName, &gParkNameArgs);
break;
if (gS6Info.name[0] == '\0')
format_string(gS6Info.name, 64, gParkName, &gParkNameArgs);
break;
}
case WIDX_SCENARIO_NAME:
safe_strcpy(gS6Info.name, text, Util::CountOf(gS6Info.name));
window_invalidate(w);