mirror of
https://github.com/geode-sdk/geode.git
synced 2025-03-25 04:11:42 -04:00
Fix #239 and revert GEODE_HIDDENs
This commit is contained in:
parent
7cc534aaf9
commit
a6a47bf6cf
8 changed files with 35 additions and 31 deletions
codegen/src
loader
include/Geode/cocos/platform
src/ui/internal
|
@ -29,7 +29,7 @@ namespace { namespace format_strings {
|
|||
)GEN";
|
||||
|
||||
char const* class_start = R"GEN(
|
||||
class {hidden}{class_name}{base_classes} {{
|
||||
class {class_name}{base_classes} {{
|
||||
public:
|
||||
static constexpr auto CLASS_NAME = "{class_name}";
|
||||
)GEN";
|
||||
|
@ -185,8 +185,8 @@ std::string generateBindingHeader(Root const& root, ghc::filesystem::path const&
|
|||
|
||||
single_output += fmt::format(::format_strings::class_start,
|
||||
fmt::arg("class_name", cls.name),
|
||||
fmt::arg("base_classes", supers),
|
||||
fmt::arg("hidden", str_if("GEODE_HIDDEN ", (codegen::platform & (Platform::Mac | Platform::iOS)) != Platform::None))
|
||||
fmt::arg("base_classes", supers)//,
|
||||
// fmt::arg("hidden", str_if("GEODE_HIDDEN ", (codegen::platform & (Platform::Mac | Platform::iOS)) != Platform::None))
|
||||
);
|
||||
|
||||
// what.
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include <assert.h>
|
||||
|
||||
#define CC_DLL __attribute__((visibility("hidden")))
|
||||
#define CC_DLL //__attribute__((visibility("hidden")))
|
||||
#define ACTUAL_CC_DLL
|
||||
|
||||
#define CC_ASSERT(cond) assert(cond)
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include <assert.h>
|
||||
|
||||
#define CC_DLL __attribute__((visibility("hidden")))
|
||||
#define CC_DLL //__attribute__((visibility("hidden")))
|
||||
#define ACTUAL_CC_DLL
|
||||
|
||||
|
||||
|
|
|
@ -5,8 +5,9 @@
|
|||
#include "../list/ModListCell.hpp"
|
||||
#include "../list/ModListLayer.hpp"
|
||||
|
||||
bool DevProfilePopup::setup(std::string const& developer) {
|
||||
bool DevProfilePopup::setup(std::string const& developer, ModListLayer* list) {
|
||||
m_noElasticity = true;
|
||||
m_layer = list;
|
||||
|
||||
this->setTitle("Mods by " + developer);
|
||||
|
||||
|
@ -18,7 +19,7 @@ bool DevProfilePopup::setup(std::string const& developer) {
|
|||
for (auto& mod : Loader::get()->getAllMods()) {
|
||||
if (mod->getDeveloper() == developer) {
|
||||
auto cell = ModCell::create(
|
||||
mod, nullptr, ModListDisplay::Concise, { 358.f, 40.f }
|
||||
mod, m_layer, ModListDisplay::Concise, { 358.f, 40.f }
|
||||
);
|
||||
cell->disableDeveloperButton();
|
||||
items->addObject(cell);
|
||||
|
@ -31,7 +32,7 @@ bool DevProfilePopup::setup(std::string const& developer) {
|
|||
continue;
|
||||
}
|
||||
auto cell = IndexItemCell::create(
|
||||
item, nullptr, ModListDisplay::Concise, { 358.f, 40.f }
|
||||
item, m_layer, ModListDisplay::Concise, { 358.f, 40.f }
|
||||
);
|
||||
cell->disableDeveloperButton();
|
||||
items->addObject(cell);
|
||||
|
@ -39,18 +40,18 @@ bool DevProfilePopup::setup(std::string const& developer) {
|
|||
|
||||
// mods list
|
||||
auto listSize = CCSize { 358.f, 160.f };
|
||||
auto list = ListView::create(items, 40.f, listSize.width, listSize.height);
|
||||
list->setPosition(winSize / 2 - listSize / 2);
|
||||
m_mainLayer->addChild(list);
|
||||
auto cellList = ListView::create(items, 40.f, listSize.width, listSize.height);
|
||||
cellList->setPosition(winSize / 2 - listSize / 2);
|
||||
m_mainLayer->addChild(cellList);
|
||||
|
||||
addListBorders(m_mainLayer, winSize / 2, listSize);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
DevProfilePopup* DevProfilePopup::create(std::string const& developer) {
|
||||
DevProfilePopup* DevProfilePopup::create(std::string const& developer, ModListLayer* list) {
|
||||
auto ret = new DevProfilePopup();
|
||||
if (ret && ret->init(420.f, 260.f, developer)) {
|
||||
if (ret && ret->init(420.f, 260.f, developer, list)) {
|
||||
ret->autorelease();
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -4,10 +4,14 @@
|
|||
|
||||
using namespace geode::prelude;
|
||||
|
||||
class DevProfilePopup : public Popup<std::string const&> {
|
||||
class ModListLayer;
|
||||
|
||||
class DevProfilePopup : public Popup<std::string const&, ModListLayer*> {
|
||||
protected:
|
||||
bool setup(std::string const& developer) override;
|
||||
ModListLayer* m_layer;
|
||||
|
||||
bool setup(std::string const& developer, ModListLayer* list) override;
|
||||
|
||||
public:
|
||||
static DevProfilePopup* create(std::string const& developer);
|
||||
static DevProfilePopup* create(std::string const& developer, ModListLayer* list);
|
||||
};
|
||||
|
|
|
@ -53,24 +53,21 @@ void InstallListCell::setupInfo(
|
|||
}
|
||||
this->addChild(m_titleLabel);
|
||||
|
||||
m_developerBtn = nullptr;
|
||||
m_creatorLabel = nullptr;
|
||||
if (developer) {
|
||||
auto creatorStr = "by " + *developer;
|
||||
auto creatorLabel = CCLabelBMFont::create(creatorStr.c_str(), "goldFont.fnt");
|
||||
creatorLabel->setScale(.34f);
|
||||
m_creatorLabel = CCLabelBMFont::create(creatorStr.c_str(), "goldFont.fnt");
|
||||
m_creatorLabel->setScale(.34f);
|
||||
if (inactive) {
|
||||
creatorLabel->setColor({ 163, 163, 163 });
|
||||
m_creatorLabel->setColor({ 163, 163, 163 });
|
||||
}
|
||||
|
||||
m_developerBtn = CCMenuItemSpriteExtra::create(
|
||||
creatorLabel, this, menu_selector(InstallListCell::onViewDev)
|
||||
);
|
||||
m_developerBtn->setPosition(
|
||||
m_creatorLabel->setPosition(
|
||||
m_titleLabel->getPositionX() + m_titleLabel->getScaledContentSize().width + 3.f +
|
||||
creatorLabel->getScaledContentSize().width / 2,
|
||||
m_creatorLabel->getScaledContentSize().width / 2,
|
||||
m_height / 2
|
||||
);
|
||||
m_menu->addChild(m_developerBtn);
|
||||
m_menu->addChild(m_creatorLabel);
|
||||
}
|
||||
|
||||
this->setupVersion(version);
|
||||
|
@ -96,7 +93,7 @@ void InstallListCell::setupVersion(std::variant<VersionInfo, ComparableVersionIn
|
|||
m_versionLabel->setScale(.2f);
|
||||
m_versionLabel->setPosition(
|
||||
m_titleLabel->getPositionX() + m_titleLabel->getScaledContentSize().width + 3.f +
|
||||
(m_developerBtn ? m_developerBtn->getScaledContentSize().width + 3.f : 0.f),
|
||||
(m_creatorLabel ? m_creatorLabel->getScaledContentSize().width + 3.f : 0.f),
|
||||
m_titleLabel->getPositionY() - 1.f
|
||||
);
|
||||
m_versionLabel->setColor({ 0, 255, 0 });
|
||||
|
@ -123,7 +120,7 @@ void InstallListCell::setupInfo(ModMetadata const& metadata, bool inactive) {
|
|||
}
|
||||
|
||||
void InstallListCell::onViewDev(CCObject*) {
|
||||
DevProfilePopup::create(getDeveloper())->show();
|
||||
// DevProfilePopup::create(getDeveloper(), m_layer)->show();
|
||||
}
|
||||
|
||||
bool InstallListCell::init(InstallListPopup* list, CCSize const& size) {
|
||||
|
|
|
@ -21,7 +21,7 @@ protected:
|
|||
float m_height;
|
||||
InstallListPopup* m_layer = nullptr;
|
||||
CCMenu* m_menu = nullptr;
|
||||
CCMenuItemSpriteExtra* m_developerBtn = nullptr;
|
||||
CCLabelBMFont* m_creatorLabel = nullptr;
|
||||
CCLabelBMFont* m_titleLabel = nullptr;
|
||||
CCLabelBMFont* m_versionLabel = nullptr;
|
||||
TagNode* m_tagLabel = nullptr;
|
||||
|
|
|
@ -178,7 +178,7 @@ void ModListCell::setupInfo(
|
|||
}
|
||||
|
||||
void ModListCell::onViewDev(CCObject*) {
|
||||
DevProfilePopup::create(this->getDeveloper())->show();
|
||||
DevProfilePopup::create(this->getDeveloper(), m_layer)->show();
|
||||
}
|
||||
|
||||
bool ModListCell::init(ModListLayer* list, CCSize const& size) {
|
||||
|
@ -227,7 +227,9 @@ void ModCell::onEnable(CCObject* sender) {
|
|||
else {
|
||||
tryOrAlert(m_mod->disable(), "Error disabling mod");
|
||||
}
|
||||
m_layer->reloadList();
|
||||
if (m_layer) {
|
||||
m_layer->reloadList();
|
||||
}
|
||||
}
|
||||
|
||||
void ModCell::onUnresolvedInfo(CCObject*) {
|
||||
|
|
Loading…
Add table
Reference in a new issue