Commit Graph

83976 Commits

Author SHA1 Message Date
Steve Cotton
547de5fd93 Test calculations of abilities with add and sub
Fix a typo in the add_sub_separated test, because it was testing
exactly the same code as add_sub_cumulative.

Add two new tests and clarify documentation, because in these tests
the order of the abilities determines whether the add or sub value is
used, it isn't that sub always overrides add.
2024-09-07 21:02:39 +02:00
newfrenchy83
c5351fb998
Fix recursion ability count version (#9296)
I use the same method what in master for weapon special recursion.
2024-09-07 16:45:26 +02:00
Nils Kneuper
20df59154d updated Arabic translation 2024-09-07 14:46:28 +02:00
Nils Kneuper
f61883c454 updated Chinese (Simplified) translation 2024-09-07 14:45:34 +02:00
newfrenchy83
02c599e59a fix submerge item issue
fix https://github.com/wesnoth/wesnoth/issues/9305 issue.

et_suv was not include in if loop condition and submerge calculation made a multiply by zero.
2024-09-07 01:04:43 -04:00
Charles Dang
704ab36e24 Unit: clean up hp/xp color getters 2024-09-06 23:08:40 -04:00
pentarctagon
2c840acc68 try this baseline 2024-09-06 12:15:21 -05:00
pentarctagon
c8fbbadc27 fixes VS build issues apparently 2024-09-06 09:13:05 -05:00
Subhraman Sarkar
adef779ed9 unit type editor: various ui improvements and bugfixes
1. race/alignment/attack damage type/attack range show corresponding icons
2. attack damage type/range now use comboboxes for custom dmg types/ranges
3. quit confirmation added to cancel button so that user doesn't accidentally lose their data
2024-09-06 09:02:05 +05:30
Subhraman Sarkar
a25d10bbed editor: show "Map Saved" and "Scenario Saved" messages as floating label
gui2 messages grab mouse focus (modal dialog), so the user needs to click on it first before doing anything else
2024-09-06 09:02:05 +05:30
Subhraman Sarkar
fe9aeb6548 editor controller: show unit menu when addon selected and simplify code
1. When addon is selected using Add-ons > Select active Add-on, the Unit menu will get activated so that the unit type editor can be used
2. Simplify initialize_addon_if_empty, returns success value as bool
2024-09-06 09:02:05 +05:30
Subhraman Sarkar
3269d703b2 file dialog: improve checking and adjust strings
1. selecting an item from the file list will cause validation to run
2. strings adjusted so they are correctly picked up by gettext
2024-09-06 09:02:05 +05:30
Subhraman Sarkar
346c7c38b3 file dialog: add user bookmarks to correct category (fixes #9298) 2024-09-06 09:02:05 +05:30
Subhraman Sarkar
7065ed9fde item tool: add right-click to remove functionality 2024-09-06 09:02:05 +05:30
newfrenchy83
979289b579 fix tag_name check deficiencies
The tag_name check is deficient for two reasons:
1.when apply_to=both is used, in the case of [damage_type] [filter_opponent][filter_weapon]type= will check the modified type for application to the owner and the original type for application to the opponent, hence a risk of infinite recursion, especially if [filter_self][filter_weapon]type= is used in the same weapon.

2. in the case of apply_to=attacker/defender, the check for [filter_attacker/defender] must take into account both the value of the variable is_attacker but also the application AFFECT_SELF/OTHER, otherwise in the case apply_to=defender with [filter_defender][filter_weapon]type=, and[filter_attacker][filter_weapon]type= otherwise we end up in the same configuration as for apply_to=both

Finally tag_name is renamed check_if_recursion to mean that this variable is used to ensure that a recursion cannot be set up even if 743b146efc prevents it from causing a crash but with an error log
2024-09-05 18:35:35 -05:00
Charles Dang
d6f922f990 Remove a redundant getter 2024-09-05 15:44:06 -04:00
Charles Dang
2d01fddd26 Clean up unit ellipse rendering code 2024-09-05 15:42:54 -04:00
Charles Dang
a46c3c0051 Image Check: exclude deleted files 2024-09-05 12:38:46 -04:00
Subhraman Sarkar
9c732d41f1
use the already hardcoded list in unit_alignments (#8731) 2024-09-05 16:50:56 +05:30
Ethan-Nowa
eff8301cac
NR05a: Vary dialogue to better suit the speaker (#8830)
I changed some of the lines in NR The Pursuit to fit better with the different characters. Tallin, Abhai, Krash, etc.
I did not do it for every dialogue.
Addresses issues #8319 and #8772

More PR review feedback addressed by Wedge.

---------

Co-authored-by: Wedge009 <wedge009@wedge009.net>
2024-09-04 10:35:35 +02:00
Charles Dang
354418188e Add rect::shifted_by
Companion of rect::shift for const objects
2024-09-04 01:30:08 -04:00
Charles Dang
dd1f60b753 More animation functions that shouldn't return const objects... 2024-09-04 01:29:30 -04:00
Toom
57f4ca20aa Apply suggestions from code review
Co-authored-by: Gunter Labes <soliton@wesnoth.org>
2024-09-03 13:37:34 -04:00
Toom
b559549501 Update callable_objects.cpp 2024-09-03 13:37:34 -04:00
Toom
06350c9ad8 Update units.lua 2024-09-03 13:37:34 -04:00
Toom
08b3ccb9b5 Update attack_type.cpp 2024-09-03 13:37:34 -04:00
Toom
6ff07f563b Update attack_type.hpp 2024-09-03 13:37:34 -04:00
Toom
2a4aa334ff add max_range and min_range to Lua weapon object, re #9169 2024-09-03 13:37:34 -04:00
Charles Dang
a5f7804277
Mass cleanup of index-based teams list access (#9290)
Mostly converting index-based loops to for loops. Includes a couple other non-team loops that were in the files I was editing.
2024-09-03 13:31:05 -04:00
Steve Cotton
de342bb29c Fix typos in test of recursion 2024-09-03 18:39:22 +02:00
Charles Dang
e437e205cb Fixup de776a4065 2024-09-03 09:01:56 -04:00
gfgtdf
b8c6edc53c
Fix indices in widget.add_item_of_type()/add_item()/remove_items_at() (#8516)
- widget:add_item_of_type() now uses lua 1-based indicies and throws lua errors on wrong indicies. (previously used c++ 0-based indexing, and could lead to assertions when wrong indicies were used, )
- widget:add_item() now has a optional location pos parameter as claimed in the wiki
- the pos and count paraemters in widget:remove_items_at() are now optional and default to removing the last element

With this is matches the behavior of the standart lua functions table.insert and table.remove which is imo what lua writers expect.
2024-09-03 14:17:57 +02:00
Wedge009
0618eadf3e Replace tab with spaces 2024-09-03 17:02:12 +10:00
Wedge009
9b51a62a2e Remove contentious last sentence as per PR review. 2024-09-03 17:02:12 +10:00
palmenf
25e77a13e9 Added an explanation of vision to the in-game help 2024-09-03 17:02:12 +10:00
Charles Dang
651779007a Surface: add area getter 2024-09-02 18:47:14 -04:00
Charles Dang
de776a4065 Rect: add center point getter 2024-09-02 18:46:16 -04:00
Gothyoba
3bcec77482 AToTB: Use month names intead of Roman Numerals 2024-09-03 07:09:11 +10:00
Charles Dang
cd21c4f26b Unit/Frame: made submerge handling more readable 2024-09-02 15:05:18 -04:00
Charles Dang
cbd7f0d309 Unit/Frame: removed unused grayscale handling for grayscale in render_unit_image
We always passed false here. The param was pulled over when I moved the old display::render_image function here and made it render_unit_image.
2024-09-02 14:47:00 -04:00
Charles Dang
3de0a624f3 Unit/Frame: reduced indentation (no functional changes) 2024-09-02 14:43:11 -04:00
Charles Dang
647f7949cb Prefer get_location over get_location_[x|y] when possible 2024-09-02 13:44:31 -04:00
Charles Dang
d37679a7c9 Fix early crash if no teams are defined
gui_->viewing_team() in refresh_objectives results in invalid index access if there are no teams here.
2024-09-02 12:37:41 -04:00
Charles Dang
93cfddaa27 Display: rename team index functions/members for clarity 2024-09-02 12:37:41 -04:00
Charles Dang
25de2962ae Editor/Context Manager: take a team reference for edit_side_dialog 2024-09-02 12:37:41 -04:00
Charles Dang
fbc7a27cdd Add display::viewing_team_is_playing
Common enough check that this is useful in pursuit of removing direct index usage.
2024-09-02 12:37:41 -04:00
Charles Dang
500e937ac9 Display: use new team getters internally
currentTeam_ is what viewing_team_index returns
2024-09-02 12:37:41 -04:00
Charles Dang
725f4b3db7 Unit/Drawer: don't keep team indices 2024-09-02 12:37:41 -04:00
Charles Dang
f1be5e4c83 Clean up scattered cases of viewing_team_index + 1 2024-09-02 12:37:41 -04:00
Charles Dang
ac9f0674d7 Display: refactor out [playing|viewing]_side
Now defined in terms of [playing|viewing]_team().side(). Much clearer. No more damn +1 math.
2024-09-02 12:37:41 -04:00