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

174 Commits

Author SHA1 Message Date
Hielke Morsink
056af36cdf Move initialization to constructor 2022-11-20 21:41:24 +01:00
Hielke Morsink
e22dd3ac32 Refactor LoadSaveWindow to class
Closes #13778
2022-11-20 21:39:30 +01:00
Duncan
482971710d Apply code style to context functions 2022-11-06 21:49:07 +01:00
Michael Steenbeek
27f3a3a796 Create function to resize window frame 2022-11-06 10:29:40 +01:00
Hielke Morsink
31dd4bf604 Use lower-case u integral suffix 2022-10-29 16:33:05 +02:00
Henry Cheng
cf9ec0bd4a Fix no overwrite alert on Windows if there are capitalization differences (#18375) 2022-10-26 08:19:44 +02:00
Gymnasiast
14f9a75e0a Refactor FontSpriteBase and font size into FontStyle 2022-10-19 11:59:26 +02:00
Hielke Morsink
f91df4138c Merge pull request #18359 2022-10-18 23:39:49 +02:00
Hielke Morsink
3bb8ea3668 Better annotate some magic numbers in for loops 2022-10-17 16:08:55 +00:00
Hielke Morsink
5fa53ad528 Rename global config functions to use TitleCase 2022-10-16 21:46:08 +02:00
Hielke Morsink
abac080d3e Rename public general config data members 2022-10-16 21:46:01 +02:00
Rik Smeets
0c78a27d9f Fix missing validation on invalid characters in file name (#18287)
When saving a new file with a name containing '/' or '\' on Windows, the incorrect file name would be determined since these characters represent a new folder. This would trigger a failure on save.

The user's input should be validated in all cases. Before, it was only executed for folder names. This change also applies the validation on file names.
2022-10-11 13:27:11 +02:00
73
b9e677945d Replace 20XX with 2022 (#18158)
* Replace 2020 with 2022

Replace all 2020 headers with 2022

* replace other years with 2022

add missing years
2022-10-01 08:42:14 +01:00
Rik Smeets
425000bfca Don't prompt to 'Save game as' when saving (#16819)
After loading a saved game and choosing 'Save game', the 'Save game as' window would open the first time every time after loading the save.
Now, it will be saved using the existing save path, except when an autosave is loaded which the player probably doesn't want to overwrite.
2022-09-25 08:33:28 +02:00
Gymnasiast
45e7ee6a73 Rename rct_window_event_list to WindowEventList 2022-08-27 16:56:52 +02:00
Gymnasiast
a088537b65 Rename rct_widgetindex to WidgetIndex 2022-08-21 18:49:23 +02:00
Hielke Morsink
7f29e4e39c Make rct_windowclass strong type WindowClass
This already revealed some places where implicit conversions were done, including some where its use was nonsense (MouseInput.cpp).
The changes to the Intent class were necessary to keep things working, and this splits things up more neatly.
2022-08-21 18:38:25 +02:00
Gymnasiast
d3fd31c611 Rename rct_string_id to StringId 2022-07-31 22:30:13 +02:00
Hielke Morsink
a258008bef Refactor window functions to take references 4 2022-07-31 17:23:16 +02:00
Hielke Morsink
76c1bc8980 Refactor window functions to take references 1 2022-07-31 17:23:15 +02:00
Hielke Morsink
6b94d8c0bc Fix overwriting buffer for parent directory when browsing "Up" 2022-05-22 14:32:06 +00:00
germanaizek
958bfbc08a Using std::move(), correct clear strings, better use '= default;', modernize make_* and replace heavy strlen 2022-05-07 16:05:39 +02:00
germanaizek
0045aed7f9 Add const ref, remove excess .c_str(), push_* -> emplace_* and rewrite constructors 2022-05-07 16:05:38 +02:00
duncanspumpkin
f835a5b521 Apply clang-tidy to static variables 2022-03-18 00:38:26 -03:00
Silent
771637f24c Refactor filename_valid_characters into Platform::IsFilenameValid 2022-03-16 21:56:54 +01:00
Silent
3773fa4cb0 Refactor uses of path_append_extension 2022-03-10 20:18:17 +01:00
Michael Steenbeek
c334c7a176 Merge pull request #16724 from Gymnasiast/refactor/remove-path_get_filename
Remove four old path functions
2022-03-02 22:25:08 +01:00
Hielke Morsink
55c71b0c74 Properly use utf8 strings where expected 2022-03-01 22:12:39 +01:00
Gymnasiast
376c79408a Replace path_set_extension with Path::WithExtension() 2022-02-26 18:26:24 +01:00
Gymnasiast
49b414a40e Replace calls to path_get_filename() 2022-02-26 17:20:07 +01:00
Charles Machalow
59c4beb3dd Fix bug where file extension can get added twice (#16720) 2022-02-26 06:25:06 +00:00
Charles Machalow
6406b18c98 Fix #16715. The first time we save a park, default to the park's name… (#16719)
* Fix #16715. Default to the park's name as the file name

* Mark Combine as nodiscard

The return value must be used for the function to do something
2022-02-26 06:23:30 +00:00
Michael Steenbeek
5edc561715 Close #11437: Migrate old platform methods 2022-02-18 21:57:00 +01: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
Silent
09897ede9e Refactor last_*_directory and last_run_version to use u8string
Fixes a regression from #16631 causing a crash when
constructing u8string from a nullptr
2022-02-13 21:34:26 +01:00
Silent
46deac8620 Fix a crash in WindowLoadsaveOpen when last_game_directory is empty
The variable path was left unitialized, which worked fine
in Release builds most of the time, but consistently crashed in Debug.
2022-02-12 00:53:26 +01:00
Michael Steenbeek
63ed6c99a5 Make StrDecompToPrecomp() take C++ strings 2022-02-07 18:56:04 +01:00
Gymnasiast
2f0e6389da Use u8string in FileDialogDesc 2022-01-29 14:09:13 +01:00
Gymnasiast
fd6b327adb Use emplace_back() instead of push_back() 2022-01-29 14:07:21 +01:00
Gymnasiast
55591b1b2f Merge old and new FileDialogDesc 2022-01-29 13:55:10 +01:00
Michael Steenbeek
f43a4344ce Remove platform_get_user_directory() (#16530) 2022-01-29 09:01:05 -03:00
Michael Steenbeek
2c8c940caa Refactor get_file_extension_type() 2022-01-27 11:14:19 +00:00
Gymnasiast
d7dcffbee8 Remove C string overload for Path::GetAbsolute() 2022-01-26 14:54:49 +01:00
Michael Steenbeek
4192fc5cc8 Fix leftover references to SC6 2022-01-24 20:03:20 +01:00
Gymnasiast
6bcf848b2f Use C++ filesystem for more file/path functions 2022-01-08 19:07:48 +01:00
frutiemax
adb692b74e Forward declare Formatter 2021-12-30 12:17:51 -05:00
Duncan
ee297e9ed3 Fix #16287: Incorrect sv6 extension using console or system browser 2021-12-22 16:19:02 +01:00
Duncan
cc22b584fd Introduce RCT2 namespace (#16037)
* Introduce RCT2 namespace

* Drop RCT2:: prefix where possible

* Drop RCT2 from structure names

* Reduce header includes
2021-11-28 16:51:38 +00: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