move loader commit hash info to about popup

This commit is contained in:
HJfod 2024-02-12 17:23:12 +02:00
parent d61112d870
commit 94ab199406

View file

@ -174,24 +174,40 @@ void ModInfoPopup::onRepository(CCObject*) {
void ModInfoPopup::onInfo(CCObject*) {
auto info = this->getMetadata();
FLAlertLayer::create(
nullptr,
("About " + info.getName()).c_str(),
fmt::format(
auto about = std::string();
if (info.getID() == "geode.loader") {
about = fmt::format(
"<cr>ID:</c> {}\n"
"<cg>Version:</c> {}\n"
"<cy>Developers:</c> {}\n"
"<cy>Path:</c> {}\n",
"<ca>Bindings Commit Hash:</c> {}\n"
"<cp>Loader Commit Hash:</c> {}",
info.getID(),
info.getVersion().toString(),
ranges::join(info.getDevelopers(), ", "),
about::getBindingsCommitHash(),
about::getLoaderCommitHash()
);
}
else {
about = fmt::format(
"<cr>ID:</c> {}\n"
"<cg>Version:</c> {}\n"
"<cy>Developers:</c> {}\n"
"<ca>Path:</c> {}\n",
info.getID(),
info.getVersion().toString(),
ranges::join(info.getDevelopers(), ", "),
info.getPath().string()
),
"OK",
);
}
FLAlertLayer::create(
nullptr,
("About " + info.getName()).c_str(),
about,
"OK", nullptr,
400.f
)
->show();
)->show();
}
void ModInfoPopup::onChangelog(CCObject* sender) {
@ -410,22 +426,6 @@ bool LocalModInfoPopup::init(Mod* mod, ModListLayer* list) {
}
}
}
if (mod == Mod::get()) {
// we're showing the internal geode mod :-)
auto* label = CCLabelBMFont::create(
fmt::format(
"Bindings: {}\nLoader: {}",
about::getBindingsCommitHash(),
about::getLoaderCommitHash()
).c_str(),
"chatFont.fnt"
);
label->setAlignment(kCCTextAlignmentRight);
label->setAnchorPoint({ .0f, .5f });
label->setScale(.5f);
label->setOpacity(89);
m_mainLayer->addChildAtPosition(label, Anchor::BottomRight, ccp(5, 0));
}
// issue report button
if (mod->getMetadata().getIssues()) {