Commit Graph

41 Commits

Author SHA1 Message Date
Gymnasiast a15f72da87
Pass DPI by ref to string drawing 2023-02-24 22:05:07 +01:00
Duncan e09f27df3c
Rename snake_case Class names (Remaining Bits) (#19237)
* Rename snake_case Class names

* Clang format

* Fix build issues
2023-01-21 19:57:17 +00:00
Duncan 859b071ddc
Rename classes with snakes OpenRCT2/A*-F* (#19215)
* Rename classes with snakes OpenRCT2/A*-F*

* Clang format files
2023-01-19 08:16:44 +00:00
Hielke Morsink 6dafbbfb65
Rename global window functions to TitleCase (#19167) 2023-01-16 20:13:42 +00:00
James103 73738bbdc8
Replace 2022 with 2023 in copyright headers
Replace all instances of the year 2022 with 2023 in all copyright headers
2023-01-01 11:58:01 +01:00
Gymnasiast 38f7c2a159
Allow using ImageId in widgets directly 2022-12-31 15:18:22 +01:00
Gymnasiast 162b01204d
Rename rct_widget to Widget 2022-12-31 15:18:22 +01:00
Hielke Morsink 31dd4bf604
Use lower-case u integral suffix 2022-10-29 16:33:05 +02:00
73 b9e677945d
Replace 20XX with 2022 (#18158)
* Replace 2020 with 2022

Replace all 2020 headers with 2022

* replace other years with 2022

add missing years
2022-10-01 08:42:14 +01:00
Gymnasiast a088537b65
Rename rct_widgetindex to WidgetIndex 2022-08-21 18:49:23 +02:00
Hielke Morsink 7f29e4e39c
Make `rct_windowclass` strong type `WindowClass`
This already revealed some places where implicit conversions were done, including some where its use was nonsense (MouseInput.cpp).
The changes to the Intent class were necessary to keep things working, and this splits things up more neatly.
2022-08-21 18:38:25 +02:00
Hielke Morsink a258008bef
Refactor window functions to take references 4 2022-07-31 17:23:16 +02:00
Hielke Morsink 76c1bc8980
Refactor window functions to take references 1 2022-07-31 17:23:15 +02:00
Ted John da89a4e413
Remove rct_window::enabled_widgets (#16643)
`enabled_widgets` was used to enable input for widgets. However I do not recall anywhere this being used to specifically disable a widget which doesn't use the dedicated `disabled_widgets` flag. I don't think there is any purpose in keeping this, so I have removed all uses of it.
2022-02-13 23:06:19 +00:00
frutiemax adb692b74e Forward declare Formatter 2021-12-30 12:17:51 -05:00
Duncan 90d2be3ddd
Clang tidy Part 3: Ui Project Enum Names (#15986)
* Enum constant case

* Apply enum names clang tidy

* Rename scoped enum missed by clang-tidy
2021-11-26 14:25:34 +00:00
Duncan 23491c8125
Close #13800: Refactor Scenery Scatter Window to class (#15559)
* Start scenery scatter window refactor

Implemented OnOpen

* Implement OnClose

* Implement OnMouseUp

* Implement OnMouseDown

* Implement OnTextInput

* Implement OnPrepareDraw

* Implement OnDraw

* Remove legacy C declarations

* Fix mistake with pointer

* Apply const where possible

* Apply review comments

* Use std::clamp

* Use from_chars

Unsure if all platforms support this

* Use String::Parse
2021-11-23 22:17:41 +00:00
Duncan bb2c7dbaca
Clang tidy Part 1: Ui Project Function Names (#15956)
* Add NOLINT around STL using classes and vendor functions

* Apply clang-tidy to ui project function names

* Undo scripting clang-format

* Upper case OpenRCT2 and RCT2
2021-11-23 13:18:07 +00:00
Hielke Morsink 9dd9b27db4
Make WIDGETS_END constexpr 2021-09-26 11:11:42 +02:00
Duncan d2aca03ff6
Fix #15271. Use formatter to pass description args to text input (#15272)
* Fix #15271. Use formatter to pass description args to text input

Originally passed the variables via global vars which were not updated to 32bit during recent refactors. This removes the global and makes the interface cleaner and corrects the type

* Fix size of arguments
2021-08-24 19:12:05 +01:00
Gymnasiast 676ef7205e
Change all calls to DrawTextBasic to use Formatter 2021-08-01 15:14:43 +02:00
Hielke Morsink e54dc7e466
Use consistent left-shift notation for widgets (#14956) 2021-06-26 14:23:15 +02:00
Gymnasiast d5f79b7972
Replace gfx_draw_string_centred() with DrawTextBasic() 2021-02-28 00:23:00 +01:00
LRFLEW 601fa5629b
Fix Window IDX enum names 2021-01-13 23:00:35 +01:00
ffrogman 7ed1804e61
Fix #12410: Refactor WINDOW_WIDGET_TYPES to use strong enum (#13453)
* Fix #12410: Refactor WINDOW_WIDGET_TYPES to use strong enum
2020-11-27 00:14:20 -03:00
pizza2004 2015acd4c0
Refactor UI/Interface Window to Title Case (#13367) 2020-11-04 04:52:23 +00:00
pizza2004 b0fd5f93d7
Refactor UI/Interface misc to TitleCase (#13354)
* Refactor LandTool to Namespace

* Refactor Theme to TitleCase

* Refactor ViewportInteraction to TitleCase
2020-11-03 10:59:00 +00:00
Aaron van Geffen d27e14f45b
Compact, statically initialized syntax for event lists (#12973) 2020-09-28 20:36:15 +02:00
Tulio Leao 731a93dc39
Create WindowColour enum for widget definition calls (#12722)
* Make MakeWidget* functions take enum colour

* Make windows A-D use WindowColour enum

* Make windows E-G use WindowColour enum

* Make windows I-M use WindowColour enum

* Make windows N-P use WindowColour enum

* Make windows R-S use WindowColour enum

* Make windows T use WindowColour enum

* Make windows V-W use WindowColour enum
2020-08-28 23:31:31 -03:00
Aaron van Geffen 7b5087f057
Update copyright year to 2020 2020-07-21 15:04:34 +02:00
Aaron van Geffen 0a5b75e882
Refactor more windows into new-style widget format
* Ride Construction
* Ride List
* Save Prompt
* Scenery
* Scenery Scatter
* Server List
* Server Start
* Shortcut Keys
2020-07-19 19:36:54 +02:00
Aaron van Geffen 2e153a7e95 Introduce widget::midX and widget::midY helper functions 2020-06-25 10:31:15 +02:00
TomasZilinek 277080de74
Fix #11570 - create gfx_draw_string_centered() overload (#11760)
* Fix #11570 - create gfx_draw_string_centered() overload

I created the overload, updated all calls from the old function to the new and deleted the old one
2020-05-17 15:29:56 -03:00
Tulio Leao 724a6d4dcf Make rct_window use ScreenCoordsXY 2020-03-02 20:51:01 -03:00
Aaron van Geffen 423ed90112
Fix #10815: Vertical alignment of scatter tool area size label. (#10823) 2020-02-23 10:57:38 +01:00
Aaron van Geffen 9278ef7c61 Move ownership of scatter globals; delegate cleanup to close event. 2020-02-22 17:25:29 +01:00
Aaron van Geffen 5d9bcc083c Remove unused update event. 2020-02-22 17:25:29 +01:00
Aaron van Geffen 2528e94b48 Introduce low, medium, and high density buttons to the scatter tool.
Change window lay-out to more closely resemble others by introducing
density buttons, along with new sprites.

The amount of elements varies by density as follows:
* Low: number of elements equal to tool size
* Medium: twice as many elements as the tool size
* High: three times as many elements as the tool size.

Remove extraneous 'retry' clause.
2020-02-22 17:25:19 +01:00
Aaron van Geffen 642de8d11a Change gWindowSceneryScatterEnabled to bool, remove hack. 2020-02-22 17:20:46 +01:00
Aaron van Geffen 6f029055a3 Make scatter window themeable; default to scenario window style. 2020-02-22 16:18:35 +01:00
Anton Scharnowski e6e48363de Introduce Scenery-Scatter Tool Window. 2020-02-22 16:18:19 +01:00