mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-10 09:32:29 +01:00
Fix: Following canceling
Stop previewing sequence now unfollows the current sprite. Using the arrow keys in-game cancels following. Resizing the window no longer cancels following.
This commit is contained in:
committed by
Aaron van Geffen
parent
298420fd1e
commit
907f18fd69
@@ -101,6 +101,10 @@ static void game_handle_key_scroll()
|
||||
const uint8 * keysState = context_get_keys_state();
|
||||
get_keyboard_map_scroll(keysState, &scrollX, &scrollY);
|
||||
|
||||
if (scrollX != 0 || scrollY != 0)
|
||||
{
|
||||
window_unfollow_sprite(mainWindow);
|
||||
}
|
||||
input_scroll_viewport(scrollX, scrollY);
|
||||
}
|
||||
|
||||
|
||||
@@ -360,6 +360,10 @@ static void window_title_command_editor_mouseup(rct_window * w, rct_widgetindex
|
||||
{
|
||||
tool_set(w, WIDX_BACKGROUND, TOOL_CROSSHAIR);
|
||||
}
|
||||
else
|
||||
{
|
||||
tool_cancel();
|
||||
}
|
||||
break;
|
||||
case WIDX_OKAY:
|
||||
if (_window_title_command_editor_insert)
|
||||
@@ -683,15 +687,9 @@ static void window_title_command_editor_tool_down(rct_window * w, rct_widgetinde
|
||||
{
|
||||
command.SpriteIndex = spriteIndex;
|
||||
window_follow_sprite(w, (size_t)command.SpriteIndex);
|
||||
tool_cancel();
|
||||
window_invalidate(w);
|
||||
}
|
||||
else
|
||||
{
|
||||
command.SpriteIndex = SPRITE_INDEX_NULL;
|
||||
command.SpriteName[0] = '\0';
|
||||
window_unfollow_sprite(w);
|
||||
}
|
||||
tool_cancel();
|
||||
window_invalidate(w);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -84,6 +84,11 @@ void TitleScreen::StopPreviewingSequence()
|
||||
{
|
||||
if (_previewingSequence)
|
||||
{
|
||||
rct_window * mainWindow = window_get_main();
|
||||
if (mainWindow != nullptr)
|
||||
{
|
||||
window_unfollow_sprite(mainWindow);
|
||||
}
|
||||
_previewingSequence = false;
|
||||
_currentSequence = title_get_config_sequence();
|
||||
gPreviewingTitleSequenceInGame = false;
|
||||
|
||||
@@ -566,7 +566,7 @@ private:
|
||||
void FixViewLocation()
|
||||
{
|
||||
rct_window * w = window_get_main();
|
||||
if (w != nullptr)
|
||||
if (w != nullptr && w->viewport_smart_follow_sprite == SPRITE_INDEX_NULL)
|
||||
{
|
||||
if (w->width != _lastScreenWidth ||
|
||||
w->height != _lastScreenHeight)
|
||||
|
||||
Reference in New Issue
Block a user