phigros.tools

Events

on(event, function) runs the function each time the event happens. Reacting to the game walks through the ones used most.

EventWhenThe function gets
updateevery frame
load, unloadthe mods loaded, they're about to reload
scenethe game changes screen, and once after loadits name: "ChapterSelector", "SongSelector", "Level"...
settingthe player changed a settingits label and value
songa song startsthe Chart
charta song's Chart as the game loaded and mirrored it, before it's laid out: what it's given then is what playsthe game's Chart
hita note is judgeda Hit
pause, resumethe player pauses or comes back
leavethe song is quit, retried or finished
finishthe song endedits Stats
jumpthe song jumped (phigrospp.jump)the time jumped to
restartthe song was put back at its start (phigrospp.restart)
replaysa replay was recorded or deleted
besta recorded play beat or tied the chart's record (with modifiers: the best of the player's replays with the same ones)its replay's path
linkthe app was opened or brought back by a phigrospp:// linkthe url
roomthe room the player is in changed (Rooms)the room, nil once out of it
anything elsephigrospp.emit was called with it, for mods talking to each otherwhat it was given

on(event, fn)

Runs the function each time the event happens.

on("hit", function(hit)
  if hit.judgement == "miss" then print("missed a " .. hit.note) end --> missed a flick
end)
on("finish", function(result)
  toast(("%d, %.2f%%"):format(result.score, result.accuracy)) --> 996761, 99.68%
end)
ParameterType
eventEvent
fnfunction

phigrospp.emit(event, ...)

Runs the on(event) handlers with these arguments.

-- in one mod
phigrospp.emit("section", 42.5, 60)
-- in another
on("section", function(from, to) print(from, to) end) --> 42.5	60
ParameterType
eventstring
...any