Skip to content

Instantly share code, notes, and snippets.

@NAEL2XD
Created December 20, 2025 23:32
Show Gist options
  • Select an option

  • Save NAEL2XD/ac81ea3d4752ec31f6ea053aa7d6b7f0 to your computer and use it in GitHub Desktop.

Select an option

Save NAEL2XD/ac81ea3d4752ec31f6ea053aa7d6b7f0 to your computer and use it in GitHub Desktop.
local utils = {
---@param sw any
---@param cases table
switch = function (sw, cases)
for _, value in cases do
if value[1] == sw or value[1] == nil then
value[2]()
end
end
end
}
function onCreate()
setProperty("skipCountdown", true)
setProperty("gf.visible", false)
setProperty("gf.visible", false)
end
local running = 0
function onCreatePost()
-- If running in a editor, this runs twice, using this blocks other things running.
if running == 1 then
debugPrint("editor found")
return Function_Stop
end
running = 1
luaDebugMode = true
if not shadersEnabled then
exitSong()
end
require("mods.scripts.ShaderHandler")
initShaderHandler()
-- haxe
addHaxeLibrary("FileSystem", "sys")
for _, shader in pairs(runHaxeCode('return FileSystem.readDirectory("mods/shaders")')) do
initLuaShader(shader:sub(0, shader:len() - 5))
end
end
---@param elapsed number
function onUpdate(elapsed)
local t = getSongPosition()
if running == t then
return Function_Stop
end
running = t
end
---@param eventName string
---@param value1 string
---@param value2 string
function onEvent(eventName, value1, value2)
if eventName == 'Trigger' then
utils.switch(value1, {
"1",
function ()
end
})
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment