feat(mods): add battle menu auxiliary action

This commit is contained in:
MaxTomahawk
2026-08-10 19:01:31 +02:00
parent 79ed37699e
commit 59725c0ead
7 changed files with 273 additions and 57 deletions
+12
View File
@@ -21,6 +21,7 @@ local MoveEffects = require("src.battle.MoveEffects")
local Party = require("src.pokemon.Party")
local Pokemon = require("src.pokemon.Pokemon")
local Runtime = require("src.mods.Runtime")
local BattleSafety = require("src.battle.BattleSafety")
local Screens = require("src.ui.Screens")
local Status = require("src.battle.Status")
local Timing = require("src.core.Timing")
@@ -1942,6 +1943,17 @@ function BattleState:update(dt)
self:resolveTurn(locked)
return
end
-- START has no vanilla action at the settled ordinary player-decision
-- boundary. A tool mod may claim this semantic auxiliary action through
-- the public hook, receiving only game plus a data-only kind. The shared
-- safety predicate keeps every unsupported/forced/animated phase inert.
if input:wasPressed("start") and Runtime.wantsHook("battle.menu_auxiliary") then
local safe = BattleSafety.inspect(self.game, self)
if safe and Runtime.call("battle.menu_auxiliary", function() return false end,
self.game, { kind = self.kind }) == true then
return
end
end
local col = (self.menuIndex - 1) % 2
local row = math.floor((self.menuIndex - 1) / 2)
if input:wasPressed("left") then