For most of these cases, adding a trailing comma to the array block makes clang-format put each item on a new line, and clang-format exception blocks could be reduced where clang-format does not handle them properly.
* Fix custom currency window exchange rate
This was using the wrong size type for the money
* Change name of string id
This was being used by two windows and should be made generic
* Refactor window_dropdown_paint
- Use ScreenRect (#12098) and ScreenCoordsXY
- Move variables to a more local scope, with the appropriate types
- Reduce nesting in if statements
* Apply suggestions from code review
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
* Combine all screenCoords calculations in window_dropdown_paint
* Remove brackets from cellCoords calculation
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
* Close#13812: Refactor window to class: TrackList
* Close#13812: Refactor window to class: TrackList
* Remove misplaced include
* Refactor to CamelCase
* Remove forward declaration
* Fix unsafe string_view operation
* Access local widgets insted of global
* Override correct function
Co-authored-by: Makke <markuswetterberg1@gmail.com>
The scenery window will periodically reset the hover selection so that when you move the cursor out of the window it correctly switches to the actual selection. This leads to the price and description resetting for a singular tick which looks a bit odd and unexpected. To fix this instead when it tries to reset it first checks to see if the cursor is still over the hover selection and if it is does not reset the selection.
This commit ignores keypresses when the mod key is held.
The reasoning is that an odd interaction happens between SDL applications and
tiling window managers. Tiling window managers like Xmonad and i3 usually use
the mod ("windows") key and a number to change workspaces. When changing
workspaces, however, the WMs still send the number key through instead of
"eating" it. It's not clear why, exactly, but it seems universal.
Mod+1 -> Goes to workspace #1
Mod+2 -> Goes to workspace #2
...
Mod+9 -> Goes to workspace #9
Most applications don't even see the number key being sent, so if you move to
workspace 1, Firefox won't type "1" into the browser bar, Vim won't type "1"
into your file, etc. But SDL applications, for whatever reason, DO see this
keydown. Of course, they'll handle it like a regular key press. So if you move
to workspace 1, which contains OpenRCT, it inadvertently toggles x-ray mode.
I first found this bug in another SDL game, The Powder Toy. After some
discussion with the devs, they fixed it like this, by ignoring keydown events
when the mod key is pressed, since the mod key is reserved for the window
manager anyway. It works well and should be in the next release.
c7619387ac...93b920a57f
I did the same thing here.