1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-19 13:03:11 +01:00
Commit Graph

246 Commits

Author SHA1 Message Date
Michael Steenbeek
577c3336c6 Create struct for all dropdown-related globals (#25023) 2025-08-23 13:56:13 +02:00
Michael Steenbeek
92f493b28a Merge pull request #25010 from Gymnasiast/refactor/more-code-style
More code style refactors
2025-08-21 22:26:52 +02:00
Gymnasiast
9c810d9e32 Update ParkData fields to new code style 2025-08-21 22:12:41 +02:00
Gymnasiast
8fd9658cd3 Update dropdown item fields and functions to new code style 2025-08-21 21:33:22 +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
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
0779b9f0ab Replace window shim and widget macros with constexpr functions (#24566) 2025-06-07 23:02:14 +02:00
mix
a27d9ccc07 Prevent path window invalidating unnecessarily 2025-05-22 20:58:55 +01:00
mix
f57f07696b Fix virtual floor not invalidating correctly 2025-05-19 16:09:27 +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
Gymnasiast
2002f697e0 Refactor INPUT_FLAGS into FlagHolder 2025-03-26 13:00:54 +01:00
Gymnasiast
fa15bc56d2 Rename INVALID_DIRECTION to kInvalidDirection 2025-03-25 22:47:08 +01:00
Aaron van Geffen
7efb6e7835 Generalise dropdown tooltips and add tooltips to footpath window (#24070) 2025-03-25 08:59:30 +01:00
Michael Steenbeek
70bdddcf36 Reduce object casting (#24072) 2025-03-25 08:51:44 +01:00
Gymnasiast
4badffcdb6 Change GameState_t members to lowerCamelCase 2025-03-20 23:05:57 +01:00
Michael Steenbeek
06c1fed4f7 Refactor gScreenFlags to LegacyScene enum 2025-03-05 20:45:04 +00:00
Gymnasiast
09da9779a5 Change Tool members to new codestyle 2025-03-01 20:12:12 +01:00
73
c7c703515e Rename audio.h to Audio.h (#23842) 2025-02-17 13:24:03 +01:00
Aaron van Geffen
bb94ee8bc0 Rename ObjectType enum to follow recent code style (#23810) 2025-02-13 23:07:55 +01:00
73
b9b2c96c97 Rename sprites.h to SpriteIds.h (#23804) 2025-02-13 15:51:46 +00: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
Michael Steenbeek
b0c99fcb6c Refactor more constants to kConstant notation 2025-01-22 16:16:55 +00: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
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
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
a24dc2e60a Reduce includes in and of Util.h/cpp 2024-12-11 20:42:43 +01:00
Aaron van Geffen
b3aa852a8d Consolidate util/Math.hpp into core/Numerics.hpp (#23319)
* Consolidate util/Math.hpp into core/Numerics.hpp

* Remove branching; replace isPowerOf2 with std::has_single_bit

* Add templated types to floor2 and ceil2
2024-12-04 21:00:26 +00:00
RedMarcher
c24e47dea1 Rename cheat variables to match new code style 2024-12-01 18:15:37 +01:00
Michael Steenbeek
8063c5caa7 Reduce casting for objects 2024-10-16 14:12:25 +02:00
Michael Steenbeek
a2ed026264 Split up remaining tile elements 2024-10-15 22:02:31 +02:00
Aaron van Geffen
97acb793e8 Rename InteractionInfo::SpriteType to interactionType 2024-09-22 16:53:43 +02:00
Gymnasiast
1f33aec8fc Convert provisional path flags to FlagHolder 2024-09-19 21:32:55 +02:00
Gymnasiast
8715264e1e Refactor provisional footpath flags 2024-09-06 23:31:50 +02:00
Gymnasiast
4ff99d6fd1 Confine provisional paths to Footpath.cpp 2024-09-06 23:31:50 +02: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
Aaron van Geffen
fe628aff0d Add ctrl/shift modifiers to footpath tool (#22569)
* Add prototype for ctrl/shift modifier keys in footpath tool

* Only allow paths at half heights when 'invalid heights' cheats are active

* Infer heights similarly to scenery tool when ModifierKey::ctrl is active
2024-08-22 21:15:20 +01:00
Aaron van Geffen
5f37ba6615 Rename footpath height related constants 2024-08-16 21:18:33 +00:00
Harry Hopkinson
4744c7416d Refactor object and network constants to kCamelCase 2024-08-11 20:21:24 +00:00
Greg
dae5b00f05 Close #22509: Refactor SPR_NONE to ImageIndex (#22517)
* ImageIndex typedef moved from ImageId.hpp to new file ImageIndexType.h.

* SPR_NONE redefined as ImageIndex type in ImageIndexType.h.

* SPR_NONE renamed to kSpriteIdNull

* Remove casts and enum all sprites as ImageIndex

* Remove sprites.h include from LandTool.h, RideData.h

* Ensure all RTD headers include sprites.h

---------

Co-authored-by: Aaron van Geffen <aaron@aaronweb.net>
2024-08-11 09:58:28 +00:00
Aaron van Geffen
03bc1e5707 Introduce isToolActive function as alternative for globals (#22430)
* Introduce isToolActive function
* Ride window: use isToolActive instead of gCurrentToolWidget
* Footpath window: use isToolActive instead of gCurrentToolWidget
* Staff window: use isToolActive instead of gCurrentToolWidget
* MazeConstruction window: use isToolActive instead of gCurrentToolWidget
* Guest window: use isToolActive instead of gCurrentToolWidget
* Map window: use isToolActive instead of gCurrentToolWidget
* LandRights window: use isToolActive instead of gCurrentToolWidget
* Replace SceneryToolIsActive legacy function with calls to isToolActive
* ClearScenery window: use isToolActive instead of gCurrentToolWidget
* Scenery window: use isToolActive instead of gCurrentToolWidget
* Water window: use isToolActive instead of gCurrentToolWidget
* Land window: use isToolActive instead of gCurrentToolWidget
* Widget: replace WidgetIsActiveTool with isToolActive
* RideConstruction window: use isToolActive instead of gCurrentToolWidget
* Ride: use isToolActive instead of gCurrentToolWidget
* TrackDesignPlace window: use isToolActive instead of gCurrentToolWidget
* StaffList window: use isToolActive instead of gCurrentToolWidget
* ViewClipping window: use isToolActive instead of gCurrentToolWidget
* PatrolArea window: use isToolActive instead of gCurrentToolWidget
* TileInspector window: use isToolActive instead of gCurrentToolWidget
* Park window: use isToolActive instead of gCurrentToolWidget
2024-08-05 10:47:36 +02:00