Commit Graph
162 Commits
Author SHA1 Message Date
Aaron van Geffen bed4d5bdca Move WindowCreate and WindowFocusOrCreate into WindowManager (#23643)
* Move WindowBringToFront into WindowManager

* Move WindowCreate and WindowFocusOrCreate into WindowManager

* Cut back on Context/UiContext includes
2025-01-19 06:58:28 -03:00
MattandAaron van Geffen b9f6b6f754 Refactor widgets state (#23621)
* Refactor windows to not share widget state

* First half of refactoring all the windows

* Refactor the remaining windows, compiles but has issues

* Fix drawing only every second widget

* Remove the need of an terminating widget

* Address WidgetIndex signedness issues; use kWidgetIndexNull more

* Address constexpr issue with Widget content union

* Fix tabs in scenery window

* Fix tabs in object selection window

* Adjust custom widget index for CustomTool events

* Use STR_NONE for default tooltip initialisation

* Adjustment for mingw compiler

* Fix bottom toolbar using the widget declaration not instance

* Remove pointless code in Guest window, handled by SetPage

* Prevent out of bounds crash

* Move scroll widgets initialization to SetPage in Cheats window

* Remove special logic in Options window

* Remove special logic in Park window

* Remove special logic for Player window

* Remove special logic for Research window

* Remove special logic for Ride window

* Remove special logic for Staff window

* Remove special logic for Finances window

* Remove special logic for MapGen window

* Remove special logic for editor objective options window

* Remove special logic for editor scenario options window

* Fix widgets not being set since page is initialized to 0

* Remove more redundant code

* Fix remaining access to widget declarations

* Remove unused variable

* Fix editor object selection tabs on successive windows

---------

Co-authored-by: Aaron van Geffen <aaron@aaronweb.net>
2025-01-18 13:45:17 +01:00
Aaron van Geffen 805c8e2a11 Plugin: allow scripts to specify tab colour maps (#23583) 2025-01-13 23:47:30 +01:00
Aaron van Geffen aa45247f21 Move WindowFind functions into WindowManager (#23517)
* Move WindowFind* functions into WindowManager

* Update parameter documentation where applicable
2025-01-08 21:12:11 +01:00
Aaron van Geffen fa06a49302 Update copyright year to 2025 (#23514) 2024-12-31 20:30:04 +01:00
Aaron van Geffen 2a3a72396b Remove ImageId::FromUInt32 and ToUInt32 (#23415)
* Allow high image ids when rendering an inline sprite

* CustomWindow: refactor use of ImageId::FromUInt32

* Dropdown: refactor use of ImageId::FromUInt32, ToUInt32

* Remove ImageId::FromUInt32

* Fix typo in mechanic status string ids

* Rewrite InventoryFormatItem to not use inline sprites any more

* Widget: replace ImageId::ToUInt32 with ImageId::GetIndex

* Remove ImageId::ToUInt32
2024-12-17 21:26:11 +01:00
Michael Bernardi e7ca356633 Replace big window size limits with int16_t max. 2024-12-10 02:09:05 +11:00
Aaron van Geffen 3685d1a24b clang-format: change IndentPPDirectives to BeforeHash (#23287) 2024-11-29 12:04:56 +09:00
Michael Bernardi 8cc53324b6 Remove view width and height from Viewport struct 2024-09-27 00:07:40 +10:00
Aaron van Geffen 896eb4f488 Consolidate FormatStringIDLegacy, FormatStringToUpper into Formatting 2024-07-13 14:09:58 +02:00
Arnold Zhou 0254b570d8 Dukvalue uint int fixes 2024-06-06 21:39:22 +02:00
Gymnasiast 8a181b5513 Split colours and colour flags 2024-05-26 12:35:40 +02:00
Aaron van Geffen 10c97c6599 CustomWindow: change spinner button order to match internal windows 2024-05-22 19:59:16 +02:00
Aaron van Geffen 57bdae9d49 Refactor WindowOtherWheelInput to be safer and script window compatible 2024-05-18 15:59:12 +02:00
Aaron van Geffen 828aeadf5b Deal with -Wdeprecated-anon-enum-enum-conversion warnings 2024-05-11 11:24:01 +02:00
Aaron van Geffen ef4cad5ee3 Move UI exclusive string ids to UiStringIds.h 2024-05-10 23:24:46 +02:00
duncanspumpkin bd3ae5cbb9 Simplify setting existing text 2024-04-26 18:27:14 +02:00
Duncan 3146d463bd Move Ui header items to OpenRCT2::Ui (#21546)
* Move ui definitions to ui project

* Enforce coding style

* Apply clang format

* Add clang tidy ignore

* Increase compiler happiness
2024-03-09 14:15:45 +00:00
mrmbernardi 4ccecd6e68 Remove forwarding functions in Window.cpp (#21516) 2024-03-03 18:04:09 +01:00
James103 1d8dc111f1 Replace 2023 with 2024 in copyright headers (#21139)
Replace all instances of the year 2023 with 2024 in all copyright headers
2024-01-01 12:52:28 +01:00
Duncan 77dd3cf8e2 Move all construction related logic into OnOpen (#20632) 2023-09-07 08:20:28 +02:00
Duncan 4349688de4 These function names have not reflected their use for a while (#20656) 2023-08-01 20:19:33 +01:00
Duncan ce86aa029f Remove custom_info pointer (#20480)
* Remove custom_info pointer

* Formatting
2023-07-18 06:24:42 +01:00
Gymnasiast 11de002a55 Fix #20417: Plugin windows missing the left title bar border 2023-06-18 22:45:35 +02:00
Michael Steenbeek 5e495d63c7 Close #15660: Allow showing window buttons on the left (#20176) 2023-05-19 10:17:38 +02:00
Michał Janiszewski f1c79f6ac4 Iterate widgets only until last (#20116) 2023-05-07 20:37:06 +00:00
Duncan cdccb21dd5 Refactor of colours (#19998)
* Move dropdown functions to dropdown code

* Use a map for the colour tip

* Keep dropdownidx and colour seperated

* Allow number of rows to match vanilla

* Apply review comment

* Bump network version
2023-04-22 08:58:13 +00:00
Gymnasiast 91f4c1e752 Use dpi ref in misc drawing functions 2023-04-11 22:59:03 +01:00
Gymnasiast 0139c8d19e Use dpi ref in everything outside the drawing folder 2023-04-11 22:57:25 +01:00
Gymnasiast 96d77ed8f7 Using dpi refs in most remaining window defs 2023-04-11 22:57:23 +01:00
Gymnasiast 9c2d5b9fef Make GfxDrawSprite() take reference 2023-04-11 22:53:30 +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
Duncan 5ee79fe65b Address all snake_case functions in ui/scripting 2023-01-17 23:50:27 +01:00
Gymnasiast 5309c80e29 Remove snake_case in interface folder 2023-01-16 22:20:41 +01:00
Hielke Morsink 6dafbbfb65 Rename global window functions to TitleCase (#19167) 2023-01-16 20:13:42 +00:00
Duncan 7f5934cc95 Remove snake_case from second chunk of Drawing (#19166) 2023-01-16 18:52:17 +00:00
Duncan 8a8d3105f3 Remove snake_case from first chunk of Drawing (#19164)
* Remove snake_case from first chunk of Drawing

* Address formatting
2023-01-16 13:50:43 +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
Gymnasiast b97ee766d5 Refactor out IMAGE_TYPE_REMAP from widgets 2022-12-31 15:16:07 +01:00
spacek531andMichael Steenbeek 44100234c3 Fix #18665, #18559: Add API for getting g2 icons by name
Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2022-12-12 23:03:16 +00:00
Basssiiie 5396368274 [Plugin] Fix crash when reading widget property on window that has both static and tab content (#18620) 2022-11-19 08:29:01 -03:00
Michael Steenbeek 6fe19878f6 More ImageId cleanup (#18258)
* Remove more usages of uint32 image indices

* Remove unused gfx_get_sprite_size()

* Remove uint32 images from text drawing

* Remove now-unused ImageId overload

* Default-initialise ttfRunIndex

* Suppress false-alarm GCC error
2022-10-10 19:42:40 +01:00
Stephan Spengler 9e1937d144 [Plugin] Widget tooltips can now be read and changed 2022-10-03 20:50:19 +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
Stephan Spengler 1b5f50fd32 Fix #17974: Setting tabIndex of custom window does not work 2022-09-06 22:17:40 +02:00
Henry Cheng 5f24099f39 Close #17868: Allow scripting to change active tab 2022-08-31 23:13:02 +02:00
Gymnasiast a088537b65 Rename rct_widgetindex to WidgetIndex 2022-08-21 18:49:23 +02:00