Rename 'addons' folder to 'mods' to avoid
Use onRun event to play startup music
This commit is contained in:
parent
bc81c9c8bf
commit
59fc3d5f77
6
init.lua
6
init.lua
|
@ -15,8 +15,8 @@ if not g_resources.addSearchPath(g_resources.getWorkDir() .. "modules", true) th
|
|||
g_logger.fatal("Unable to add modules directory to the search path.")
|
||||
end
|
||||
|
||||
-- try to add addons path too
|
||||
g_resources.addSearchPath(g_resources.getWorkDir() .. "addons", true)
|
||||
-- try to add mods path too
|
||||
g_resources.addSearchPath(g_resources.getWorkDir() .. "mods", true)
|
||||
|
||||
-- setup directory for saving configurations
|
||||
g_resources.setupUserWriteDir(g_app.getCompactName())
|
||||
|
@ -41,7 +41,7 @@ g_modules.ensureModuleLoaded("client")
|
|||
g_modules.autoLoadModules(999)
|
||||
g_modules.ensureModuleLoaded("game")
|
||||
|
||||
-- addons 1000-9999
|
||||
-- mods 1000-9999
|
||||
g_modules.autoLoadModules(9999)
|
||||
|
||||
if g_resources.fileExists("/otclientrc.lua") then
|
||||
|
|
|
@ -1 +1 @@
|
|||
This folder work exactly as modules folder, however is intended to place only addons here.
|
||||
This folder work exactly as modules folder, however is intended to place only mods here.
|
|
@ -36,14 +36,15 @@ function Client.init()
|
|||
g_window.setIcon(resolvepath('clienticon.png'))
|
||||
g_keyboard.bindKeyDown('Ctrl+Shift+R', Client.reloadScripts)
|
||||
|
||||
addEvent(function()
|
||||
scheduleEvent(function()
|
||||
-- Play startup music (The Silver Tree, by Mattias Westlund)
|
||||
g_sounds.playMusic("/client/startup.ogg", 3)
|
||||
connect(g_game, { onGameStart = function() g_sounds.stopMusic(3) end })
|
||||
connect(g_game, { onGameEnd= function() g_sounds.playMusic("/client/startup.ogg", 3) end })
|
||||
end, 100)
|
||||
end, 0)
|
||||
connect(g_app, { onRun =
|
||||
function()
|
||||
-- Play startup music (The Silver Tree, by Mattias Westlund)
|
||||
g_sounds.playMusic("startup.ogg", 3)
|
||||
connect(g_game, { onGameStart = function() g_sounds.stopMusic(3) end })
|
||||
connect(g_game, { onGameEnd = function() g_sounds.playMusic("startup.ogg", 3) end })
|
||||
end
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
function Client.terminate()
|
||||
|
|
Loading…
Reference in New Issue