1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-19 04:53:12 +01:00
Commit Graph

137 Commits

Author SHA1 Message Date
Michael Bernardi
1bc0eca74c Remove unused includes 2025-06-17 22:42:13 +10:00
Michael Steenbeek
7b322d825a Refactor constants in window .cpp files 2025-06-16 23:10:47 +02:00
Gymnasiast
81e3181ebb Pass ScreenSize to makeWindowShim() 2025-06-10 23:21:15 +02:00
Gymnasiast
bdba89f428 Pass ScreenSize to window creation functions 2025-06-10 23:20:28 +02:00
Gymnasiast
650fa3ae2e Rename WindowWidgetType to WidgetType and change for new code style 2025-06-10 19:55:12 +02:00
Gymnasiast
149468406b Update WindowColour enum for new code style 2025-06-10 19:53:12 +02:00
Gymnasiast
86e265f093 Make widget creation functions lowerCamelCase 2025-06-10 19:51:21 +02:00
Aaron van Geffen
a4e92770fd Defer temp object Load/Unload to calling side 2025-05-28 00:58:25 +02:00
Aaron van Geffen
342f10a63c Load scenario previews using temp objects too 2025-05-27 23:17:25 +02:00
Aaron van Geffen
d51a1754b4 Work around TryClassifyFile not working with .sea files 2025-05-25 22:21:08 +02:00
Aaron van Geffen
0f59d6dd02 Optionally allow scenario previews to use screenshots 2025-05-21 18:07:19 +02:00
Aaron van Geffen
ed6aa6c356 Show 'loading' stub while preview is being loaded 2025-05-16 21:44:57 +02:00
Aaron van Geffen
7cd59ab75f Create park preview images from scenario meta objects 2025-05-16 14:33:21 +02:00
Aaron van Geffen
0779b9f0ab Replace window shim and widget macros with constexpr functions (#24566) 2025-06-07 23:02:14 +02:00
Aaron van Geffen
f64d5bb4a6 Implement OnLanguageChange event for ScenarioSelect window (#24519) 2025-05-28 00:31:43 +02:00
Aaron van Geffen
3721dbdffa ScenarioSelect: load minimap using background worker (#24436) 2025-05-18 15:45:11 +02:00
Matt
6335c31336 Rename DrawPixelInfo to RenderTarget (#24339)
* Begin backend separation, rename type DrawingPixelInfo to RenderTarget

* Rename dpi variables to rt
2025-05-04 22:06:46 +00:00
Aaron van Geffen
3f87e2b67a Centralise ResizeFrame in WindowBase and call when setting widgets or resizing 2025-04-11 20:37:54 +02:00
Garrett Leach
a8c476a9a2 Fix crash from failing to open file for preview (#24171)
If the file open fails in FileStream it will throw an IOException. We now capture that exception in the existing catch.
2025-04-07 21:26:10 +00:00
Aaron van Geffen
2d32c8766c Draw minimap in scenario selection screen for .park based scenarios 2025-03-09 17:49:41 +01:00
Gymnasiast
be31812fa8 Create strong enum for ScenarioSelectMode 2025-03-25 15:09:23 +01:00
Gymnasiast
a8982ac113 Rename SCENARIO_CATEGORY and turn into strong enum 2025-03-25 15:09:23 +01:00
Michael Steenbeek
9f343abdda Reduce hardcoded positions for various windows 2025-02-26 21:09:54 +01:00
73
c7c703515e Rename audio.h to Audio.h (#23842) 2025-02-17 13:24:03 +01:00
Briar
376cb7980c Fix #9999-#10003: translations have truncated strings
This issue, along with several related language-specific
trunctions, was traced back to the fact that ScenarioIndexEntry
uses a fixed-length array of utf8 characters to store the name,
internal name, and scenario details. In some cases, this does
not provide enough characters to contain the full description
and so the safe copy methods truncate them to fit in the
available buffer.

Since the use of fixed-size arrays is a holdover from earlier
C code, this commit addresses the issue by changing ScenarioIndexEntry
to use proper utf8 strings and string views, which do not require
truncation.
2025-02-15 00:18:24 +01:00
73
b9b2c96c97 Rename sprites.h to SpriteIds.h (#23804) 2025-02-13 15:51:46 +00:00
Michael Steenbeek
b0c99fcb6c Refactor more constants to kConstant notation 2025-01-22 16:16:55 +00:00
Michael Steenbeek
be9f27e4f9 Mass rename constants (#23656) 2025-01-19 15:59:45 +00: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
fa06a49302 Update copyright year to 2025 (#23514) 2024-12-31 20:30:04 +01:00
Aaron van Geffen
35e117aca2 Rename String methods to use lowerCamelCase 2024-12-11 22:49:37 +01:00
Aaron van Geffen
a24dc2e60a Reduce includes in and of Util.h/cpp 2024-12-11 20:42:43 +01:00
Aaron van Geffen
5442b20a7a Move StrLogicalCmp, SafeStrCpy, SafeStrCat to String.hpp 2024-12-11 20:42:43 +01:00
ζeh Matt
9dfd4f3b19 Rename the callback types 2024-12-04 20:43:55 +02:00
Aaron van Geffen
9436a9501e Move bitScanForward from Util.h to Numerics.hpp 2024-10-29 11:08:39 +01:00
Aaron van Geffen
b971d1596e Indent window widget definitions (#22700)
* Indent definitions in About, AssetPacks windows

* Indent definitions in Banner, Changelog, CustomCurrency windows

* Indent DebugPaint, DemolishRidePrompt windows

* Indent EditorBottomToolbar, EditorInventionsList

* Indent EditorObjectiveOptions, EditorScenarioOptions

* Indent Finances

* Indent Footpath

* Indent GameBottomToolbar

* Indent Guest window

* Indent GuestList, InstallTrack windows

* Indent Land, LandRights windows

* Indent LoadSave, Main, MapGen, MapTooltip windows

* Indent MazeConstruction

* Indent Multiplayer

* Indent NetworkStatus

* Indent NewCampaign

* Indent NewRide window

* Indent News window

* Indent NewsOptions window

* Indent ObjectLoadError window

* Indent Options window

* Indent Park window

* Indent PatrolArea window

* Indent Player window

* Indent RefurbishRidePrompt window

* Indent Research window

* Indent Ride window

* Indent RideConstruction

* Indent RideList

* Indent SavePrompt

* Indent ScenarioSelect widgets

* Indent scenario window

* Indent scenery scatter window defs

* Indent server list window

* Indent server start window§

* Indent ShortcutKeys window

* Indent Sign window

* Indent Staff window

* Indent StaffFirePrompt window

* Indent StaffList window defs

* Indent Themes window defs

* Indent TileInspector window defs

* Indent TitleExit, TitleMenu, TitleOptions, Tooltip windows

* Indent TrackDesignManage window defs

* Indent TrackDesignPlace defs

* Indent TrackList def

* Indent Transparency window defs

* Indent ViewClipping window defs

* Indent Viewport window defs

* Indent Water window defs
2024-09-04 21:11:26 +02:00
Matt
d72e535117 Fix #22457: Potential crash opening the scenario select window 2024-08-15 18:31:27 +02:00
Aaron van Geffen
51816d2bd5 Disambiguate calls to UtilBitScanForward (#22402) 2024-07-28 18:44:59 +02:00
Aaron van Geffen
3d5c19de08 Drop Localisation.h include where not required 2024-07-13 13:33:32 +02:00
Aaron van Geffen
c08541efc7 Remove gCommonStringFormatBuffer, CommonTextBufferSize 2024-07-13 13:25:55 +02:00
Aaron van Geffen
2a6061001b Move kObjectiveNames to Objective unit 2024-07-12 23:50:59 +02:00
Aaron van Geffen
3fd91038c3 Rename Date.h to Localisation.Date.h to match unit file 2024-07-12 22:18:43 +02:00
Gymnasiast
8a181b5513 Split colours and colour flags 2024-05-26 12:35:40 +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
a63d86c488 Introduce Config namespace and struct 2024-05-10 12:10:21 +02:00
Harry-Hopkinson
cd9ca1debb Rename TOP_TOOLBAR_HEIGHT to kTopToolbarHeight 2024-04-14 18:12:58 +00:00
Michael Steenbeek
6eb96b1b07 Fix #21604: Scenario selector shows incorrect guest objectives 2024-03-22 21:39:04 +01: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