mirror of https://github.com/OpenRCT2/OpenRCT2.git
This commit is contained in:
parent
25eb403c78
commit
85c1ec8fa5
|
@ -363,21 +363,27 @@ static void window_title_editor_mouseup(rct_window* w, rct_widgetindex widgetInd
|
||||||
auto handle = TitleSequenceGetParkHandle(_editingTitleSequence, w->selected_list_item);
|
auto handle = TitleSequenceGetParkHandle(_editingTitleSequence, w->selected_list_item);
|
||||||
auto stream = (IStream*)handle->Stream;
|
auto stream = (IStream*)handle->Stream;
|
||||||
auto hintPath = String::ToStd(handle->HintPath);
|
auto hintPath = String::ToStd(handle->HintPath);
|
||||||
|
|
||||||
bool isScenario = ParkImporter::ExtensionIsScenario(hintPath);
|
bool isScenario = ParkImporter::ExtensionIsScenario(hintPath);
|
||||||
auto& objectMgr = OpenRCT2::GetContext()->GetObjectManager();
|
try
|
||||||
auto parkImporter = std::unique_ptr<IParkImporter>(ParkImporter::Create(hintPath));
|
{
|
||||||
auto result = parkImporter->LoadFromStream(stream, isScenario);
|
auto& objectMgr = OpenRCT2::GetContext()->GetObjectManager();
|
||||||
objectMgr.LoadObjects(result.RequiredObjects.data(), result.RequiredObjects.size());
|
auto parkImporter = std::unique_ptr<IParkImporter>(ParkImporter::Create(hintPath));
|
||||||
parkImporter->Import();
|
auto result = parkImporter->LoadFromStream(stream, isScenario);
|
||||||
|
objectMgr.LoadObjects(result.RequiredObjects.data(), result.RequiredObjects.size());
|
||||||
|
parkImporter->Import();
|
||||||
|
|
||||||
if (isScenario)
|
if (isScenario)
|
||||||
scenario_begin();
|
scenario_begin();
|
||||||
else
|
else
|
||||||
game_load_init();
|
game_load_init();
|
||||||
|
|
||||||
TitleSequenceCloseParkHandle(handle);
|
TitleSequenceCloseParkHandle(handle);
|
||||||
window_title_editor_open(WINDOW_TITLE_EDITOR_TAB_SAVES);
|
window_title_editor_open(WINDOW_TITLE_EDITOR_TAB_SAVES);
|
||||||
|
}
|
||||||
|
catch (const std::exception&)
|
||||||
|
{
|
||||||
|
context_show_error(ERROR_TYPE_FILE_LOAD, STR_FILE_CONTAINS_INVALID_DATA);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue