mirror of
https://github.com/geode-sdk/geode.git
synced 2025-02-17 00:30:26 -05:00
add Mod::getResourcesDir for getting the mod's resources directory
This commit is contained in:
parent
7089194be9
commit
00550323e5
3 changed files with 15 additions and 1 deletions
|
@ -83,7 +83,16 @@ namespace geode {
|
|||
bool wasSuccesfullyLoaded() const;
|
||||
ModInfo getModInfo() const;
|
||||
ghc::filesystem::path getTempDir() const;
|
||||
/**
|
||||
* Get the path to the mod's platform binary (.dll on Windows, .dylib
|
||||
* on Mac & iOS, .so on Android)
|
||||
*/
|
||||
ghc::filesystem::path getBinaryPath() const;
|
||||
/**
|
||||
* Get the path to the mod's runtime resources directory (contains all
|
||||
* of its resources)
|
||||
*/
|
||||
ghc::filesystem::path getResourcesDir() const;
|
||||
|
||||
Result<> saveData();
|
||||
Result<> loadData();
|
||||
|
|
|
@ -270,7 +270,7 @@ void Loader::Impl::updateModResources(Mod* mod) {
|
|||
return;
|
||||
}
|
||||
|
||||
auto searchPath = dirs::getModRuntimeDir() / mod->getID() / "resources";
|
||||
auto searchPath = mod->getResourcesDir();
|
||||
|
||||
log::debug("Adding resources for {}", mod->getID());
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include <Geode/loader/Mod.hpp>
|
||||
#include <Geode/loader/Dirs.hpp>
|
||||
#include "ModImpl.hpp"
|
||||
|
||||
USE_GEODE_NAMESPACE();
|
||||
|
@ -71,6 +72,10 @@ ghc::filesystem::path Mod::getBinaryPath() const {
|
|||
return m_impl->getBinaryPath();
|
||||
}
|
||||
|
||||
ghc::filesystem::path Mod::getResourcesDir() const {
|
||||
return dirs::getModRuntimeDir() / this->getID() / "resources";
|
||||
}
|
||||
|
||||
Result<> Mod::saveData() {
|
||||
return m_impl->saveData();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue