Commit Graph

158 Commits

Author SHA1 Message Date
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
Ted John 83d1b6eb8f Refactor widget.c to C++ 2018-01-07 12:39:58 +01:00
Michael Steenbeek 755add6c9a
Compile localisation folder as C++ 2018-01-06 18:32:25 +01:00
Michael Steenbeek d25856d59c Make tile element type strings in the Tile Inspector translatable 2018-01-03 10:21:53 +01:00
Marijn van der Werf 1e946fc0fe Move Dropdown to UI project 2017-12-16 15:47:38 +02:00
Michael Steenbeek 6dc49d643a Compile files in base dir as C++ 2017-12-13 08:03:48 +01:00
Michael Steenbeek 60d8865efb Compile game.c and game.h as C++ 2017-12-05 09:10:27 +01:00
Michael Steenbeek 407f1ad148
Create scenery_small_entry_has_flag() 2017-12-04 20:09:38 +01:00
Marijn van der Werf f19344aea6 Move tile inspector to UI module 2017-11-23 23:12:25 +01:00
Renamed from src/openrct2/windows/TileInspector.cpp (Browse further)