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

206 Commits

Author SHA1 Message Date
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
Michael Steenbeek
e813532efb Close #15750: Multiple park entrance types in one park (#21909)
* Add new park entrance placement window

* Start entrance tool as soon as window opens;

* Rename constants to conform to current code standards

* Increment PARK_FILE_CURRENT_VERSION

* Increment kNetworkStreamVersion

Co-authored-by: Aaron van Geffen <aaron@aaronweb.net>
2024-08-04 23:02:16 +00:00
Aaron van Geffen
706fd8f3f0 Fix #21175: Some hotkeys don't work when toolbars are hidden 2024-07-31 21:54:10 +02:00
Aaron van Geffen
67fa13f4ac Move window shim definitions into Widget.h (#22412)
* Move window shim definitions into Widget.h

* Remove unnecessary TileInspectorGlobals.h include from Window.h

* Remove Ride.h include from Window.h
2024-07-29 22:31:57 +02:00
Aaron van Geffen
5ae97d4d3b Move title version info to its own window (#22302) 2024-07-15 22:33:01 +03:00
Aaron van Geffen
c9de56471d Allow customising the progress string format
Fixup: deal with -Wdeprecated-anon-enum-enum-conversion warning
2024-05-20 21:37:40 +02:00
Aaron van Geffen
804f63e52a Use new progress window for network transfers 2024-05-20 20:53:37 +02:00
Aaron van Geffen
539bb5487e Introduce context functions and intents for progress window 2024-05-20 16:28:00 +02:00
Aaron van Geffen
e6fac7f870 Introduce progress/loader window 2024-05-19 22:05:05 +02:00
Aaron van Geffen
a63d86c488 Introduce Config namespace and struct 2024-05-10 12:10:21 +02:00
Aaron van Geffen
347ce53f26 Re-introduce message on successful screenshot (#21983)
* Re-introduce message on successful screenshot

* Automatically close previous screenshot notices before new ones
2024-05-10 15:04:12 +02:00
Duncan
5a70fd97fb Move vehicle sounds update into Ui library (#21577)
* Move vehicle sounds update into Ui library

* Add missing statics

* Apply review comments

* Sprinkle some const

* Clang format accumulate
2024-03-20 11:14:52 +00:00
CoryY
3f81a491b0 Close #21569: Remove 'Window' from Window Open function names (#21613)
* Close #21569: Remove 'Window' from Window Open function names

Windows are all under the OpenRCT2::Ui::Windows namespace. As such, "Window" is removed from the Open functions names.

* Update Contributors.md

* Fix formatting TrackMangeOpen

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>

* Fix formatting TrackPlaceOpen

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>

---------

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2024-03-17 06:37:46 +00:00
Duncan
7a60e7f2e0 OpenRCT2::Ui::Windows namespace for OpenRCT2 Ui Windows (#21559)
* Move all the windows into OpenRCT2::Ui::Windows namespace

* Fix missing symbol

* Clang format

* Call the correct FormatStringID
2024-03-10 13:52:35 +00:00
ζeh Matt
2661cf8772 Refactor out all uses of gCurrentRotation, remove gCurrentRotation 2024-03-05 10:23:28 +02:00