mirror of
https://github.com/SWG-Source/client-tools.git
synced 2026-01-15 22:04:32 -05:00
Merge pull request #5 from Geit/gu-16.9/no-trade-removable
GU 16.9 - No Trade Removable
This commit is contained in:
@@ -91,6 +91,7 @@ namespace ObjectAttributeManagerNamespace
|
||||
bool hasTooltips;
|
||||
bool noTrade;
|
||||
bool noTradeShared;
|
||||
bool noTradeRemovable;
|
||||
int revision;
|
||||
int tier;
|
||||
bool unique;
|
||||
@@ -102,6 +103,7 @@ namespace ObjectAttributeManagerNamespace
|
||||
hasTooltips(false),
|
||||
noTrade(false),
|
||||
noTradeShared(false),
|
||||
noTradeRemovable(false),
|
||||
revision(_revision),
|
||||
tier(-1),
|
||||
unique(false),
|
||||
@@ -120,6 +122,9 @@ namespace ObjectAttributeManagerNamespace
|
||||
if (attribPair.first.find(SharedObjectAttributes::no_trade_shared) != std::string::npos)
|
||||
noTradeShared = true;
|
||||
|
||||
if (attribPair.first.find(SharedObjectAttributes::no_trade_removable) != std::string::npos)
|
||||
noTradeRemovable = true;
|
||||
|
||||
if (attribPair.first.find(SharedObjectAttributes::unique) != std::string::npos)
|
||||
unique = true;
|
||||
|
||||
@@ -637,6 +642,9 @@ void ObjectAttributeManager::formatAttributes (const AttributeVector & av, Uni
|
||||
if (fullKey.find(SharedObjectAttributes::no_trade_shared) != std::string::npos)
|
||||
continue;
|
||||
|
||||
if (fullKey.find(SharedObjectAttributes::no_trade_removable) != std::string::npos)
|
||||
continue;
|
||||
|
||||
if (fullKey.find(SharedObjectAttributes::unique) != std::string::npos)
|
||||
continue;
|
||||
|
||||
@@ -1371,6 +1379,22 @@ bool ObjectAttributeManager::isNoTradeShared(std::string const & staticItemName)
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
bool ObjectAttributeManager::isNoTradeRemovable(NetworkId const & id)
|
||||
{
|
||||
bool noTradeRemovable = false;
|
||||
|
||||
AttributeMap::const_iterator it = s_attribs.find(id);
|
||||
if (it != s_attribs.end())
|
||||
{
|
||||
AttributeInfo const & info = it->second;
|
||||
noTradeShared = info.noTradeRemovable;
|
||||
}
|
||||
|
||||
return noTradeRemovable;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
bool ObjectAttributeManager::isUnique(NetworkId const & id)
|
||||
{
|
||||
bool unique = false;
|
||||
|
||||
@@ -86,6 +86,7 @@ public:
|
||||
static bool isNoTrade(std::string const & staticItemName);
|
||||
static bool isNoTradeShared(NetworkId const & id);
|
||||
static bool isNoTradeShared(std::string const & staticItemName);
|
||||
static bool isNoTradeRemovable(NetworkId const & id);
|
||||
// unique stuff
|
||||
static bool isUnique(NetworkId const & id);
|
||||
static bool isUnique(std::string const & staticItemName);
|
||||
|
||||
@@ -184,6 +184,7 @@ namespace CuiStringIds
|
||||
|
||||
MAKE_STRING_ID(ui, no_trade_tooltip);
|
||||
MAKE_STRING_ID(ui, no_trade_shared_tooltip);
|
||||
MAKE_STRING_ID(ui, no_trade_removable_tooltip);
|
||||
MAKE_STRING_ID(ui, unique_tooltip);
|
||||
|
||||
MAKE_STRING_ID(ui, change_friend_without_saving);
|
||||
|
||||
@@ -732,7 +732,12 @@ void SwgCuiInventoryInfo::updateAttributeFlags()
|
||||
|
||||
if (isNoTradeVisible)
|
||||
{
|
||||
if (ObjectAttributeManager::isNoTradeShared(object->getNetworkId()))
|
||||
if (ObjectAttributeManager::isNoTradeRemovable(object->getNetworkId()))
|
||||
{
|
||||
m_noTrade->SetLocalText(StringId("object_usability", "no_trade_removable").localize());
|
||||
m_noTrade->SetTooltip(CuiStringIds::no_trade_shared_removable.localize());
|
||||
}
|
||||
else if (ObjectAttributeManager::isNoTradeShared(object->getNetworkId()))
|
||||
{
|
||||
m_noTrade->SetLocalText(StringId("object_usability", "no_trade_shared").localize());
|
||||
m_noTrade->SetTooltip(CuiStringIds::no_trade_shared_tooltip.localize());
|
||||
|
||||
Reference in New Issue
Block a user