This commit is contained in:
Harry Hopkinson 2024-05-10 01:49:50 +00:00 committed by GitHub
commit 6363b9b8be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 19 additions and 3 deletions

View File

@ -11,6 +11,7 @@
0.4.11 (2024-05-05)
------------------------------------------------------------------------
- Feature: [#11512] Coloured usernames by group on multiplayer servers.
- Feature: [#21656] Save the currently following entity into the save file.
- Feature: [#21734] Park admittance price can now be set via text input.
- Feature: [#21957] [Plugin] Expose whether the game is paused to the plugin API.
- Improved: [#21728] “Fix all rides” cheat now also works if a mechanic is already fixing the ride.

View File

@ -361,6 +361,12 @@ void GameLoadInit()
auto& gameState = GetGameState();
windowManager->SetMainView(gameState.SavedView, gameState.SavedViewZoom, gameState.SavedViewRotation);
if (gameState.CurrentlyFollowingEntity != EntityId::GetNull())
{
auto* mainWindow = WindowGetMain();
WindowFollowSprite(*mainWindow, gameState.CurrentlyFollowingEntity);
}
if (NetworkGetMode() != NETWORK_MODE_CLIENT)
{
GameActions::ClearQueue();

View File

@ -126,6 +126,7 @@ namespace OpenRCT2
ScreenCoordsXY SavedView;
uint8_t SavedViewRotation;
ZoomLevel SavedViewZoom;
EntityId CurrentlyFollowingEntity{ EntityId::GetNull() };
ObjectEntryIndex LastEntranceStyle;

View File

@ -1751,6 +1751,7 @@ void WindowFollowSprite(WindowBase& w, EntityId spriteIndex)
if (spriteIndex.ToUnderlying() < MAX_ENTITIES || spriteIndex.IsNull())
{
w.viewport_smart_follow_sprite = spriteIndex;
GetGameState().CurrentlyFollowingEntity = spriteIndex;
}
}
@ -1758,6 +1759,7 @@ void WindowUnfollowSprite(WindowBase& w)
{
w.viewport_smart_follow_sprite = EntityId::GetNull();
w.viewport_target_sprite = EntityId::GetNull();
GetGameState().CurrentlyFollowingEntity = EntityId::GetNull();
}
Viewport* WindowGetViewport(WindowBase* w)

View File

@ -599,7 +599,7 @@ namespace OpenRCT2
void ReadWriteInterfaceChunk(GameState_t& gameState, OrcaStream& os)
{
os.ReadWriteChunk(ParkFileChunkType::INTERFACE, [&gameState](OrcaStream::ChunkStream& cs) {
os.ReadWriteChunk(ParkFileChunkType::INTERFACE, [&gameState, &os](OrcaStream::ChunkStream& cs) {
cs.ReadWrite(gameState.SavedView.x);
cs.ReadWrite(gameState.SavedView.y);
if (cs.GetMode() == OrcaStream::Mode::READING)
@ -612,6 +612,12 @@ namespace OpenRCT2
cs.Write(static_cast<int8_t>(gameState.SavedViewZoom));
}
cs.ReadWrite(gameState.SavedViewRotation);
if (os.GetHeader().TargetVersion >= PARK_FILE_CURRENT_VERSION)
cs.ReadWrite(gameState.CurrentlyFollowingEntity);
else
gameState.CurrentlyFollowingEntity = EntityId::GetNull();
cs.ReadWrite(gameState.LastEntranceStyle);
cs.ReadWrite(gameState.EditorStep);
});

View File

@ -11,10 +11,10 @@ namespace OpenRCT2
struct GameState_t;
// Current version that is saved.
constexpr uint32_t PARK_FILE_CURRENT_VERSION = 33;
constexpr uint32_t PARK_FILE_CURRENT_VERSION = 34;
// The minimum version that is forwards compatible with the current version.
constexpr uint32_t PARK_FILE_MIN_VERSION = 33;
constexpr uint32_t PARK_FILE_MIN_VERSION = 34;
// The minimum version that is backwards compatible with the current version.
// If this is increased beyond 0, uncomment the checks in ParkFile.cpp and Context.cpp!