Fix whitespaces
parent
7a7b96bf9d
commit
d0b9886b28
|
|
@ -605,12 +605,12 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg,
|
|||
// don't show toast and add message to chat history on receive debug message
|
||||
// with disabled setting showing script errors or enabled setting to show script
|
||||
// errors in separate window.
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
// if (chat_msg.mChatType == CHAT_TYPE_DEBUG_MSG)
|
||||
static LLCachedControl<bool> FSllOwnerSayToScriptDebugWindow(gSavedSettings, "FSllOwnerSayToScriptDebugWindow");
|
||||
if (chat_msg.mChatType == CHAT_TYPE_DEBUG_MSG || (chat_msg.mChatType == CHAT_TYPE_OWNER && FSllOwnerSayToScriptDebugWindow))
|
||||
static LLCachedControl<bool> FSllOwnerSayToScriptDebugWindow(gSavedSettings, "FSllOwnerSayToScriptDebugWindow");
|
||||
if (chat_msg.mChatType == CHAT_TYPE_DEBUG_MSG || (chat_msg.mChatType == CHAT_TYPE_OWNER && FSllOwnerSayToScriptDebugWindow))
|
||||
{
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow] Show llOwnerSays in the script debug window instead of local chat
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow] Show llOwnerSays in the script debug window instead of local chat
|
||||
// if(gSavedSettings.getBOOL("ShowScriptErrors") == FALSE)
|
||||
if(gSavedSettings.getBOOL("ShowScriptErrors") == FALSE && chat_msg.mChatType == CHAT_TYPE_DEBUG_MSG)
|
||||
return;
|
||||
|
|
@ -632,7 +632,7 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg,
|
|||
//if (gSavedSettings.getS32("ShowScriptErrorsLocation")== 1)// show error in window //("ScriptErrorsAsChat"))
|
||||
{
|
||||
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
// LLColor4 txt_color;
|
||||
|
||||
// LLViewerChat::getChatColor(chat_msg,txt_color);
|
||||
|
|
@ -644,7 +644,7 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg,
|
|||
LLFloaterScriptDebug::addScriptLine(chat_msg);
|
||||
// <FS:Ansariel> Script debug icon
|
||||
//return;
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
// if (gSavedSettings.getS32("ShowScriptErrorsLocation") == 1)
|
||||
if (gSavedSettings.getS32("ShowScriptErrorsLocation") == 1 || chat_msg.mChatType == CHAT_TYPE_OWNER)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -117,29 +117,29 @@ LLFloater* LLFloaterScriptDebug::addOutputWindow(const LLUUID& object_id, bool s
|
|||
// void LLFloaterScriptDebug::addScriptLine(const std::string &utf8mesg, const std::string &user_name, const LLColor4& color, const LLUUID& source_id)
|
||||
void LLFloaterScriptDebug::addScriptLine(const LLChat& chat)
|
||||
{
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
// LLViewerObject* objectp = gObjectList.findObject(source_id);
|
||||
LLViewerObject* objectp = gObjectList.findObject(chat.mFromID);
|
||||
std::string floater_label;
|
||||
|
||||
// Handle /me messages.
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
// std::string prefix = utf8mesg.substr(0, 4);
|
||||
// std::string message = (prefix == "/me " || prefix == "/me'") ? user_name + utf8mesg.substr(3) : utf8mesg;
|
||||
|
||||
if (objectp)
|
||||
{
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
if (chat.mChatType == CHAT_TYPE_DEBUG_MSG)
|
||||
{
|
||||
objectp->setIcon(LLViewerTextureManager::getFetchedTextureFromFile("script_error.j2c", FTT_LOCAL_FILE, TRUE, LLGLTexture::BOOST_UI));
|
||||
// <FS:Ansariel> Mark script error icons
|
||||
objectp->getIcon()->setScriptError();
|
||||
// </FS:Ansariel> Mark script error icons
|
||||
}
|
||||
// </FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
if (chat.mChatType == CHAT_TYPE_DEBUG_MSG)
|
||||
{
|
||||
objectp->setIcon(LLViewerTextureManager::getFetchedTextureFromFile("script_error.j2c", FTT_LOCAL_FILE, TRUE, LLGLTexture::BOOST_UI));
|
||||
// <FS:Ansariel> Mark script error icons
|
||||
objectp->getIcon()->setScriptError();
|
||||
// </FS:Ansariel> Mark script error icons
|
||||
}
|
||||
// </FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
floater_label = llformat("%s (%.0f, %.0f, %.0f)",
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
// user_name.c_str(),
|
||||
chat.mFromName.c_str(),
|
||||
objectp->getPositionRegion().mV[VX],
|
||||
|
|
@ -148,13 +148,13 @@ void LLFloaterScriptDebug::addScriptLine(const LLChat& chat)
|
|||
}
|
||||
else
|
||||
{
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
// floater_label = user_name;
|
||||
floater_label = chat.mFromName;
|
||||
}
|
||||
|
||||
addOutputWindow(LLUUID::null);
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
// addOutputWindow(source_id);
|
||||
addOutputWindow(chat.mFromID);
|
||||
|
||||
|
|
@ -162,18 +162,18 @@ void LLFloaterScriptDebug::addScriptLine(const LLChat& chat)
|
|||
LLFloaterScriptDebugOutput* floaterp = LLFloaterReg::getTypedInstance<LLFloaterScriptDebugOutput>("script_debug_output", LLUUID::null);
|
||||
if (floaterp)
|
||||
{
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
// floaterp->addLine(message, user_name, color);
|
||||
floaterp->addLine(chat, chat.mFromName);
|
||||
}
|
||||
|
||||
// add to specific script instance floater
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
// floaterp = LLFloaterReg::getTypedInstance<LLFloaterScriptDebugOutput>("script_debug_output", source_id);
|
||||
floaterp = LLFloaterReg::getTypedInstance<LLFloaterScriptDebugOutput>("script_debug_output", chat.mFromID);
|
||||
if (floaterp)
|
||||
{
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
// floaterp->addLine(message, floater_label, color);
|
||||
floaterp->addLine(chat, floater_label);
|
||||
}
|
||||
|
|
@ -216,89 +216,85 @@ void LLFloaterScriptDebugOutput::addLine(const LLChat& chat, const std::string &
|
|||
setTitle(user_name);
|
||||
setShortTitle(user_name);
|
||||
}
|
||||
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
// mHistoryEditor->appendText(utf8mesg, true, LLStyle::Params().color(color));
|
||||
|
||||
bool prependNewLineState = mHistoryEditor->getText().size() != 0;
|
||||
|
||||
LLColor4 txt_color = LLUIColorTable::instance().getColor("White");
|
||||
LLViewerChat::getChatColor(chat, txt_color);
|
||||
|
||||
|
||||
//IRC styled /me messages.
|
||||
bool prependNewLineState = !mHistoryEditor->getText().empty();
|
||||
|
||||
LLColor4 txt_color = LLUIColorTable::instance().getColor("White");
|
||||
LLViewerChat::getChatColor(chat, txt_color);
|
||||
|
||||
//IRC styled /me messages.
|
||||
std::string prefix = chat.mText.substr(0, 4);
|
||||
bool irc_me = (prefix == "/me " || prefix == "/me'");
|
||||
|
||||
if (chat.mChatType == CHAT_TYPE_OWNER) {
|
||||
|
||||
LLFontGL* fontp = LLViewerChat::getChatFont();
|
||||
std::string font_name = LLFontGL::nameFromFont(fontp);
|
||||
std::string font_size = LLFontGL::sizeFromFont(fontp);
|
||||
bool irc_me = (prefix == "/me " || prefix == "/me'");
|
||||
|
||||
LLStyle::Params body_message_params;
|
||||
body_message_params.color(txt_color);
|
||||
body_message_params.readonly_color(txt_color);
|
||||
body_message_params.font.name(font_name);
|
||||
body_message_params.font.size(font_size);
|
||||
|
||||
|
||||
// Delimiter after a name in header copy/past and in plain text mode
|
||||
std::string delimiter = ": ";
|
||||
// Don't add any delimiter after name in irc styled messages
|
||||
if (irc_me || chat.mChatStyle == CHAT_STYLE_IRC)
|
||||
{
|
||||
delimiter = LLStringUtil::null;
|
||||
}
|
||||
if (chat.mChatType == CHAT_TYPE_OWNER)
|
||||
{
|
||||
|
||||
time_t utc_time;
|
||||
utc_time = time_corrected();
|
||||
std::string timeStr ="["+ LLTrans::getString("TimeHour")+"]:["+LLTrans::getString("TimeMin")+"]";
|
||||
LLSD substitution;
|
||||
substitution["datetime"] = (S32) utc_time;
|
||||
LLStringUtil::format (timeStr, substitution);
|
||||
LLFontGL* fontp = LLViewerChat::getChatFont();
|
||||
std::string font_name = LLFontGL::nameFromFont(fontp);
|
||||
std::string font_size = LLFontGL::sizeFromFont(fontp);
|
||||
|
||||
LLStyle::Params timestamp_style(body_message_params);
|
||||
LLColor4 timestamp_color = LLUIColorTable::instance().getColor("ChatTimestampColor");
|
||||
timestamp_style.color(timestamp_color);
|
||||
timestamp_style.readonly_color(timestamp_color);
|
||||
mHistoryEditor->appendText("[" + timeStr + "] ", prependNewLineState, timestamp_style);
|
||||
|
||||
|
||||
// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) | Added: RLVa-1.2.0f
|
||||
// NOTE-RLVa: we don't need to do any @shownames or @showloc filtering here because we'll already have an existing URL
|
||||
std::string url = chat.mURL;
|
||||
if ( (url.empty()) || (std::string::npos == url.find("objectim")) )
|
||||
{
|
||||
// [/RLVa:KB]
|
||||
// for object IMs, create a secondlife:///app/objectim SLapp
|
||||
/*std::string*/ url = LLViewerChat::getSenderSLURL(chat, LLSD());
|
||||
// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) | Added: RLVa-1.2.0f
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
LLStyle::Params body_message_params;
|
||||
body_message_params.color(txt_color);
|
||||
body_message_params.readonly_color(txt_color);
|
||||
body_message_params.font.name(font_name);
|
||||
body_message_params.font.size(font_size);
|
||||
|
||||
// set the link for the object name to be the objectim SLapp
|
||||
// (don't let object names with hyperlinks override our objectim Url)
|
||||
LLStyle::Params link_params(body_message_params);
|
||||
link_params.color.control = "ChatNameObjectColor";
|
||||
LLColor4 link_color = LLUIColorTable::instance().getColor("ChatNameObjectColor");
|
||||
link_params.color = link_color;
|
||||
link_params.readonly_color = link_color;
|
||||
link_params.is_link = true;
|
||||
link_params.link_href = url;
|
||||
mHistoryEditor->appendText(chat.mFromName + delimiter, false, link_params); // <FS:Zi> FIRE-8600: TAB out of chat history
|
||||
|
||||
std::string message = irc_me ? chat.mText.substr(3) : chat.mText;
|
||||
|
||||
mHistoryEditor->appendText(message, false, body_message_params);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string message = irc_me ? chat.mFromName + chat.mText.substr(3) : chat.mText;
|
||||
mHistoryEditor->appendText(message, prependNewLineState, LLStyle::Params().color(txt_color));
|
||||
}
|
||||
// </FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
// Delimiter after a name in header copy/past and in plain text mode
|
||||
std::string delimiter = ": ";
|
||||
// Don't add any delimiter after name in irc styled messages
|
||||
if (irc_me || chat.mChatStyle == CHAT_STYLE_IRC)
|
||||
{
|
||||
delimiter = LLStringUtil::null;
|
||||
}
|
||||
|
||||
time_t utc_time;
|
||||
utc_time = time_corrected();
|
||||
std::string timeStr ="["+ LLTrans::getString("TimeHour")+"]:["+LLTrans::getString("TimeMin")+"]";
|
||||
LLSD substitution;
|
||||
substitution["datetime"] = (S32) utc_time;
|
||||
LLStringUtil::format (timeStr, substitution);
|
||||
|
||||
LLStyle::Params timestamp_style(body_message_params);
|
||||
LLColor4 timestamp_color = LLUIColorTable::instance().getColor("ChatTimestampColor");
|
||||
timestamp_style.color(timestamp_color);
|
||||
timestamp_style.readonly_color(timestamp_color);
|
||||
mHistoryEditor->appendText("[" + timeStr + "] ", prependNewLineState, timestamp_style);
|
||||
|
||||
// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) | Added: RLVa-1.2.0f
|
||||
// NOTE-RLVa: we don't need to do any @shownames or @showloc filtering here because we'll already have an existing URL
|
||||
std::string url = chat.mURL;
|
||||
if ( (url.empty()) || (std::string::npos == url.find("objectim")) )
|
||||
{
|
||||
// [/RLVa:KB]
|
||||
// for object IMs, create a secondlife:///app/objectim SLapp
|
||||
/*std::string*/ url = LLViewerChat::getSenderSLURL(chat, LLSD());
|
||||
// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) | Added: RLVa-1.2.0f
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
|
||||
// set the link for the object name to be the objectim SLapp
|
||||
// (don't let object names with hyperlinks override our objectim Url)
|
||||
LLStyle::Params link_params(body_message_params);
|
||||
link_params.color.control = "ChatNameObjectColor";
|
||||
LLColor4 link_color = LLUIColorTable::instance().getColor("ChatNameObjectColor");
|
||||
link_params.color = link_color;
|
||||
link_params.readonly_color = link_color;
|
||||
link_params.is_link = true;
|
||||
link_params.link_href = url;
|
||||
mHistoryEditor->appendText(chat.mFromName + delimiter, false, link_params); // <FS:Zi> FIRE-8600: TAB out of chat history
|
||||
|
||||
std::string message = irc_me ? chat.mText.substr(3) : chat.mText;
|
||||
|
||||
mHistoryEditor->appendText(message, false, body_message_params);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string message = irc_me ? chat.mFromName + chat.mText.substr(3) : chat.mText;
|
||||
mHistoryEditor->appendText(message, prependNewLineState, LLStyle::Params().color(txt_color));
|
||||
}
|
||||
// </FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
mHistoryEditor->blockUndo();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,8 +39,8 @@ public:
|
|||
LLFloaterScriptDebug(const LLSD& key);
|
||||
virtual ~LLFloaterScriptDebug();
|
||||
virtual BOOL postBuild();
|
||||
static void show(const LLUUID& object_id);
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
static void show(const LLUUID& object_id);
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
// static void addScriptLine(const std::string &utf8mesg, const std::string &user_name, const LLColor4& color, const LLUUID& source_id);
|
||||
static void addScriptLine(const LLChat& chat);
|
||||
|
||||
|
|
@ -60,7 +60,7 @@ public:
|
|||
LLFloaterScriptDebugOutput(const LLSD& object_id);
|
||||
~LLFloaterScriptDebugOutput();
|
||||
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
|
||||
// void addLine(const std::string &utf8mesg, const std::string &user_name, const LLColor4& color);
|
||||
void addLine(const LLChat& chat, const std::string &user_name);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue