* 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
|
之前 寬度: | 高度: | 大小: 28 KiB 之後 寬度: | 高度: | 大小: 28 KiB |
之前 寬度: | 高度: | 大小: 1.1 KiB 之後 寬度: | 高度: | 大小: 1.1 KiB |
之前 寬度: | 高度: | 大小: 385 B 之後 寬度: | 高度: | 大小: 385 B |
之前 寬度: | 高度: | 大小: 37 KiB 之後 寬度: | 高度: | 大小: 37 KiB |
之前 寬度: | 高度: | 大小: 39 KiB 之後 寬度: | 高度: | 大小: 39 KiB |
之前 寬度: | 高度: | 大小: 763 B 之後 寬度: | 高度: | 大小: 763 B |
之前 寬度: | 高度: | 大小: 52 KiB 之後 寬度: | 高度: | 大小: 52 KiB |
@ -1,10 +1,8 @@
|
||||
Module
|
||||
name: core_lib
|
||||
name: corelib
|
||||
description: Contains core lua classes, functions and constants used by other modules
|
||||
author: OTClient team
|
||||
website: www.otclient.info
|
||||
autoload: true
|
||||
autoload-priority: 10
|
||||
reloadable: false
|
||||
|
||||
@onLoad: |
|
@ -1,15 +1,15 @@
|
||||
GameSidePanel < UIMiniWindowContainer
|
||||
image-source: images/sidepanel.png
|
||||
image-source: /images/sidepanel.png
|
||||
image-border: 4
|
||||
padding: 4
|
||||
|
||||
GameBottomPanel < Panel
|
||||
image-source: images/bottompanel.png
|
||||
image-source: /images/bottompanel.png
|
||||
image-border: 4
|
||||
|
||||
GameMapPanel < UIGameMap
|
||||
padding: 4
|
||||
image-source: images/mappanel.png
|
||||
image-source: /images/mappanel.png
|
||||
image-border: 4
|
||||
|
||||
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
|
||||
size: 34 34
|
||||
padding: 1
|
||||
image-source: /game/images/item.png
|
||||
image-source: /images/item.png
|
||||
font: verdana-11px-rounded
|
||||
border-color: white
|