Skip to content

Commit

Permalink
showcase mode
Browse files Browse the repository at this point in the history
  • Loading branch information
matcool committed Aug 4, 2021
1 parent f2c13db commit 8a556e5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
20 changes: 19 additions & 1 deletion src/overlay_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,17 @@ bool OverlayLayer::init() {
label->setPosition({win_size.width - 55, win_size.height - 190});
addChild(label);

toggle = gd::CCMenuItemToggler::create(check_off_sprite, check_on_sprite, this, menu_selector(OverlayLayer::on_toggle_showcase));
toggle->setPosition({win_size.width - 35, -225});
toggle->toggle(rs.showcase_mode);
menu->addChild(toggle);

label = CCLabelBMFont::create("Showcase Mode", "bigFont.fnt");
label->setAnchorPoint({1, 0.5});
label->setScale(0.6f);
label->setPosition({win_size.width - 55, win_size.height - 225});
addChild(label);

sprite = CCSprite::create("square02b_001.png");
sprite->setColor({0, 0, 0});
sprite->setOpacity(69);
Expand Down Expand Up @@ -263,4 +274,11 @@ void OverlayLayer::on_toggle_real_time(CCObject* toggle_) {
if (toggle != nullptr) {
ReplaySystem::get_instance().real_time_mode = !toggle->isOn(); // why is it flipped
}
}
}

void OverlayLayer::on_toggle_showcase(CCObject* toggle_) {
auto toggle = cast<gd::CCMenuItemToggler*>(toggle_);
if (toggle != nullptr) {
ReplaySystem::get_instance().showcase_mode = !toggle->isOn();
}
}
1 change: 1 addition & 0 deletions src/overlay_layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class OverlayLayer : public gd::FLAlertLayer, public CCTextFieldDelegate, public
void on_frame(CCObject*);

void on_toggle_real_time(CCObject*);
void on_toggle_showcase(CCObject*);

virtual void keyBackClicked();
virtual void keyDown(enumKeyCodes key) {
Expand Down
2 changes: 1 addition & 1 deletion src/replay_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void ReplaySystem::_update_status_label() {
label->setString("Recording");
break;
case PLAYING:
label->setString("Playing");
label->setString(showcase_mode ? "" : "Playing");
break;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/replay_system.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,5 @@ class ReplaySystem {
unsigned get_frame();

bool real_time_mode = true; // fuck it we going public
bool showcase_mode = false;
};

0 comments on commit 8a556e5

Please sign in to comment.