mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-23 15:52:55 +01:00
committed by
GitHub
parent
c5297dfcdd
commit
d7f23bc5bf
@@ -2774,7 +2774,6 @@ STR_5410 :Edit
|
|||||||
STR_5411 :Reload
|
STR_5411 :Reload
|
||||||
STR_5412 :Skip to
|
STR_5412 :Skip to
|
||||||
STR_5413 :Load
|
STR_5413 :Load
|
||||||
STR_5414 :Load{MOVE_X}{87}Six Flags Magic Mountain.SC6
|
|
||||||
STR_5415 :Load{MOVE_X}{87}{STRING}
|
STR_5415 :Load{MOVE_X}{87}{STRING}
|
||||||
STR_5416 :Load{MOVE_X}{87}No save selected
|
STR_5416 :Load{MOVE_X}{87}No save selected
|
||||||
STR_5417 :Location
|
STR_5417 :Location
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
- Fix: [#10477] Large Scenery cannot be placed higher using SHIFT.
|
- Fix: [#10477] Large Scenery cannot be placed higher using SHIFT.
|
||||||
- Fix: [#10489] Hosts last player action not being synchronized.
|
- Fix: [#10489] Hosts last player action not being synchronized.
|
||||||
- Fix: [#10543] Secondary shop item prices are not imported correctly from RCT1 saves.
|
- Fix: [#10543] Secondary shop item prices are not imported correctly from RCT1 saves.
|
||||||
|
- Removed: [#6898] LOADMM and LOADRCT1 title sequence commands (use LOADSC instead).
|
||||||
|
|
||||||
0.2.4 (2019-10-28)
|
0.2.4 (2019-10-28)
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -622,9 +622,8 @@ public:
|
|||||||
if (_titleSequencePlayer == nullptr)
|
if (_titleSequencePlayer == nullptr)
|
||||||
{
|
{
|
||||||
auto context = GetContext();
|
auto context = GetContext();
|
||||||
auto scenarioRepository = context->GetScenarioRepository();
|
|
||||||
auto gameState = context->GetGameState();
|
auto gameState = context->GetGameState();
|
||||||
_titleSequencePlayer = CreateTitleSequencePlayer(*scenarioRepository, *gameState);
|
_titleSequencePlayer = CreateTitleSequencePlayer(*gameState);
|
||||||
}
|
}
|
||||||
return _titleSequencePlayer.get();
|
return _titleSequencePlayer.get();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,12 +45,8 @@ using namespace OpenRCT2;
|
|||||||
class TitleSequencePlayer final : public ITitleSequencePlayer
|
class TitleSequencePlayer final : public ITitleSequencePlayer
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
static constexpr const char* SFMM_FILENAME = "Six Flags Magic Mountain.SC6";
|
|
||||||
|
|
||||||
IScenarioRepository& _scenarioRepository;
|
|
||||||
GameState& _gameState;
|
GameState& _gameState;
|
||||||
|
|
||||||
size_t _sequenceId = 0;
|
|
||||||
TitleSequence* _sequence = nullptr;
|
TitleSequence* _sequence = nullptr;
|
||||||
int32_t _position = 0;
|
int32_t _position = 0;
|
||||||
int32_t _waitCounter = 0;
|
int32_t _waitCounter = 0;
|
||||||
@@ -60,9 +56,8 @@ private:
|
|||||||
CoordsXY _viewCentreLocation = {};
|
CoordsXY _viewCentreLocation = {};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit TitleSequencePlayer(IScenarioRepository& scenarioRepository, GameState& gameState)
|
explicit TitleSequencePlayer(GameState& gameState)
|
||||||
: _scenarioRepository(scenarioRepository)
|
: _gameState(gameState)
|
||||||
, _gameState(gameState)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,7 +94,6 @@ public:
|
|||||||
|
|
||||||
Eject();
|
Eject();
|
||||||
_sequence = sequence;
|
_sequence = sequence;
|
||||||
_sequenceId = titleSequenceId;
|
|
||||||
|
|
||||||
Reset();
|
Reset();
|
||||||
return true;
|
return true;
|
||||||
@@ -258,23 +252,6 @@ private:
|
|||||||
// 25 ms/tick
|
// 25 ms/tick
|
||||||
_waitCounter = std::max<int32_t>(1, command->Milliseconds / (uint32_t)GAME_UPDATE_TIME_MS);
|
_waitCounter = std::max<int32_t>(1, command->Milliseconds / (uint32_t)GAME_UPDATE_TIME_MS);
|
||||||
break;
|
break;
|
||||||
case TITLE_SCRIPT_LOADMM:
|
|
||||||
{
|
|
||||||
const scenario_index_entry* entry = _scenarioRepository.GetByFilename(SFMM_FILENAME);
|
|
||||||
if (entry == nullptr)
|
|
||||||
{
|
|
||||||
Console::Error::WriteLine("%s not found.", SFMM_FILENAME);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const utf8* path = entry->path;
|
|
||||||
if (!LoadParkFromFile(path))
|
|
||||||
{
|
|
||||||
Console::Error::WriteLine("Failed to load: \"%s\" for the title sequence.", path);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case TITLE_SCRIPT_LOCATION:
|
case TITLE_SCRIPT_LOCATION:
|
||||||
{
|
{
|
||||||
int32_t x = command->X * 32 + 16;
|
int32_t x = command->X * 32 + 16;
|
||||||
@@ -318,32 +295,6 @@ private:
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TITLE_SCRIPT_LOADRCT1:
|
|
||||||
{
|
|
||||||
source_desc sourceDesc;
|
|
||||||
if (!ScenarioSources::TryGetById(command->SaveIndex, &sourceDesc) || sourceDesc.index == -1)
|
|
||||||
{
|
|
||||||
Console::Error::WriteLine("Invalid scenario id.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const utf8* path = nullptr;
|
|
||||||
size_t numScenarios = _scenarioRepository.GetCount();
|
|
||||||
for (size_t i = 0; i < numScenarios; i++)
|
|
||||||
{
|
|
||||||
const scenario_index_entry* scenario = _scenarioRepository.GetByIndex(i);
|
|
||||||
if (scenario && scenario->source_index == sourceDesc.index)
|
|
||||||
{
|
|
||||||
path = scenario->path;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (path == nullptr || !LoadParkFromFile(path))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case TITLE_SCRIPT_LOADSC:
|
case TITLE_SCRIPT_LOADSC:
|
||||||
{
|
{
|
||||||
bool loadSuccess = false;
|
bool loadSuccess = false;
|
||||||
@@ -558,7 +509,7 @@ private:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
std::unique_ptr<ITitleSequencePlayer> CreateTitleSequencePlayer(IScenarioRepository& scenarioRepository, GameState& gameState)
|
std::unique_ptr<ITitleSequencePlayer> CreateTitleSequencePlayer(GameState& gameState)
|
||||||
{
|
{
|
||||||
return std::make_unique<TitleSequencePlayer>(scenarioRepository, gameState);
|
return std::make_unique<TitleSequencePlayer>(gameState);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,5 +20,4 @@ namespace OpenRCT2
|
|||||||
class GameState;
|
class GameState;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<ITitleSequencePlayer> CreateTitleSequencePlayer(
|
std::unique_ptr<ITitleSequencePlayer> CreateTitleSequencePlayer(OpenRCT2::GameState& gameState);
|
||||||
IScenarioRepository& scenarioRepository, OpenRCT2::GameState& gameState);
|
|
||||||
|
|||||||
@@ -955,9 +955,6 @@ static void window_title_editor_scrollpaint_commands(rct_window* w, rct_drawpixe
|
|||||||
set_format_arg(0, uintptr_t, _editingTitleSequence->Saves[command->SaveIndex]);
|
set_format_arg(0, uintptr_t, _editingTitleSequence->Saves[command->SaveIndex]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TITLE_SCRIPT_LOADMM:
|
|
||||||
commandName = STR_TITLE_EDITOR_COMMAND_LOAD_SFMM;
|
|
||||||
break;
|
|
||||||
case TITLE_SCRIPT_LOCATION:
|
case TITLE_SCRIPT_LOCATION:
|
||||||
commandName = STR_TITLE_EDITOR_COMMAND_LOCATION;
|
commandName = STR_TITLE_EDITOR_COMMAND_LOCATION;
|
||||||
set_format_arg(0, uint16_t, command->X);
|
set_format_arg(0, uint16_t, command->X);
|
||||||
@@ -996,18 +993,6 @@ static void window_title_editor_scrollpaint_commands(rct_window* w, rct_drawpixe
|
|||||||
case TITLE_SCRIPT_END:
|
case TITLE_SCRIPT_END:
|
||||||
commandName = STR_TITLE_EDITOR_END;
|
commandName = STR_TITLE_EDITOR_END;
|
||||||
break;
|
break;
|
||||||
case TITLE_SCRIPT_LOADRCT1:
|
|
||||||
{
|
|
||||||
commandName = STR_TITLE_EDITOR_COMMAND_LOAD_FILE;
|
|
||||||
const char* name = "";
|
|
||||||
source_desc desc;
|
|
||||||
if (ScenarioSources::TryGetById(command->SaveIndex, &desc))
|
|
||||||
{
|
|
||||||
name = desc.title;
|
|
||||||
}
|
|
||||||
set_format_arg(0, uintptr_t, name);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case TITLE_SCRIPT_LOADSC:
|
case TITLE_SCRIPT_LOADSC:
|
||||||
{
|
{
|
||||||
commandName = STR_TITLE_EDITOR_COMMAND_LOAD_FILE;
|
commandName = STR_TITLE_EDITOR_COMMAND_LOAD_FILE;
|
||||||
|
|||||||
@@ -2902,7 +2902,6 @@ enum
|
|||||||
STR_TITLE_EDITOR_ACTION_RELOAD = 5411, // unused (commented out)
|
STR_TITLE_EDITOR_ACTION_RELOAD = 5411, // unused (commented out)
|
||||||
STR_TITLE_EDITOR_ACTION_SKIP_TO = 5412,
|
STR_TITLE_EDITOR_ACTION_SKIP_TO = 5412,
|
||||||
STR_TITLE_EDITOR_ACTION_LOAD = 5413,
|
STR_TITLE_EDITOR_ACTION_LOAD = 5413,
|
||||||
STR_TITLE_EDITOR_COMMAND_LOAD_SFMM = 5414,
|
|
||||||
STR_TITLE_EDITOR_COMMAND_LOAD_FILE = 5415,
|
STR_TITLE_EDITOR_COMMAND_LOAD_FILE = 5415,
|
||||||
STR_TITLE_EDITOR_COMMAND_LOAD_NO_SAVE = 5416,
|
STR_TITLE_EDITOR_COMMAND_LOAD_NO_SAVE = 5416,
|
||||||
STR_TITLE_EDITOR_COMMAND_TYPE_LOCATION = 5417,
|
STR_TITLE_EDITOR_COMMAND_TYPE_LOCATION = 5417,
|
||||||
|
|||||||
@@ -453,15 +453,6 @@ static std::vector<TitleCommand> LegacyScriptRead(utf8* script, size_t scriptLen
|
|||||||
{
|
{
|
||||||
command.Type = TITLE_SCRIPT_END;
|
command.Type = TITLE_SCRIPT_END;
|
||||||
}
|
}
|
||||||
else if (_stricmp(token, "LOADMM") == 0)
|
|
||||||
{
|
|
||||||
command.Type = TITLE_SCRIPT_LOADMM;
|
|
||||||
}
|
|
||||||
else if (_stricmp(token, "LOADRCT1") == 0)
|
|
||||||
{
|
|
||||||
command.Type = TITLE_SCRIPT_LOADRCT1;
|
|
||||||
command.SaveIndex = atoi(part1) & 0xFF;
|
|
||||||
}
|
|
||||||
else if (_stricmp(token, "LOADSC") == 0)
|
else if (_stricmp(token, "LOADSC") == 0)
|
||||||
{
|
{
|
||||||
command.Type = TITLE_SCRIPT_LOADSC;
|
command.Type = TITLE_SCRIPT_LOADSC;
|
||||||
@@ -578,13 +569,6 @@ static std::string LegacyScriptWrite(TitleSequence* seq)
|
|||||||
const TitleCommand* command = &seq->Commands[i];
|
const TitleCommand* command = &seq->Commands[i];
|
||||||
switch (command->Type)
|
switch (command->Type)
|
||||||
{
|
{
|
||||||
case TITLE_SCRIPT_LOADMM:
|
|
||||||
sb.Append("LOADMM");
|
|
||||||
break;
|
|
||||||
case TITLE_SCRIPT_LOADRCT1:
|
|
||||||
String::Format(buffer, sizeof(buffer), "LOADRCT1 %u", command->SaveIndex);
|
|
||||||
sb.Append(buffer);
|
|
||||||
break;
|
|
||||||
case TITLE_SCRIPT_LOAD:
|
case TITLE_SCRIPT_LOAD:
|
||||||
if (command->SaveIndex == 0xFF)
|
if (command->SaveIndex == 0xFF)
|
||||||
{
|
{
|
||||||
@@ -648,9 +632,7 @@ bool TitleSequenceIsLoadCommand(const TitleCommand* command)
|
|||||||
{
|
{
|
||||||
switch (command->Type)
|
switch (command->Type)
|
||||||
{
|
{
|
||||||
case TITLE_SCRIPT_LOADMM:
|
|
||||||
case TITLE_SCRIPT_LOAD:
|
case TITLE_SCRIPT_LOAD:
|
||||||
case TITLE_SCRIPT_LOADRCT1:
|
|
||||||
case TITLE_SCRIPT_LOADSC:
|
case TITLE_SCRIPT_LOADSC:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ enum TITLE_SCRIPT
|
|||||||
{
|
{
|
||||||
TITLE_SCRIPT_UNDEFINED = 0xFF,
|
TITLE_SCRIPT_UNDEFINED = 0xFF,
|
||||||
TITLE_SCRIPT_WAIT = 0,
|
TITLE_SCRIPT_WAIT = 0,
|
||||||
TITLE_SCRIPT_LOADMM,
|
|
||||||
TITLE_SCRIPT_LOCATION,
|
TITLE_SCRIPT_LOCATION,
|
||||||
TITLE_SCRIPT_ROTATE,
|
TITLE_SCRIPT_ROTATE,
|
||||||
TITLE_SCRIPT_ZOOM,
|
TITLE_SCRIPT_ZOOM,
|
||||||
@@ -73,7 +72,6 @@ enum TITLE_SCRIPT
|
|||||||
TITLE_SCRIPT_SPEED,
|
TITLE_SCRIPT_SPEED,
|
||||||
TITLE_SCRIPT_LOOP,
|
TITLE_SCRIPT_LOOP,
|
||||||
TITLE_SCRIPT_ENDLOOP,
|
TITLE_SCRIPT_ENDLOOP,
|
||||||
TITLE_SCRIPT_LOADRCT1,
|
|
||||||
TITLE_SCRIPT_LOADSC,
|
TITLE_SCRIPT_LOADSC,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user