Skip to content

Commit

Permalink
editorpauselayer doneth
Browse files Browse the repository at this point in the history
  • Loading branch information
altalk23 committed Feb 3, 2024
1 parent 706e70b commit a70be34
Showing 1 changed file with 34 additions and 38 deletions.
72 changes: 34 additions & 38 deletions src/EditorPauseLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,45 +7,45 @@ using namespace geode::node_ids;

// special class for this because making it a CCMenuItemToggler would be very UB
// (not gonna reinterpret_cast that into the members)
// class GuidelinesButton : public CCMenuItemSpriteExtra {
// protected:
// bool init() override {
// if (!CCMenuItemSpriteExtra::init(
// CCSprite::createWithSpriteFrameName("GJ_audioOffBtn_001.png"),
// nullptr,
// this, nullptr
// )) return false;
class GuidelinesButton : public CCMenuItemSpriteExtra {
protected:
bool init() override {
if (!CCMenuItemSpriteExtra::init(
CCSprite::createWithSpriteFrameName("GJ_audioOffBtn_001.png"),
nullptr,
this, nullptr
)) return false;

// this->updateSprite();
this->updateSprite();

// return true;
// }
return true;
}

// void updateSprite() {
// this->setNormalImage(CCSprite::createWithSpriteFrameName(
// GameManager::get()->m_showSongMarkers ?
// "GJ_audioOnBtn_001.png" :
// "GJ_audioOffBtn_001.png"
// ));
// }
void updateSprite() {
this->setNormalImage(CCSprite::createWithSpriteFrameName(
GameManager::get()->m_showSongMarkers ?
"GJ_audioOnBtn_001.png" :
"GJ_audioOffBtn_001.png"
));
}

// void activate() override {
// CCMenuItemSpriteExtra::activate();
// GameManager::get()->m_showSongMarkers ^= 1;
// this->updateSprite();
// }
void activate() override {
CCMenuItemSpriteExtra::activate();
GameManager::get()->m_showSongMarkers ^= 1;
this->updateSprite();
}

// public:
// static GuidelinesButton* create() {
// auto ret = new GuidelinesButton();
// if (ret && ret->init()) {
// ret->autorelease();
// return ret;
// }
// CC_SAFE_DELETE(ret);
// return nullptr;
// }
// };
public:
static GuidelinesButton* create() {
auto ret = new GuidelinesButton();
if (ret && ret->init()) {
ret->autorelease();
return ret;
}
CC_SAFE_DELETE(ret);
return nullptr;
}
};

$register_ids(EditorPauseLayer) {
auto winSize = CCDirector::get()->getWinSize();
Expand Down Expand Up @@ -219,7 +219,6 @@ using namespace geode::node_ids;
);
}
}
// uhh can someone with devtools change these values
optionsMenu->setContentSize({ 120.f, winSize.height - 60.f });
optionsMenu->setPosition(70.f, winSize.height / 2 - 25.f + 10.f);
optionsMenu->updateLayout();
Expand All @@ -236,8 +235,6 @@ using namespace geode::node_ids;

auto guidelinesMenu = menu;

// someone with windows addresses plox do this
#if 0
// replace the two guidelines buttons with a single toggle
guidelinesMenu->getChildByID("guidelines-enable-button")->removeFromParent();
guidelinesMenu->getChildByID("guidelines-disable-button")->removeFromParent();
Expand All @@ -247,7 +244,6 @@ using namespace geode::node_ids;
guidelinesMenu->insertBefore(glToggle, nullptr);
m_guidelinesOffButton = m_guidelinesOnButton = nullptr;
// this->updateSongButton();
#endif

guidelinesMenu->setID("guidelines-menu");
guidelinesMenu->setContentSize({ winSize.width / 2, 50.f });
Expand Down

0 comments on commit a70be34

Please sign in to comment.