Commit Graph

158 Commits

Author SHA1 Message Date
Gymnasiast f365bc3cb7
Create getters and setters for occupied quadrant 2019-08-27 21:12:48 +02:00
Gymnasiast 4c684031bf
Remove game command remnant in Tile Inspector 2019-08-19 20:38:48 +02:00
Gymnasiast 255ce3f62b
Extend tile element size to 16 bytes 2019-08-18 14:03:36 +02:00
Matt cc6321048f
Refactor window_invalidate to use rct_window::Invalidate 2019-08-11 17:22:00 +02:00
Ted John f7c86debe3 Fix #9767: NRE in window_tile_inspector_paint 2019-08-08 12:42:09 +01:00
Ted John 61d64ab8c5 Do not use user strings for banners 2019-07-29 19:18:16 +01:00
Ted John 3f45976009 Fix openrct2ui errors 2019-07-29 19:18:16 +01:00
Ted John 5c07c53faf Refactor get banner 2019-07-25 22:21:19 +01:00
Hielke Morsink 2792ddfe80 Tile Inspector: Use correct names for up/down buttons
This little mistake has been around for years and is most likely caused
by reordering the buttons. They used to be side-to-side, but their names
were never changed, and since the order of tile elements is reversed I
never noticed it was wrong.
2019-07-21 11:34:50 +02:00
duncanspumpkin ecbff5d4f2 Refactor to use CoordsXY 2019-06-20 18:53:30 +01:00
duncanspumpkin 2a60268c05 Fix #9440. Set the tile coordinate correctly with spinner. 2019-06-20 18:52:40 +01:00
duncanspumpkin 96ec0123ca Refactor and clean up for CI's. 2019-06-11 18:43:23 +01:00
duncanspumpkin 3162d4dc75 Implement TileModifyAction
Further work moving game commands into the game action framework
2019-06-11 18:42:52 +01:00
joshtucker132 4dc77bf121 Feature #8791: Improved tile element flag manipulation in Tile Inspector 2019-05-14 21:38:31 +02:00
Hielke Morsink ac7bc97736 Expose colour scheme in the tile inspector (#6116) 2019-04-22 15:49:09 +02:00
Hielke Morsink d8f1933a5b Show dash for station index for non-station elements 2019-04-22 15:25:29 +02:00
Aaron van Geffen 2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
duncanspumpkin d3c0a76259 Use correct functions where defined 2019-02-27 10:49:48 +00:00
duncanspumpkin fae15fceca Use IsBroken 2019-02-27 10:49:48 +00:00
duncanspumpkin ab058fe659 Remove unnecessary compare with zero 2019-02-26 08:13:21 +00:00
duncanspumpkin 737c308e4e Use IsGhost() to access ghost state
Added set and clear ghost to further prevent direct access to flags
2019-02-25 15:12:35 +00:00
Michael Steenbeek 2a4215a30f
Create constant for SCROLLING_MODE_NONE 2019-02-14 22:41:48 +01:00
Michael Steenbeek fdba61002f
Add station index to Tile Inspector 2019-01-08 11:25:12 +01:00
Michał Janiszewski 8a70b29f64
Fix GCC's warning regarding enum vs non-enum values being compared (#8551) 2019-01-04 21:29:44 +01:00
Michael Steenbeek b5317ee9e9
Split drawing of path and railing 2019-01-02 19:52:53 +01:00
ζeh Matt 7d19a5bc77 Refactor memcpy to std::memcpy and memset to std::memset (#8408) 2018-12-15 22:23:31 +01:00
ζeh Matt 940fff4bbf Fix dereferencing nullptr when game objects are missing. (#8360) 2018-12-05 22:59:15 +01:00
Hielke Morsink 354d973a48 Use std::size instead of Util::CountOf 2018-11-23 21:59:08 +01:00
Michael Steenbeek f8add7f62e
Rename rct_tile_element to TileElement 2018-11-01 13:53:50 +01:00
Michael Steenbeek 5f4cca3c7e Remove rest of access to footpath edges 2018-10-31 15:08:06 +01:00
Michael Steenbeek d89c3d9e67 Replace calls to get path edges
This replaces most calls/direct access to the footpath edges (i.e. the orthogonal directions, not the corners). This includes places where the whole byte was retrieved, but only compared against orthogonal directions.
2018-10-31 15:08:06 +01:00
Michał Janiszewski 95175b44e9
Prevent recently closed window from having actions performed on it (#8143)
Fixes #8121
2018-10-24 20:57:39 +02:00
Gymnasiast 774d26306f Fix formatting 2018-10-04 14:54:13 +02:00
Gymnasiast 015ece94c6 Replace C-style functions for getting path entries 2018-10-04 12:13:17 +02:00
Gymnasiast ecd6247462 Replace C-style functions for checking getting path additions 2018-10-04 12:13:17 +02:00
Gymnasiast 37f59e17dc Replace C-style isSloped() function 2018-10-04 12:13:17 +02:00
Michael Steenbeek 882a65e4c0 Port queue functions 2018-10-03 12:18:21 +02:00
Michael Steenbeek f8483b4726 Fix formatting 2018-09-27 22:15:04 +02:00
Michael Steenbeek 3b7fc4cf8c Port rest of banner functions 2018-09-27 22:15:04 +02:00
Michael Steenbeek d01b21a1ac Port banner index 2018-09-27 22:15:04 +02:00
Michael Steenbeek 3c93aca727 Port entrance station index and sequence lookup 2018-09-27 22:15:04 +02:00
Michael Steenbeek c7eaa1ba80 Port entrance ride index lookup 2018-09-27 22:15:04 +02:00
Michael Steenbeek cc7f8e612d Port entrance type lookup 2018-09-27 22:15:04 +02:00
Michael Steenbeek a3e9c63fc3 Move GetRideIndex to struct methods 2018-09-25 21:57:21 +02:00
Michael Steenbeek 650971bc68 Move HasChain to struct methods 2018-09-25 21:57:21 +02:00
Gymnasiast ae4c464ce7 Move getting track sequence to struct methods 2018-09-25 21:57:21 +02:00
Gymnasiast 8908f3f47e Move getting track type to struct methods 2018-09-25 21:57:21 +02:00
Michael Steenbeek 6062960390 Port remaining wall stuff to struct methods 2018-09-17 15:42:34 +02:00
Michael Steenbeek 508276b081 Remove lots of direct access to ->type fields 2018-09-17 15:18:07 +02:00
Gymnasiast 0f08128657 Fix formatting 2018-09-16 21:34:51 +02:00
Michael Steenbeek 74ccf010e6 Port surface elements to new structure 2018-09-16 21:34:51 +02:00
Michael Steenbeek 35b4724626 Port large scenery to new structure 2018-09-16 21:34:50 +02:00
Michael Steenbeek 1a825a4045 Small fixes 2018-09-14 10:18:46 +02:00
Michael Steenbeek b5bb4c7fb9 Do not access old small scenery age field 2018-09-13 17:26:36 +02:00
Michael Steenbeek e9993f78de Replace read access of small scenery entry index 2018-09-13 17:02:38 +02:00
Michael Steenbeek a02d360df6 Change TileElement to use OpenLoco's structure 2018-09-13 15:36:32 +02:00
Linus Unnebäck fd07be587a
Remove Math::Clamp in favour of std::clamp 2018-08-12 16:47:12 +01:00
clang-format b02dfdbc93 Binpack function arguments together
Previously when the arguments of a function wouldn't fit on a single line, clang-format would put each argument on its own line instead. By enabling the binpack parameter setting, it tried to fit as many on one line as possible instead.

Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
2018-07-23 16:00:22 +02:00
clang-format 95ce592579 Enforce not breaking before assignments and function names
Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
2018-07-23 16:00:19 +02:00
clang-format e558660860 clang-format UI windows 2018-07-23 16:00:14 +02:00
Michael Steenbeek 1b08fb4e69 Replace our own integer types with standard ones 2018-06-20 17:30:40 +02:00
Michael Steenbeek ec3a1e575e
Replace Math::Min and Max with std variants 2018-06-20 17:11:35 +02:00
Hielke Morsink 0cf256ac9e Ready copyright notice for clang-format
Clang-format sees the text behind `#pragma region` as code and formats it. Instead of stating the copyright and date there, it's now in the comment block right below it. The text "Copyright" is left in the `#pragma region` line, as clang-format sees it as a single identifier.

I took the opportunity to normalize the dates, and add the copyright notice to the source files where it was missing them (except for third-party and the generated resources.h file).
2018-06-15 14:07:34 +02:00
Hielke Morsink 7355b497a1 Use new banner index type
BannerIndex is defined in common.h (like some other types such as money32 and rct_string_id), so that banner.h wouldn't have to be includede everywhere. Later on, it may be nicer to have a custom types file instead of putting them all in common.h.
2018-06-11 13:29:41 +02:00
Ted John 3096c4de00 Remove window internals from TileInspector logic 2018-06-11 00:09:00 +01:00
Hielke Morsink 36d123b272
Revert renaming of spinners (#7650) 2018-06-10 21:31:08 +02:00
Hielke Morsink 82370c36c6
Allow holding down spinners in tile inspector (#7647)
This basically moves much of the event handling from mouseup to mousedown, and adds a new array with widget indices for the spinners. This automatically enables scrolling for them as well.
2018-06-10 18:55:44 +02:00
Hielke Morsink 0fc4cad80f
Fix tile inspector errors for banner (#7640)
This is likely the least used page of the tile inspector, since two things have been broken for months apparently.

- The checkboxes for the blocked edges weren't being positioned correctly
- Rotating a banner that has either 0 or more than 1 edges blocked, the blocked edges weren't updated correctly
2018-06-09 17:16:04 +02:00
Aaron van Geffen f2b0f7457e Terminology change: rename spinners to steppers. 2018-06-01 23:25:07 +02:00
Aaron van Geffen 64b04cccd1 Change spinners in Tile Inspector to new +/- buttons. 2018-06-01 15:20:13 +02:00
Hielke Morsink 617372fd38 Check for page correctly 2018-05-27 18:07:05 +02:00
Hielke Morsink 15ae358946
Fix #7569: Assertion hit when using the XY spinners (#7570)
The X/Y spinners change the currently tile selected, and reset the element selection index. Previously this would also set the page to default immediately, but since that's now done on invalidation instead, the page would not be correct. This is fixed by checking the index of the selected element too, instead of only the selected page, in the mouse_up event.
2018-05-27 18:03:34 +02:00
Aaron van Geffen 7a107264df Tile inspector: clip overly long object name strings. 2018-05-26 01:20:46 +02:00
Aaron van Geffen 146235931f Tile inspector: use SCROLLABLE_ROW_HEIGHT constant.
The tile inspector window was using its own LIST_ITEM_HEIGHT constant,
instead of the SCROLLABLE_ROW_HEIGHT constant commonly used in other windows.

This fixes CJK text overlapping.
2018-05-26 01:20:29 +02:00
Hielke Morsink 1a9dc7beee
Fix #7564 Some buttons are not greyed out when they should (#7565) 2018-05-25 23:09:52 +02:00
Aaron van Geffen a2f39079a7
Merge pull request #7556 from Gymnasiast/tile-element-cleanup
Replace all occurrences of tile_element_is_last_for_tile()
2018-05-25 13:34:28 +02:00
Hielke Morsink c50011aa3e Re-add zebra stripes and light text 2018-05-25 00:46:21 +02:00
Hielke Morsink 59c7b097ee Add Ctrl + Click to select tile elements
Co-authored-by: wolfreak99 <jbminor1991@gmail.com>
2018-05-25 00:46:20 +02:00
Hielke Morsink 0d77c279aa Fix: buttons sometimes stay pressed
In the invalidate function of the tile inspector, the checkboxes get checked to match the selected tile element. Some of those checkboxes share their widget index with buttons from other pages. When a checkbox is checked, the it's set to be "pressed", which causes the butons in the other tabs so appear that way. This behaviour is fixed by unpressing widgets when switching to another page.
2018-05-25 00:46:20 +02:00
Hielke Morsink fe40005372 Automatically set the correct page
Instead of having to set the page and setup the widgets correctly when a new elements gets selected, it now switches automatically on invalidation to the correct tab. This fixes the issue where pasted elements were selected but the page for them not shown, and removes two of the intents that were made for the tile inspector.
2018-05-25 00:46:20 +02:00
Hielke Morsink 4b25a71924 #5832 Resize tile inspector automatically when selecting a tile element 2018-05-25 00:46:19 +02:00
Hielke Morsink f79589527d Adjust list style to match other lists
- No odd/even checked colours
- Black text (white on hover)
- Darker background
- Solid fill background for hovered and selected element
2018-05-25 00:46:19 +02:00
Hielke Morsink 4c1097d5b1 Minor code cleanups 2018-05-25 00:46:19 +02:00
Michael Steenbeek b573bd49b3 Replace all occurrences of tile_element_is_last_for_tile() 2018-05-24 11:44:53 +02:00
Michał Janiszewski a2ef4bd699
Exclude pre-formatted blocks from clang-format (#7520)
[ci skip]
2018-05-16 20:41:29 +02:00
Michael Steenbeek 5f9d40be7a
Replace tile_element_get_type() with struct method 2018-05-02 19:27:04 +02:00
Michael Steenbeek b725916808 Use TitleCase 2018-05-02 13:27:53 +02:00
Michael Steenbeek ef433df26a Clean up tile element usage, introduce struct methods 2018-05-02 11:58:12 +02:00
oli414 3bff12c081 Seperate surface tile element 2018-05-01 16:33:16 +02:00
Michał Janiszewski cd065d4f41 Reduce includes in common header 2018-03-20 00:27:58 +01:00
Hielke Morsink 55979a3fff Remove and replace C typedefs
`typedef struct/union/enum name { ... } name_again;` is not needed whe compiling C++, moving the name at the back to be in front of the object and removing `typedef` makes it usable the very same way.
This also replaces typedefs with the using keyword. They have better readability, especially for function pointer types, and would allow more flexibility when used with templates.
2018-02-14 09:42:26 +01:00
Hielke Morsink 915dbdf869 Add button to tile inspector to make entrances usable
With this, entrances and exits that have been moved away from its original XY
location can be made usable. Only one entrance or exit will be usable per
station.
2018-02-06 19:09:51 +01:00
Marijn van der Werf 4c956def67 Update UI imports 2018-01-18 22:57:55 +01:00
Michael Steenbeek 037b236d8f Add the RCT1 edge styles 2018-01-13 15:39:22 +01:00
ZehMatt 84f2917f59 Use const and constexpr whenever possible. 2018-01-11 22:29:08 +01:00
Michael Steenbeek cd5a1ba888 Compile files in world folder as C++ 2018-01-11 13:25:09 +01:00
Michał Janiszewski 469e142c7b Change casing of header files 2018-01-11 09:30:09 +01:00
Aaron van Geffen c9b48beea0 Replace WWT_CLOSEBOX with WWT_BUTTON where not used as a close button. 2018-01-08 00:02:25 +01:00
Aaron van Geffen ecc1cfed2a Rename WWT_DROPDOWN_BUTTON to WWT_BUTTON.
The previous name implied an exclusive association with dropdowns.
While used to display the dropdown triangle button, this is not an
exclusive use.
2018-01-08 00:01:32 +01:00
Aaron van Geffen 9a2d3b226c Rename WWT_13 to WWT_TABLE_HEADER.
This is used for left-aligned header buttons for data tables.
2018-01-07 23:54:51 +01:00