diff --git a/apps/openmw-mp/Script/Functions/GUI.cpp b/apps/openmw-mp/Script/Functions/GUI.cpp index 58bbcd370..6780bfb00 100644 --- a/apps/openmw-mp/Script/Functions/GUI.cpp +++ b/apps/openmw-mp/Script/Functions/GUI.cpp @@ -49,6 +49,19 @@ void GUIFunctions::InputDialog(unsigned short pid, int id, const char *label) no mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_GUI_MESSAGEBOX)->Send(false); } +void GUIFunctions::PasswordDialog(unsigned short pid, int id, const char *label) noexcept +{ + Player *player; + GET_PLAYER(pid, player,); + + player->guiMessageBox.id = id; + player->guiMessageBox.label = label; + player->guiMessageBox.type = Player::GUIMessageBox::PasswordDialog; + + mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_GUI_MESSAGEBOX)->setPlayer(player); + mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_GUI_MESSAGEBOX)->Send(false); +} + void GUIFunctions::ListBox(unsigned short pid, int id, const char *label, const char *items) { Player *player; diff --git a/apps/openmw-mp/Script/Functions/GUI.hpp b/apps/openmw-mp/Script/Functions/GUI.hpp index 2bca9453b..1618e05c0 100644 --- a/apps/openmw-mp/Script/Functions/GUI.hpp +++ b/apps/openmw-mp/Script/Functions/GUI.hpp @@ -9,10 +9,11 @@ {"MessageBox", GUIFunctions::_MessageBox},\ {"CustomMessageBox", GUIFunctions::CustomMessageBox},\ {"InputDialog", GUIFunctions::InputDialog},\ + {"PasswordDialog", GUIFunctions::PasswordDialog},\ {"ListBox", GUIFunctions::ListBox},\ {"SetMapVisibility", GUIFunctions::SetMapVisibility},\ {"SetMapVisibilityAll", GUIFunctions::SetMapVisibilityAll},\ - {"SetConsoleAllow", GUIFunctions::SetConsoleAllow}\ + {"SetConsoleAllow", GUIFunctions::SetConsoleAllow}\ class GUIFunctions { @@ -22,6 +23,7 @@ public: static void CustomMessageBox(unsigned short pid, int id, const char *label, const char *buttons) noexcept; static void InputDialog(unsigned short pid, int id, const char *label) noexcept; + static void PasswordDialog(unsigned short pid, int id, const char *label) noexcept; static void ListBox(unsigned short pid, int id, const char *label, const char *items);