Name UI flag to disallow user interaction

Also bypass setting name text for null ID
This commit is contained in:
Liru Færs
2019-10-09 20:07:29 -04:00
parent b132578692
commit 0b7061afb7
4 changed files with 13 additions and 2 deletions

View File

@@ -50,6 +50,8 @@ LLNameBox::LLNameBox(const std::string& name)
void LLNameBox::showProfile() void LLNameBox::showProfile()
{ {
if (!mAllowInteract) return;
if (mIsGroup) if (mIsGroup)
LLGroupActions::show(mNameID); LLGroupActions::show(mNameID);
else else
@@ -59,6 +61,8 @@ void LLNameBox::showProfile()
// virtual // virtual
BOOL LLNameBox::handleRightMouseDown(S32 x, S32 y, MASK mask) BOOL LLNameBox::handleRightMouseDown(S32 x, S32 y, MASK mask)
{ {
if (!mAllowInteract) return;
if (!LLTextBox::handleRightMouseDown(x, y, mask)) if (!LLTextBox::handleRightMouseDown(x, y, mask))
{ {
// Singu TODO: Generic menus for groups // Singu TODO: Generic menus for groups

View File

@@ -58,6 +58,8 @@ LLNameEditor::LLNameEditor(const std::string& name, const LLRect& rect,
// virtual // virtual
BOOL LLNameEditor::handleRightMouseDown(S32 x, S32 y, MASK mask) BOOL LLNameEditor::handleRightMouseDown(S32 x, S32 y, MASK mask)
{ {
if (!mAllowInteract) return;
bool simple_menu = mContextMenuHandle.get()->getName() != "rclickmenu"; bool simple_menu = mContextMenuHandle.get()->getName() != "rclickmenu";
std::string new_menu; std::string new_menu;
// Singu TODO: Generic menus for groups // Singu TODO: Generic menus for groups

View File

@@ -39,7 +39,7 @@
std::set<LLNameUI*> LLNameUI::sInstances; std::set<LLNameUI*> LLNameUI::sInstances;
LLNameUI::LLNameUI(const std::string& loading, const LLUUID& id, bool is_group) LLNameUI::LLNameUI(const std::string& loading, const LLUUID& id, bool is_group)
: mNameID(id), mIsGroup(is_group) : mNameID(id), mIsGroup(is_group), mAllowInteract(false)
, mInitialValue(!loading.empty() ? loading : LLTrans::getString("LoadingData")) , mInitialValue(!loading.empty() ? loading : LLTrans::getString("LoadingData"))
{ {
sInstances.insert(this); sInstances.insert(this);
@@ -49,7 +49,11 @@ void LLNameUI::setNameID(const LLUUID& name_id, bool is_group)
{ {
mNameID = name_id; mNameID = name_id;
mIsGroup = is_group; mIsGroup = is_group;
setNameText(); if (mAllowInteract = mNameID.notNull())
setNameText();
else
setText(LLTrans::getString(mIsGroup ? "GroupNameNone" : "AvatarNameNobody"));
}
void LLNameUI::setNameText() void LLNameUI::setNameText()
{ {

View File

@@ -58,5 +58,6 @@ private:
protected: protected:
LLUUID mNameID; LLUUID mNameID;
bool mIsGroup; bool mIsGroup;
bool mAllowInteract;
std::string mInitialValue; std::string mInitialValue;
}; };