Complete fix for FIRE-5002: Pressing "/" now always starts chat

meow-7.2.2
Ansariel 2012-02-13 20:21:21 +01:00
parent a029582b54
commit deae6d3a89
3 changed files with 39 additions and 7 deletions

View File

@ -487,3 +487,22 @@ BOOL LLNearbyChat::chatIsEmpty() const
// return FALSE for unfocused chat editor, so other UI elements can claim arrow keys
return FALSE;
}
void LLNearbyChat::startChatInDefaultChatBar(const char* line)
{
showDefaultChatBar(TRUE);
setFocusedInputEditor(mDefaultChatBar, TRUE);
if (line)
{
std::string line_string(line);
mFocusedInputEditor->setText(line_string);
}
mFocusedInputEditor->setCursorToEnd();
}
std::string LLNearbyChat::getCurrentChatInDefaultCharBar()
{
return mDefaultChatBar ? mDefaultChatBar->getText() : LLStringUtil::null;
}

View File

@ -62,6 +62,9 @@ public:
BOOL chatIsEmpty() const;
void startChatInDefaultChatBar(const char* line);
std::string getCurrentChatInDefaultCharBar();
LLNearbyChatControl* mFocusedInputEditor;
};

View File

@ -577,19 +577,29 @@ void start_gesture( EKeystate s )
if (KEYSTATE_UP == s &&
! (focus_ctrlp && focus_ctrlp->acceptsTextInput()))
{
// <FS:Zi> Remove floating chat bar
// TODO: This needs the new bottom chat bar to work at all
/* if (LLNearbyChat::getInstance()->getCurrentChat().empty())
// <FS:Ansariel> Changed for new chatbar
//if (LLNearbyChat::getInstance()->getCurrentChat().empty())
//{
// // No existing chat in chat editor, insert '/'
// LLNearbyChat::startChat("/");
//}
//else
//{
// // Don't overwrite existing text in chat editor
// LLNearbyChat::startChat(NULL);
//}
if (LLNearbyChat::instance().getCurrentChatInDefaultCharBar().empty())
{
// No existing chat in chat editor, insert '/'
LLNearbyChat::startChat("/");
LLNearbyChat::instance().startChatInDefaultChatBar("/");
}
else
{
// Don't overwrite existing text in chat editor
LLNearbyChat::startChat(NULL);
}*/
// </FS:Zi>
LLNearbyChat::instance().startChatInDefaultChatBar(NULL);
}
// </FS:Ansarieö>
}
}