diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp
index b83cff7265..7614c5024f 100644
--- a/indra/llui/llconsole.cpp
+++ b/indra/llui/llconsole.cpp
@@ -63,7 +63,9 @@ LLConsole::LLConsole(const LLConsole::Params& p)
mLinePersistTime(p.persist_time), // seconds
mFont(p.font),
mConsoleWidth(0),
- mConsoleHeight(0)
+ mConsoleHeight(0),
+ mParseUrls(p.parse_urls), // Ansariel: If lines should be parsed for URLs
+ mBackgroundImage(p.background_image) // Ansariel: Configurable background for different console types
{
if (p.font_size_index.isProvided())
{
@@ -187,7 +189,7 @@ void LLConsole::draw()
//[FIX FIRE-2822 SJ] Start a little bit higher with the Console not to let it blend with the stand button when Avatar is sitting
F32 y_pos = 10.f;
- LLUIImagePtr imagep = LLUI::getUIImage("Rounded_Square");
+ LLUIImagePtr imagep = LLUI::getUIImage(mBackgroundImage);
//AO: Unify colors and opacity with the color preferences control for all onscreen overlay background
// console/bubblechat/tag backgrounds. FIRE-969
@@ -271,16 +273,19 @@ void LLConsole::addConsoleLine(const LLWString& wline, const LLColor4 &color, LL
removeExtraLines();
// Parse SLURLs
- LLUrlMatch urlMatch;
LLWString newLine = wline;
- LLWString workLine = wline;
- while (LLUrlRegistry::instance().findUrl(workLine, urlMatch))
+ if (mParseUrls)
{
- LLWStringUtil::replaceString(newLine, utf8str_to_wstring(urlMatch.getUrl()), utf8str_to_wstring(urlMatch.getLabel()));
+ LLUrlMatch urlMatch;
+ LLWString workLine = wline;
+ while (LLUrlRegistry::instance().findUrl(workLine, urlMatch))
+ {
+ LLWStringUtil::replaceString(newLine, utf8str_to_wstring(urlMatch.getUrl()), utf8str_to_wstring(urlMatch.getLabel()));
- // Remove the URL from the work line so we don't end in a loop in case of regular URLs!
- // findUrl will always return the very first URL in a string
- workLine = workLine.erase(0, urlMatch.getEnd() + 1);
+ // Remove the URL from the work line so we don't end in a loop in case of regular URLs!
+ // findUrl will always return the very first URL in a string
+ workLine = workLine.erase(0, urlMatch.getEnd() + 1);
+ }
}
// Parse SLURLs
diff --git a/indra/llui/llconsole.h b/indra/llui/llconsole.h
index 555096732a..6bcc4788cf 100644
--- a/indra/llui/llconsole.h
+++ b/indra/llui/llconsole.h
@@ -49,10 +49,15 @@ public:
Optional max_lines;
Optional persist_time;
Optional font_size_index;
+ Optional parse_urls; // Ansariel: If lines should be parsed for URLs
+ Optional background_image; // Ansariel: Configurable background for different console types
+
Params()
: max_lines("max_lines", LLUI::sSettingGroups["config"]->getS32("ConsoleMaxLines")),
persist_time("persist_time", 0.f), // forever
- font_size_index("font_size_index")
+ font_size_index("font_size_index"),
+ parse_urls("parse_urls", false), // Ansariel: If lines should be parsed for URLs
+ background_image("background_image", "transparent") // Ansariel: Configurable background for different console types
{
changeDefault(mouse_opaque, false);
}
@@ -163,7 +168,8 @@ private:
const LLFontGL* mFont;
S32 mConsoleWidth;
S32 mConsoleHeight;
-
+ bool mParseUrls; // Ansariel: If lines should be parsed for URLs
+ std::string mBackgroundImage; // Ansariel: Configurable background for different console types
};
extern LLConsole* gConsole;
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index f5ca679c8a..3894c9f3ec 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1781,6 +1781,8 @@ void LLViewerWindow::initBase()
cp.name("console");
cp.max_lines(gSavedSettings.getS32("ConsoleBufferSize"));
cp.rect(getChatConsoleRect());
+ cp.parse_urls(true); // Ansariel: Enable URL parsing for the chat console
+ cp.background_image("Rounded_Square"); // Ansariel: Configurable background for different console types
// AO, have console respect/reuse NearbyToastLifeTime for the length popup chat messages are displayed.
//cp.persist_time(gSavedSettings.getF32("ChatPersistTime"));
cp.persist_time((F32)gSavedSettings.getS32("NearbyToastLifeTime"));