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
@@ -15,7 +15,8 @@ local function onSkinComboBoxOptionChange(self, optionText, optionData)
|
||||
end
|
||||
|
||||
local function getSkinPath(name)
|
||||
return g_modules.getModulesPath() .. g_lua.getCurrentSourcePath(0) .. '/skins/' .. string.lower(name) .. '/'
|
||||
local current = getfsrcpath()
|
||||
return g_resources.getRealDir(current) .. current .. '/skins/' .. string.lower(name)
|
||||
end
|
||||
|
||||
-- public functions
|
||||
@@ -30,9 +31,9 @@ function Skins.init()
|
||||
|
||||
local userSkinName = Settings.get('skin')
|
||||
if userSkinName and Skins.setSkin(userSkinName) then
|
||||
info('Using configured skin: ' .. userSkinName)
|
||||
pdebug('Using configured skin: ' .. userSkinName)
|
||||
else
|
||||
info('Using default skin: ' .. defaultSkinName)
|
||||
pdebug('Using default skin: ' .. defaultSkinName)
|
||||
Skins.setSkin(defaultSkinName)
|
||||
Settings.set('skin', defaultSkinName)
|
||||
end
|
||||
@@ -65,7 +66,7 @@ function Skins.installSkin(skin)
|
||||
end
|
||||
|
||||
if installedSkins[skin.name] then
|
||||
warning(skin.name .. ' has been replaced.')
|
||||
pwarning(skin.name .. ' has been replaced.')
|
||||
end
|
||||
|
||||
installedSkins[skin.name] = skin
|
||||
@@ -79,12 +80,12 @@ end
|
||||
function Skins.setSkin(name)
|
||||
local skin = installedSkins[name]
|
||||
if not skin then
|
||||
warning("Skin " .. name .. ' does not exist.')
|
||||
pwarning("Skin " .. name .. ' does not exist.')
|
||||
return false
|
||||
end
|
||||
|
||||
g_fonts.clearFonts()
|
||||
g_ui.clearStyles()
|
||||
g_ui.clearStyles()
|
||||
|
||||
if name ~= defaultSkinName then
|
||||
local defaultSkin = installedSkins[defaultSkinName]
|
||||
|
BIN
modules/client_skins/skins/default/images/bottompanel.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
modules/client_skins/skins/default/images/item.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
modules/client_skins/skins/default/images/logout.png
Normal file
After Width: | Height: | Size: 385 B |
BIN
modules/client_skins/skins/default/images/mappanel.png
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
modules/client_skins/skins/default/images/miniwindow.png
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
modules/client_skins/skins/default/images/miniwindowbuttons.png
Normal file
After Width: | Height: | Size: 763 B |
BIN
modules/client_skins/skins/default/images/sidepanel.png
Normal file
After Width: | Height: | Size: 52 KiB |