Commit Graph

75 Commits

Author SHA1 Message Date
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