From 6d26c70739d908aea1675deeea7bb6df1803887b Mon Sep 17 00:00:00 2001 From: HJfod <60038575+HJfod@users.noreply.github.com> Date: Wed, 31 Jul 2024 00:34:18 +0300 Subject: [PATCH] more pro stuff --- .github/workflows/build.yml | 4 +++- src/features/about/AboutBEPopup.cpp | 25 +++++++++++++++---------- src/features/about/AboutBEPopup.hpp | 1 + 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e3537be..4a908aa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,7 +62,9 @@ jobs: - uses: actions/checkout@v4 - name: Install OpenSSL - run: sudo apt-get install libssl-dev + run: | + sudo apt-get install libssl-dev + sudo apt install pkg-config - name: Checkout Pro uses: actions/checkout@v4 diff --git a/src/features/about/AboutBEPopup.cpp b/src/features/about/AboutBEPopup.cpp index de69ff0..92ec87f 100644 --- a/src/features/about/AboutBEPopup.cpp +++ b/src/features/about/AboutBEPopup.cpp @@ -139,17 +139,18 @@ bool AboutBEPopup::setup() { menu->setContentSize({ 325, 100 }); menu->ignoreAnchorPointForPosition(false); - for (auto pair : std::initializer_list> { - { "Report a Bug", menu_selector(AboutBEPopup::onReportBug) }, - { "Suggest a Feature", menu_selector(AboutBEPopup::onSuggestFeature) }, - { "Changelog", menu_selector(AboutBEPopup::onChangelog) }, - { "Special Thanks", menu_selector(AboutBEPopup::onSpecialThanks) }, - { "Support BE", menu_selector(AboutBEPopup::onSupport) }, - { "Supporters", menu_selector(AboutBEPopup::onSupporters) }, + for (auto pair : std::initializer_list> { + { "report-bug-btn", "Report a Bug", menu_selector(AboutBEPopup::onReportBug) }, + { "suggest-btn", "Suggest a Feature", menu_selector(AboutBEPopup::onSuggestFeature) }, + { "changelog-btn", "Changelog", menu_selector(AboutBEPopup::onChangelog) }, + { "special-thanks-btn", "Special Thanks", menu_selector(AboutBEPopup::onSpecialThanks) }, + { "support-btn", "Support BE", menu_selector(AboutBEPopup::onSupport) }, + { "supporters-btn", "Supporters", menu_selector(AboutBEPopup::onSupporters) }, }) { - auto spr = ButtonSprite::create(pair.first, "goldFont.fnt", "GJ_button_05.png", .8f); + auto spr = ButtonSprite::create(std::get<1>(pair), "goldFont.fnt", "GJ_button_05.png", .8f); spr->setScale(.55f); - auto btn = CCMenuItemSpriteExtra::create(spr, this, pair.second); + auto btn = CCMenuItemSpriteExtra::create(spr, this, std::get<2>(pair)); + btn->setID(std::get<0>(pair)); menu->addChild(btn); } @@ -157,7 +158,7 @@ bool AboutBEPopup::setup() { m_mainLayer->addChildAtPosition(menu, Anchor::Center, ccp(0, -60)); #ifdef BETTEREDIT_PRO - pro::addAboutPopupStuff(m_mainLayer); + pro::addAboutPopupStuff(this); #endif // BE links @@ -194,6 +195,10 @@ bool AboutBEPopup::setup() { return true; } +void AboutBEPopup::onClose(CCObject* sender) { + PopupWithCorners::onClose(sender); +} + void AboutBEPopup::onSupport(CCObject*) { SupportPopup::create(false)->show(); // openSupportPopup(Mod::get()); diff --git a/src/features/about/AboutBEPopup.hpp b/src/features/about/AboutBEPopup.hpp index 8b504ff..25156f3 100644 --- a/src/features/about/AboutBEPopup.hpp +++ b/src/features/about/AboutBEPopup.hpp @@ -12,6 +12,7 @@ class AboutBEPopup : public PopupWithCorners<> { public: static AboutBEPopup* create(); + void onClose(CCObject* sender) override; void onSettings(CCObject*); void onReportBug(CCObject*); void onSuggestFeature(CCObject*);