mirror of
https://github.com/edubart/otclient.git
synced 2025-10-17 04:53:27 +02:00
Refactoring and flexibility changes
* Split game module into game and game_interface * Move core_lib to corelib * Move miniwindow to corelib * Introduce init.lua script for initializing the client, giving much more flexibility * OTClient is no longer Application derived and is much simpler
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
Client = {}
|
||||
|
||||
function Client.reloadScripts()
|
||||
dofile '/otclientrc'
|
||||
reloadModules()
|
||||
dofile '/otclientrc'
|
||||
local message = tr('All modules and scripts were reloaded.')
|
||||
TextMessage.displayEventAdvance(message)
|
||||
print(message)
|
||||
@@ -35,16 +35,13 @@ function Client.init()
|
||||
g_window.setTitle('OTClient')
|
||||
g_window.setIcon(resolvepath('clienticon.png'))
|
||||
|
||||
-- show the only window after the first frame is rendered
|
||||
scheduleEvent(function()
|
||||
addEvent(function()
|
||||
scheduleEvent(function()
|
||||
g_window.show()
|
||||
|
||||
-- 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, 0)
|
||||
end, 100)
|
||||
end, 0)
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user