mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-21 05:53:02 +01:00
Adjust the import/export code to have the game state passed
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "../Context.h"
|
||||
#include "../FileClassifier.h"
|
||||
#include "../GameState.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../ParkImporter.h"
|
||||
#include "../common.h"
|
||||
@@ -22,6 +23,8 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
static void WriteConvertFromAndToMessage(FileExtension sourceFileType, FileExtension destinationFileType);
|
||||
static u8string GetFileTypeFriendlyName(FileExtension fileType);
|
||||
|
||||
@@ -98,7 +101,9 @@ exitcode_t CommandLine::HandleCommandConvert(CommandLineArgEnumerator* enumerato
|
||||
|
||||
objManager.LoadObjects(loadResult.RequiredObjects);
|
||||
|
||||
importer->Import();
|
||||
// TODO: Have a separate GameState and exchange once loaded.
|
||||
auto& gameState = GetGameState();
|
||||
importer->Import(gameState);
|
||||
}
|
||||
catch (const std::exception& ex)
|
||||
{
|
||||
@@ -120,7 +125,9 @@ exitcode_t CommandLine::HandleCommandConvert(CommandLineArgEnumerator* enumerato
|
||||
// correct initial view
|
||||
WindowCloseByClass(WindowClass::MainWindow);
|
||||
|
||||
exporter->Export(destinationPath);
|
||||
auto& gameState = GetGameState();
|
||||
|
||||
exporter->Export(gameState, destinationPath);
|
||||
}
|
||||
catch (const std::exception& ex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user