mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-22 07:13:07 +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();
|
const uint8 * keysState = context_get_keys_state();
|
||||||
get_keyboard_map_scroll(keysState, &scrollX, &scrollY);
|
get_keyboard_map_scroll(keysState, &scrollX, &scrollY);
|
||||||
|
|
||||||
|
if (scrollX != 0 || scrollY != 0)
|
||||||
|
{
|
||||||
|
window_unfollow_sprite(mainWindow);
|
||||||
|
}
|
||||||
input_scroll_viewport(scrollX, scrollY);
|
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);
|
tool_set(w, WIDX_BACKGROUND, TOOL_CROSSHAIR);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tool_cancel();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case WIDX_OKAY:
|
case WIDX_OKAY:
|
||||||
if (_window_title_command_editor_insert)
|
if (_window_title_command_editor_insert)
|
||||||
@@ -683,17 +687,11 @@ static void window_title_command_editor_tool_down(rct_window * w, rct_widgetinde
|
|||||||
{
|
{
|
||||||
command.SpriteIndex = spriteIndex;
|
command.SpriteIndex = spriteIndex;
|
||||||
window_follow_sprite(w, (size_t)command.SpriteIndex);
|
window_follow_sprite(w, (size_t)command.SpriteIndex);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
command.SpriteIndex = SPRITE_INDEX_NULL;
|
|
||||||
command.SpriteName[0] = '\0';
|
|
||||||
window_unfollow_sprite(w);
|
|
||||||
}
|
|
||||||
tool_cancel();
|
tool_cancel();
|
||||||
window_invalidate(w);
|
window_invalidate(w);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void window_title_command_editor_invalidate(rct_window * w)
|
static void window_title_command_editor_invalidate(rct_window * w)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -84,6 +84,11 @@ void TitleScreen::StopPreviewingSequence()
|
|||||||
{
|
{
|
||||||
if (_previewingSequence)
|
if (_previewingSequence)
|
||||||
{
|
{
|
||||||
|
rct_window * mainWindow = window_get_main();
|
||||||
|
if (mainWindow != nullptr)
|
||||||
|
{
|
||||||
|
window_unfollow_sprite(mainWindow);
|
||||||
|
}
|
||||||
_previewingSequence = false;
|
_previewingSequence = false;
|
||||||
_currentSequence = title_get_config_sequence();
|
_currentSequence = title_get_config_sequence();
|
||||||
gPreviewingTitleSequenceInGame = false;
|
gPreviewingTitleSequenceInGame = false;
|
||||||
|
|||||||
@@ -566,7 +566,7 @@ private:
|
|||||||
void FixViewLocation()
|
void FixViewLocation()
|
||||||
{
|
{
|
||||||
rct_window * w = window_get_main();
|
rct_window * w = window_get_main();
|
||||||
if (w != nullptr)
|
if (w != nullptr && w->viewport_smart_follow_sprite == SPRITE_INDEX_NULL)
|
||||||
{
|
{
|
||||||
if (w->width != _lastScreenWidth ||
|
if (w->width != _lastScreenWidth ||
|
||||||
w->height != _lastScreenHeight)
|
w->height != _lastScreenHeight)
|
||||||
|
|||||||
Reference in New Issue
Block a user