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:
Eduardo Bart
2012-06-19 21:15:56 -03:00
parent 9e72860178
commit 8761220deb
115 changed files with 448 additions and 363 deletions

View File

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

View File

@@ -3,8 +3,6 @@ Module
description: Initialize the client and setups its main window
author: edubart
website: www.otclient.info
autoload: true
autoload-priority: 100
reloadable: false
load-later: