mirror of
https://github.com/geode-sdk/geode.git
synced 2025-02-17 00:30:26 -05:00
made it slightly better
This commit is contained in:
parent
9a46231420
commit
0da9cef29f
2 changed files with 28 additions and 28 deletions
Binary file not shown.
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 5.9 KiB |
|
@ -714,37 +714,37 @@ void ModsLayer::onSettings(CCObject*) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModsLayer::onCopy(CCObject*) {
|
void ModsLayer::onCopy(CCObject*) {
|
||||||
auto text = "No mods installed";
|
|
||||||
auto mods = Loader::get()->getAllMods();
|
auto mods = Loader::get()->getAllMods();
|
||||||
if (!mods.empty()) {
|
if (mods.empty()) {
|
||||||
text = "Mods list copied to clipboard!";
|
Notification::create("No mods installed", NotificationIcon::Info, 0.6f)->show();
|
||||||
std::sort(mods.begin(), mods.end(), [](Mod* a, Mod* b) {
|
return;
|
||||||
auto const s1 = a->getID();
|
|
||||||
auto const s2 = b->getID();
|
|
||||||
return std::lexicographical_compare(s1.begin(), s1.end(), s2.begin(), s2.end(), [](auto a, auto b) {
|
|
||||||
return std::tolower(a) < std::tolower(b);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
std::stringstream ss;
|
|
||||||
using namespace std::string_view_literals;
|
|
||||||
for (int i = 0; i < mods.size(); i++) {
|
|
||||||
auto& mod = mods[i];
|
|
||||||
ss << fmt::format("{} | [{}] {}",
|
|
||||||
mod->isEnabled() ? "x"sv :
|
|
||||||
mod->hasProblems() ? "!"sv :
|
|
||||||
" "sv,
|
|
||||||
mod->getVersion().toVString(), mod->getID()
|
|
||||||
);
|
|
||||||
if (i != mods.size() - 1) {
|
|
||||||
ss << "\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
clipboard::write(ss.str());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto popup = TextAlertPopup::create(text, 0.5f, 0.6f, 150, "bigFont.fnt");
|
std::sort(mods.begin(), mods.end(), [](Mod* a, Mod* b) {
|
||||||
this->addChild(popup, 100);
|
auto const s1 = a->getID();
|
||||||
|
auto const s2 = b->getID();
|
||||||
|
return std::lexicographical_compare(s1.begin(), s1.end(), s2.begin(), s2.end(), [](auto a, auto b) {
|
||||||
|
return std::tolower(a) < std::tolower(b);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
std::stringstream ss;
|
||||||
|
using namespace std::string_view_literals;
|
||||||
|
for (int i = 0; i < mods.size(); i++) {
|
||||||
|
auto& mod = mods[i];
|
||||||
|
ss << fmt::format("{} | [{}] {}",
|
||||||
|
mod->isEnabled() ? "x"sv :
|
||||||
|
mod->hasProblems() ? "!"sv :
|
||||||
|
" "sv,
|
||||||
|
mod->getVersion().toVString(), mod->getID()
|
||||||
|
);
|
||||||
|
if (i != mods.size() - 1) {
|
||||||
|
ss << "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
clipboard::write(ss.str());
|
||||||
|
|
||||||
|
Notification::create("Mods list copied to clipboard", NotificationIcon::Info, 0.5f)->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
ModsLayer* ModsLayer::create() {
|
ModsLayer* ModsLayer::create() {
|
||||||
|
|
Loading…
Reference in a new issue