From 7fe043146dd9a94453de2d57b700f464fc5a94b0 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Fri, 24 Jun 2022 19:01:33 -0700 Subject: [PATCH] Res: Auto-register frame callback --- res/scripts/pokemon.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/res/scripts/pokemon.lua b/res/scripts/pokemon.lua index 76a1fcdbe..7ebe54bb8 100644 --- a/res/scripts/pokemon.lua +++ b/res/scripts/pokemon.lua @@ -499,10 +499,21 @@ function detectGame() console:error("Unknown game!") else console:log("Found game: " .. game.name) + if not partyBuffer then + partyBuffer = console:createBuffer("Party") + end end end +function updateBuffer() + if not game or not partyBuffer then + return + end + printPartyStatus(game, partyBuffer) +end + callbacks:add("start", detectGame) +callbacks:add("frame", updateBuffer) if emu then detectGame() end