Commit Graph

2226 Commits

Author SHA1 Message Date
Tom Parsons c4ae579a84
Feature #11817: Show authors field in object selection (#12591)
* Feature #11817: Show authors field in object selection

- authors field in JSON shows as last line in bottom right on object selection
- authors field added to Object class
- ObjectFileIndex version bump as authors is serialised

* fix sign comparison warning

* Start object selection corner text higher to avoid overlap

* Use references to reduce unneccessary copies

* make GetAuthors const

* Clip drawing of authors string so it doesn't cross widgets

At max length the leftmost aligns exactly with description left

* Add a changelog message

* make SetAuthors use an rvalue reference

* remove unnecessary nullptr check
2020-08-09 06:23:28 +01:00
Sidney 933570fd62
Close #12442: Refactor SCENARIO_SOURCE to use strong enum (#12608) 2020-08-08 09:38:43 -03:00
Tulio Leao be9dca6945
Close #12416: Refactor CURRENCY_AFFIX to use strong enum (#12589)
* Close #12416: Refactor CURRENCY_AFFIX to use strong enum

* Add static assert to check config enum type

Co-authored-by: Matt Thomson <matt-thomson@users.noreply.github.com>
2020-08-05 20:26:18 -03:00
Matt 0dc43d66e4 Remove the use of INTERFACE macro and macro its self 2020-08-05 16:30:44 +02:00
Matt 83355e35cc Move IStream, MemoryStream, FileStream into OpenRCT2 namespace 2020-08-05 16:29:36 +02:00
Matt 30376085cf Include missing headers 2020-08-05 16:29:29 +02:00
Matt Thomson 150100d89f Fix #12416: Refactor CURRENCY_AFFIX to use strong enum 2020-08-04 21:35:59 +01:00
pizza2004 156be224f9
Close #12399: Refactor MIXER_GROUP to strong enum (#12531) 2020-08-03 20:51:12 -03:00
Duncan 0809069e74
Fix #12577: Mistake made in refactor #12538 (#12579)
Loop called the peep window open only when nullptr. Added extra checks for nullptr on window open
2020-08-03 20:09:24 -03:00
pizza2004 d217dfa9b9
Refactor NewsItem into namespace and Pascal Case (#12511) 2020-08-02 23:14:00 -03:00
Duncan aa11773da3
Fix #12566, #12565, #12562, #12560, #12558: Nullptr deref (#12567)
Mistake made in refactor meant that a nullptr deref took place when the screen coords were outside of the normal play area
2020-08-02 20:13:09 +01:00
Duncan 733bc5a981
Close #12518: Viewport Refactor (#12541)
* Remove viewport pointer from get_map_coordinates_from_pos

* Removed viewport from get_window

* Return a InteractionInfo from get_map_coord...

* Remove viewport_interaction_info struct

* Add Entity union to simplify code

* Name the enum used for viewport interaction

* Simplify functions further by returning the info struct

* Add default switches
2020-08-02 08:32:59 +01:00
Łukasz Pękalski 0f78d452a4
Part of #12497: Remove extra SPRITE_INDEX_NULL check (#12538)
* refactor: deleted double check of SPRITE_INDEX_NULL in Staff* ride_get_mechanic(Ride* ride)

* refactor: deleted double check of SPRITE_INDEX_NULL in Ride.cpp file

* refactor: deleted double check of SPRITE_INDEX_NULL in windows/Ride.cpp in function static rct_string_id window_ride_get_status_vehicle

* refactor: deleted double check of SPRITE_INDEX_NULL in ride/Ride.cpp

* refactor: deleted double check in FormatStatusTo
2020-08-02 08:28:11 +01:00
Aaron van Geffen e039a51826
Fix #12552: Grey rectangles appear under windows and menus (#12554)
* Fix #12552: Grey rectangles appear under windows and menus

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-08-02 00:47:28 -03:00
annoyingdroid ddd21fa87a
Part of #12098: Use ScreenRect on gfx_filter_rect (#12134) 2020-08-01 14:40:01 -03:00
Michał Janiszewski 88bad7729c
Merge pull request #12491 from janisozaur/openurl
Add OpenURL method, with implementation for Linux and Windows
2020-08-01 15:42:31 +02:00
Michael Steenbeek 4e9c32ff3a
Merge pull request #12521 from AaronVanGeffen/refactor/widgets-8
Refactor the last sets of widget definitions
2020-08-01 15:11:28 +02:00
Gymnasiast 3d071cec53
Implement OpenURL for macOS 2020-08-01 14:25:32 +02:00
Duncan 6d11825e1a
Reduce the use of rct_sprite (#12530)
* Reduce the use of rct_sprite

* Pass the correct types in S4 importer

* Add additional nullptr checks

* Simplify the viewport interaction

* Apply review comments

* Small cleanup of GetEntity

* Fix test paint
2020-08-01 11:29:54 +01:00
Aaron van Geffen 3430076088 Very quickly process remaining review comments 2020-07-31 13:25:08 +02:00
Aaron van Geffen 16a484545a
Use WW in MapGen common widgets 2020-07-31 11:26:49 +02:00
Aaron van Geffen e6e850e399
Apply suggestions from code review
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2020-07-31 11:25:50 +02:00
Duncan c6e26267a4
Reduce the use of GET_VEHICLE (#12494)
* Start removing GET_VEHICLE macro use

* Further work

* Remove further GET_VEHICLE's

* Further removal of GET_VEHICLE

* Remove the last of GET_VEHICLE

* Fix testpaint

* Fix nullptr deref

* Make review changes

Also swapped in helper functions and used a standard patern for iterating the train cars

* Further simplify loops for train cars
2020-07-31 07:48:27 +01:00
Aaron van Geffen d32809eaef
Fix formatting for StaffFirePrompt (#12525) 2020-07-30 23:06:01 +02:00
Aaron van Geffen 16ad1d18fb
Refactor another set of widget definitions (#12503)
* Refactor TopToolbar

* Refactor TrackDesignManage

* Refactor TrackDesignPlace

* Refactor TrackList

* Refactor ViewClipping

* Refactor Viewport

* Refactor TitleEditor

* Refactor TitleCommandEditor

* Refactor Themes

* Refactor TextInput
2020-07-30 22:58:49 +02:00
Aaron van Geffen b738c4fa87 Refactor StaffFirePrompt 2020-07-30 22:51:32 +02:00
Aaron van Geffen fe9d577c2e Refactor Staff 2020-07-30 22:45:40 +02:00
Aaron van Geffen e8e61bd987 Refactor Sign 2020-07-30 22:39:09 +02:00
Aaron van Geffen 9b6f6b6216 Refactor Ride 2020-07-30 22:36:42 +02:00
Aaron van Geffen c1cff7fab0 Refactor Park 2020-07-30 22:25:18 +02:00
Aaron van Geffen 8325ec04ed Refactor ObjectLoadError 2020-07-30 22:05:11 +02:00
Aaron van Geffen 173c103573 Refactor NewRide 2020-07-30 21:56:51 +02:00
Aaron van Geffen 5e04508a59 Refactor NewCampaign 2020-07-30 21:54:26 +02:00
Aaron van Geffen 60e397abb9 Refactor Network 2020-07-30 21:51:13 +02:00
Aaron van Geffen 240e45d62d Refactor MusicCredits 2020-07-30 21:51:03 +02:00
Aaron van Geffen 24fc4119c9 Refactor Multiplayer 2020-07-30 21:28:48 +02:00
Aaron van Geffen 915dc5f07c Refactor MazeConstruction 2020-07-30 21:23:51 +02:00
Aaron van Geffen cd5b506b6b Refactor MapTooltip 2020-07-30 21:21:08 +02:00
Aaron van Geffen 768fcfcba2 Refactor MapGen 2020-07-30 21:18:32 +02:00
Michael Steenbeek bb1d81471d
Fix #12506: Cannot advertise food if there are no rides in the park 2020-07-29 10:44:38 +02:00
Michael Steenbeek 469f894701
Fix #12505: Stores can only have the first product advertised 2020-07-29 00:08:16 +02:00
Tulio Leao 63f683853e
Merge pull request #12479 from pizza2004/news-enum
Refactor NewsItem to use strong enums
2020-07-28 18:21:45 -03:00
Michael Steenbeek f8ab48176a
Tile Inspector: remove hardcoded surface/edge style names 2020-07-28 22:37:52 +02:00
pizza2004 a3edeabb5c Refactor NEWS_FLAG_* to use strong enum 2020-07-28 12:54:31 -06:00
pizza2004 c2b11a9582 Close #12398: Refactor NEWS_TYPE_* to use strong enum 2020-07-28 12:54:31 -06:00
pizza2004 cee7f8d34c Close #12397: Refactor NEWS_ITEM_* to use strong enum 2020-07-28 12:54:18 -06:00
Aaron van Geffen b34b573ad9
Refactor more widget definitions (#12354)
* Refactor Dropdown

* Refactor EditorMain

* Refactor EditorScenarioOptions

* Refactor InstallTrack

Increased window height to 460 (was 448); one line of text was overflowing.

* Refactor Guest

* Refactor LandRights

* Refactor LoadSave

* Refactor Main

* Refactor Map

* Add extra constants to EditorScenarioOptions
2020-07-27 19:54:22 -03:00
frutiemax af0fc89cf4
Close #12456: Refactor INPUT_STATE to use strong enum (#12484) 2020-07-27 19:51:10 -03:00
Michał Janiszewski 6a191224b5
Fix formatting of UiContext.macOS.mm 2020-07-27 17:20:28 +02:00
Michał Janiszewski 352870b503 Add OpenURL method, with implementation for Linux and Windows 2020-07-26 22:09:29 +02:00
Ted John cf9e8022a0 Fix #12297: OpenGL renderer causing artifacts
Do not re-allocate texture memory if we don't need to and aren't going to restore the old pixels.
2020-07-26 18:46:23 +01:00
Duncan 8a378ad236
Remove uses of GET_PEEP macro and replace with GetEntity (#12467)
* Use TryGetEntity and GetEntity instead of macro

* Use GetEntity for ui guest window

* Remove final GET_PEEP macro uses

* Fix remaining issues
2020-07-26 17:42:02 +01:00
Michael Steenbeek 9db2aac3bf
Merge pull request #12482 from frutiemax/Fix12457
Close #12457: Refactor INTRO_STATE to use strong enum
2020-07-26 15:40:22 +02:00
frutiemax 6598ae14aa Close #12457: Rename INTRO_STATE to use PascalCase 2020-07-26 09:32:53 -04:00
frutiemax 0f1788d273 Part of #12457: Refactor INTRO_STATE to use strong enum 2020-07-26 09:25:29 -04:00
Michał Janiszewski f1fa016400
Reset window pointer when cleaning up after dropdown 2020-07-26 10:09:56 +02:00
Matt fa2bd4cad6 Refactor PeepType to use strong enum 2020-07-25 11:54:37 +02:00
Michael Steenbeek 6ba6184602
Merge pull request #12362 from Gymnasiast/refactor/object-entry-index-null-to-0xFFFF
Change ObjectEntryIndex null value to 0xFFFF
2020-07-25 09:25:04 +02:00
Aaron van Geffen 4d0d41dfbe
Restore spinner decrease button width (#12370) 2020-07-24 19:12:11 +02:00
Gymnasiast 682add27dd
Change ObjectEntryIndex null value to 0xFFFF 2020-07-23 12:45:42 +02:00
Duncan 4a235e3bb6
Refactor ResearchItem Type to an enum class (#12346)
* Change type of ResearchItem.type to enum class

This is to prevent any future issues caused by confusion as to what the type is and further improves the codebase.

* Specifiy a size for the type

Also remove the static cast where not required

* Apply review comments
2020-07-22 14:25:05 +01:00
Aaron van Geffen 205fc3332b
Refactor more widget definitions
* Increase height for changelog button in about window
* Tackle banner window
* Tackle changelog window
* Tackle custom currency window
* Tackle finance summary
* Tackle quit prompt widgets
* Tackle debug paint widgets
* Tackle demolish and refurbish prompt widgets
2020-07-21 17:38:57 +02:00
Aaron van Geffen 7b5087f057
Update copyright year to 2020 2020-07-21 15:04:34 +02:00
Aaron van Geffen 8f57c22bfe
Refactor options window widget definitions into new format (#12316) 2020-07-21 14:14:44 +02:00
Michael Steenbeek 09ece01096
Merge pull request #12303 from AaronVanGeffen/refactor/cheats
Refactor cheats window
2020-07-21 11:36:24 +02:00
Aaron van Geffen 3d7c0a567e Introduce local constants per review suggestion 2020-07-20 00:12:04 +02:00
Aaron van Geffen 0a5b75e882
Refactor more windows into new-style widget format
* Ride Construction
* Ride List
* Save Prompt
* Scenery
* Scenery Scatter
* Server List
* Server Start
* Shortcut Keys
2020-07-19 19:36:54 +02:00
Aaron van Geffen b966173550
Fix #12315: Re-introduce titles in Finances and Research windows. (#12317) 2020-07-19 14:31:24 +02:00
Aaron van Geffen d303f0b1ef Add constants for common cheat widget sizes. 2020-07-19 11:54:41 +02:00
Aaron van Geffen 15704d6d33 Refactor cheat window widget definitions into new format 2020-07-17 22:46:50 +02:00
Aaron van Geffen 6375d79c27 Cheats window: unfold existing window-specific macros 2020-07-17 22:46:48 +02:00
Gymnasiast cf664c8340
Close #11971: Replace ride groups with new ride types 2020-07-17 00:19:49 +02:00
frutiemax f49149222e
Close #12245: Use coords objects for SetLocation (Window_internal.h) 2020-07-16 23:01:42 +02:00
Aaron van Geffen 79ae0786c0
Refactor more widgets definitions into new format
* About
* Editor Bottom Toolbar
* Editor Inventions List
* Editor Object Selection
* Error
* Finances
* Footpath
* Game Bottom Toolbar
* Guest List
* Network Status
* News
* News Options
* Player
* Research
* Staff List
* Title Options
* About window.

And fix MakeSpinnerWidgets declaration order.
2020-07-16 20:48:25 +02:00
frutiemax 0fa0ca451e
Part of #12245: Use coords for window_scroll_to_location (#12282) 2020-07-15 23:26:27 -03:00
frutiemax c474f2ddc0
Close #12096: Use only ScreenRect on gfx_fill_rect (#12280) 2020-07-15 22:34:57 -03:00
Tulio Leao 289dc96f25
Remove goto from window_create_auto_pos (#12256)
* Reduce code duplication on window_create_auto_pos

* Remove deadcode from window_create_auto_pos

Cascadin window offset deadcode

* Extract ClampWindowToScreen from window_create_auto_pos

* Remove goto usage from window_create_auto_pos
2020-07-15 22:59:35 +01:00
frutiemax cd92597ec4
Part of #12096: Use ScreenRect on gfx_fill_rect in Tile*.cpp (#12248) 2020-07-15 16:19:49 -03:00
Tulio Leao f36a86e9e6
Use MakeWidget for most Title windows and the ToolTip (#12264)
* Use MakeWidget for windows/Tooltip.cpp

* Use MakeWidget for windows/TitleScenarioSelect.cpp

* Use MakeWidget for windows/TitleMenu.cpp

* Use MakeWidget for windows/TitleExit.cpp

* Use MakeWidget for windows/TitleLogo.cpp

* Clarify initial size of TitleMenu buttons
2020-07-15 15:48:41 +02:00
Michael Steenbeek d80f9b511f
Merge pull request #12255 from Gymnasiast/refactor/more-constants-in-track-curve
Refactor/more constants in track curve
2020-07-15 15:36:42 +02:00
Tulio Leao 0951c0c5cc
Remove goto from input_state_widget_pressed (#12265) 2020-07-15 07:50:01 -03:00
frutiemax f94c3bc2f3
Close #12242: Convert TrackDesignPlace static globals to use Coords (#12249) 2020-07-15 04:01:16 +02:00
Aaron van Geffen 5344bc2e38 Convert terraforming tools to new widget defintions 2020-07-14 23:36:22 +02:00
Gymnasiast e080d4655e
Use RideConstructionSpecialPieceSelected in two more places 2020-07-14 01:10:47 +02:00
Michael Steenbeek 1034aadb72
Merge pull request #12238 from frutiemax/Fix12223
Close #12223: Assert that Formatter::Add() only receives desired types
2020-07-14 00:05:37 +02:00
frutiemax 5f4e1ba344 Forbid usage of uint8_t* in formatter::Add 2020-07-13 17:40:04 -04:00
frutiemax 84a4c4e473
Part of #12096: ScreenRect on gfx_fill_rect in windows/Ride.cpp (#12239) 2020-07-13 17:49:12 -03:00
frutiemax b39a0037f0
Close #12164: Use Coords for place_virtual_track (#12240) 2020-07-13 16:37:10 -03:00
frutiemax 59618327af
Part of #12096: Use ScreenRect on gfx_fill_rect in Map.cpp (#12230) 2020-07-13 14:36:49 -03:00
Michael Steenbeek 1cf89362f0
Merge pull request #12184 from IntelOrca/sea
Add support for reading .sea (RCT classic) files
2020-07-13 17:23:16 +02:00
Michael Steenbeek 132b2e5966
Fix #12071: Crash in Guest List when a guest dies (#12126)
Send refresh guest list intent on peep removal

Also added protection to guest list to prevent accessing invalid peeps
2020-07-13 09:31:04 -03:00
Thamara Andrade 0fb2a6216c
Close #12099: Use ScreenLine on gfx_draw_line (#12143) 2020-07-12 18:50:52 -03:00
frutiemax 27734e2971
Part of #12160: Use Coords for viewport_coord_to_map_coord (#12216) 2020-07-12 18:42:54 -03:00
frutiemax 508344a088
Close #12174: Remove Formatter additions with uintptr_t 2020-07-11 18:56:12 +02:00
Michael Steenbeek b43ce35ef5
Fix: Map Generator shows incorrect map sizes (#12211) 2020-07-11 12:19:01 -03:00
Ted John 8c81cacc6f Add sea decryption 2020-07-11 11:40:34 +01:00
frutiemax 123d0cceb6
Close #12173: Remove Formatter additions with void* (#12196) 2020-07-11 03:06:23 +02:00
Ted John 0e788918e2 Fix build for latest VS2019 2020-07-10 18:44:26 +01:00
frutiemax 0e96674a46
Part of #12096: ScreenRect w/ gfx_fill_rect in libopenrct2ui (#12188) 2020-07-10 13:59:08 -03:00
Michał Janiszewski dbf00956b5
Fix null pointers reported by launchpad builders (#12168) 2020-07-09 22:52:14 +01:00