1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-22 14:24:33 +01:00
Commit Graph

220 Commits

Author SHA1 Message Date
Michael Steenbeek
eb38b7227f Change WindowFlag to strong enum 2025-09-20 21:46:42 +02:00
Gymnasiast
472e048f69 Make WindowView into strong enum 2025-09-17 23:49:17 +02:00
Gymnasiast
ea5fc03dd0 Turn WindowDetail into strong enum 2025-09-17 23:35:10 +02:00
Gymnasiast
a662c5ef8e Change WindowClass members to use lowerCamelCase 2025-09-17 23:18:52 +02:00
Gymnasiast
c94babb06e Rename g_window_list to gWindowList 2025-09-17 23:16:17 +02:00
Gymnasiast
3a803e13e2 Change window functions to use lowerCamelCase 2025-09-17 20:10:12 +02:00
Gymnasiast
d4a0bca091 Rename Window fields 2025-09-17 20:10:12 +02:00
Gymnasiast
f46fea3bff Rename rct_windownumber to WindowNumber 2025-09-17 20:10:12 +02:00
Aaron van Geffen
832a1d1f74 Move localisation units into OpenRCT2 namespace 2025-09-11 22:11:12 +02:00
Michał Janiszewski
eb5dababc9 Fix a crash when closing windows would open other windows (#24972)
This could happen when trying to open a ride, which does not have
entrance or exit, from the ride list window. The `OnClose` handler would
want to open a window for placing said elements causing invalidation of
the window list.

20ac77904b/src/openrct2-ui/windows/RideConstruction.cpp (L324)
2025-08-16 01:07:07 +03:00
Garrett Leach
a8767ec4d8 Only add full initialized windows to the window list (#24859)
This removes the possibility of a race condition where a window is added to the window list but OnOpen has not been called. Many windows use OnOpen to set up required members so if say OnDraw is called it may use uninitialized members. For an example see ProgressWindow.
2025-08-01 17:03:30 +02:00
Michał Janiszewski
f6292b4c13 Use clang-format 20 (#24861)
https://clang.llvm.org/docs/ClangFormatStyleOptions.html
2025-07-31 11:01:48 +02:00
Gymnasiast
bdba89f428 Pass ScreenSize to window creation functions 2025-06-10 23:20:28 +02:00
Aaron van Geffen
dac097ce64 Rework news options into one tab in the news window 2025-06-10 21:13:05 +00:00
Gymnasiast
650fa3ae2e Rename WindowWidgetType to WidgetType and change for new code style 2025-06-10 19:55:12 +02:00
Matt
77511786b2 Merge pull request #24407 from ZehMatt/windows-storage
Eliminate more shared_ptr usage
2025-05-17 01:18:00 +03:00
ζeh Matt
e3fb47cf98 Fix flaw in BringToFront using the wrong iterator, ignore dead ones 2025-05-17 00:45:09 +03:00
ζeh Matt
39479d7b12 Use vector and unique_ptr for windows storage 2025-05-17 00:45:08 +03:00
Matt
42df41efdb Remove the use of shared_ptr for the Context (#24404)
* Replace shared_ptr with unique_ptr for Context systems, return refs

* Fix all the users

* clang-format fix

* Fix linux builds
2025-05-15 22:46:06 +03:00
ζeh Matt
e3062985c0 Fix code calling ViewportUpdatePosition this is incorrect 2025-04-25 17:48:37 +03:00
Gymnasiast
734c0959ef Widen WindowFlags to 32 bits 2025-04-19 14:07:02 +02:00
Aaron van Geffen
a8267412c2 Move title height helper functions to WindowBase and fix FlexUI plugins 2025-04-11 23:26:34 +02:00
Aaron van Geffen
3f87e2b67a Centralise ResizeFrame in WindowBase and call when setting widgets or resizing 2025-04-11 20:37:54 +02:00
Michael Steenbeek
8d1bb273d8 WIP: Make title bar bigger in Enlarged UI mode 2025-02-24 18:18:12 +01:00
Aaron van Geffen
807a2fa7c9 Merge objective options into scenario options 2025-03-13 13:57:03 +01:00
Aaron van Geffen
3747fd70d4 Force object selection window to close when changing scenes 2025-03-23 15:13:40 +01:00
Gymnasiast
4badffcdb6 Change GameState_t members to lowerCamelCase 2025-03-20 23:05:57 +01:00
Aaron van Geffen
7411b718bc Prevent closing object selection window when selection is invalid (#23968)
* EditorObjectSelectionWindowCheck: move window close out to caller side

* WindowManager: apply CanClose check again

* Amend changelog
2025-03-11 21:14:04 +01:00
Michael Steenbeek
8266447904 Split LOADSAVETYPE_* into LoadSaveAction and LoadSaveType 2025-03-06 21:06:39 +00:00
Michael Steenbeek
06c1fed4f7 Refactor gScreenFlags to LegacyScene enum 2025-03-05 20:45:04 +00:00
Gymnasiast
9cf02f3635 Refactor MODAL_RESULT_* to enum 2025-03-01 20:12:11 +01:00
Aaron van Geffen
5561c53bd3 Split FileBrowser and OverwritePrompt from LoadSave unit (#23851)
* Split FileBrowser and OverwritePrompt from LoadSave unit

* Introduce FileBrowser::OpenPreferred

* Refactor FileBrowser::GetTitleStringId into its own function

* Rewrite OpenSystemFileBrowser using designated initalisers

* Rename dateModified, dateFormatted, timeFormatted properties
2025-02-22 17:22:27 +01:00
Aaron van Geffen
2302f0d2e3 Rework Localisation includes (#23789)
* Clean up internal localisation header includes

* Remove some external localisation includes

* Remove dependency on FormatCodes.h from InteractiveConsole.h

* Reduce Formatter.h, Localisation.Date.h includes
2025-02-07 22:36:42 +01:00
Mathias Gibbens
3508b62c3a Guard against possible null pointer dereferences
Signed-off-by: Mathias Gibbens <gibmat@debian.org>
2025-02-02 21:04:36 +00:00
ζeh Matt
a80702c61f Fix #23707: Crash when plugins use a custom tool 2025-01-25 21:42:53 +02:00
Aaron van Geffen
cf448753c1 Move WindowInvalidate and WidgetInvalidate families into WindowManager (#23692)
* Move WindowInvalidate and WidgetInvalidate families into WindowManager

* Use InvalidateWidget shorthand in more places

* Cut back on UiContext includes

* Cut back on Window.h includes

* Remove outdated parameter comments
2025-01-25 13:46:08 +01:00
Aaron van Geffen
a8773dd805 Move WindowClose family into WindowManager (#23646)
* Replace WindowClose() calls with Close method calls where possible

* Move WindowClose family into WindowManager

* Remove UpdateSceneryGroupIndexes hack
2025-01-19 18:49:18 +01:00
Aaron van Geffen
5fbe8d0ae1 Centralise external window signatures in Windows.h (#23653) 2025-01-19 15:50:54 +01:00
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
Matt
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
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
ζeh Matt
9dfd4f3b19 Rename the callback types 2024-12-04 20:43:55 +02:00
ζeh Matt
53d1c27771 Fix a few more missing callback misuses 2024-12-04 18:46:56 +02:00
Michael Bernardi
8cc53324b6 Remove view width and height from Viewport struct 2024-09-27 00:07:40 +10:00
Michael Steenbeek
a53784551b Move _legacy.cpp contents to UI project (#22811) 2024-09-22 21:00:52 +02:00
Gymnasiast
4ff99d6fd1 Confine provisional paths to Footpath.cpp 2024-09-06 23:31:50 +02:00
Gymnasiast
ab3e919678 Move removal/restoring of provisional elements to UI project 2024-09-06 23:31:50 +02:00
Aaron van Geffen
0c97e44be0 Move GetInputManager and GetShortcutManager declarations (#22565) 2024-08-14 14:15:44 +01:00
Aaron van Geffen
6e444ea170 Split off MouseInput.h from Input.h (#22564)
* Move declarations from Input.h into new MouseInput.h

* Remove unused GetNextKey function from MouseInput.cpp
2024-08-14 14:14:16 +01:00