Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Alphalaneous committed Oct 26, 2024
2 parents 2b6812d + 8e3ea7f commit d37742f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/UIModding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1464,8 +1464,11 @@ void UIModding::handleModifications(CCNode* node, matjson::Object nodeObject) {

void UIModding::doUICheck(CCNode* node) {

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

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


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

Expand Down Expand Up @@ -1516,7 +1519,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 @@ -1599,4 +1601,4 @@ void UIModding::doUICheckForType(std::string type, CCNode* node) {
matjson::Object object = value.as_object();
handleModifications(node, object);
}
}
}

0 comments on commit d37742f

Please sign in to comment.