mirror of
https://github.com/SWG-Source/client-tools.git
synced 2026-01-15 22:04:32 -05:00
Make ClientExpertiseManager and CuiExpertise respect God Mode
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include "clientGame/CreatureObject.h"
|
||||
#include "clientGame/Game.h"
|
||||
#include "clientGame/GameNetwork.h"
|
||||
#include "clientGame/PlayerObject.h"
|
||||
#include "clientUserInterface/CuiSkillManager.h"
|
||||
#include "sharedFoundation/ExitChain.h"
|
||||
#include "sharedNetworkMessages/ExpertiseRequestMessage.h"
|
||||
@@ -588,7 +589,12 @@ int ClientExpertiseManager::getExpertisePointsSpentForPlayerInTreeUpToTier(int t
|
||||
*/
|
||||
int ClientExpertiseManager::getExpertisePointsRemainingForPlayer()
|
||||
{
|
||||
return getExpertisePointsTotalForPlayer() - getExpertisePointsSpentForPlayer();
|
||||
if (PlayerObject::isAdmin()) {
|
||||
return 999; // gods always have infinite expertise points
|
||||
}
|
||||
else {
|
||||
return getExpertisePointsTotalForPlayer() - getExpertisePointsSpentForPlayer();
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
@@ -1083,6 +1089,11 @@ bool ClientExpertiseManager::canAllocateExpertise(std::string const & expertiseN
|
||||
CreatureObject const * const player = Game::getPlayerCreature();
|
||||
if (!player)
|
||||
return false;
|
||||
|
||||
// you can allocate the expertise if you're in god mode
|
||||
if (PlayerObject::isAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
//Check if the player has all the prerequisites
|
||||
SkillObject::SkillVector const prereqs = skill->getPrerequisiteSkills();
|
||||
|
||||
@@ -905,6 +905,9 @@ void SwgCuiExpertise::updateExpertiseDisplayName()
|
||||
m_expertiseDisplayName->SetLocalText(localizedDisplayName);
|
||||
Unicode::String localizedDisplayDescription;
|
||||
ClientExpertiseManager::localizeExpertiseDescription(m_currentBaseSkillName, localizedDisplayDescription);
|
||||
if (PlayerObject::isAdmin()) {
|
||||
localizedDisplayDescription.append(Unicode::narrowToWide("\n\\#ffff00 ***God Mode Override is On***\\#."));
|
||||
}
|
||||
m_expertiseDisplayDescription->SetLocalText(localizedDisplayDescription);
|
||||
|
||||
std::string const & iconPath = RoadmapManager::getIconPathForSkill(m_currentSkillName);
|
||||
|
||||
Reference in New Issue
Block a user