Skip to content

Commit

Permalink
1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Uproxide committed Nov 19, 2024
1 parent 88810c0 commit 2d40814
Show file tree
Hide file tree
Showing 12 changed files with 165 additions and 180 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
- name: Windows
os: windows-latest

# - name: macOS
# os: macos-latest
- name: macOS
os: macos-latest

- name: Android32
os: ubuntu-latest
Expand Down
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@
"xtr1common": "cpp",
"xtree": "cpp",
"xutility": "cpp",
"source_location": "cpp"
"source_location": "cpp",
"cfenv": "cpp",
"coroutine": "cpp",
"expected": "cpp"
}
}
12 changes: 11 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
# 1.7.0
* Re-add Toggling Difficulties
* Add Legendary and Mythic Glows
- Enable them in mod settings
* Rewrite Difficulty Sprite function
* Add MacOS Support
* Port to 4.0.0-beta.1
* Killed Riley again
* Removed Herozer

# 1.6.0
* Replaced Legacy Difficulties with Uproxide Difficulties
- Pretty much that means I drew them, Capeesh?
* Temporarily remove Toggling Difficulties
* Port to 2.207
* Port to 4.0.0-alpha.1

# 1.6.0-prerelease.2
* Support for BetterInfo
Expand Down
17 changes: 14 additions & 3 deletions mod.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"geode": "4.0.0-alpha.1",
"geode": "4.0.0-beta.1",
"gd": {
"android": "2.2074",
"win": "2.2074",
"mac": "2.206"
"mac": "2.2074"
},
"version": "v1.6.0",
"version": "v1.7.0",
"id": "uproxide.more_difficulties",
"name": "More Difficulties",
"developer": "Uproxide",
Expand Down Expand Up @@ -35,6 +35,17 @@
"description": "Enables Uproxide Difficulty Sprites (By well, Uproxide!)",
"type": "bool",
"default": false
},
"toggle-difficulties": {
"type": "custom:toggle-difficulties",
"name": "Toggle Difficulties",
"description": "Toggle on or off certain difficulties."
},
"toggle-mythic-glow": {
"type": "bool",
"default": false,
"name": "Toggle Mythic Glow",
"description": "Toggles on or off the Mythic and Legendary glows."
}
},
"dependencies": [
Expand Down
Binary file modified resources/DifficultySheet/MD_Difficulty04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/DifficultySheet/MD_Difficulty07.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/DifficultySheet/MD_Difficulty07_Legacy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
82 changes: 19 additions & 63 deletions src/hooks/LevelCell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,76 +24,32 @@ class $modify(LevelCell) {
int difficulty = p0->getAverageDifficulty();
bool isDemon = p0->m_demon.value() == 1;

CCSprite* mdSpr = CCSprite::createWithSpriteFrameName((useLegacyIcons) ? "MD_Difficulty04_Legacy.png"_spr : "MD_Difficulty04.png"_spr);
MoreDFSprite* mdSpr = MoreDFSprite::createWithStarCount({(starCount != 0) ? starCount : suggestedStarCount}, false);
CCSprite* mdGlow = CCSprite::createWithSpriteFrameName("MD_LegendaryGlow.png"_spr);
// mdGlow->setBlendFunc(ccBlendFunc::)

mdSpr->setZOrder(zOrder);
mdSpr->setID("more-difficulties-spr"_spr);
if (mdSpr && ((starCount != 0) ? (starCount == 4 || starCount == 7 || starCount == 9) : (suggestedStarCount == 4 || suggestedStarCount == 7 || suggestedStarCount == 9))) {
mdSpr->setZOrder(zOrder);
mdSpr->setID("more-difficulties-spr"_spr);

switch(starCount) {
case 4:
if (SaveThings::casual && !isDemon && difficulty == 3) {

mdSpr->setPosition(difficultyPos);
difficultyNode->addChild(mdSpr);
difficultySpr->setOpacity(0);
}
break;
case 7:
if (SaveThings::tough && !isDemon && difficulty == 4) {
mdSpr->initWithSpriteFrameName((useLegacyIcons) ? "MD_Difficulty07_Legacy.png"_spr : "MD_Difficulty07.png"_spr);
mdSpr->setPosition(difficultyPos);
difficultyNode->addChild(mdSpr);
difficultySpr->setOpacity(0);
}
break;
case 9:
if (SaveThings::cruel && !isDemon && difficulty == 5) {
mdSpr->initWithSpriteFrameName((useLegacyIcons) ? "MD_Difficulty09_Legacy.png"_spr : "MD_Difficulty09.png"_spr);
mdSpr->setPosition(difficultyPos);
difficultyNode->addChild(mdSpr);
difficultySpr->setOpacity(0);
}
break;
default:
break;
mdSpr->setPosition(difficultyPos);
difficultyNode->addChild(mdSpr);
difficultySpr->setOpacity(0);
}

if (starCount == 0) {
switch(suggestedStarCount) {
case 4:
if (SaveThings::casual) {
mdSpr->setPosition(difficultyPos);
difficultyNode->addChild(mdSpr);
difficultySpr->setOpacity(0);
}
break;
case 7:
if (SaveThings::tough) {
mdSpr->initWithSpriteFrameName((useLegacyIcons) ? "MD_Difficulty07_Legacy.png"_spr : "MD_Difficulty07.png"_spr);
mdSpr->setPosition(difficultyPos);
difficultyNode->addChild(mdSpr);
difficultySpr->setOpacity(0);
}
break;
case 9:
if (SaveThings::cruel) {
mdSpr->initWithSpriteFrameName((useLegacyIcons) ? "MD_Difficulty09_Legacy.png"_spr : "MD_Difficulty09.png"_spr);
mdSpr->setPosition(difficultyPos);
difficultyNode->addChild(mdSpr);
difficultySpr->setOpacity(0);
}
break;
default:
break;

if (Mod::get()->getSettingValue<bool>("toggle-mythic-glow")) {
if (mdSpr && p0->m_isEpic == 2) {
mdSpr->addChild(mdGlow);
mdGlow->setPosition(ccp(mdSpr->getContentWidth() / 2, 26.5));
mdGlow->setOpacity(150);
} else if (mdSpr && p0->m_isEpic == 3) {
mdGlow->initWithSpriteFrameName("MD_MythicGlow.png"_spr);
mdSpr->addChild(mdGlow);
mdGlow->setPosition(ccp(mdSpr->getContentWidth() / 2, 26.5));
mdGlow->setOpacity(150);
}
}

if (p0->m_isEpic == 2) {
// mdSpr->addChild(mdGlow);
}


if (p0->m_levelID == 79669868) {
mdSpr->initWithSpriteFrameName("MD_DifficultyCP.png"_spr);
mdSpr->setPosition(difficultyPos);
Expand Down
74 changes: 20 additions & 54 deletions src/hooks/LevelInfoLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ using namespace geode::prelude;

#include <Geode/modify/LevelInfoLayer.hpp>
#include "../managers/SaveThings.hpp"
#include "../ui/MoreDFSprite.hpp"

class $modify(LevelInfoLayer) {
bool init(GJGameLevel* p0, bool p1) {
Expand All @@ -23,66 +24,31 @@ class $modify(LevelInfoLayer) {
cocos2d::CCPoint difficultyPos = m_difficultySprite->getPosition() + CCPoint { .0f, .0f };
int zOrder = m_difficultySprite->getZOrder();

auto mdSpr = CCSprite::createWithSpriteFrameName((useLegacyIcons) ? "MD_Difficulty04_Legacy.png"_spr : "MD_Difficulty04.png"_spr);
MoreDFSprite* mdSpr = MoreDFSprite::createWithStarCount({(starCount != 0) ? starCount : suggestedStarCount}, false);
CCSprite* mdGlow = CCSprite::createWithSpriteFrameName("MD_LegendaryGlow.png"_spr);

mdSpr->setZOrder(zOrder);
mdSpr->setID("more-difficulties-spr"_spr);

switch(starCount) {
case 4:
if (SaveThings::casual && !isDemon && difficulty == 3) {
mdSpr->setPosition(difficultyPos);
this->addChild(mdSpr);
m_difficultySprite->setOpacity(0);
}
break;
case 7:
if (SaveThings::tough && !isDemon && difficulty == 4) {
mdSpr->initWithSpriteFrameName((useLegacyIcons) ? "MD_Difficulty07_Legacy.png"_spr : "MD_Difficulty07.png"_spr);
mdSpr->setPosition(difficultyPos);
this->addChild(mdSpr);
m_difficultySprite->setOpacity(0);
}
break;
case 9:
if (SaveThings::cruel && !isDemon && difficulty == 5) {
mdSpr->initWithSpriteFrameName((useLegacyIcons) ? "MD_Difficulty09_Legacy.png"_spr : "MD_Difficulty09.png"_spr);
mdSpr->setPosition(difficultyPos);
this->addChild(mdSpr);
m_difficultySprite->setOpacity(0);
}
break;
default:
break;
if (mdSpr && ((starCount != 0) ? (starCount == 4 || starCount == 7 || starCount == 9) : (suggestedStarCount == 4 || suggestedStarCount == 7 || suggestedStarCount == 9))) {
mdSpr->setZOrder(zOrder);
mdSpr->setID("more-difficulties-spr"_spr);

mdSpr->setPosition(difficultyPos);
this->addChild(mdSpr);
m_difficultySprite->setOpacity(0);
}

if (starCount == 0) {
switch(suggestedStarCount) {
case 4:
if (SaveThings::casual) {
mdSpr->setPosition(difficultyPos);
this->addChild(mdSpr);
m_difficultySprite->setOpacity(0);
}
break;
case 7:
if (SaveThings::tough) {
mdSpr->initWithSpriteFrameName((useLegacyIcons) ? "MD_Difficulty07_Legacy.png"_spr : "MD_Difficulty07.png"_spr);
mdSpr->setPosition(difficultyPos);
this->addChild(mdSpr);
m_difficultySprite->setOpacity(0);
}
break;
case 9:
if (SaveThings::cruel) {
mdSpr->initWithSpriteFrameName((useLegacyIcons) ? "MD_Difficulty09_Legacy.png"_spr : "MD_Difficulty09.png"_spr);
mdSpr->setPosition(difficultyPos);
this->addChild(mdSpr);
m_difficultySprite->setOpacity(0);
}
break;
default:
break;
if (Mod::get()->getSettingValue<bool>("toggle-mythic-glow")) {
if (mdSpr && p0->m_isEpic == 2) {
mdSpr->addChild(mdGlow);
mdGlow->setPosition(ccp(mdSpr->getContentWidth() / 2, 26.5));
mdGlow->setOpacity(150);
} else if (mdSpr && p0->m_isEpic == 3) {
mdGlow->initWithSpriteFrameName("MD_MythicGlow.png"_spr);
mdSpr->addChild(mdGlow);
mdGlow->setPosition(ccp(mdSpr->getContentWidth() / 2, 26.5));
mdGlow->setOpacity(150);
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void ToggleDifficultiesNode::onToggleBtn(CCObject*) {
} */

$on_mod(Loaded) {
SaveThings::casual = true;
SaveThings::tough = true;
SaveThings::cruel = true;
SaveThings::casual = Mod::get()->getSavedValue<bool>("casual", true);;
SaveThings::tough = Mod::get()->getSavedValue<bool>("tough", true);;
SaveThings::cruel = Mod::get()->getSavedValue<bool>("cruel", true);;
}
11 changes: 8 additions & 3 deletions src/ui/MoreDFSprite.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#include <Geode/Geode.hpp>

#include "./MoreDFSprite.hpp"
#include "../managers/SaveThings.hpp"

/* bool MoreDFSprite::init() {
bool MoreDFSprite::init() {
return true;
}
}

MoreDFSprite* MoreDFSprite::createWithStarCount(int starCount, bool smallSpr) {
auto ret = new MoreDFSprite();
Expand All @@ -23,10 +24,14 @@ MoreDFSprite* MoreDFSprite::createWithStarCount(int starCount, bool smallSpr) {
std::string spriteName = fmt::format("uproxide.more_difficulties/MD_Difficulty0{}{}.png", starCount, extraStuff);
log::info("{}", spriteName);

if ((starCount == 4 && !SaveThings::casual) || (starCount == 7 && !SaveThings::tough) || (starCount == 4 && !SaveThings::cruel)) {
return nullptr;
}

if (ret && ret->initWithSpriteFrameName(spriteName.c_str()) && ret->init()) {
ret->autorelease();
return ret;
}
CC_SAFE_DELETE(ret);
return nullptr;
}; */
};
Loading

0 comments on commit 2d40814

Please sign in to comment.