Skip to content

Commit

Permalink
Fix $ path
Browse files Browse the repository at this point in the history
  • Loading branch information
Alphalaneous authored Oct 18, 2024
1 parent 0fc0471 commit edf4640
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/UIModding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1463,8 +1463,9 @@ void UIModding::handleModifications(CCNode* node, matjson::Object nodeObject) {

void UIModding::doUICheck(CCNode* node) {

std::string path = "ui/" + node->getID() + ".json";

std::string path = "ui/" + node->getID() + ".json"
std::replace(path.begin(), path.end(), '/', '$');

unsigned long fileSize = 0;
unsigned char* buffer = CCFileUtils::sharedFileUtils()->getFileData(path.c_str(), "rb", &fileSize);

Expand Down Expand Up @@ -1515,7 +1516,6 @@ void UIModding::startFileListeners() {
for (std::string path : packs) {

std::string uiPath = fmt::format("{}{}", path, "ui\\");
std::replace(uiPath.begin(), uiPath.end(), '$', '/');

FileWatcher* fw = new FileWatcher(uiPath, std::chrono::milliseconds(500));
listeners.push_back(fw);
Expand Down Expand Up @@ -1598,4 +1598,4 @@ void UIModding::doUICheckForType(std::string type, CCNode* node) {
matjson::Object object = value.as_object();
handleModifications(node, object);
}
}
}

0 comments on commit edf4640

Please sign in to comment.