[wesnoth-commits] [wesnoth/wesnoth] ac2b44: Upgrade the existing scope exit utility

Celtic Minstrel noreply at github.com
Sun Apr 4 04:58:38 UTC 2021


  Branch: refs/heads/lua_events
  Home:   https://github.com/wesnoth/wesnoth
  Commit: ac2b44f4e9ea21c8659184ed04aa865e99e0ecb4
      https://github.com/wesnoth/wesnoth/commit/ac2b44f4e9ea21c8659184ed04aa865e99e0ecb4
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2021-04-04 (Sun, 04 Apr 2021)

  Changed paths:
    M src/gui/dialogs/multiplayer/mp_join_game.cpp
    M src/units/udisplay.cpp
    M src/utils/scope_exit.hpp

  Log Message:
  -----------
  Upgrade the existing scope exit utility


  Commit: d94c8b8e6cdf7b2bc81865c29c184a6de8a11e66
      https://github.com/wesnoth/wesnoth/commit/d94c8b8e6cdf7b2bc81865c29c184a6de8a11e66
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2021-04-04 (Sun, 04 Apr 2021)

  Changed paths:
    M src/game_events/handlers.cpp
    M src/game_events/handlers.hpp
    M src/game_events/manager.cpp
    M src/game_events/manager.hpp
    M src/game_events/manager_impl.cpp
    M src/game_events/manager_impl.hpp
    M src/game_events/menu_item.cpp
    M src/game_events/menu_item.hpp
    M src/game_events/wmi_manager.cpp
    M src/game_events/wmi_manager.hpp
    M src/game_state.cpp
    M src/scripting/game_lua_kernel.cpp
    M src/scripting/game_lua_kernel.hpp
    M src/scripting/lua_kernel_base.cpp
    M src/units/unit.cpp

  Log Message:
  -----------
  Events are now a Lua function instead of WML

The function is specified by [event]code= and will be passed the entire contents of the [event] tag (including the code itself).

If code= is omitted, a default is supplied which runs ActionWML; however, internally it is still a function rather than a list of ActionWML commands.


  Commit: 1a361545f3d0b564869d6f707d365c3c0dde6b1c
      https://github.com/wesnoth/wesnoth/commit/1a361545f3d0b564869d6f707d365c3c0dde6b1c
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2021-04-04 (Sun, 04 Apr 2021)

  Changed paths:
    M data/lua/core/interface.lua
    M data/lua/on_event.lua
    M data/lua/wml-tags.lua
    M src/game_events/entity_location.cpp
    M src/game_events/entity_location.hpp
    M src/game_events/handlers.cpp
    M src/game_events/handlers.hpp
    M src/game_events/manager.cpp
    M src/game_events/manager.hpp
    M src/game_events/manager_impl.cpp
    M src/game_events/manager_impl.hpp
    M src/game_events/menu_item.cpp
    M src/game_events/pump.cpp
    M src/game_events/pump.hpp
    M src/scripting/game_lua_kernel.cpp
    M src/scripting/game_lua_kernel.hpp
    M src/scripting/push_check.hpp
    M src/side_filter.hpp

  Log Message:
  -----------
  Enable setting an arbitrary Lua function as an event handler.

Unlike the old wesnoth.game_events.on_event hook and the "convenient" on_event() wrapper for it, this new functionality supports all of the features of WML events, with the sole exception of serialization, since it's not possible to reliably serialize a Lua function.

This commit also divorces menu items from the event that they trigger. The undocumented wesnoth.interface.set_menu_item function no longer adds an event for the menu item; the caller needs to separately register an event using the new functionality.


  Commit: fa394afe134d35be06f08a7f9550adcec0c64284
      https://github.com/wesnoth/wesnoth/commit/fa394afe134d35be06f08a7f9550adcec0c64284
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2021-04-04 (Sun, 04 Apr 2021)

  Changed paths:
    M src/ai/formula/ai.cpp
    M src/formula/callable_objects.cpp
    M src/formula/callable_objects.hpp
    M src/game_events/handlers.cpp
    M src/game_events/manager.cpp

  Log Message:
  -----------
  Add [event]filter_formula= for WFL event filtering


  Commit: 9c7a59331df118bb75ae511cf1cf06b4a29d3485
      https://github.com/wesnoth/wesnoth/commit/9c7a59331df118bb75ae511cf1cf06b4a29d3485
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2021-04-04 (Sun, 04 Apr 2021)

  Changed paths:
    M src/formula/callable_objects.cpp

  Log Message:
  -----------
  WFL: Add recall list to the side object


  Commit: e6bf75df26d7d10be64289ae3b740a42855e984a
      https://github.com/wesnoth/wesnoth/commit/e6bf75df26d7d10be64289ae3b740a42855e984a
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2021-04-04 (Sun, 04 Apr 2021)

  Changed paths:
    M src/formula/callable_objects.cpp
    M src/formula/callable_objects.hpp
    M src/game_events/handlers.cpp

  Log Message:
  -----------
  Make the event context available to WFL event filters


  Commit: 4cd24a08978d0db6ce1405e12d973d9978ae7233
      https://github.com/wesnoth/wesnoth/commit/4cd24a08978d0db6ce1405e12d973d9978ae7233
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2021-04-04 (Sun, 04 Apr 2021)

  Changed paths:
    M src/game_events/handlers.cpp
    M src/game_events/manager.cpp
    M src/scripting/game_lua_kernel.cpp
    M src/scripting/game_lua_kernel.hpp

  Log Message:
  -----------
  Support Lua event filters as [event]filter= with [filter_args]

This also supports passing an arbitrary Lua function as the filter when the event is registered from Lua.


Compare: https://github.com/wesnoth/wesnoth/compare/ac2b44f4e9ea%5E...4cd24a08978d



More information about the Commits mailing list