Skip to content

Commit e596dbc

Browse files
authored
Merge pull request #74 from hiimjasmine00/main
Bugfixes and index requirements
2 parents 548b440 + 5135b32 commit e596dbc

4 files changed

Lines changed: 12 additions & 11 deletions

File tree

src/InterfaceFixAndExt.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,7 @@ class $modify(MLE_LevelPageExt, LevelPage) {
154154
LevelPage::updateDynamicPage(level);
155155

156156
//REPLACE_DIFFICULTY_SPRITE really
157-
if (REPLACE_DIFFICULTY_SPRITE) if (auto difficultySprite = typeinfo_cast<CCSprite*>(
158-
this->getChildByIDRecursive("difficulty-sprite")
159-
)) {
157+
if (REPLACE_DIFFICULTY_SPRITE) if (auto difficultySprite = m_difficultySprite) {
160158
auto diffID = static_cast<int>(level->m_difficulty);
161159

162160
auto sz = difficultySprite->getContentSize(); //limitNodeSize

src/Resources.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,12 @@ class $modify(MLE_LocalLevelManager, LocalLevelManager) {
157157

158158
#include <Geode/modify/LoadingLayer.hpp>
159159
class $modify(MLE_LoadingLayer, LoadingLayer) {
160-
static inline int AFTER_LOADING = true;
160+
static inline bool AFTER_LOADING = true;
161161
void reloadc(float) { LocalLevelManager::get()->init(); };
162162
$override bool init(bool a) {
163163
if (!LoadingLayer::init(a)) return false;
164164
this->scheduleOnce(schedule_selector(MLE_LoadingLayer::reloadc), 0.25f);
165-
AFTER_LOADING = 1;
165+
AFTER_LOADING = true;
166166
return true;
167167
}
168168
};
@@ -172,7 +172,8 @@ class $modify(MLE_MenuLayer, MenuLayer) {
172172
$override bool init() {
173173
if (!MenuLayer::init()) return false;
174174
//add frames form known mods
175-
if (MLE_LoadingLayer::AFTER_LOADING--) {
175+
if (MLE_LoadingLayer::AFTER_LOADING) {
176+
MLE_LoadingLayer::AFTER_LOADING = false;
176177
auto freeDiffID = 10;
177178
auto diffFrameExists = true;
178179
auto diffSpriteExists = true;

src/TheDataDrivenAchievements.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ class $modify(MLE_AchievementManager, AchievementManager) {
8484
if (!THE_DATA_DRIVEN_ACHIEVEMENTS) return AchievementManager::addManualAchievements();
8585
if (!existsInPaths("achievements.json")) { // generate default file
8686
file::writeStringSafe(getMod()->getConfigDir() / "achievements.json", "{}");
87-
setUserObject("is-data-file-generating"_spr, new CCObject());
87+
auto object = new CCObject();
88+
object->autorelease();
89+
setUserObject("is-data-file-generating"_spr, object);
8890
AchievementManager::addManualAchievements();
8991
setUserObject("is-data-file-generating"_spr, nullptr);
9092
addManualAchievements();

src/_MainLevelsEditorMenu.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,12 +409,12 @@ class MainLevelsEditorMenu : public geode::Popup<> {
409409

410410
auto body = std::stringstream();
411411

412-
body << """" "` File:` [" + path.string() + "](file:///" + string::replace(path.string(), " ", "%20") + ")";
412+
body << """" "` File:` [" + string::pathToString(path) + "](file:///" + string::replace(string::pathToString(path), " ", "%20") + ")";
413413
body << "\n";
414-
body << "\n" "` Dir:` [" + dir.string() + "](file:///" + string::replace(dir.string(), " ", "%20") + ")";
414+
body << "\n" "` Dir:` [" + string::pathToString(dir) + "](file:///" + string::replace(string::pathToString(dir), " ", "%20") + ")";
415415
body << "\n";
416416
body << "\n" "```";
417-
body << "\n" "zip tree of \"" << std::filesystem::path(path).filename().string() << "\": ";
417+
body << "\n" "zip tree of \"" << string::pathToString(path.filename()) << "\": ";
418418
auto unzip = file::Unzip::create(string::pathToString(path));
419419
if (unzip.err()) body
420420
<< "\n" "FAILED TO OPEN CREATED ZIP!"
@@ -424,7 +424,7 @@ class MainLevelsEditorMenu : public geode::Popup<> {
424424
body << "\n" "```";
425425
body << "\n";
426426
body << "\n" "```";
427-
body << "\n" "data \"" << std::filesystem::path(path).filename().string() << "\": ";
427+
body << "\n" "data \"" << string::pathToString(path.filename()) << "\": ";
428428
for (auto entry : dbg_json) body
429429
<< "\n- " << entry.getKey().value_or("unk") + ": " << entry.dump();
430430
body << "\n" "```";

0 commit comments

Comments
 (0)