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()
{
if (!mAllowInteract) return;
if (mIsGroup)
LLGroupActions::show(mNameID);
else
@@ -59,6 +61,8 @@ void LLNameBox::showProfile()
// virtual
BOOL LLNameBox::handleRightMouseDown(S32 x, S32 y, MASK mask)
{
if (!mAllowInteract) return;
if (!LLTextBox::handleRightMouseDown(x, y, mask))
{
// Singu TODO: Generic menus for groups

View File

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

View File

@@ -39,7 +39,7 @@
std::set<LLNameUI*> LLNameUI::sInstances;
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"))
{
sInstances.insert(this);
@@ -49,7 +49,11 @@ void LLNameUI::setNameID(const LLUUID& name_id, bool is_group)
{
mNameID = name_id;
mIsGroup = is_group;
setNameText();
if (mAllowInteract = mNameID.notNull())
setNameText();
else
setText(LLTrans::getString(mIsGroup ? "GroupNameNone" : "AvatarNameNobody"));
}
void LLNameUI::setNameText()
{

View File

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