36237 Commits

Author SHA1 Message Date
pentarctagon
bcec952e1e Fix duplicate mod ids breaking mod selection
Fixes #6780
2024-02-11 14:38:14 -06:00
Steve Cotton
6828b54ac7 Log instead of assert for incorrect [teleport] tags in ActionWML
Each [teleport] tag should have exactly one each of [source],
[target] and [filter]. Missing any of those is caught immediately
above the new conditional block, so this makes having two or more
of any of them be treated the same.

The log should maybe be made more visible, but it's a case that
can already be detected by schema validation, so validate it
there instead.

The code in teleport.cpp uses assert() in the cases that the
newly-added code in this commit catches. That's bug 8175, and
it's probably still reachable for units with teleport abilities,
so this doesn't close that bug.
2024-02-09 14:45:03 +01:00
shijie.chen
5d7479b0e1
Remove unnecessary includes (#8347) 2024-02-08 09:40:17 -06:00
Celtic Minstrel
249f9e70f9 [Lua] Fix an error reading filters in wesnoth.game_events.add 2024-02-07 22:09:55 -05:00
gfgtdf
60ae0db611
remove nonsensial comment
we call do_replay() after at_end() so its clearly possible  to be at the end here
2024-02-06 02:51:36 +01:00
Severin Glöckner
dd40711d79 Avoid linebreak in title text of help pages
* doesn't clutter unit help tree when a unit variation is displayed
* when displaying a unit variation in the help, it displays the links
  below the unit image at the same line as when displaying the base unit
patch from #6011
2024-02-04 21:20:52 -06:00
Celtic Minstrel
c143dfdfeb Fix shallow_literal/shallow_parsed not returning named tuples for the WML tags 2024-02-04 16:23:25 -05:00
pentarctagon
d71d3b25cd Force the UI to update fully when changing addon filters
content_resize_request() doesn't appear to return the correct result in this case, even when the number of rows to display has increased.

Fix #7270
2024-02-04 12:02:59 -06:00
pentarctagon
e3ee472352 Remove transparent padding from the status icon image files.
Just removing transparency from all images on the top bar and side bar causes other issues, particularly with the unit sprite and the clock icon alignment.

Fixes #8335
2024-02-04 10:56:03 -06:00
shijie.chen
cfd8aabb94 [dev] Remove unused header files 2024-02-03 20:21:57 +01:00
gfgtdf
75784ee3c3
make sure transform_unit doesn't heal the unit (#8147)
Previously it could happen that removing an object applies the status healing,
in particular of the default AMLAs (which are meant to only heal the unit once).
2024-02-03 18:47:37 +01:00
gfgtdf
30139da16c
fix typo in comment 2024-02-02 20:28:45 +01:00
Steve Cotton
6b516e8aa5 Fix deprecation warning when setting [endlevel]end_credits=
Change the Lua implementation to directly call the
non-deprecated function, this is related to 9daa10a9f2.

Clean up the C++ header files by removing the declarations of
functions that were removed in 3c8de46771.

Use [endlevel]end_credits=no in the test scenario (trigger it
by moving to hex 9,3). If you debug with :next_level without
triggering the moveto, "The End" will show; trigger the moveto
first, and it won't show the credits.
2024-02-02 16:04:27 +01:00
pentarctagon
37a45c32ce Re-add cropping of transparent padding on status icons.
Fixes #8303
2024-02-01 09:32:14 -06:00
gfgtdf
9dbbb09fc3
fix whitespace 2024-02-01 01:34:37 +01:00
gfgtdf
05d1e4b9ba
require_modification/campaign now defaults to yes (#8135)
It's better to be defensive with those default values,
especially now that the mp lobby code can automatically
download addons, having require_modification set to true
isn't inconvenient for the users either.

(The issue that the added comment is about isn't something
that was added in this commit)
2024-02-01 01:29:20 +01:00
gfgtdf
5ab3fc0488 fix (most parts of) 7780 make unit_placed events nonundoable by default
There are still other places in the code that call unit_placed so there might be some cases left where unit_placed don't prevent undoing, but most of them are nonundoable anyways.
2024-01-31 01:53:54 +00:00
Charles Dang
cc4932ea46 Make Ubuntu happier 2024-01-29 23:41:39 -05:00
Charles Dang
3cbe0dcdcc Make Ubuntu happy 2024-01-29 22:32:05 -05:00
Charles Dang
8619e403a8 Game Config: make tc/color_info take a string_view and allow heterogeneous lookup 2024-01-29 21:14:07 -05:00
pentarctagon
f71e0b3b17 add a delay after using scroll.
Fixes #8276
2024-01-29 00:48:06 -06:00
pentarctagon
dcde7c541e Re-sets the standing animation before and after the temporary_unit_mover moves the unit
Fixes #6960
2024-01-26 16:18:45 -06:00
demario-w
c873e09a60 Store core ID into save 2024-01-22 16:35:35 +01:00
pentarctagon
970163813d 2024 copyright update 2024-01-20 22:22:23 -06:00
pentarctagon
78dff4cf8e 1.17.25+dev 2024-01-20 20:04:23 -06:00
pentarctagon
971e05c63a 1.17.25 2024-01-20 20:02:42 -06:00
Subhraman Sarkar
18086e78ae
Hotkeys (#8249)
Shortcut keys for map editor
2024-01-20 19:32:31 -06:00
Celtic Minstrel
508859cfb6 Make a copy of the active event handler list before executing them.
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
2024-01-21 01:38:48 +01:00
Eugene
9f99a4ef7d
Simplify nearest neighbor rescale (#8240) 2024-01-20 16:50:14 -06:00
Steve Cotton
286f14657b Handling of RTL in the left pane of the help browser
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.
2024-01-20 14:28:16 +01:00
Steve Cotton
69dae9f0a3 Remove code because menu::set_heading and menu::style::scale_images aren't called
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.
2024-01-20 14:28:16 +01:00
Steve Cotton
22c8a1581d Remove dead code from GUI1's menu class
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().
2024-01-20 14:28:16 +01:00
gfgtdf
8039781676 fix unit:to_map(loc) #8229
lua_unit::put_map already removes the unit previously on that tile, and doing it here causes an error when the unit was on that tile already.
2024-01-18 00:58:57 +01:00
pentarctagon
453dbc685f Enable stricter checks for debug builds.
Use _GLIBCXX_DEBUG, _GLIBCXX_DEBUG_PEDANTIC, and _GLIBCXX_ASSERTIONS for the debug Ubuntu build.
2024-01-17 00:38:11 -06:00
Gunter Labes
1a47a9943f
Remove confusing lowercase comparison
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.
2024-01-15 22:28:29 +01:00
pentarctagon
0c0f9ba997 Fix attempting to erase end() in the boost unit tests.
In that test current_addon_ is "", so when run locally with add-ons installed it results in it attempting to erase dirs_.end().
2024-01-13 13:44:56 -06:00
Pentarctagon
987827b475
Prevent wesnoth from crashing after campaign credits (#8235)
Fixes #7395
2024-01-13 11:15:50 -06:00
Gunter Labes
1930008332 Make "faction" and "faction_name" inputs work 2024-01-08 08:31:01 +01:00
Gunter Labes
bd2c250386 Remove "name" input of removed attribute 2024-01-08 08:31:01 +01:00
Gunter Labes
ceadb1aafd Make "undead" input work again 2024-01-08 08:31:01 +01:00
Severin Glöckner
932dca3982 show_narration: use label column if only given a string
This matches behaviour in 1.14
2024-01-07 00:00:00 +01:00
Celtic Minstrel
219be073a3 Lua: Fix error when calling wesnoth.print_attributes on a GUI2 widget
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.
2024-01-06 12:03:03 -05:00
Steve Cotton
0d1592bab2 Add po hints for "taught" in the attack dialog 2024-01-05 16:11:55 +01:00
Charles Dang
cdfeb73df6 Replace utils::set_split with utils::split_set
They did the same thing.
2024-01-05 02:29:33 -05:00
Charles Dang
2de180a901 GUI2/Pane: fixed compilation with C++20
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.
2024-01-04 13:53:07 -05:00
Charles Dang
574f9ded13
Simplified scale IPF implementations (#8200) 2024-01-04 13:50:47 -05:00
Gunter Labes
3e41aa0dc5
Confine special handling to only the affected platforms 2024-01-03 16:51:40 +01:00
P. J. McDermott
13d5682487 Save horizontal scrolling inversion check in static variable
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.
2024-01-01 16:00:54 -06:00
Rafael Silva
61b2e8eb4f
make wml_tag::iterator copy assignable (#8174)
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`.
2023-12-31 12:16:03 -05:00
Charles Dang
6bb8c56241
IPF: improve memory safety when constructing mod queue (#8164)
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.
2023-12-27 23:41:33 -05:00