Skip to content

Commit

Permalink
firemario211
Browse files Browse the repository at this point in the history
  • Loading branch information
hiimjasmine00 committed Nov 19, 2024
1 parent 02140be commit 1939ffb
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 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(DemonsInBetween VERSION 1.3.0)
project(DemonsInBetween VERSION 1.3.1)

add_library(${PROJECT_NAME} SHARED
src/classes/DIBSearchPopup.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 @@
# Demons In Between Changelog
## v1.3.1 (2024-11-18)
- Fixed an incompatibility with the mod "Overcharged Main Levels" by Firee

## v1.3.0 (2024-11-15)
- Ported to Geode v4.0.0-beta.1

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.2074",
"mac": "2.2074"
},
"version": "v1.3.0",
"version": "v1.3.1",
"id": "hiimjustin000.demons_in_between",
"name": "Demons In Between",
"developer": "hiimjustin000",
Expand Down
4 changes: 2 additions & 2 deletions src/DemonsInBetween.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ struct LadderDemon {
};

class DemonsInBetween {
private:
public:
inline static std::vector<cocos2d::CCPoint> LONG_OFFSETS = {
{ 0.0f, -5.0f }, { 0.125f, -5.0f }, { 0.0f, -5.0f }, { 0.0f, -5.125f }, { 0.25f, -5.0f },
{ 0.125f, -4.75f }, { 0.0f, -5.0f }, { 0.0f, -4.125f }, { -0.125f, -4.125f }, { 0.0f, -4.0f },
Expand All @@ -25,7 +25,7 @@ class DemonsInBetween {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 11, 12, 13, 14, 14, 15, 15,
16, 17, 18, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20
};
public:

inline static std::vector<LadderDemon> GDDL = {};
inline static std::vector<LadderDemon> GDDL_MAIN = {};
inline static matjson::Value GDDL_CACHE = {};
Expand Down
13 changes: 10 additions & 3 deletions src/hooks/LevelPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ using namespace geode::prelude;

#include <Geode/modify/LevelPage.hpp>
class $modify(DIBLevelPage, LevelPage) {
static void onModify(auto& self) {
(void)self.setHookPriority("LevelPage::updateDynamicPage", -1); // overcharged main levels is 0 D:
}

void updateDynamicPage(GJGameLevel* level) {
LevelPage::updateDynamicPage(level);

Expand All @@ -17,9 +21,12 @@ class $modify(DIBLevelPage, LevelPage) {
auto demon = DemonsInBetween::demonForLevel(level, true);
if (demon.id == 0 || demon.difficulty == 0) return;

auto demonSprite = CCSprite::createWithSpriteFrameName(fmt::format("DIB_{:02d}_001.png"_spr, demon.difficulty).c_str());
demonSprite->setPosition(m_difficultySprite->getPosition());
demonSprite->setScale(1.1f);
auto overcharged = Loader::get()->getLoadedMod("firee.overchargedlevels");
auto overchargedEnabled = overcharged && overcharged->getSettingValue<bool>("enabled");
auto demonSprite = CCSprite::createWithSpriteFrameName(fmt::format("DIB_{:02d}{}_001.png"_spr, demon.difficulty, overchargedEnabled ? "_btn" : "").c_str());
demonSprite->setPosition(m_difficultySprite->getPosition() +
(overchargedEnabled ? DemonsInBetween::SHORT_OFFSETS[(size_t)demon.difficulty - 1] * 0.9f : CCPoint { 0.0f, 0.0f }));
demonSprite->setScale(overchargedEnabled ? 0.9f : 1.1f);
demonSprite->setID("between-difficulty-sprite"_spr);
m_levelDisplay->addChild(demonSprite);
m_difficultySprite->setVisible(false);
Expand Down

0 comments on commit 1939ffb

Please sign in to comment.