mirror of
https://github.com/edubart/otclient.git
synced 2025-12-14 12:49:47 +01:00
improvements to skins
This commit is contained in:
@@ -77,6 +77,7 @@ void ModuleManager::discoverModulesPath()
|
||||
// try to add module directory
|
||||
if(g_resources.addToSearchPath(dir, false)) {
|
||||
//g_logger.info(stdext::format("Using modules directory '%s'", dir.c_str()));
|
||||
m_modulesPath = dir;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ public:
|
||||
void ensureModuleLoaded(const std::string& moduleName);
|
||||
void unloadModules();
|
||||
void reloadModules();
|
||||
std::string getModulesPath() { return m_modulesPath; }
|
||||
|
||||
ModulePtr getModule(const std::string& moduleName);
|
||||
std::deque<ModulePtr> getModules() { return m_modules; }
|
||||
@@ -47,6 +48,7 @@ protected:
|
||||
friend class Module;
|
||||
|
||||
private:
|
||||
std::string m_modulesPath;
|
||||
std::deque<ModulePtr> m_modules;
|
||||
std::multimap<int, ModulePtr> m_autoLoadModules;
|
||||
};
|
||||
|
||||
@@ -66,6 +66,13 @@ bool ResourceManager::addToSearchPath(const std::string& path, bool insertInFron
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ResourceManager::removeFromSearchPath(const std::string& path)
|
||||
{
|
||||
if(!PHYSFS_removeFromSearchPath(path.c_str()))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void ResourceManager::searchAndAddPackages(const std::string& packagesDir, const std::string& packageExt, bool append)
|
||||
{
|
||||
auto files = listDirectoryFiles(resolvePath(packagesDir));
|
||||
|
||||
@@ -34,6 +34,7 @@ public:
|
||||
bool setupWriteDir(const std::string& appWriteDirName);
|
||||
|
||||
bool addToSearchPath(const std::string& path, bool insertInFront = true);
|
||||
bool removeFromSearchPath(const std::string& path);
|
||||
void searchAndAddPackages(const std::string& packagesDir, const std::string& packagesExt, bool append);
|
||||
|
||||
bool fileExists(const std::string& fileName);
|
||||
|
||||
Reference in New Issue
Block a user