refactor: Update resource path to use getModDir

This commit is contained in:
子沐呀
2024-11-04 17:04:52 +08:00
Unverified
parent c16046e405
commit d0824bc540
2 changed files with 2 additions and 2 deletions
+1 -2
View File
@@ -59,8 +59,7 @@ void Entry::loadI18n() {
void Entry::loadResourcePack() { void Entry::loadResourcePack() {
gmlib::tools::VanillaFix::setFixI18nEnabled(); gmlib::tools::VanillaFix::setFixI18nEnabled();
std::string resourcePath = "./plugins/DeathMessages/resource/"; auto resource = gmlib::i18n::ResourceI18n(getSelf().getModDir() / u8"resource", MOD_NAME, 0, 8, 0);
auto resource = gmlib::i18n::ResourceI18n(resourcePath, MOD_NAME, 0, 8, 0);
resource.addLanguage("en_US", en_US); resource.addLanguage("en_US", en_US);
resource.addLanguage("zh_CN", zh_CN); resource.addLanguage("zh_CN", zh_CN);
} }
+1
View File
@@ -66,6 +66,7 @@ target("DeathMessages") -- Change this to your mod name.
set_exceptions("none") -- To avoid conflicts with /EHa set_exceptions("none") -- To avoid conflicts with /EHa
set_kind("shared") set_kind("shared")
set_languages("cxx23") set_languages("cxx23")
set_symbols("debug")
after_build(function (target) after_build(function (target)
local mod_packer = import("scripts.after_build") local mod_packer = import("scripts.after_build")