made it slightly better

This commit is contained in:
Justin Pridgen 2024-08-19 07:01:50 -04:00
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

View file

@ -714,10 +714,12 @@ 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();
return;
}
std::sort(mods.begin(), mods.end(), [](Mod* a, Mod* b) { std::sort(mods.begin(), mods.end(), [](Mod* a, Mod* b) {
auto const s1 = a->getID(); auto const s1 = a->getID();
auto const s2 = b->getID(); auto const s2 = b->getID();
@ -741,10 +743,8 @@ void ModsLayer::onCopy(CCObject*) {
} }
} }
clipboard::write(ss.str()); clipboard::write(ss.str());
}
auto popup = TextAlertPopup::create(text, 0.5f, 0.6f, 150, "bigFont.fnt"); Notification::create("Mods list copied to clipboard", NotificationIcon::Info, 0.5f)->show();
this->addChild(popup, 100);
} }
ModsLayer* ModsLayer::create() { ModsLayer* ModsLayer::create() {