Skip to content

Commit

Permalink
move modtober animation to only show up on modtober tab
Browse files Browse the repository at this point in the history
  • Loading branch information
matcool committed Jan 13, 2025
1 parent 875b785 commit 39b5582
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
9 changes: 0 additions & 9 deletions loader/src/ui/mods/ModsLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "GeodeStyle.hpp"
#include "ui/mods/sources/ModListSource.hpp"
#include <loader/LoaderImpl.hpp>
#include "events/EventWinnerAnimation.hpp"

bool ModsStatusNode::init() {
if (!CCNode::init())
Expand Down Expand Up @@ -623,14 +622,6 @@ bool ModsLayer::init() {
return true;
}

void ModsLayer::onEnterTransitionDidFinish() {
CCLayer::onEnterTransitionDidFinish();
// todo: generic system for this for any contest event
if (!Mod::get()->setSavedValue("shown-modtober-winner", true)) {
this->addChild(EventWinnerAnimation::create());
}
}

void ModsLayer::gotoTab(ModListSource* src) {
// Update selected tab
for (auto tab : m_tabs) {
Expand Down
1 change: 0 additions & 1 deletion loader/src/ui/mods/ModsLayer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ class ModsLayer : public CCLayer, public SetIDPopupDelegate {
void keyDown(enumKeyCodes key) override;
void keyBackClicked() override;
void setIDPopupClosed(SetIDPopup*, int value) override;
void onEnterTransitionDidFinish() override;

void onTab(CCObject* sender);
void onOpenModsFolder(CCObject*);
Expand Down
6 changes: 6 additions & 0 deletions loader/src/ui/mods/list/ModList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "../popups/SortPopup.hpp"
#include "../GeodeStyle.hpp"
#include "../ModsLayer.hpp"
#include "../events/EventWinnerAnimation.hpp"

static size_t getDisplayPageSize(ModListSource* src, ModListDisplay display) {
if (src->isLocalModsOnly() && Mod::get()->template getSettingValue<bool>("infinite-local-mods-list")) {
Expand Down Expand Up @@ -264,6 +265,11 @@ bool ModList::init(ModListSource* src, CCSize const& size) {
auto src = typeinfo_cast<ServerModListSource*>(m_source);
src && src->getType() == ServerModListType::Modtober24
) {
// todo: generic system for this for any contest event
if (!Mod::get()->setSavedValue("shown-modtober-winner", true)) {
CCScene::get()->addChild(EventWinnerAnimation::create());
}

auto menu = CCMenu::create();
menu->setID("modtober-banner");
menu->ignoreAnchorPointForPosition(false);
Expand Down

0 comments on commit 39b5582

Please sign in to comment.