mirror of
https://github.com/geode-sdk/geode.git
synced 2025-03-28 13:52:07 -04:00
fix dev names being clickable in the dev popup (fix for #153)
This commit is contained in:
parent
cf69fa3b2f
commit
fac032f8b1
3 changed files with 21 additions and 10 deletions
loader/src/ui/internal
|
@ -17,9 +17,11 @@ bool DevProfilePopup::setup(std::string const& developer) {
|
|||
// installed mods
|
||||
for (auto& mod : Loader::get()->getAllMods()) {
|
||||
if (mod->getDeveloper() == developer) {
|
||||
items->addObject(ModCell::create(
|
||||
auto cell = ModCell::create(
|
||||
mod, nullptr, ModListDisplay::Concise, { 358.f, 40.f }
|
||||
));
|
||||
);
|
||||
cell->disableDeveloperButton();
|
||||
items->addObject(cell);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,9 +30,11 @@ bool DevProfilePopup::setup(std::string const& developer) {
|
|||
if (Loader::get()->isModInstalled(item->info.id())) {
|
||||
continue;
|
||||
}
|
||||
items->addObject(IndexItemCell::create(
|
||||
auto cell = IndexItemCell::create(
|
||||
item, nullptr, ModListDisplay::Concise, { 358.f, 40.f }
|
||||
));
|
||||
);
|
||||
cell->disableDeveloperButton();
|
||||
items->addObject(cell);
|
||||
}
|
||||
|
||||
// mods list
|
||||
|
|
|
@ -94,24 +94,24 @@ void ModListCell::setupInfo(
|
|||
auto creatorLabel = CCLabelBMFont::create(creatorStr.c_str(), "goldFont.fnt");
|
||||
creatorLabel->setScale(.43f);
|
||||
|
||||
auto creatorBtn = CCMenuItemSpriteExtra::create(
|
||||
m_developerBtn = CCMenuItemSpriteExtra::create(
|
||||
creatorLabel, this, menu_selector(ModListCell::onViewDev)
|
||||
);
|
||||
creatorBtn->setPositionX(
|
||||
m_developerBtn->setPositionX(
|
||||
m_height / 2 + logoSize / 2 + 13.f
|
||||
+ creatorLabel->getScaledContentSize().width / 2
|
||||
- m_menu->getPositionX()
|
||||
);
|
||||
if (hasDesc && spaceForTags) {
|
||||
creatorBtn->setPositionY(+7.5f);
|
||||
m_developerBtn->setPositionY(+7.5f);
|
||||
}
|
||||
else if (hasDesc || spaceForTags) {
|
||||
creatorBtn->setPositionY(0.f);
|
||||
m_developerBtn->setPositionY(0.f);
|
||||
}
|
||||
else {
|
||||
creatorBtn->setPositionY(-7.f);
|
||||
m_developerBtn->setPositionY(-7.f);
|
||||
}
|
||||
m_menu->addChild(creatorBtn);
|
||||
m_menu->addChild(m_developerBtn);
|
||||
|
||||
if (hasDesc) {
|
||||
auto descBG = CCScale9Sprite::create("square02b_001.png", {0.0f, 0.0f, 80.0f, 80.0f});
|
||||
|
@ -150,6 +150,10 @@ bool ModListCell::init(ModListLayer* list, CCSize const& size) {
|
|||
return true;
|
||||
}
|
||||
|
||||
void ModListCell::disableDeveloperButton() {
|
||||
m_developerBtn->setEnabled(false);
|
||||
}
|
||||
|
||||
// ModCell
|
||||
|
||||
ModCell* ModCell::create(
|
||||
|
|
|
@ -23,6 +23,7 @@ protected:
|
|||
CCLabelBMFont* m_description;
|
||||
CCMenuItemToggler* m_enableToggle = nullptr;
|
||||
CCMenuItemSpriteExtra* m_unresolvedExMark;
|
||||
CCMenuItemSpriteExtra* m_developerBtn;
|
||||
|
||||
bool init(ModListLayer* list, CCSize const& size);
|
||||
void setupInfo(ModInfo const& info, bool spaceForTags, ModListDisplay display);
|
||||
|
@ -35,6 +36,8 @@ public:
|
|||
virtual void updateState() = 0;
|
||||
virtual CCNode* createLogo(CCSize const& size) = 0;
|
||||
virtual std::string getDeveloper() const = 0;
|
||||
|
||||
void disableDeveloperButton();
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue