Commit graph

9 commits

Author SHA1 Message Date
Celtic Minstrel
38ae304725 Move Lua undo API into experimental 2023-10-14 19:26:36 -04:00
Celtic Minstrel
10d67aa82a Implement a new Lua API to the undo system 2023-10-14 19:26:36 -04:00
Steve Cotton
49ebbb9709 Make fix_whitespace complain about mixing tabs and spaces
Ensures that files either use tabs for indentation or spaces for indentation,
but don't switch between the two within the same file.

This doesn't fix the whitespace, it's a simple check to flag it up
on the assumption that it's better to use an editor or code formatter
to clean up the file.

Elsewhere in the CI we use the luacheck tool - while that can detect
mixing tabs and spaces in a single line's indent, it doesn't check for
inconsistent indentation within a file.
2023-02-05 02:22:53 +01:00
Steve Cotton
e3deff8bfd Make undo work again, undeprecate on_event()
Fixes #6898. The issue is that non-WML events added through the new events API
always disable undo with no equivalent of WML's `[allow_undo]`. The long-term
fix is to add a way to do that; however until that's available then listeners
for `moveto` need to use the old `on_event` API. The old `on_event` API can't
be deprecated yet, and this is enforced by our unit tests (the build fails if
there are unexpected deprecation warnings during the tests).

Reverts most of 7e234f8833. Does not revert files
that only listen for non-undoable events such as `die` or `new turn`.

Reverts the deprecation part of #5663's 8cd1332630.
2022-11-19 05:23:30 +01:00
Severin Glöckner
a748126b75 Lua: don't trigger unit placed events by WML tags
If the last argument to the C++ function ( game_lua_kernel::intf_put_unit )
is false, event's won't be fired.

closes #5158
2022-10-26 23:32:10 -05:00
Celtic Minstrel
7e234f8833 Replace deprecated usages of on_event() 2022-07-18 21:56:42 -04:00
Pentarctagon
d203b061f9
Whitespace cleanup of lua files. 2021-04-25 15:11:09 -05:00
doofus-01
2a8baa9590
various small fixes (#5495)
* units - set image_icon for sidebar display of Cataphract

* units - remove inactive ability description for Diversion

* add recruit/recall to event list triggering check for diversion animation (Dunefolk Falconer)
2021-01-24 16:59:54 -08:00
doofus-01
182a7bb602
Units - Dunefolk - Falconer branch of Skirmisher line (#4779)
* Units - Dunefolk - first draft at Falconer branch of skirmisher

* Dunefolk - revision to Falconer line

* Units - dunefolk - some progress on falconer standing animation

* Units - dunefolk - attack animations for falconer

* Units - dunefolk - defense and melee (partial) attack anims

* units - dunefolk - WIP lvl3 falconer

* units - dunefolk - revise falconer

* units - dunefolk - animation work on Falconer line

* units - dunefolk - falconer ability diversion revised to affect enemy chance-to-hit. Animation filter/trigger not yet resolved

* units/abilities - dunefolk falconer diversion ability-related animations mechanism

* units - dunefolk - sky_hunter animation frames

* dunefolk/abilities - fix diversion animations to work on die event

* abilities - schema validation induced correction

* abilities - diversion animations - attempt to fix case of undo movement

* units - dunefolk - finish some cosmetic issues for Falconer line

* units - dunefolk - wmlindent

* use on_undo over select in diversionability

undoing can only change the 'diversion' state if the original action also did,
so there is no reason to check it in all 'select' events.

* fixup

* minor clean-up

Co-authored-by: gfgtdf <daniel.gfgtdf@gmail.com>
2020-03-23 17:59:53 -07:00