Skip to content

Commit 744fd24

Browse files
committed
it compiles but it doesnt work right i think
1 parent 1b04d8c commit 744fd24

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/ui/SongControlMenu.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,23 @@ bool SongControlMenu::setup() {
126126
this->m_totlTimeLb = totalLength;
127127
// DONT ADD this->m_totlTimeLb AS A CHILD -- SongControlMenu::updateCurrentLabel() HANDLES THAT!
128128

129+
cocos2d::CCLayerColor* currProgBar = cocos2d::CCLayerColor::create({200, 200, 200, 255});
130+
currProgBar->setContentSize({(this->b->getContentWidth() / 2.f) + 0.f, 2.5f});
131+
currProgBar->setAnchorPoint({0.f, 0.f});
132+
this->m_currProgBar = currProgBar;
133+
134+
cocos2d::CCLayerColor* darkProgBar = cocos2d::CCLayerColor::create({30, 30, 30, 255});
135+
darkProgBar->setContentSize({this->b->getContentWidth(), 2.5f});
136+
darkProgBar->setAnchorPoint({0.f, 0.f});
137+
darkProgBar->addChild(currProgBar);
138+
this->m_darkProgBar = darkProgBar;
139+
140+
cocos2d::CCClippingNode* clippingNode = cocos2d::CCClippingNode::create(darkProgBar);
141+
clippingNode->setContentSize(darkProgBar->getContentSize());
142+
clippingNode->setAnchorPoint({0.f, 0.f});
143+
clippingNode->addChild(darkProgBar);
144+
this->m_clipNode = clippingNode;
145+
129146
SongControlMenu::updateCurrentLabel();
130147

131148
/*
@@ -174,6 +191,8 @@ bool SongControlMenu::setup() {
174191
this->m_closeBtn->setID("close-button"_spr);
175192
this->m_buttonMenu->setID("close-menu"_spr);
176193
this->m_otherLabel->setID("im-not-spotify"_spr);
194+
this->m_darkProgBar->setID("dark-prog-bar"_spr);
195+
this->m_currProgBar->setID("curr-prog-bar"_spr);
177196
this->m_totlTimeLb->setID("total-time-label"_spr);
178197
this->m_smallLabel->setID("current-song-label"_spr);
179198
this->m_currTimeLb->setID("current-time-label"_spr);
@@ -351,6 +370,7 @@ void SongControlMenu::updateCurrentLabel() {
351370
this->b->addChildAtPosition(this->m_increDecreMenu, geode::Anchor::Center);
352371
this->b->addChildAtPosition(this->m_currTimeLb, geode::Anchor::BottomLeft, {27.5f, 6.f});
353372
this->b->addChildAtPosition(this->m_totlTimeLb, geode::Anchor::BottomRight, {-27.5f, 6.f});
373+
this->b->addChildAtPosition(this->m_clipNode, geode::Anchor::BottomLeft);
354374
this->m_currTimeLb->setScale(.35f);
355375
this->m_totlTimeLb->setScale(.35f);
356376
SongControlMenu::checkDaSongPositions(0.f);

src/ui/SongControlMenu.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ class SongControlMenu final : public geode::Popup<> {
1414
cocos2d::CCMenu* m_increDecreMenu {};
1515
InfoAlertButton* m_infoButton {};
1616
cocos2d::extension::CCScale9Sprite*b{};
17+
cocos2d::CCLayerColor* m_darkProgBar{};
18+
cocos2d::CCLayerColor* m_currProgBar{};
19+
cocos2d::CCClippingNode* m_clipNode {};
1720
bool setup() override;
1821
void onShuffleButton(CCObject*);
1922
void onCopyButton(CCObject*);

0 commit comments

Comments
 (0)