[General] Rename jailText to jailEndText and add jailProgressText in PlayerJail

pull/249/merge
David Cernat 8 years ago
parent 708d3723eb
commit ad9fa0631a

@ -7,7 +7,8 @@
#include <iostream>
using namespace std;
void MechanicsFunctions::Jail(unsigned short pid, int jailDays, bool ignoreJailTeleportation, bool ignoreJailSkillIncreases, const char* jailText) noexcept
void MechanicsFunctions::Jail(unsigned short pid, int jailDays, bool ignoreJailTeleportation, bool ignoreJailSkillIncreases,
const char* jailProgressText, const char* jailEndText) noexcept
{
Player *player;
GET_PLAYER(pid, player, );
@ -15,7 +16,8 @@ void MechanicsFunctions::Jail(unsigned short pid, int jailDays, bool ignoreJailT
player->jailDays = jailDays;
player->ignoreJailTeleportation = ignoreJailTeleportation;
player->ignoreJailSkillIncreases = ignoreJailSkillIncreases;
player->jailText = jailText;
player->jailProgressText = jailProgressText;
player->jailEndText = jailEndText;
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_JAIL)->setPlayer(player);
mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_JAIL)->Send(false);

@ -11,7 +11,8 @@
class MechanicsFunctions
{
public:
static void Jail(unsigned short pid, int jailDays, bool ignoreJailTeleportation = false, bool ignoreJailSkillIncreases = false, const char* jailText = "") noexcept;
static void Jail(unsigned short pid, int jailDays, bool ignoreJailTeleportation = false, bool ignoreJailSkillIncreases = false,
const char* jailProgressText = "", const char* jailEndText = "") noexcept;
static void Resurrect(unsigned short pid, unsigned int type) noexcept;
};

@ -56,6 +56,17 @@ namespace MWGui
mProgressBar->setScrollRange(100+1);
mProgressBar->setScrollPosition(0);
mProgressBar->setTrackSize(0);
/*
Start of tes3mp addition
If we've received a packet overriding the default jail progress text, use the new text
*/
if (!mwmp::Main::get().getLocalPlayer()->jailProgressText.empty())
setText("LoadingText", mwmp::Main::get().getLocalPlayer()->jailProgressText);
/*
End of tes3mp addition
*/
}
void JailScreen::onFrame(float dt)
@ -139,12 +150,10 @@ namespace MWGui
/*
Start of tes3mp addition
If we've received a packet overriding the default jail text, use the new text
If we've received a packet overriding the default jail end text, use the new text
*/
if (!mwmp::Main::get().getLocalPlayer()->jailText.empty())
{
message = mwmp::Main::get().getLocalPlayer()->jailText;
}
if (!mwmp::Main::get().getLocalPlayer()->jailEndText.empty())
message = mwmp::Main::get().getLocalPlayer()->jailEndText;
/*
End of tes3mp addition
*/
@ -187,7 +196,8 @@ namespace MWGui
*/
mwmp::Main::get().getLocalPlayer()->ignoreJailTeleportation = false;
mwmp::Main::get().getLocalPlayer()->ignoreJailSkillIncreases = false;
mwmp::Main::get().getLocalPlayer()->jailText = "";
mwmp::Main::get().getLocalPlayer()->jailProgressText = "";
mwmp::Main::get().getLocalPlayer()->jailEndText = "";
/*
End of tes3mp addition
*/

@ -59,7 +59,8 @@ LocalPlayer::LocalPlayer()
deathReason = "suicide";
isChangingRegion = false;
jailText = "";
jailProgressText = "";
jailEndText = "";
}
LocalPlayer::~LocalPlayer()

@ -256,7 +256,8 @@ namespace mwmp
int jailDays;
bool ignoreJailTeleportation;
bool ignoreJailSkillIncreases;
std::string jailText;
std::string jailProgressText;
std::string jailEndText;
unsigned int resurrectType;
};

@ -16,5 +16,6 @@ void PacketPlayerJail::Packet(RakNet::BitStream *bs, bool send)
RW(player->jailDays, send);
RW(player->ignoreJailTeleportation, send);
RW(player->ignoreJailSkillIncreases, send);
RW(player->jailText, send, 1);
RW(player->jailProgressText, send, 1);
RW(player->jailEndText, send, 1);
}

Loading…
Cancel
Save