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

0.6.1
David Cernat 8 years ago
parent 708d3723eb
commit ad9fa0631a

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

@ -11,7 +11,8 @@
class MechanicsFunctions class MechanicsFunctions
{ {
public: 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; static void Resurrect(unsigned short pid, unsigned int type) noexcept;
}; };

@ -56,6 +56,17 @@ namespace MWGui
mProgressBar->setScrollRange(100+1); mProgressBar->setScrollRange(100+1);
mProgressBar->setScrollPosition(0); mProgressBar->setScrollPosition(0);
mProgressBar->setTrackSize(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) void JailScreen::onFrame(float dt)
@ -139,12 +150,10 @@ namespace MWGui
/* /*
Start of tes3mp addition 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()) if (!mwmp::Main::get().getLocalPlayer()->jailEndText.empty())
{ message = mwmp::Main::get().getLocalPlayer()->jailEndText;
message = mwmp::Main::get().getLocalPlayer()->jailText;
}
/* /*
End of tes3mp addition End of tes3mp addition
*/ */
@ -187,7 +196,8 @@ namespace MWGui
*/ */
mwmp::Main::get().getLocalPlayer()->ignoreJailTeleportation = false; mwmp::Main::get().getLocalPlayer()->ignoreJailTeleportation = false;
mwmp::Main::get().getLocalPlayer()->ignoreJailSkillIncreases = 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 End of tes3mp addition
*/ */

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

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

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

Loading…
Cancel
Save