Skip to content

Fix Go To window not raising event on index 0#969

Merged
chreden merged 3 commits intomasterfrom
bug/968
May 8, 2022
Merged

Fix Go To window not raising event on index 0#969
chreden merged 3 commits intomasterfrom
bug/968

Conversation

@chreden
Copy link
Copy Markdown
Owner

@chreden chreden commented May 6, 2022

If the user entered 0 as the index in the GoTo window ImGui would not return true for that - so the on_selected event was never raised. Instead we also raise the event in the section that closes the dialog on escape/enter - it is still raised in the InputInt check as the +/- arrows trigger that path.

Also change ViewerUI to pass the currently selected room/item as an initial value when making the GoTo window visible. This is a bit nicer than it always being at 0.

Bug reported by @TempleOfHorus

Closes #968

If the user entered 0 as the index in the `GoTo` window ImGui would not return true for that - so the `on_selected` event was never raised. Instead we also raise the event in the section that closes the dialog on escape/enter - it is still raised in the `InputInt` check as the +/- arrows trigger that path.

Also change `ViewerUI` to pass the currently selected room/item as an initial value when making the `GoTo` window visible. This is a bit nicer than it always being at 0.

Closes #968
@chreden chreden added this to the Next milestone May 6, 2022
@chreden chreden requested a review from makotocchi May 6, 2022 23:40
@chreden chreden self-assigned this May 6, 2022
chreden added 2 commits May 7, 2022 01:00
Update missed mocks and tests
#968
If negative number is entered, don't raise the event and don't set it back to 0.
Add a test for it.
#968
@chreden chreden merged commit efc3a19 into master May 8, 2022
@chreden chreden deleted the bug/968 branch May 8, 2022 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Go To Window doesn't raise event for room/item 0 when entering text

2 participants