2012-01-05 02:28:29 +01:00
|
|
|
Client = {}
|
2011-12-03 22:41:37 +01:00
|
|
|
|
|
|
|
-- TODO: load and save configurations
|
2011-12-05 19:27:07 +01:00
|
|
|
function Client.init()
|
2011-12-30 07:36:10 +01:00
|
|
|
g_window.show()
|
2012-01-05 02:28:29 +01:00
|
|
|
g_window.setMinimumSize({ width = 550, height = 450 })
|
2011-12-30 07:36:10 +01:00
|
|
|
|
2011-12-30 05:50:19 +01:00
|
|
|
-- initialize in fullscreen mode on mobile devices
|
|
|
|
if g_window.getPlatformType() == "X11-EGL" then
|
2011-12-30 07:05:32 +01:00
|
|
|
g_window.setFullscreen(true)
|
2011-12-30 05:50:19 +01:00
|
|
|
else
|
2012-01-03 02:32:34 +01:00
|
|
|
local size = { width = 1024,
|
|
|
|
height = 768 }
|
|
|
|
g_window.resize(size)
|
|
|
|
|
|
|
|
local displaySize = g_window.getDisplaySize()
|
|
|
|
local pos = { x = (displaySize.width - size.width)/2,
|
|
|
|
y = (displaySize.height - size.height)/2 }
|
|
|
|
g_window.move(pos)
|
2011-12-30 05:50:19 +01:00
|
|
|
end
|
2011-12-30 07:36:10 +01:00
|
|
|
|
2011-12-03 22:41:37 +01:00
|
|
|
g_window.setTitle('OTClient')
|
2012-01-05 02:28:29 +01:00
|
|
|
g_window.setIcon(resolvepath('clienticon.png'))
|
|
|
|
|
|
|
|
if not g_sprites.isLoaded() or not g_thingsType.isLoaded() then
|
|
|
|
fatal("spr and dat files are not loaded, did you loaded them?")
|
|
|
|
end
|
2011-12-03 22:41:37 +01:00
|
|
|
end
|
|
|
|
|
2011-12-05 19:27:07 +01:00
|
|
|
function Client.terminate()
|
2011-12-03 22:41:37 +01:00
|
|
|
end
|