Compare commits
1 Commits
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "${pluginName}",
|
"name": "${pluginName}",
|
||||||
"entry": "${pluginFile}",
|
"entry": "${pluginFile}",
|
||||||
"version": "0.10.0",
|
"version": "0.10.1",
|
||||||
"author": "GroupMountain",
|
"author": "GroupMountain",
|
||||||
"description": "Check Player's Inventory",
|
"description": "Check Player's Inventory",
|
||||||
"type": "native",
|
"type": "native",
|
||||||
|
|||||||
+19
-19
@@ -74,7 +74,7 @@ void checkOnlineForm(Player& pl) {
|
|||||||
if (onlineList.size() == 1) {
|
if (onlineList.size() == 1) {
|
||||||
return pl.sendMessage(tr("checkOnline.empty"));
|
return pl.sendMessage(tr("checkOnline.empty"));
|
||||||
}
|
}
|
||||||
fm.sendTo(pl, [](Player& pl, int index) {
|
fm.sendTo(pl, [](Player& pl, int index, ll::form::FormCancelReason) {
|
||||||
if (index == -1) {
|
if (index == -1) {
|
||||||
return mainForm(pl);
|
return mainForm(pl);
|
||||||
}
|
}
|
||||||
@@ -119,7 +119,7 @@ void checkAllForm(Player& pl) {
|
|||||||
if (allList.size() == 1) {
|
if (allList.size() == 1) {
|
||||||
return pl.sendMessage(tr("checkAll.empty"));
|
return pl.sendMessage(tr("checkAll.empty"));
|
||||||
}
|
}
|
||||||
fm.sendTo(pl, [](Player& pl, int index) {
|
fm.sendTo(pl, [](Player& pl, int index, ll::form::FormCancelReason) {
|
||||||
if (index == -1) {
|
if (index == -1) {
|
||||||
return mainForm(pl);
|
return mainForm(pl);
|
||||||
}
|
}
|
||||||
@@ -136,15 +136,15 @@ void searchPlayerForm(Player& pl) {
|
|||||||
{tr("form.searchPlayer.fuzzySearch"), tr("form.searchPlayer.preciseSearch")},
|
{tr("form.searchPlayer.fuzzySearch"), tr("form.searchPlayer.preciseSearch")},
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
fm.sendTo(pl, [](Player& pl, const ll::form::CustomFormResult& result) {
|
fm.sendTo(pl, [](Player& pl, const ll::form::CustomFormResult& result, ll::form::FormCancelReason) {
|
||||||
if (result.empty()) {
|
if (!result.has_value()) {
|
||||||
return mainForm(pl);
|
return mainForm(pl);
|
||||||
}
|
}
|
||||||
std::string inputName;
|
std::string inputName;
|
||||||
if (std::holds_alternative<std::string>(result.at("name"))) {
|
if (std::holds_alternative<std::string>(result->at("name"))) {
|
||||||
inputName = std::get<std::string>(result.at("name"));
|
inputName = std::get<std::string>(result->at("name"));
|
||||||
}
|
}
|
||||||
auto searchMode = std::get<std::string>(result.at("mode"));
|
auto searchMode = std::get<std::string>(result->at("mode"));
|
||||||
if (inputName.empty()) {
|
if (inputName.empty()) {
|
||||||
return invalidInputForm(pl);
|
return invalidInputForm(pl);
|
||||||
}
|
}
|
||||||
@@ -175,7 +175,7 @@ void searchResultForm(Player& pl, std::unordered_map<mce::UUID, std::string> res
|
|||||||
for (auto& [uuid, name] : resultList) {
|
for (auto& [uuid, name] : resultList) {
|
||||||
fm.appendButton(name, [&uuid](Player& pl) { checkPlayerForm(pl, uuid); });
|
fm.appendButton(name, [&uuid](Player& pl) { checkPlayerForm(pl, uuid); });
|
||||||
}
|
}
|
||||||
fm.sendTo(pl, [](Player& pl, int index) {
|
fm.sendTo(pl, [](Player& pl, int index, ll::form::FormCancelReason) {
|
||||||
if (index == -1) {
|
if (index == -1) {
|
||||||
return searchPlayerForm(pl);
|
return searchPlayerForm(pl);
|
||||||
}
|
}
|
||||||
@@ -189,8 +189,8 @@ void searchNotFoundForm(Player& pl, std::string& name) {
|
|||||||
tr("form.notFound.returnSearch"),
|
tr("form.notFound.returnSearch"),
|
||||||
tr("form.returnMainForm")
|
tr("form.returnMainForm")
|
||||||
);
|
);
|
||||||
fm.sendTo(pl, [](Player& pl, ll::form::ModalForm::SelectedButton result) {
|
fm.sendTo(pl, [](Player& pl, ll::form::ModalFormResult result, ll::form::FormCancelReason) {
|
||||||
if (result == ll::form::ModalForm::SelectedButton::Upper) {
|
if (result == ll::form::ModalFormSelectedButton::Upper) {
|
||||||
return searchPlayerForm(pl);
|
return searchPlayerForm(pl);
|
||||||
}
|
}
|
||||||
return mainForm(pl);
|
return mainForm(pl);
|
||||||
@@ -216,7 +216,7 @@ void checkPlayerForm(Player& pl, mce::UUID uuid) {
|
|||||||
fm.appendButton(tr("form.checkPlayer.deleteData"), [uuid, name](Player& pl) {
|
fm.appendButton(tr("form.checkPlayer.deleteData"), [uuid, name](Player& pl) {
|
||||||
return confirmDeleteForm(pl, uuid, name);
|
return confirmDeleteForm(pl, uuid, name);
|
||||||
});
|
});
|
||||||
fm.sendTo(pl, [](Player& pl, int index) {
|
fm.sendTo(pl, [](Player& pl, int index, ll::form::FormCancelReason) {
|
||||||
if (index == -1) {
|
if (index == -1) {
|
||||||
return mainForm(pl);
|
return mainForm(pl);
|
||||||
}
|
}
|
||||||
@@ -230,8 +230,8 @@ void invalidInputForm(Player& pl) {
|
|||||||
tr("form.invalidInput.returnSearch"),
|
tr("form.invalidInput.returnSearch"),
|
||||||
tr("form.returnMainForm")
|
tr("form.returnMainForm")
|
||||||
);
|
);
|
||||||
fm.sendTo(pl, [](Player& pl, ll::form::ModalForm::SelectedButton result) {
|
fm.sendTo(pl, [](Player& pl, ll::form::ModalFormResult result, ll::form::FormCancelReason) {
|
||||||
if (result == ll::form::ModalForm::SelectedButton::Upper) {
|
if (result == ll::form::ModalFormSelectedButton::Upper) {
|
||||||
return searchPlayerForm(pl);
|
return searchPlayerForm(pl);
|
||||||
}
|
}
|
||||||
return mainForm(pl);
|
return mainForm(pl);
|
||||||
@@ -245,8 +245,8 @@ void confirmWriteForm(Player& pl, mce::UUID uuid, std::string name) {
|
|||||||
tr("form.confirmAction"),
|
tr("form.confirmAction"),
|
||||||
tr("form.cancelAction")
|
tr("form.cancelAction")
|
||||||
);
|
);
|
||||||
fm.sendTo(pl, [uuid, name](Player& pl, ll::form::ModalForm::SelectedButton result) {
|
fm.sendTo(pl, [uuid, name](Player& pl, ll::form::ModalFormResult result, ll::form::FormCancelReason) {
|
||||||
if (result == ll::form::ModalForm::SelectedButton::Upper) {
|
if (result == ll::form::ModalFormSelectedButton::Upper) {
|
||||||
auto& self = static_cast<GMLIB_Player&>(pl);
|
auto& self = static_cast<GMLIB_Player&>(pl);
|
||||||
auto nbt = self.getNbt();
|
auto nbt = self.getNbt();
|
||||||
auto targetNbt = GMLIB_Player::getPlayerNbt(uuid);
|
auto targetNbt = GMLIB_Player::getPlayerNbt(uuid);
|
||||||
@@ -267,8 +267,8 @@ void confirmDeleteForm(Player& pl, mce::UUID uuid, std::string name) {
|
|||||||
tr("form.confirmAction"),
|
tr("form.confirmAction"),
|
||||||
tr("form.cancelAction")
|
tr("form.cancelAction")
|
||||||
);
|
);
|
||||||
fm.sendTo(pl, [uuid, name](Player& pl, ll::form::ModalForm::SelectedButton result) {
|
fm.sendTo(pl, [uuid, name](Player& pl, ll::form::ModalFormResult result, ll::form::FormCancelReason) {
|
||||||
if (result == ll::form::ModalForm::SelectedButton::Upper) {
|
if (result == ll::form::ModalFormSelectedButton::Upper) {
|
||||||
auto player = GMLIB_Level::getLevel()->getPlayer(uuid);
|
auto player = GMLIB_Level::getLevel()->getPlayer(uuid);
|
||||||
if (player) {
|
if (player) {
|
||||||
return deleteFailedForm(pl, uuid, name);
|
return deleteFailedForm(pl, uuid, name);
|
||||||
@@ -287,8 +287,8 @@ void deleteFailedForm(Player& pl, mce::UUID uuid, std::string name) {
|
|||||||
tr("form.deleteFailed.returnCheck"),
|
tr("form.deleteFailed.returnCheck"),
|
||||||
tr("form.returnMainForm")
|
tr("form.returnMainForm")
|
||||||
);
|
);
|
||||||
fm.sendTo(pl, [uuid](Player& pl, ll::form::ModalForm::SelectedButton result) {
|
fm.sendTo(pl, [uuid](Player& pl, ll::form::ModalFormResult result, ll::form::FormCancelReason) {
|
||||||
if (result == ll::form::ModalForm::SelectedButton::Upper) {
|
if (result == ll::form::ModalFormSelectedButton::Upper) {
|
||||||
return checkPlayerForm(pl, uuid);
|
return checkPlayerForm(pl, uuid);
|
||||||
}
|
}
|
||||||
return mainForm(pl);
|
return mainForm(pl);
|
||||||
|
|||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"format_version": 2,
|
"format_version": 2,
|
||||||
"tooth": "github.com/GroupMountain/InventoryCheck",
|
"tooth": "github.com/GroupMountain/InventoryCheck",
|
||||||
"version": "0.10.0",
|
"version": "0.10.1",
|
||||||
"info": {
|
"info": {
|
||||||
"name": "InventoryCheck",
|
"name": "InventoryCheck",
|
||||||
"description": "Check Player's Inventory",
|
"description": "Check Player's Inventory",
|
||||||
@@ -14,9 +14,9 @@
|
|||||||
"gmlib"
|
"gmlib"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"asset_url": "https://github.com/GroupMountain/InventoryCheck/releases/download/v0.10.0/InventoryCheck-windows-x64.zip",
|
"asset_url": "https://github.com/GroupMountain/InventoryCheck/releases/download/v0.10.1/InventoryCheck-windows-x64.zip",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"github.com/GroupMountain/GMLIB": ">=0.10.x"
|
"github.com/GroupMountain/GMLIB": ">=0.10.0"
|
||||||
},
|
},
|
||||||
"files": {
|
"files": {
|
||||||
"place": [
|
"place": [
|
||||||
|
|||||||
Reference in New Issue
Block a user