Packages system with .otpkg files

When otclient initializes it tries to find all .otpkg files inside the
current search paths (./ ./modules ./addons) and then add them
to the front of current search paths. This way .otpkg can contains
many modules/addons and modifications in a single file that otclient
can recognize.

otpkg files can be compressed files supported by PhysFS, which
are ZIP (.zip) and LZMA (.7z).
This commit is contained in:
Eduardo Bart
2012-07-16 16:35:14 -03:00
parent 09425eba31
commit bc81c9c8bf
6 changed files with 77 additions and 44 deletions

View File

@@ -27,7 +27,7 @@ function Skins.init()
Skins.installSkins('skins')
if installedSkins[defaultSkinName] then
g_resources.addToSearchPath(getSkinPath(defaultSkinName), 0)
g_resources.addSearchPath(getSkinPath(defaultSkinName), 0)
end
local userSkinName = g_settings.get('skin', 'false')
@@ -50,9 +50,9 @@ function Skins.init()
end
function Skins.terminate()
g_resources.removeFromSearchPath(getSkinPath(defaultSkinName))
g_resources.removeSearchPath(getSkinPath(defaultSkinName))
if currentSkin then
g_resources.removeFromSearchPath(getSkinPath(currentSkin.name))
g_resources.removeSearchPath(getSkinPath(currentSkin.name))
end
installedSkins = nil
@@ -98,10 +98,12 @@ function Skins.setSkin(name)
Skins.loadSkin(defaultSkin)
end
if currentSkin then
g_resources.removeFromSearchPath(getSkinPath(currentSkin.name))
if currentSkin and currentSkin.name ~= defaultSkinName then
g_resources.removeSearchPath(getSkinPath(currentSkin.name))
end
if skin.name ~= defaultSkinName then
g_resources.addSearchPath(getSkinPath(skin.name), true)
end
g_resources.addToSearchPath(getSkinPath(skin.name), true)
Skins.loadSkin(skin)
currentSkin = skin

View File

@@ -38,7 +38,7 @@ function UIMessageBox.display(title, message, flags)
connect(messagebox, { onEscape = function(self) self:cancel() end })
end
messagebox:lock()
--messagebox:lock()
return messagebox
end