Block Tells/Mail in NPE #12 #13

This commit is contained in:
AconiteX
2021-08-14 03:17:37 -04:00
parent 62ded5af58
commit d50870f457
2 changed files with 26 additions and 8 deletions

View File

@@ -1057,6 +1057,12 @@ void CommandCppFuncsNamespace::commandFuncInstantMessageTell (Command const
if (!player || player->getNetworkId () != actorId)
return;
if(Game::isTutorial() && !Game::getPlayerObject()->isAdmin())
{
CuiSystemMessageManager::sendFakeSystemMessage(Unicode::narrowToWide("You cannot initiate a tell while in the tutorial."));
return;
}
Unicode::String result;
IGNORE_RETURN(CuiInstantMessageManager::tell (params, result));
if (!result.empty ())
@@ -1071,6 +1077,12 @@ void CommandCppFuncsNamespace::commandFuncInstantMessageTtell (Command const
if (!player || player->getNetworkId () != actorId)
return;
if (Game::isTutorial() && !Game::getPlayerObject()->isAdmin())
{
CuiSystemMessageManager::sendFakeSystemMessage(Unicode::narrowToWide("You cannot initiate a tell while in the tutorial."));
return;
}
Unicode::String result;
IGNORE_RETURN(CuiInstantMessageManager::targetedTell (params, result));
if (!result.empty ())
@@ -1085,6 +1097,12 @@ void CommandCppFuncsNamespace::commandFuncInstantMessageRetell (Command const
if (!player || player->getNetworkId () != actorId)
return;
if (Game::isTutorial() && !Game::getPlayerObject()->isAdmin())
{
CuiSystemMessageManager::sendFakeSystemMessage(Unicode::narrowToWide("You cannot initiate a tell while in the tutorial."));
return;
}
Unicode::String result;
IGNORE_RETURN(CuiInstantMessageManager::retell (params, result));
if (!result.empty ())

View File

@@ -119,11 +119,11 @@ m_lastScrollPosY (0L)
setState (MS_closeable);
setState (MS_closeDeactivates);
// disable New/Reply/Forward button if squelched
// disable New/Reply/Forward button if squelched or in tutorial
const bool isSquelched = Game::isPlayerSquelched();
m_buttonNew->SetEnabled(!isSquelched);
m_buttonReply->SetEnabled(!isSquelched);
m_buttonForward->SetEnabled(!isSquelched);
m_buttonNew->SetEnabled(!isSquelched && !Game::isTutorial());
m_buttonReply->SetEnabled(!isSquelched && !Game::isTutorial());
m_buttonForward->SetEnabled(!isSquelched && !Game::isTutorial());
registerMediatorObject (*m_table, true);
registerMediatorObject (*m_buttonNew, true);
@@ -710,14 +710,14 @@ void SwgCuiPersistentMessageBrowser::update(float deltaTimeSecs)
{
CuiMediator::update(deltaTimeSecs);
// disable New/Reply/Forward button if squelched
// disable New/Reply/Forward button if squelched or in tutorial
const bool isSquelched = Game::isPlayerSquelched();
if (m_buttonNew)
m_buttonNew->SetEnabled(!isSquelched);
m_buttonNew->SetEnabled(!isSquelched && !Game::isTutorial());
if (m_buttonReply)
m_buttonReply->SetEnabled(!isSquelched);
m_buttonReply->SetEnabled(!isSquelched && !Game::isTutorial());
if (m_buttonForward)
m_buttonForward->SetEnabled(!isSquelched);
m_buttonForward->SetEnabled(!isSquelched && !Game::isTutorial());
}
//======================================================================