1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-30 19:22:14 +00:00

mod_vfs stuff from TurkeyMcMac's PR

Co-authored-by: Jude Melton-Houghton <jwmhjwmh@gmail.com>
This commit is contained in:
Desour 2025-02-21 12:19:04 +01:00
parent d8435dcf8d
commit e4a3b631cf
10 changed files with 119 additions and 67 deletions

View file

@ -55,6 +55,7 @@ struct PointedThing;
struct ItemVisualsManager;
class ClientScripting;
class SSCSMController;
struct ModVFS;
namespace scene {
class IAnimatedMesh;
@ -127,14 +128,6 @@ public:
~Client();
DISABLE_CLASS_COPY(Client);
// Load local mods into memory
void scanModSubfolder(const std::string &mod_name, const std::string &mod_path,
std::string mod_subpath);
inline void scanModIntoMemory(const std::string &mod_name, const std::string &mod_path)
{
scanModSubfolder(mod_name, mod_path, "");
}
/*
request all threads managed by client to be stopped
*/
@ -385,7 +378,7 @@ public:
bool checkLocalPrivilege(const std::string &priv)
{ return checkPrivilege(priv); }
virtual scene::IAnimatedMesh* getMesh(const std::string &filename, bool cache = false);
const std::string* getModFile(std::string filename);
ModVFS *getModVFS() { return m_mod_vfs.get(); }
ModStorageDatabase *getModStorageDatabase() override { return m_mod_storage_database; }
ItemVisualsManager *getItemVisualsManager() { return m_item_visuals_manager; }
@ -586,7 +579,7 @@ private:
ModStorageDatabase *m_mod_storage_database = nullptr;
float m_mod_storage_save_timer = 10.0f;
std::vector<ModSpec> m_mods;
StringMap m_mod_vfs;
std::unique_ptr<ModVFS> m_mod_vfs;
// SSCSM
std::unique_ptr<SSCSMController> m_sscsm_controller;