1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Use optional instead of Json for queries

This commit is contained in:
Ivan Savenko
2023-09-19 23:17:25 +03:00
parent 541f7590c5
commit d257fb37f0
18 changed files with 51 additions and 69 deletions

View File

@@ -1063,15 +1063,12 @@ void CPlayerInterface::showMapObjectSelectDialog(QueryID askID, const Component
auto selectCallback = [=](int selection)
{
JsonNode reply(JsonNode::JsonType::DATA_INTEGER);
reply.Integer() = selection;
cb->sendQueryReply(reply, askID);
cb->sendQueryReply(selection, askID);
};
auto cancelCallback = [=]()
{
JsonNode reply(JsonNode::JsonType::DATA_NULL);
cb->sendQueryReply(reply, askID);
cb->sendQueryReply(std::nullopt, askID);
};
const std::string localTitle = title.toString();