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
+12 -2
View File
@@ -19,7 +19,12 @@ void checkOnlineForm(Player& pl) {
return true;
});
for (auto& [uuid, name] : onlineList) {
fm.appendButton(name, [uuid](Player& pl) { return checkPlayerForm(pl, uuid); });
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) {
@@ -60,7 +65,12 @@ 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) {
fm.appendButton(name, [uuid](Player& pl) { return checkPlayerForm(pl, uuid); });
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) {