* 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 simplermaster
@ -0,0 +1,48 @@
|
|||||||
|
-- this is the first file executed when the application starts
|
||||||
|
-- we have to load the first modules form here
|
||||||
|
|
||||||
|
-- setup application name and version
|
||||||
|
g_app.setName('OTClient')
|
||||||
|
g_app.setCompactName('otclient')
|
||||||
|
g_app.setVersion('0.4.0_dev')
|
||||||
|
|
||||||
|
-- setup logger
|
||||||
|
g_logger.setLogFile(g_resources.getWorkDir() .. g_app.getCompactName() .. ".log")
|
||||||
|
|
||||||
|
-- print first terminal message
|
||||||
|
g_logger.info(g_app.getName() .. ' ' .. g_app.getVersion() .. ' (rev ' .. g_app.getBuildRevision() .. ') built on ' .. g_app.getBuildDate())
|
||||||
|
|
||||||
|
-- add modules directory to the search path
|
||||||
|
if not g_resources.addToSearchPath(g_resources.getWorkDir() .. "modules", true) then
|
||||||
|
g_logger.fatal("Unable to add modules directory to the search path.")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- try to add addons path too
|
||||||
|
g_resources.addToSearchPath(g_resources.getWorkDir() .. "addons", true)
|
||||||
|
|
||||||
|
-- setup directory for saving configurations
|
||||||
|
g_resources.setupWriteDir(g_app.getCompactName())
|
||||||
|
|
||||||
|
-- load configurations
|
||||||
|
g_configs.load("/config.otml")
|
||||||
|
|
||||||
|
g_modules.discoverModules()
|
||||||
|
|
||||||
|
-- core modules 0-99
|
||||||
|
g_modules.autoLoadModules(99);
|
||||||
|
g_modules.ensureModuleLoaded("corelib")
|
||||||
|
|
||||||
|
-- client modules 100-499
|
||||||
|
g_modules.autoLoadModules(499);
|
||||||
|
g_modules.ensureModuleLoaded("client")
|
||||||
|
|
||||||
|
-- game modules 500-999
|
||||||
|
g_modules.autoLoadModules(999);
|
||||||
|
g_modules.ensureModuleLoaded("game")
|
||||||
|
|
||||||
|
-- addons 1000-9999
|
||||||
|
g_modules.autoLoadModules(9999)
|
||||||
|
|
||||||
|
if g_resources.fileExists("/otclientrc.lua") then
|
||||||
|
dofile("/otclientrc.lua")
|
||||||
|
end
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 385 B After Width: | Height: | Size: 385 B |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 763 B After Width: | Height: | Size: 763 B |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
@ -1,10 +1,8 @@
|
|||||||
Module
|
Module
|
||||||
name: core_lib
|
name: corelib
|
||||||
description: Contains core lua classes, functions and constants used by other modules
|
description: Contains core lua classes, functions and constants used by other modules
|
||||||
author: OTClient team
|
author: OTClient team
|
||||||
website: www.otclient.info
|
website: www.otclient.info
|
||||||
autoload: true
|
|
||||||
autoload-priority: 10
|
|
||||||
reloadable: false
|
reloadable: false
|
||||||
|
|
||||||
@onLoad: |
|
@onLoad: |
|
@ -1,15 +1,15 @@
|
|||||||
GameSidePanel < UIMiniWindowContainer
|
GameSidePanel < UIMiniWindowContainer
|
||||||
image-source: images/sidepanel.png
|
image-source: /images/sidepanel.png
|
||||||
image-border: 4
|
image-border: 4
|
||||||
padding: 4
|
padding: 4
|
||||||
|
|
||||||
GameBottomPanel < Panel
|
GameBottomPanel < Panel
|
||||||
image-source: images/bottompanel.png
|
image-source: /images/bottompanel.png
|
||||||
image-border: 4
|
image-border: 4
|
||||||
|
|
||||||
GameMapPanel < UIGameMap
|
GameMapPanel < UIGameMap
|
||||||
padding: 4
|
padding: 4
|
||||||
image-source: images/mappanel.png
|
image-source: /images/mappanel.png
|
||||||
image-border: 4
|
image-border: 4
|
||||||
|
|
||||||
UIWidget
|
UIWidget
|
@ -0,0 +1,21 @@
|
|||||||
|
Module
|
||||||
|
name: game_interface
|
||||||
|
description: Create the game interface, where the ingame stuff starts
|
||||||
|
author: OTClient team
|
||||||
|
website: www.otclient.info
|
||||||
|
|
||||||
|
@onLoad: |
|
||||||
|
importStyle 'styles/items.otui'
|
||||||
|
importStyle 'styles/creatures.otui'
|
||||||
|
importStyle 'styles/miniwindow.otui'
|
||||||
|
importStyle 'styles/countwindow.otui'
|
||||||
|
|
||||||
|
dofile 'widgets/uigamemap'
|
||||||
|
dofile 'widgets/uiitem'
|
||||||
|
|
||||||
|
dofile 'gameinterface'
|
||||||
|
|
||||||
|
GameInterface.init()
|
||||||
|
|
||||||
|
@onUnload: |
|
||||||
|
GameInterface.terminate()
|
@ -1,6 +1,6 @@
|
|||||||
Item < UIItem
|
Item < UIItem
|
||||||
size: 34 34
|
size: 34 34
|
||||||
padding: 1
|
padding: 1
|
||||||
image-source: /game/images/item.png
|
image-source: /images/item.png
|
||||||
font: verdana-11px-rounded
|
font: verdana-11px-rounded
|
||||||
border-color: white
|
border-color: white
|