This avoids issues if the events being executed add new handlers, since adding a new handler needs to sort the list according to the event priority.
Fixes#8157
Fixes the display of topic headings, including unit names, in right to left
languages (Arabic and Hebrew).
The GUI1 menu code is only kept to support one UI feature, the help browser.
However, the code supported multiple columns and multiple things in each
column; to do the latter it handled each column as a string with embedded
separators. To support the help GUI, all that's needed is for each row to have
an indent, an icon, and a text field. Traces of the multiple-column support are
still in the code, but the drawing code is simplified.
The logic for working out whether mouse clicks are on the icon or the text has
moved from the subclass to the main menu class, as it's a subset of the logic
for drawing the UI.
In LTR languages, this looks almost identical.
In RTL languages, the book icons now appear in the right place, and the text
placement is reasonable.
Remove some special cases from the drawing code, because menu::draw_row
was previously also used for drawing the headings.
As scale_images was never called, adjust_image_bounds was a no-op.
This is separate from the main dead code removal commit because it touches
active code paths.
The GUI1 menu code is only kept to support one UI feature, the help browser.
More specifically, the left-hand pane that looks like a treeview.
Remove the code for sorting the list in the UI. The help articles are ordered
by category, and there isn't a UI control for the user to sort them into a
different order.
Remove erase_item(), which wasn't called from anywhere.
Remove clear_item(), recalculate_pos() and assert_pos(). These three were
only called by the sorting code and erase_item().
If case insensitive handling is wanted here then it needs to show all matches not just an arbitrary first one.
Since this forwards to searchlog which properly matches case insensitively anyway that does not seem particularly useful though.
This not only fixes the error in the GUI2 widget __dir metamethod,
but also makes the system swallow any errors in said metamethod.
A Lua warning is output if such an error arises.
C++20 makes aggregate initialization more restrictive. Any user-defined, rather than just use-provided,
constructor is forbidden for an aggregate class, including defaulted ones.
Avoids two to four function calls on each SDL_MouseWheelEvent.
Also update code comment and changelog entry based on @vgaming's report
of issue #3362 being fixed.
Slightly improves commit ab4001d. Tested again with SDL 2.0.14 and
2.28.5.
This makes iterators based on this class to meet LegacyInputIterator requirements, allowing them to be used with STL algorithms such as MSVC's `std::find_if`.
Previously, the mod parser returned a raw to-heap pointer. Once added to a mod queue, it would then
be owned by a shared_ptr (overkill). This makes it so the mod executors are managed by unique_ptrs
for their entire lifetime.
* Fix horizontal scrolling regression (fixes#7404)
The old issue #2218 was actually a bug in SDL, fixed on X11 in version
2.0.18 and on Wayland in version 2.0.20. The hardcoded workaround in
pull #2481 (commit 4bc4373) caused a regression in fixed SDL versions.
This fix is similar to the workaround in widelands/widelands#5394
committed as widelands/widelands@67db32a.
Tested with SDL 2.0.14 and 2.28.5.
* Make mouse handler use same coordinate signs as map
Also fix mouse_wheel_*() virtual method calls, which have been wrong in
the X axis since commit dfe2f33 (and unused since commit c912f7e).
selected schedule will write to utils/schedule.cfg on scenario save
HOTKEY_EDITOR_CUSTOM_TODS is disabled unless user loads scenario
custom_tod:Preview button and associated callback added.
editor:translatable attributes now written with leading underscore
editor:support for multiple custom time schedules
Fixes#2919.
The severities would always override the previous one, in this order: error < warning < info < debug < none.
This commit changes this behavior so the directives are applied in the order they appear in the command line. Additionally, it is now possible to specify the same log severity multiple times.
previously it needed multiple calls to remove multiple types of modifications (which could be slow since each call involves a full rebuild of the unit).
assert() is not a good way to handle incorrect user input,
It is a debugging tool that should only be used for
conditions that the program guarantees to be true
(unless there a is a bug in the c++ code).