Commit Graph

321 Commits

Author SHA1 Message Date
Hielke Morsink ba85cf4873
Close #15896: Refactor out the ZoomLevel operators 2022-02-26 23:14:59 +01:00
Michael Steenbeek 5edc561715
Close #11437: Migrate old platform methods 2022-02-18 21:57:00 +01:00
Ted John 6c3a417af3
Merge pull request #16259 from IntelOrca/refactor/rectangle-maps
Refactor map size to allow for rectangle maps.
2022-02-15 19:08:37 +00:00
Michael Steenbeek ffe67ff33e
Merge pull request #16642 from Gymnasiast/refactor/dropdown
Create Dropdown::Item and use it for gDropdownItems
2022-02-15 18:50:26 +01:00
Ted John 454bfb0a8f Refactor map size to allow for rectangle maps 2022-02-14 23:15:59 +00:00
Ted John b775832d01 Refactor window flags to be read with the helper methods 2022-02-13 23:09:42 +00:00
Ted John da89a4e413
Remove rct_window::enabled_widgets (#16643)
`enabled_widgets` was used to enable input for widgets. However I do not recall anywhere this being used to specifically disable a widget which doesn't use the dedicated `disabled_widgets` flag. I don't think there is any purpose in keeping this, so I have removed all uses of it.
2022-02-13 23:06:19 +00:00
Gymnasiast 723867e0a0
Create Dropdown::Item and use it for gDropdownItems 2022-02-12 23:57:22 +01:00
Silent 4621cc4264
Json: Fix wrong implicit path typecasts in ReadFromFile and WriteToFile
These functions accepted fs::path which meant passing a u8string to them
wrongly assumed an ANSI encoding and not UTF-8. This would be
a non-issue in C++20 where char8_t is separate, but until then it was an issue
causing incorrect character conversions, and thus an exception.
2022-02-12 14:36:37 +01:00
Gymnasiast 10301507a9
Fix Android 2022-01-08 16:58:57 +01:00
frutiemax adb692b74e Forward declare Formatter 2021-12-30 12:17:51 -05:00
Hielke Morsink 9615dda192
Reimplement hotkey handler for toggling visibility 2021-12-03 00:24:56 +01:00
Duncan bb2c7dbaca
Clang tidy Part 1: Ui Project Function Names (#15956)
* Add NOLINT around STL using classes and vendor functions

* Apply clang-tidy to ui project function names

* Undo scripting clang-format

* Upper case OpenRCT2 and RCT2
2021-11-23 13:18:07 +00:00
IntelOrca 34128dc262
Add new .park save format
Co-authored-by: Gymnasiast <Gymnasiast@users.noreply.github.com>
Co-authored-by: duncanspumpkin <duncanspumpkin@users.noreply.github.com>
Co-authored-by: ZehMatt <Zehmatt@users.noreply.github.com>
Co-authored-by: Broxzier <Broxzier@users.noreply.github.com>
2021-11-21 22:43:22 +01:00
Hielke Morsink 5b9b52c028
Use (const) references to scrolls where possible 2021-10-01 15:21:01 +02:00
Hielke Morsink 6de1868ad8
Use (const) references to widgets where possible
Note: The change from `w->widgets[WIDX_ENTRY_PRICE]` to `entryPriceWidget` is intended.
2021-10-01 15:21:00 +02:00
Hielke Morsink a8b84989eb
Check for nullptr explicitly in operct2-ui (#15460) 2021-09-25 08:45:06 +02:00
Hielke Morsink 4b4b3333d6
Remove unnecessary else blocks 2021-09-16 18:31:12 +02:00
Hielke Morsink 28681eebc0
Merge pull request #15407 from ZehMatt/refactor/optional-use
Make use of std::optional strict
2021-09-14 17:45:18 +02:00
Hielke Morsink 2af5e0dc82
Remove unnecessary else block 2021-09-13 23:25:33 +02:00
Hielke Morsink cf78d6841d
return nullopt instead of {} 2021-09-13 23:24:57 +02:00
ζeh Matt 59a6c34db4
Make use of std::optional strict 2021-09-13 20:02:32 +03:00
Duncan 940cab87d3
Map size refactors from NSF (#15112)
* Support large map sizes

* Fix top spin painting

* Fix crooked house

* Increase bb size

* Decrease limit back

* Clang format

* Remove asserts and apply review comments

* Fix rebase mistake

Co-authored-by: Ted John <ted@brambles.org>
2021-08-16 20:51:16 +01:00
Ted John 5f853df1fd
Remove gS6Info 2021-08-02 20:38:02 +02:00
Kane bd8d3934e0
Close #15143: Add a shortcut key for Giant Screenshot 2021-08-01 09:20:34 +02:00
Michael Steenbeek 9c2fb84a53
Invalidate screen when toggling transparent water flag
Pointed out here: https://github.com/OpenRCT2/OpenRCT2/issues/14753#issuecomment-849024680
2021-07-27 12:16:36 +02:00
ζeh Matt 751c419594
Minor cleanups (#14954)
* Fix uninitialized variables in InputManager

* Use constexpr for const values

* Add break statements instead of implicit fallthrough

* Default initialize variables in Cheats window

* Default initialize variables in News window

* Default initialize window event pointers
2021-06-26 01:43:05 -03:00
duncanspumpkin 98f9f24909 Remove sprite.h includes where possible 2021-05-29 08:54:33 +01:00
Gymnasiast 8f6713a4f1
Reverse option, add shortcut 2021-05-24 16:54:30 +02:00
Ted John b179f6e597
Merge pull request #13965 from telk5093/footpath_hotkeys
Make ride construction shortcuts work for footpath too
2021-03-06 01:27:18 +00:00
Ted John 083d22adf2 Fix #14195: Binding (NumPad) Enter to send message closes the chat 2021-02-28 14:08:16 +00:00
Ted John 789b04b4aa Fix #14194: Pressing WASD in text box moves main viewport, too 2021-02-28 14:07:56 +00:00
Ted John 17a29dfe87 Fix #14190: Game crash likely related to plug-in hotkeys
Do not cache references to RegisteredShortcut as they can be invalidated when new shortcuts are registered / removed.
Use a map to improve query performance of shortcut by ID.
Store a separate list of strings for the map to use as a key.
2021-02-28 01:13:43 +00:00
Ted John 1ee72ffd21 Fix #14184: Right and down arrow swapped
Incorrect order of legacy shortcut IDs.
2021-02-27 15:51:05 +00:00
TELK 99e72dde3f Change StringIds to more generic 2021-02-24 16:50:40 +09:00
Ted John 52dffb83c2 Fix #14160: Game crashs when registering shortcuts 2021-02-23 22:18:00 +00:00
Ted John 817edff4bd Fix #14149: Numpad shortcut keys are not loaded correctly 2021-02-23 20:35:24 +00:00
TELK ea5cf16924 Feature: Make ride construction shortcuts work for footpath too 2021-02-23 16:11:53 +09:00
Ted John 440c0f447f
Fix #14140: Some shortcut keys are not working 2021-02-21 21:44:53 +01:00
Ted John ed29c0a37b Replace std::printf with Console::* 2021-02-21 03:14:20 +00:00
Ted John e383b6f6f7 Move zoom and rotation to view tab 2021-02-21 03:14:20 +00:00
Ted John 2b14fe9d7f Update shortcut listings 2021-02-21 03:14:19 +00:00
Ted John ff86ebbfe5 Localise shortcut strings 2021-02-21 03:14:19 +00:00
Ted John acfda711f5 Use std::string_view without reference 2021-02-21 03:14:19 +00:00
Ted John 59b4be6a12 Move InputManager to UiContext 2021-02-21 03:14:19 +00:00
Ted John 80662d72a4 Cache view scroll shortcuts 2021-02-21 03:14:19 +00:00
Ted John 2b197d0fb2 Fix parsing of shortcuts 2021-02-21 03:14:18 +00:00
Ted John 46c3fd4e5f Use FileStream instead of fstream 2021-02-21 03:14:18 +00:00
Ted John eda33fea20 Fix view scroll shortcuts 2021-02-21 03:14:18 +00:00
Ted John 2b3aabb8e4 Remove old shortcut code and fix issues 2021-02-21 03:14:18 +00:00
Ted John f2f658bf28 Refactor some code into more files 2021-02-21 03:14:18 +00:00
Ted John af0ed416f5 Implement loading / saving of new shortcuts 2021-02-21 03:14:18 +00:00
Ted John 18c3587d63 Rename shortcut IDs and order groups 2021-02-21 03:14:18 +00:00
Ted John 7b00f9d96d Add tabs to keyboard shortcut window 2021-02-21 03:14:18 +00:00
Ted John e7ae9f9f15 Read legacy shortcuts and move to constants 2021-02-21 03:14:17 +00:00
Ted John 900f3cd92b Fix gcc / clang builds 2021-02-21 03:14:17 +00:00
Ted John afc548c5a7 Add plugin API for shortcuts 2021-02-21 03:14:13 +00:00
Ted John 9964df5335 Implement gamepad support 2021-02-21 03:13:28 +00:00
Ted John e6b6403024 Refactor and fix shortcut 2021-02-21 03:13:28 +00:00
Ted John ea975f88fc Implement more InputManager 2021-02-21 03:13:28 +00:00
Ted John c8f31dea7f Process keyboard input events 2021-02-21 03:13:28 +00:00
Ted John 3339089235 Add more shortcuts 2021-02-21 03:13:28 +00:00
Ted John f009b9a804 Only handle release mouse buttons 2021-02-21 03:13:28 +00:00
Ted John ccae533978 Add input manager 2021-02-21 03:13:27 +00:00
Ted John b1eb975529 Re-add show change dialog 2021-02-21 03:13:27 +00:00
Ted John e5f263a0fc Get new manager showing in window 2021-02-21 03:13:27 +00:00
Ted John 28aead5cb5 Start work on new shortcut engine 2021-02-21 03:13:27 +00:00
Michael Steenbeek 61536eb1f6
Fix #14073: NPE in InputUpdateTooltip 2021-02-12 18:36:58 +01:00
Ted John be350f7e2e Add widget visible flag 2021-01-26 00:25:59 +00:00
amdoku 85efe047bb
Close #12444: Refactor TILE_INSPECTOR_PAGE to use strong enum (#13134) 2021-01-03 10:30:59 -03:00
Tulio Leao 221aa8cece Close #12453: Refactor RCT2_EDITOR_STEP to strong enum 2020-12-23 20:07:53 -03:00
Adam f09b14ef2b
Split actions hpp files into separate h and cpp files (#13548)
* Split up SmallSceneryPlace/Remove

Added undo function for Remove Scenery

* Refactor: Balloon and Banner actions hpp=>h/cpp

* Refactor: rename all action *.hpp files to *.cpp

This is preparation for separation in later commits. Note that without
the complete set of commits in this branch, the code will not build.

* Refactor Clear, Climate, Custom, and Footpath actions hpp=>h/cpp

* VSCode: add src subdirectories to includePath

* Refactor Guest actions hpp=>h/cpp

* Refactor Land actions hpp=>h/cpp

* Refactor LargeScenery actions hpp=>h/cpp

* Refactor Load, Maze, Network actions hpp=>h/cpp

* Refactor Park actions hpp=>h/cpp

* Refactor/style: move private function declarations in actions *.h

Previous action .h files included private function declarations with
private member variables, before public function declarations. This
commit re-orders the header files to the following order:
- public member variables
- private member variables
- public functions
- private functions

* Refactor Pause action hpp=>h/cpp

* Refactor Peep, Place, Player actions hpp=>h/cpp

* Refactor Ride actions hpp=>h/cpp

* Refactor Scenario, Set*, Sign* actions hpp=>h/cpp

* Refactor SmallScenerySetColourAction hpp=>h/cpp

* Refactor Staff actions hpp=>h/cpp

* Refactor Surface, Tile, Track* actions hpp=>h/cpp

* Refactor Wall and Water actions hpp=>h/cpp

* Fix various includes and other compile errors

Update includes for tests.
Move static function declarations to .h files
Add explicit includes to various files that were previously implicit
(the required header was a nested include in an action hpp file, and the
action .h file does not include that header)
Move RideSetStatus string enum to the cpp file to avoid unused imports

* Xcode: modify project file for actions refactor

* Cleanup whitespace and end-of-file newlines

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2020-12-10 06:39:10 +00:00
ffrogman 7ed1804e61
Fix #12410: Refactor WINDOW_WIDGET_TYPES to use strong enum (#13453)
* Fix #12410: Refactor WINDOW_WIDGET_TYPES to use strong enum
2020-11-27 00:14:20 -03:00
Hielke Morsink f0c1ea1d37
Split declarations and definitions to improve compile times when editing (#13332)
* Split FileStream declarations and definitions

* Split JobPool declarations and definitions

* Split StringBuilder declarations and definitions

* Split StringReader declarations and definitions

* Split ZoomLevel declarations and definitions

* Fix missing include in FileClassifier.cpp

* Remove pragma once from source files

* Fix missing include in StringBuilder.h

* Update Xcode project

* Fix compilation of tests

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2020-11-07 12:42:04 +00:00
pizza2004 2015acd4c0
Refactor UI/Interface Window to Title Case (#13367) 2020-11-04 04:52:23 +00:00
Łukasz Pękalski 88a6a085e4
Close #12455: Refactor MOUSE_STATE to use strong enum (#13361)
* Close #12455: Refactor MOUSE_STATE to use strong enum

refactor: MouseState to strong enum

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-11-03 18:41:19 -03:00
pizza2004 a5607da09d
Refactor Widget to TitleCase (#13355) 2020-11-03 18:29:22 -03:00
pizza2004 b0fd5f93d7
Refactor UI/Interface misc to TitleCase (#13354)
* Refactor LandTool to Namespace

* Refactor Theme to TitleCase

* Refactor ViewportInteraction to TitleCase
2020-11-03 10:59:00 +00:00
pizza2004 68bd035f12
Refactor Dropdown to TitleCase (#13352)
* Refactor Dropdown Namespace

* Refactor Dropdown to TitleCase
2020-11-03 08:16:06 +00:00
pizza2004 1643c62939 Refactor UI/Input MouseInput to Title Case 2020-11-02 07:05:33 -07:00
pizza2004 34f362b86e Refactor UI/Input KeyboardShortcuts to Title Case 2020-11-02 06:55:16 -07:00
pizza2004 06c0c1b982 Refactor UI/Input Input to Title Case 2020-11-02 06:55:16 -07:00
Duncan cd39c30989
Tooltip 2 (#13159)
* Use ScreenCoords for tooltip

* Remove temporary variables

* Small refactor

* Fix #13151. Not passing tooltip arguments correctly for ride window

* Fix Server List window version tooltip

* Fix cheats tooltip event

* Add static to function decl

* Remove unreachable break statements in Ride.cpp

* Apply review suggestions

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-10-17 09:10:08 +01:00
Julia Pinheiro cba1d48226
Close #12408: Refactor CURSOR_ID to use strong enum 2020-10-11 18:01:14 +02:00
Duncan f28907a87d
Rework tooltip to be more logical (#13137) 2020-10-10 10:49:56 -03:00
Duncan 197bb897bb
Fix #7748. Move tooltip timeout reset to correct location (#13132)
* Fix #7748. Move tooltip timeout reset to correct location

Mistake made in implementation

* Add changelog entry
2020-10-09 16:53:31 +01:00
ζeh Matt 61b510db66
Merge pull request #13073 from ZehMatt/refactor/audio-cleanup
Minor cleanup around audio code
2020-10-07 21:18:59 +03:00
Tulio Leao 076544f490
Merge pull request #13084 from vjavs/PVS-Studio/Fixes
Make some PVS-Studio fixes
2020-10-07 08:24:59 -03:00
Mike Jones 7441001c4e
Close #12407: Refactor CHAT_INPUT to use strong enum (#13116) 2020-10-06 21:37:08 -03:00
Matt 091145037e
Move the audio code into OpenRCT2 namespace 2020-10-07 00:34:42 +03:00
Vinicius Sa 579e008590
Refactor process_mouse_over()
- Remove unnecessary local variables and assignments

 - Remove unreached if-statement branch

Reported by PVS-Studio (Warning: V587).

Fix 5/7.

Issue: 12523
2020-10-06 18:21:24 -03:00
Bryan DiLaura 56e8cc77c6
Close #12409: Refactor CONSOLE_INPUT to use strong enum (#13052) 2020-10-01 10:31:03 +01:00
Duncan 3c8adb1fc1
Remove gMapTooltip format args global (#12971)
Fix mistake
2020-09-28 21:45:28 -03:00
Matt d0d5cc5179
Remove unused declarations 2020-09-16 20:23:34 +03:00
Łukasz Pękalski 411f242cfd
Close #12431 Refactor VirtualFloorStyles to use strong enum (#12790) 2020-08-27 21:06:39 -03:00
Tulio Leao 4caf571c22
Followup on #12475 post-mortem comments (#12745)
* Remove using namespace OpenRCT2 from header

* Fix using wronf undefined enum for shortcut key map
2020-08-21 16:07:38 +01:00
frutiemax 4cc550a364
Close #12460: Refactor KeyboardShortcut to use strong enum (#12475)
* Close #12460: Refactor KeyboardShortcut to use strong enum

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-08-20 23:54:43 -03:00
Matt 0dc43d66e4 Remove the use of INTERFACE macro and macro its self 2020-08-05 16:30:44 +02:00
Matt 30376085cf Include missing headers 2020-08-05 16:29:29 +02:00
frutiemax af0fc89cf4
Close #12456: Refactor INPUT_STATE to use strong enum (#12484) 2020-07-27 19:51:10 -03:00