Orders window has different widget layouts depending on vehicle type
which don't all have the same widgets, and therefore it tries to disable
widgets that might not exist.
Restore the old behaviour of ignoring such requests, instead of crashing.
This changes from naming storage-type to naming functionality.
* `FillNestedArray` is renamed to `FillWidgetLookup`.
* `Window::nested_array` is renamed to `Window::widget_lookup`.
* `array` parameter renamed as well.
Having two ways (`FillNestedArray` and `SetupSmallestSize`) to initialize
`Window::nested_array` introduces confusion.
Instead, make `FillNestedArray` the canonical way, always call it, and remove
init_array from `SetupSmallestSize`.
This simplifies processing nwidget parts as, unlike the remaining length, the pointer to the end of the list never changes. This is the same principle as we use(d) for tracking end instead of length for C-style strings.
And this removes 160~ instances of the lengthof() macro.
This replaces/simplifies testing for a closebox to allow closing a window with right-click, and testing for specific window classes when closing all windows by hotkey.
This allows right-click closing of dropdowns and the high-score window.
Clicking and releasing on the query toolbar icon is meant to select the land-info tool.
This did not work as during closing a window, OnFocusLost() is called, which then closes the window again. These two calls toggled the land-info tool one and off in the same action.
Resolve by not calling Window::Close in OnFocusLost() if the window is already closing.
They all now access a std::string_view, instead of a "const char *"
or std::string (in some cases).
Additionally, GetCharAtPosition and friends now return an index
instead of a "const char *", as it makes for a more clear interface.
This to prevent compilation issues between runs with and without precompiled
headers. Also remove the headers from the rest of the code base as they are
not needed there anymore, although they do relatively little harm.
* Fix: Use width of caret symbol '_' for text entry.
This replaces an arbitrary pixel width with the space actually required.
* Fix#8971: Update QueryString sizes with interface scale change.
Progress bars are drawn differently depending on when it was added, with
different layouts and sizes.
This change adds a standard padding size to use, and makes all progress
bars visually similar, with scaled padding.