1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-19 21:13:05 +01:00

Feature: Preview title sequences in-game

Title sequences can now be played back in-game, allowing for much easier
editing.

Improved title sequence playback in general. Clicking play while on a
different title sequence will play the new one. Clicking stop will make
the title screen go back to the config title sequence. And the closing
the title sequence window will also make the game go back to the config
title sequence, and reload the sequence if it was modified.

Changes made to title sequences in-game are now correctly loaded in the
title screen.

Starting a title sequence within the editor will now always reset it
even if it's the current playing sequence. (Not for playing in the
editor though).

Get Location in title sequence command editor now has 100% accuracy
compared to before
where it would usually get some offset value.

Added `get_map_coordinates_from_pos_window` which will allow getting the
viewport coordinates of a specific window even if the input coordinates
are under another window. This has use with getting 2D positions from
the main window without the other windows getting in the way.

Options window will now always specify the config title sequence in the
dropdown and not the current title sequence.

Made a global variable `gLoadKeepWindowsOpen`, in game.h to keep windows
open when loading a park. When loading a title sequence park in-game.
The sequence player will force-close all park-specific windows ahead of
time.

Skipping while testing title sequences no longer needs to reload the
park if the current playback position is already before the target
position and ahead of the load position.

Added changelog entry.
This commit is contained in:
Robert Jordan
2017-10-30 07:07:01 -04:00
committed by Michael Steenbeek
parent dd4f5ff93b
commit a3c64bb146
15 changed files with 226 additions and 103 deletions

View File

@@ -58,9 +58,13 @@ uint16 TitleScreen::GetCurrentSequence()
return _currentSequence;
}
void TitleScreen::SetCurrentSequence(uint16 value)
void TitleScreen::SetCurrentSequence(uint16 value, bool loadSequence)
{
_currentSequence = value;
if (loadSequence)
{
TryLoadSequence();
}
}
bool TitleScreen::ShouldHideVersionInfo()
@@ -103,7 +107,7 @@ void TitleScreen::Load()
if (_sequencePlayer != nullptr)
{
_sequencePlayer->Reset();
_sequencePlayer->Begin(_currentSequence);
// Force the title sequence to load / update so we
// don't see a blank screen for a split second.
@@ -187,7 +191,7 @@ void TitleScreen::TitleInitialise()
IScenarioRepository * scenarioRepository = GetScenarioRepository();
_sequencePlayer = CreateTitleSequencePlayer(scenarioRepository);
}
size_t seqId = title_sequence_manager_get_index_for_config_id(gConfigInterface.current_title_sequence_preset);
size_t seqId = title_get_config_sequence();
if (seqId == SIZE_MAX)
{
seqId = title_sequence_manager_get_index_for_config_id("*OPENRCT2");
@@ -283,6 +287,11 @@ extern "C"
}
}
uint16 title_get_config_sequence()
{
return (uint16)title_sequence_manager_get_index_for_config_id(gConfigInterface.current_title_sequence_preset);
}
uint16 title_get_current_sequence()
{
uint16 result = 0;
@@ -293,11 +302,11 @@ extern "C"
return result;
}
void title_set_current_sequence(uint16 value)
void title_set_current_sequence(uint16 value, bool loadSequence)
{
if (_singleton != nullptr)
{
_singleton->SetCurrentSequence(value);
_singleton->SetCurrentSequence(value, loadSequence);
}
}