Skip to content

Commit

Permalink
fix logo and pack deselecting
Browse files Browse the repository at this point in the history
  • Loading branch information
LimeGradient committed Sep 30, 2024
1 parent becb454 commit adaacc4
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 26 deletions.
5 changes: 0 additions & 5 deletions .github/ISSUE_TEMPLATE/config.yml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/ISSUE_TEMPLATE/modpack-submission.yml

This file was deleted.

1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Added new pack schema
- Fixed icons
- Fixed empty file names when exporting
- Fixed mods importing without the proper binary

# v1.1.1
- Ported to GD 2.206
Expand Down
10 changes: 8 additions & 2 deletions src/lists/PackCell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ bool PackCell::init(PackInfo* packInfo) {
m_logo = CCSprite::createWithTexture(texture);
image->release();
texture->release();

m_logo->setScale(0.135f);
} else {
m_logo = CCSprite::createWithSpriteFrameName("discord-icon.png"_spr);
m_logo->setScale(0.75f);
}

m_logo->setID("logo-sprite");
m_logo->setScale(0.135f);
m_logo->setAnchorPoint({.5f, .5f});
m_logo->setPosition({15.f, 14.f});
this->addChild(m_logo);
Expand Down Expand Up @@ -108,7 +110,11 @@ bool PackCell::init(PackInfo* packInfo) {

void PackCell::onEnable(CCObject*) {
auto packSelectLayer = static_cast<PackSelectList*>(CCScene::get()->getChildByIDRecursive("pack-select-list"));
packSelectLayer->packSelect(this->m_packInfo);
if (!this->m_enableToggle->isToggled()) {
packSelectLayer->packSelect(this->m_packInfo);
} else {
packSelectLayer->packDeselect();
}
}

PackCell* PackCell::create(PackInfo* packInfo) {
Expand Down
7 changes: 6 additions & 1 deletion src/lists/PackSelectList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void PackSelectList::packSelect(PackInfo* packInfo) {
if (packJson["hasLocalMods"].as_bool() == true) {
FLAlertLayer::create(
"Mod Profiles",
"<cr>Warning!</c> this pack might contain mods in development! Beware!",
"<cr>Warning!</c> This pack may contain mods in development! Beware!",
"Ok"
)->show();
}
Expand All @@ -127,6 +127,11 @@ void PackSelectList::packSelect(PackInfo* packInfo) {
m_restartBtn->setVisible(true);
}

void PackSelectList::packDeselect() {
m_importPackBtn->setVisible(true);
m_restartBtn->setVisible(false);
}

void PackSelectList::onImportPack(CCObject*) {

}
Expand Down
1 change: 1 addition & 0 deletions src/lists/PackSelectList.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ class PackSelectList : public CCNode {
static PackSelectList* create(CCSize const& size);

void packSelect(PackInfo* packInfo);
void packDeselect();
};

0 comments on commit adaacc4

Please sign in to comment.