Commit Graph

2918 Commits

Author SHA1 Message Date
Sijmen ebedf83176
Format ServerList.cpp (#15625) 2021-10-20 21:26:01 -03:00
Steve Blythe b15dc66acb
Part of #12098: Use ScreenRect in gfx_filter_rect() (#15603) 2021-10-20 19:43:32 -03:00
ζeh Matt 60422960a3
Merge pull request #15616 from ZehMatt/fix-15006
Fix #15006: Prevent allocating empty texture atlases
2021-10-20 10:46:57 -07:00
ζeh Matt ea0b8840ac
Merge pull request #15610 from ZehMatt/refactor/stringvariant
Replace StringVariant with std::variant
2021-10-20 10:46:42 -07:00
Michael Steenbeek 62a9096079
Fix #15466: Crash when opening dropdown with 0 rows 2021-10-20 18:50:21 +02:00
ζeh Matt 6a219b2481
Fix #15006: Prevent allocating empty texture atlases 2021-10-20 19:02:15 +03:00
ζeh Matt 7fc49fca39
Replace StringVariant with std::variant 2021-10-20 16:35:58 +03:00
ζeh Matt 8e06d84a09
Refactor result passing of TrackDesignAction 2021-10-20 16:08:21 +03:00
ζeh Matt e06f9c3ee7
Refactor result passing of TrackPlaceAction 2021-10-20 14:15:24 +02:00
Hielke Morsink 9dd20ec619
Improve array formatting
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.
2021-10-17 18:21:45 +02:00
Duncan fe46a2cf09
Fix Custom Currency window (#15596)
* 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
2021-10-17 14:56:11 +01:00
Hielke Morsink c01aedf32e
Merge pull request #15578 2021-10-16 23:28:02 +02:00
Hielke Morsink aff3b41feb
Refactor research status drawing code 2021-10-16 19:32:54 +02:00
Gymnasiast eb14c426fd
Rename research_remove() to ResearchRemove() 2021-10-15 17:01:04 +02:00
Gymnasiast 5cf4a53b66
Make research_remove take const ref 2021-10-15 16:21:14 +02:00
hjort96 eba2041aaa
Close #13791: Refactor window to class Options (#15558)
* Create class OptionsWindow. Moving functions to class.

* Move functions to class OptionsWindow

* Fix coding style

Co-authored-by: hjort96 <jonathan.hjorth96@hotmail.com>
2021-10-15 10:41:30 +01:00
Sijmen 83a3da0a28
Refactor window_dropdown_paint (Part of #12098) (#15574)
* 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>
2021-10-14 20:46:45 -03:00
Hielke Morsink c2d3ca5f85
Automatically deduce std::array types
This also improves formatting of some arrays with weird or no indention.
2021-10-14 23:27:28 +02:00
Duncan dc6a8a6235
Refactor ObjectLoadError to class (#15573)
* Move into class

* Refactor names and const

* Apply review comments
2021-10-14 16:53:48 +01:00
Makke94 780ebea3f0
Refactor TrackList Window into class (#13812) (#15533)
* 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>
2021-10-14 15:35:40 +01:00
ζeh Matt b4cd8e4628
Fix #15560: Memory leak due to OpenGL Renderer not releasing a texture 2021-10-11 21:01:11 +02:00
Michael Steenbeek 6ea0d8639d
Merge pull request #15552 from CookiePLMonster/fix-15227
Fix Object Selection not tearing down objects properly
2021-10-11 09:30:33 +02:00
Duncan 961d51eae4
Fix hovering on scenery window showing incorrect hover for 1 tick
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.
2021-10-10 12:17:52 +02:00
Duncan 5ee78213b2
Port over research == operator from NSF 2021-10-10 12:09:26 +02:00
adam-bloom 793eba68d1 add additional comments on SDL resolution 2021-10-09 15:00:30 -06:00
adam-bloom 3efae5bff7 minor changes and point at alpha dependencies 2021-10-09 14:59:58 -06:00
Silent 3e64a227e5
Fix Object Selection not freeing the object when unhovering
Fixes a double-free on previews.
2021-10-09 21:48:43 +02:00
Michał Janiszewski 1b4875e528 Extract math-related functions from common.h to Math.hpp
Saves wide inclusion of <stdexcept> header, which pulls in <string>
2021-10-09 21:43:06 +02:00
Michael Steenbeek 15897c23a1
Merge pull request #15498 from duncanspumpkin/sceneryWindow
Backport scenery window from NSF
2021-10-09 17:13:36 +02:00
ζeh Matt 05e58cda11
Merge pull request #15538 from ZehMatt/feature/parallel-draw
Implement multithreaded drawing
2021-10-09 05:53:48 -07:00
seanmajorpayne e8b6e24498
Fix #15451: Guest List name filter remains after group selection 2021-10-09 12:49:26 +02:00
Gaven Rendell 86cf0dc916 Remove Windows check 2021-10-08 21:27:48 +01:00
Gaven Rendell 33fa31e6d0 Exclude Win/Mac from ignoring mod key 2021-10-08 21:25:36 +01:00
Gaven Rendell 7787bb46e0 Handle mod key edge-cases in tiling WMs
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.
2021-10-08 21:25:33 +01:00
Ted John 6b965074ec
Merge pull request #15527 from hjort96/refactor-window-ViewClipping
Close #13813 : Refactor window to class: ViewClipping
2021-10-08 13:57:25 +01:00
seanmajorpayne 25419bb4e3
Fix #15197: Cannot place flat ride after removing it in construction
Demolishing a flat ride (using the bulldozer icon in the construction menu) will now reopen the construction window to it's default state.
2021-10-08 00:13:04 +02:00
hjort96 dba34d2c17 Removed a line 2021-10-07 22:38:12 +02:00
Duncan fd18ac7f85
Modify StaffSetPatrolAreaAction to have three modes (#15494)
* Modify StaffSetPatrolAreaAction to have three modes

* Actually serialise mode

* Apply review comments

* Increment network version

* Apply review comment

* Update replay
2021-10-07 18:02:24 +01:00
hjort96 9d57e93df9 Add suggestions from review. 2021-10-07 16:21:19 +02:00
ζeh Matt a0e7752f26
Pass rct_drawpixelinfo explicit to avoid races 2021-10-06 23:48:07 +03:00
duncanspumpkin d7053784f2 Fix unresearched scenery groups showing 2021-10-06 17:11:08 +01:00
ζeh Matt c054967230
Merge pull request #15530 from ZehMatt/refactor/wallplaceaction-result
Refactor action result passing for WallPlaceAction
2021-10-06 08:50:57 -07:00
Bepso c44d1151c2
Close #13766 : Refactor Clear Scenery to class (#15481)
* Add CleanScenery class
2021-10-06 16:46:01 +01:00
duncanspumpkin 9e227c1e2f Add const where possible 2021-10-06 16:44:07 +01:00
duncanspumpkin fea69cc86c Backport scenery window from NSF
Co-authored-by: IntelOrca <IntelOrca@users.noreply.github.com>
Co-authored-by: Gymnasiast <Gymnasiast@users.noreply.github.com>
2021-10-06 16:44:05 +01:00
ζeh Matt 976d15ce10
Merge pull request #15529 from ZehMatt/refactor/smallsceneryplaceaction-result
Refactor action result passing for SmallSceneryPlaceAction
2021-10-06 08:32:16 -07:00
ζeh Matt d2ffeaa7b0
Refactor action result passing for WallPlaceAction 2021-10-06 18:31:09 +03:00
ζeh Matt 9cb26f7b02
Refactor action result passing for SmallSceneryPlaceAction 2021-10-06 16:12:37 +03:00
Hielke Morsink 782220b42b
Show "Update available" in all game-options dropdowns
Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2021-10-06 15:02:35 +02:00
hjort96 763c31ce5b Fix clang-format 2021-10-05 20:06:17 +02:00