Rename 'addons' folder to 'mods' to avoid

Use onRun event to play startup music
This commit is contained in:
Eduardo Bart 2012-07-16 20:04:45 -03:00
parent bc81c9c8bf
commit 59fc3d5f77
4 changed files with 13 additions and 12 deletions

View File

@ -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.") g_logger.fatal("Unable to add modules directory to the search path.")
end end
-- try to add addons path too -- try to add mods path too
g_resources.addSearchPath(g_resources.getWorkDir() .. "addons", true) g_resources.addSearchPath(g_resources.getWorkDir() .. "mods", true)
-- setup directory for saving configurations -- setup directory for saving configurations
g_resources.setupUserWriteDir(g_app.getCompactName()) g_resources.setupUserWriteDir(g_app.getCompactName())
@ -41,7 +41,7 @@ g_modules.ensureModuleLoaded("client")
g_modules.autoLoadModules(999) g_modules.autoLoadModules(999)
g_modules.ensureModuleLoaded("game") g_modules.ensureModuleLoaded("game")
-- addons 1000-9999 -- mods 1000-9999
g_modules.autoLoadModules(9999) g_modules.autoLoadModules(9999)
if g_resources.fileExists("/otclientrc.lua") then if g_resources.fileExists("/otclientrc.lua") then

View File

@ -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.

View File

@ -36,14 +36,15 @@ function Client.init()
g_window.setIcon(resolvepath('clienticon.png')) g_window.setIcon(resolvepath('clienticon.png'))
g_keyboard.bindKeyDown('Ctrl+Shift+R', Client.reloadScripts) g_keyboard.bindKeyDown('Ctrl+Shift+R', Client.reloadScripts)
addEvent(function() connect(g_app, { onRun =
scheduleEvent(function() function()
-- Play startup music (The Silver Tree, by Mattias Westlund) -- Play startup music (The Silver Tree, by Mattias Westlund)
g_sounds.playMusic("/client/startup.ogg", 3) g_sounds.playMusic("startup.ogg", 3)
connect(g_game, { onGameStart = function() g_sounds.stopMusic(3) end }) connect(g_game, { onGameStart = function() g_sounds.stopMusic(3) end })
connect(g_game, { onGameEnd= function() g_sounds.playMusic("/client/startup.ogg", 3) end }) connect(g_game, { onGameEnd = function() g_sounds.playMusic("startup.ogg", 3) end })
end, 100) end
end, 0) })
end end
function Client.terminate() function Client.terminate()