Skip to content

Commit

Permalink
gauntletnode id fixes (#105)
Browse files Browse the repository at this point in the history
* gauntletnode id fixes

* awesome
  • Loading branch information
hiimjustin000 authored Oct 1, 2024
1 parent 6328879 commit 91fdd02
Showing 1 changed file with 41 additions and 29 deletions.
70 changes: 41 additions & 29 deletions src/GauntletNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <Geode/modify/GauntletNode.hpp>
#include <Geode/utils/NodeIDs.hpp>

#include "IDCheck.hpp"

using namespace geode::prelude;
using namespace geode::node_ids;

Expand Down Expand Up @@ -37,7 +39,7 @@ struct GauntletNodeIDs : Modify<GauntletNodeIDs, GauntletNode> {
this,
0,
"gauntlet-info-node",
"empty-node",
"reward-node",
"background",
"gauntlet-name-label",
"gauntlet-label",
Expand All @@ -51,7 +53,7 @@ struct GauntletNodeIDs : Modify<GauntletNodeIDs, GauntletNode> {
this,
0,
"gauntlet-info-node",
"empty-node",
"reward-node",
"background",
"gauntlet-name-label",
"gauntlet-label",
Expand All @@ -60,32 +62,42 @@ struct GauntletNodeIDs : Modify<GauntletNodeIDs, GauntletNode> {
);
}

if (auto gauntletInfoNode = this->getChildByID("gauntlet-info-node")) {
if (
self->m_fields->m_gauntlet->hasCompletedMapPack() &&
GSM->isSpecialChestUnlocked(GSM->getGauntletRewardKey(self->m_fields->m_gauntlet->m_packID))
) {
setIDs(
gauntletInfoNode,
0,
"gauntlet-sprite",
"gauntlet-shadow-sprite",
"gauntlet-progress-label",
"gauntlet-progress-shadow-label"
);
} else {
setIDs(
gauntletInfoNode,
0,
"gauntlet-sprite",
"gauntlet-shadow-sprite",
"gauntlet-progress-label",
"gauntlet-progress-shadow-label",
"reward-label",
"reward-shadow-label",
"chest-sprite",
"chest-shadow-sprite"
);
}
if (
self->m_fields->m_gauntlet->hasCompletedMapPack() &&
GSM->isSpecialChestUnlocked(GSM->getGauntletRewardKey(self->m_fields->m_gauntlet->m_packID))
) {
setIDs(
m_gauntletInfoNode,
0,
"gauntlet-sprite",
"gauntlet-shadow-sprite",
"gauntlet-progress-label",
"gauntlet-progress-shadow-label"
);
} else {
setIDs(
m_gauntletInfoNode,
0,
"gauntlet-sprite",
"gauntlet-shadow-sprite",
"gauntlet-progress-label",
"gauntlet-progress-shadow-label",
"reward-label",
"reward-shadow-label",
"chest-sprite",
"chest-shadow-sprite"
);

setIDs(
m_rewardNode,
0,
"reward-label",
"reward-shadow-label",
"chest-sprite",
"chest-shadow-sprite"
);
}

verifyIDSafe(m_gauntletInfoNode, "gauntlet-info-node");
verifyIDSafe(m_rewardNode, "reward-node");
}

0 comments on commit 91fdd02

Please sign in to comment.