From 403c1d5f7895d6adb9d98c6b1c478f848be111dd Mon Sep 17 00:00:00 2001 From: Tixx <83774803+WiserTixx@users.noreply.github.com> Date: Wed, 25 Jun 2025 13:51:20 +0200 Subject: [PATCH] Add support for reporting to options in ConfirmationDialog --- include/LuaAPI.h | 2 +- src/LuaAPI.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/LuaAPI.h b/include/LuaAPI.h index 6748a78..4c4f361 100644 --- a/include/LuaAPI.h +++ b/include/LuaAPI.h @@ -36,7 +36,7 @@ namespace MP { std::pair DropPlayer(int ID, std::optional MaybeReason); std::pair SendChatMessage(int ID, const std::string& Message); std::pair SendNotification(int ID, const std::string& Message, const std::string& Icon, const std::string& Category); - std::pair ConfirmationDialog(int ID, const std::string& Title, const std::string& Body, const sol::table& buttons, const std::string& InteractionID, const bool& warning = false); + std::pair ConfirmationDialog(int ID, const std::string& Title, const std::string& Body, const sol::table& buttons, const std::string& InteractionID, const bool& warning = false, const bool& reportToServer = true, const bool& reportToExtensions = true); std::pair RemoveVehicle(int PlayerID, int VehicleID); void Set(int ConfigID, sol::object NewValue); TLuaValue Get(int ConfigID); diff --git a/src/LuaAPI.cpp b/src/LuaAPI.cpp index 9e847d8..c71ff29 100644 --- a/src/LuaAPI.cpp +++ b/src/LuaAPI.cpp @@ -241,7 +241,7 @@ std::pair LuaAPI::MP::SendNotification(int ID, const std::str return Result; } -std::pair LuaAPI::MP::ConfirmationDialog(int ID, const std::string& Title, const std::string& Body, const sol::table& buttons, const std::string& InteractionID, const bool& warning) { +std::pair LuaAPI::MP::ConfirmationDialog(int ID, const std::string& Title, const std::string& Body, const sol::table& buttons, const std::string& InteractionID, const bool& warning, const bool& reportToServer, const bool& reportToExtensions) { std::pair Result; const nlohmann::json PacketBody = { @@ -249,7 +249,9 @@ std::pair LuaAPI::MP::ConfirmationDialog(int ID, const std::s { "body", Body }, { "buttons", nlohmann::json::parse(JsonEncode(buttons), nullptr, false) }, { "interactionID", InteractionID }, - { "class", warning ? "experimental" : "" } + { "class", warning ? "experimental" : "" }, + { "reportToServer", reportToServer }, + { "reportToExtensions", reportToExtensions } }; std::string Packet = "D" + PacketBody.dump();