Skip to content

Commit

Permalink
v1.2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
hiimjasmine00 committed Jun 29, 2024
1 parent 82b0fb2 commit ac74bdb
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64")
set(CMAKE_CXX_VISIBILITY_PRESET hidden)

project(FakeRate VERSION 1.2.5)
project(FakeRate VERSION 1.2.6)

add_library(${PROJECT_NAME} SHARED
src/FakeRate.cpp
Expand Down
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Fake Rate Changelog
## v1.2.6 (2024-06-29)
- Fixed a bug that caused the More Difficulties difficulty face to be offset in the level info page

## v1.2.5 (2024-06-28)
- Fixed a bug that caused the More Difficulties difficulty face to be offset in the level cell

Expand Down
2 changes: 1 addition & 1 deletion mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"win": "2.206",
"mac": "2.206"
},
"version": "v1.2.5",
"version": "v1.2.6",
"id": "hiimjustin000.fake_rate",
"name": "Fake Rate",
"developer": "hiimjustin000",
Expand Down
22 changes: 12 additions & 10 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,16 @@ class $modify(FRLevelInfoLayer, LevelInfoLayer) {
void checkFakeRate() {
auto vec = Mod::get()->getSavedValue<std::vector<FakeRateSaveData>>("fake-rate", {});
auto it = std::find_if(vec.begin(), vec.end(), [this](auto const& item) { return item.id == m_level->m_levelID; });
auto stars = m_level->m_stars;
auto stars = m_level->m_stars.value();
auto starsRequested = m_level->m_starsRequested;
if (it != vec.end()) updateFakeRate(it->stars, it->feature, it->difficulty, it->moreDifficultiesOverride, false, true);
else m_fields->m_fakeRateData = {
.id = m_level->m_levelID,
.stars = stars,
.feature = m_level->m_featured > 1 ? m_level->m_isEpic + 1 : 0,
.difficulty = FakeRate::getDifficultyFromLevel(m_level),
.moreDifficultiesOverride = stars == 4 || stars == 7 || stars == 9 ? stars : 0
.moreDifficultiesOverride = stars == 4 || stars == 7 || stars == 9 ? stars :
stars == 0 && (starsRequested == 4 || starsRequested == 7 || starsRequested == 9) ? starsRequested : 0
};
}

Expand Down Expand Up @@ -200,17 +202,17 @@ class $modify(FRLevelInfoLayer, LevelInfoLayer) {
}
if (!moreDifficultiesSprite) {
moreDifficultiesSprite = CCSprite::createWithSpriteFrameName(frameName);
moreDifficultiesSprite->setPosition(difficultySpriteParent->convertToWorldSpace({
m_difficultySprite->getPositionX() + (legacy ? 0.0f : 0.25f),
m_difficultySprite->getPositionY() - (legacy ? 0.0f : 0.1f)
}));
moreDifficultiesSprite->setID("uproxide.more_difficulties/more-difficulties-spr");
addChild(moreDifficultiesSprite, 3);
}
else {
moreDifficultiesSprite->initWithSpriteFrameName(frameName);
moreDifficultiesSprite->setVisible(true);
}
moreDifficultiesSprite->setPosition(difficultySpriteParent->convertToWorldSpace({
m_difficultySprite->getPositionX() + (legacy ? 0.0f : 0.25f),
m_difficultySprite->getPositionY() - (legacy ? 0.0f : 0.1f)
}));
m_difficultySprite->setOpacity(0);
}
}
Expand Down Expand Up @@ -380,17 +382,17 @@ class $modify(FRLevelCell, LevelCell) {
}
if (!moreDifficultiesSprite) {
moreDifficultiesSprite = CCSprite::createWithSpriteFrameName(frameName);
moreDifficultiesSprite->setPosition({
difficultySprite->getPositionX() + (legacy ? 0.0f : 0.25f),
difficultySprite->getPositionY() - (legacy ? 0.0f : 0.1f)
});
moreDifficultiesSprite->setID("uproxide.more_difficulties/more-difficulties-spr");
difficultyContainer->addChild(moreDifficultiesSprite, 3);
}
else {
moreDifficultiesSprite->initWithSpriteFrameName(frameName);
moreDifficultiesSprite->setVisible(true);
}
moreDifficultiesSprite->setPosition({
difficultySprite->getPositionX() + (legacy ? 0.0f : 0.25f),
difficultySprite->getPositionY() - (legacy ? 0.0f : 0.1f)
});
difficultySprite->setOpacity(0);
}
}
Expand Down

0 comments on commit ac74bdb

Please sign in to comment.