feat: disable self action

This commit is contained in:
Tsubasa6848
2024-02-28 04:41:32 +08:00
Unverified
parent 7c6c59e953
commit 37e56772e0
2 changed files with 14 additions and 2 deletions
+10
View File
@@ -19,8 +19,13 @@ void checkOnlineForm(Player& pl) {
return true;
});
for (auto& [uuid, name] : onlineList) {
if (uuid != pl.getUuid()) {
fm.appendButton(name, [uuid](Player& pl) { return checkPlayerForm(pl, uuid); });
}
}
if (onlineList.size() == 1) {
return pl.sendMessage(tr("checkOnline.empty"));
}
fm.sendTo(pl, [](Player& pl, int index) {
if (index == -1) {
return mainForm(pl);
@@ -60,8 +65,13 @@ void checkAllForm(Player& pl) {
auto fm = ll::form::SimpleForm(tr("form.checkList.title"), tr("form.checkList.content"));
auto allList = generateUuidMap();
for (auto& [uuid, name] : allList) {
if (uuid != pl.getUuid()) {
fm.appendButton(name, [uuid](Player& pl) { return checkPlayerForm(pl, uuid); });
}
}
if (allList.size() == 1) {
return pl.sendMessage(tr("checkAll.empty"));
}
fm.sendTo(pl, [](Player& pl, int index) {
if (index == -1) {
return mainForm(pl);
+2
View File
@@ -49,4 +49,6 @@ std::string defaultLanguage_zh_CN = R"(
form.deleteFailed.title=
form.deleteFailed.content= %s 线\n\n如需删除全部玩家数据
form.deleteFailed.returnCheck=
checkOnline.empty=线线\n还不快去招人
checkAll.empty=\n还不快去招人
)";