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

19904 Commits

Author SHA1 Message Date
Peter Froud
40a7fa70fc Fix empty error messages (#21351)
* Add `STR_ERR_CANT_CHANGE_PARK_ENTRANCE_FEE`

* Add `STR_ERR_TRACK_ON_THIS_TILE_NEEDS_WATER`

* Return existing `GameAction::Result`

* Add `STR_ERR_ACTION_INVALID_FOR_THAT_STAFF_TYPE`

I am open to suggestions for a different message!
Originally this was going to be STR_ERR_WRONG_STAFF_TYPE
but I thought that was confusing because the game
action arguments do not specify a staff type. We
want it to mean "the staff ID you specified is the
wrong StaffType for this game action".

* Refactor `StaffSetColour()` to return `Result`

* Remove unnecessary arguments when `Status` is `Ok`

* Refactor `SwapTileElements()` to return `Result`

Also add STR_ERR_CANT_SWAP_TILE_ELEMENT_WITH_ITSELF

* Format code

* Use `STR_ERR_CANT_CHANGE_PARK_ENTRANCE_FEE` in title

* Format code using Github web editor

* Format indentation
2024-02-19 20:58:04 -03:00
Martin Mizzi
f5a9846ea2 Move gBankLoan and gBankLoanInterestRate to GameState_t 2024-02-19 04:42:44 -05:00
Ota
e9b214282d Fix #21039: Text rendering bleeds pixels through windows
Should fix [#21039 ](https://github.com/OpenRCT2/OpenRCT2/issues/21039).

As it is explained in the issue, the outline and inset code would not respect the DPI bounds in the drawing process by accessing e.g. `*(dst + 1)` to draw an outline, in this case to the right.
#### Approach
I approached this issue by creating a function `GetPixel()`  in `TTFSurface` that would return a value if the given x and y coordinates is a part of a TTF text, else 0. 

In the for loop, iterating through the TTF text, the if condition
```
if (surface->GetPixel(xx + srcX_start + 1, yy + srcY_start)
                        || surface->GetPixel(xx + srcX_start - 1, yy + srcY_start)
                        || surface->GetPixel(xx + srcX_start, yy + srcY_start + 1)
                        || surface->GetPixel(xx + srcX_start, yy + srcY_start - 1))
```
checks if the coordinates **(xx, yy)** is an outline of a text. the writing bounds. Adding `srcX_start`, which is 0 or `-skipX` if `skipX < 0`, when calling `GetPixel()`, would shift the pixel access to the correct position, where the text begins on the surface. The same is done for the Y axis. (Not having this would lead to the outlines/insets not moving with the text when the window with the TTF text moves)
2024-02-17 23:31:07 +01:00
Gymnasiast
accfa1af61 Add WoodenSupportType::Null, replace std::nullopt with it 2024-02-17 22:26:15 +01:00
Gymnasiast
b254501b25 Refactor calls to old WoodenASupportsPaintSetupRotated() 2024-02-17 22:26:15 +01:00
Alex Parisi
efb6d48c4c Add plugin API to get registered plugin metadata (#20709)
* Added API for getAllPlugins

Added functionality to the Scripting API to allow Contexts to return a list of all registered plugins.

* Fixed naming conventions, returning list of authors

Changed function names to follow get/set convention. Removed unnecessary copies of shared pointers, now using auto instead. Changed the functionality to return an array of authors instead of a string.

* Added changelog entry

Also added myself to list of contributors

* Moved all functionality to ScPlugin

Created a ScPlugin class and moved the current getPlugins functionality there.

* Changed from method to property

Function names now match the get/set convention for properties. Also did some code cleanup.

* Update copyright

* Bump plugin version

---------

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2024-02-16 05:53:48 -03:00
Matt
d929e6a540 Allow tooltips to show up when an error window is present 2024-02-15 13:32:58 +01:00
Michael Steenbeek
1613658647 Merge pull request #21401 from Gymnasiast/refactor/track-design-save-cpp
Small cleanup in TrackDesignSave.cpp
2024-02-15 13:32:21 +01:00
Harry-Hopkinson
43f13ff36c Format code 2024-02-14 14:13:17 +00:00
Harry-Hopkinson
0a8f1154ad Add OpenRCT2 as namespace. 2024-02-14 14:10:08 +00:00
Harry Hopkinson
691f5f88e5 Move gNewsItems to GameState 2024-02-14 10:54:15 +00:00
Gymnasiast
085a126bbf Remove unnecessary arguments to TrackDesignSave{Add,Remove}TileElement 2024-02-13 23:31:09 +01:00
Gymnasiast
4b03275cff Remove snake_case in TrackDesignSave.cpp 2024-02-13 23:26:41 +01:00
David Sungaila
89f83d6c0d Fix #21288: Overlapping text in the About window 2024-02-13 23:10:39 +01:00
Harry Hopkinson
1c285dbf9f Move gMaxBankLoan to GameState 2024-02-13 21:36:35 +01:00
Severin Paul Höfer
0c7b94255f Fix #21318: VirtualFloor not properly invalidated (#21386)
* Fix condition for setting VirtualFloor coordinates

* Update changelog.txt
2024-02-13 16:53:55 -03:00
Matt
19be093569 Fix #21208: Error messages disappear too quickly if the game runs for a while (#21394)
* Reset gCurrentRealTimeTicks when the map is initialized

* Use 32 bit for gWindowUpdateTicks

* Update changelog.txt
2024-02-13 16:03:30 -03:00
Matt
5ac347e9f6 Merge pull request #21389 from ZehMatt/error-update-1
Don't close the error window if the new error will not show
2024-02-13 15:54:14 +02:00
Matt
5ed5fece46 Merge pull request #21390 from Harry-Hopkinson/gMapSize-to-GameState_t
Move gMapSize to GameState_t
2024-02-13 14:14:57 +02:00
Michael Steenbeek
c3380e29dd Fix #21286: Cannot build unbanking turns with RCT1 vehicles 2024-02-12 23:23:05 +01:00
Harry-Hopkinson
ce8afe252a Use OpenRCT2 namespace in Map.cpp 2024-02-12 21:49:57 +00:00
Harry-Hopkinson
b755c873e5 Move gMapSize to GameState_t 2024-02-12 21:32:08 +00:00
ζeh Matt
c24657a7f7 Don't close the error window if the new error will not show 2024-02-12 23:02:31 +02:00
Harry Hopkinson
a55da09e1c Move gMapBaseZ to GameState_t (#21370)
* Move gMapBaseZ to GameState_t

* Fix fomatting
2024-02-11 21:40:32 +00:00
Michael Steenbeek
1a13cdcc57 Fix #21220: Localised park name not used when loading SC4 2024-02-11 20:51:23 +00:00
Michael Steenbeek
70b9d0ca47 Add button to reload object 2024-02-11 20:45:31 +00:00
Michael Steenbeek
c4be52644d Fix #21358: Crash during RCT1 research import 2024-02-11 20:08:48 +00:00
Michael Steenbeek
67a7614140 Merge pull request #21111 from Gymnasiast/refactor/goto-removal
Remove more gotos in Vehicle.cpp
2024-02-11 18:09:23 +01:00
Matt
c8b28ca457 Fix #21330: Tooltips from dropdown widgets have the wrong position 2024-02-10 18:47:40 +01:00
David Sungaila
920e39fb34 Windows: add app manifest to enable PerMonitorV2 2024-02-10 14:08:16 +01:00
Michael Steenbeek
776674af7a Merge pull request #21130 from Gymnasiast/fix/research-table-size
Fix: Research table in LL parks imported incompletely
2024-02-08 22:05:09 +01:00
Gymnasiast
61e8b6d206 Move _suggestedGuestMaximum to GameState_t 2024-02-08 21:47:31 +01:00
Gymnasiast
142d708cee Move _guestGenerationProbability to GameState_t 2024-02-08 21:46:41 +01:00
Harry Hopkinson
6deac11916 Move gTotalRideValueForMoney to GameState_t 2024-02-08 09:39:28 +00:00
Gymnasiast
c40a840f5b Fix #18963: Too many items available in some RCT1 scenarios 2024-02-08 02:13:31 +01:00
Gymnasiast
8e64eaca94 Fix #18963: Razor Rocks and BPB import too few research items 2024-02-08 02:13:31 +01:00
Michael Steenbeek
6a9f9025ff Fix: too many options are hidden if the platform has no file picker
Mainly affects Android.

Co-authored-by: Basssiiie <Basssiiie@users.noreply.github.com>
2024-02-07 22:38:45 +00:00
Harry Hopkinson
ad5ef31a97 Move gTotalIncomeFromAdmissions to GameState_t (#21348) 2024-02-07 19:13:04 -03:00
ZeeMaji
1849c7de47 Fix mini helicopters & monorail bicycles being swapped in RCT1 2024-02-07 22:51:36 +01:00
Hielke Morsink
c9fe19e0d9 Part of #21193: Move gParkRatingHistory to GameState_t 2024-02-07 11:04:10 +01:00
Harry Hopkinson
3eb9cf2264 Move gTotalAdmissions to GameState_t (#21341)
Part of #21193.
2024-02-06 21:42:05 +01:00
Harry Hopkinson
fd17842291 Move gNumGuestsInParkLastWeek to GameState_t. 2024-02-05 09:50:58 +00:00
Michael Steenbeek
9efe25c11c Fix #20907: RCT1/AA scenarios use the 4-across train for the Inverted RC (#21303) 2024-02-04 20:39:52 -03:00
Gymnasiast
d413f7dd48 Fix formatting 2024-02-04 22:55:57 +01:00
frutiemax
376d69090b Remove goto label loc_6DC743 2024-02-04 22:55:35 +01:00
frutiemax
c8d836bc09 Remove goto label loc_6DC985 2024-02-04 22:55:35 +01:00
frutiemax
580852351f Remove goto label loc_6DC99A 2024-02-04 22:55:34 +01:00
frutiemax
535b485d37 Remove goto label loc_6DCD2B 2024-02-04 21:41:00 +01:00
frutiemax
714b2a1ace Remove goto loc_6DCD4A 2024-02-04 21:41:00 +01:00
frutiemax
1cd1b7ca87 Remove goto label loc_6DC9BC 2024-02-04 21:41:00 +01:00