[General] Add notes for InputDialogs in GUIBoxes packet

sol2-server-rewrite
David Cernat 7 years ago
parent 3b5fb9cd6b
commit 49ea76aa9d

@ -36,13 +36,14 @@ void GUIFunctions::CustomMessageBox(unsigned short pid, int id, const char *labe
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_GUI_MESSAGEBOX)->Send(false);
}
void GUIFunctions::InputDialog(unsigned short pid, int id, const char *label) noexcept
void GUIFunctions::InputDialog(unsigned short pid, int id, const char *label, const char *note) noexcept
{
Player *player;
GET_PLAYER(pid, player,);
player->guiMessageBox.id = id;
player->guiMessageBox.label = label;
player->guiMessageBox.note = note;
player->guiMessageBox.type = Player::GUIMessageBox::InputDialog;
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_GUI_MESSAGEBOX)->setPlayer(player);

@ -63,9 +63,10 @@ public:
* \param pid The player ID for whom the input dialog should appear.
* \param id The numerical ID of the input dialog.
* \param label The text at the top of the input dialog.
* \parm note The text at the bottom of the input dialog.
* \return void
*/
static void InputDialog(unsigned short pid, int id, const char *label) noexcept;
static void InputDialog(unsigned short pid, int id, const char *label, const char *note) noexcept;
/**
* \brief Display a password dialog at the center of the screen.

@ -1,7 +1,3 @@
//
// Created by koncord on 23.07.16.
//
#include "PacketGUIBoxes.hpp"
#include <components/openmw-mp/NetworkMessages.hpp>
@ -25,7 +21,8 @@ void PacketGUIBoxes::Packet(RakNet::BitStream *bs, bool send)
if (player->guiMessageBox.type == BasePlayer::GUIMessageBox::CustomMessageBox)
RW(player->guiMessageBox.buttons, send);
else if (player->guiMessageBox.type == BasePlayer::GUIMessageBox::PasswordDialog)
else if (player->guiMessageBox.type == BasePlayer::GUIMessageBox::InputDialog ||
player->guiMessageBox.type == BasePlayer::GUIMessageBox::PasswordDialog)
RW(player->guiMessageBox.note, send);
}

Loading…
Cancel
Save