# Conflicts:
#	autobuild.xml
#	indra/cmake/Audio.cmake
#	indra/llui/llconsole.cpp
#	indra/newview/app_settings/settings.xml
#	indra/newview/llfloaterimnearbychathandler.cpp
#	indra/newview/llfloaterscriptedprefs.cpp
#	indra/newview/llhudnametag.cpp
#	indra/newview/llhudtext.cpp
#	indra/newview/llpanelpermissions.cpp
#	indra/newview/llscripteditor.cpp
#	indra/newview/lltexturefetch.cpp
#	indra/newview/lltextureview.cpp
#	indra/newview/llviewerchat.cpp
#	indra/newview/llviewerchat.h
#	indra/newview/llviewermenu.cpp
#	indra/newview/llviewerobjectlist.cpp
#	indra/newview/llviewerparceloverlay.cpp
#	indra/newview/llviewerparceloverlay.h
#	indra/newview/llviewerwindow.cpp
#	indra/newview/llvoavatar.cpp
#	indra/newview/llvosurfacepatch.cpp
master
Ansariel 2024-08-05 20:10:02 +02:00
commit 80f9aaa46e
79 changed files with 1030 additions and 369 deletions

View File

@ -2232,11 +2232,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>archive</key> <key>archive</key>
<map> <map>
<key>hash</key> <key>hash</key>
<string>ad0dd0f608b868cc44c225ee48e114239fca2807</string> <string>1e694e5562b8d844bc44d5f7ae4dce243ee70d23</string>
<key>hash_algorithm</key> <key>hash_algorithm</key>
<string>sha1</string> <string>sha1</string>
<key>url</key> <key>url</key>
<string>https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.3-1.3.6.e4101b6/ogg_vorbis-1.3.3-1.3.6.e4101b6-darwin64-e4101b6.tar.zst</string> <string>https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.5-1.3.7/ogg_vorbis-1.3.5-1.3.7.10218872737-darwin64-10218872737.tar.zst</string>
</map> </map>
<key>name</key> <key>name</key>
<string>darwin64</string> <string>darwin64</string>
@ -2246,11 +2246,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>archive</key> <key>archive</key>
<map> <map>
<key>hash</key> <key>hash</key>
<string>90052be851c4fcecc35d8424b4f31352de14ab2f</string> <string>ce0c6adb6d684eb2f4b2ad8838c67186c59e151a</string>
<key>hash_algorithm</key> <key>hash_algorithm</key>
<string>sha1</string> <string>sha1</string>
<key>url</key> <key>url</key>
<string>https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.3-1.3.6-881f65e/ogg_vorbis-1.3.3-1.3.6.881f65e-linux64-881f65e.tar.zst</string> <string>https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.5-1.3.7/ogg_vorbis-1.3.5-1.3.7.10218872737-linux64-10218872737.tar.zst</string>
</map> </map>
<key>name</key> <key>name</key>
<string>linux64</string> <string>linux64</string>
@ -2260,11 +2260,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>archive</key> <key>archive</key>
<map> <map>
<key>hash</key> <key>hash</key>
<string>2e73a0a5659c9a09eba2f94619aa5c23c7cc3937</string> <string>9434b592c5d748c5deb64ad548fd1484638e3172</string>
<key>hash_algorithm</key> <key>hash_algorithm</key>
<string>sha1</string> <string>sha1</string>
<key>url</key> <key>url</key>
<string>https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.3-1.3.6.e4101b6/ogg_vorbis-1.3.3-1.3.6.e4101b6-windows64-e4101b6.tar.zst</string> <string>https://github.com/secondlife/3p-ogg_vorbis/releases/download/v1.3.5-1.3.7/ogg_vorbis-1.3.5-1.3.7.10218872737-windows64-10218872737.tar.zst</string>
</map> </map>
<key>name</key> <key>name</key>
<string>windows64</string> <string>windows64</string>
@ -2277,7 +2277,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>copyright</key> <key>copyright</key>
<string>Copyright (c) 2002, Xiph.org Foundation</string> <string>Copyright (c) 2002, Xiph.org Foundation</string>
<key>version</key> <key>version</key>
<string>1.3.3-1.3.6.e4101b6</string> <string>1.3.5-1.3.7.10218872737</string>
<key>name</key> <key>name</key>
<string>ogg_vorbis</string> <string>ogg_vorbis</string>
<key>description</key> <key>description</key>

View File

@ -1,4 +1,5 @@
# -*- cmake -*- # -*- cmake -*-
include(Linking)
include(Prebuilt) include(Prebuilt)
include_guard() include_guard()
@ -9,9 +10,23 @@ use_prebuilt_binary(ogg_vorbis)
target_include_directories( ll::vorbis SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include ) target_include_directories( ll::vorbis SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include )
if (WINDOWS) if (WINDOWS)
target_link_libraries(ll::vorbis INTERFACE ogg_static vorbis_static vorbisenc_static vorbisfile_static ) target_link_libraries(ll::vorbis INTERFACE
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libogg.lib
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libogg.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisenc.lib
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbisenc.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisfile.lib
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbisfile.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libvorbis.lib
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libvorbis.lib
)
else (WINDOWS) else (WINDOWS)
# <FS:Zi> These must be in this order, or it won't link: vorbisenc vorbisfile vorbis ogg target_link_libraries(ll::vorbis INTERFACE
target_link_libraries(ll::vorbis INTERFACE vorbisenc vorbisfile vorbis ogg) # <FS:Zi> These must be in this order, or it won't link: vorbisenc vorbisfile vorbis ogg
${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisenc.a
${ARCH_PREBUILT_DIRS_RELEASE}/libvorbisfile.a
${ARCH_PREBUILT_DIRS_RELEASE}/libvorbis.a
${ARCH_PREBUILT_DIRS_RELEASE}/libogg.a
)
endif (WINDOWS) endif (WINDOWS)

View File

@ -1202,12 +1202,12 @@ void LLButton::setImageSelected(LLPointer<LLUIImage> image)
mImageSelected = image; mImageSelected = image;
} }
void LLButton::setImageColor(const LLColor4& c) void LLButton::setImageColor(const LLUIColor& c)
{ {
mImageColor = c; mImageColor = c;
} }
void LLButton::setColor(const LLColor4& color) void LLButton::setColor(const LLUIColor& color)
{ {
setImageColor(color); setImageColor(color);
} }

View File

@ -176,8 +176,8 @@ public:
virtual void onCommit(); virtual void onCommit();
void setUnselectedLabelColor( const LLColor4& c ) { mUnselectedLabelColor = c; } void setUnselectedLabelColor( const LLUIColor& c ) { mUnselectedLabelColor = c; }
void setSelectedLabelColor( const LLColor4& c ) { mSelectedLabelColor = c; } void setSelectedLabelColor( const LLUIColor& c ) { mSelectedLabelColor = c; }
void setUseEllipses( bool use_ellipses ) { mUseEllipses = use_ellipses; } void setUseEllipses( bool use_ellipses ) { mUseEllipses = use_ellipses; }
void setUseFontColor( bool use_font_color) { mUseFontColor = use_font_color; } void setUseFontColor( bool use_font_color) { mUseFontColor = use_font_color; }
@ -232,14 +232,14 @@ public:
const std::string getLabelSelected() const { return wstring_to_utf8str(mSelectedLabel); } const std::string getLabelSelected() const { return wstring_to_utf8str(mSelectedLabel); }
void setImageColor(const std::string& color_control); void setImageColor(const std::string& color_control);
void setImageColor(const LLColor4& c); void setImageColor(const LLUIColor& c);
/*virtual*/ void setColor(const LLColor4& c); /*virtual*/ void setColor(const LLUIColor& c);
void setImages(const std::string &image_name, const std::string &selected_name); void setImages(const std::string &image_name, const std::string &selected_name);
void setDisabledImageColor(const LLColor4& c) { mDisabledImageColor = c; } void setDisabledImageColor(const LLUIColor& c) { mDisabledImageColor = c; }
void setDisabledSelectedLabelColor( const LLColor4& c ) { mDisabledSelectedLabelColor = c; } void setDisabledSelectedLabelColor( const LLUIColor& c ) { mDisabledSelectedLabelColor = c; }
void setImageOverlay(const std::string& image_name, LLFontGL::HAlign alignment = LLFontGL::HCENTER, const LLColor4& color = LLColor4::white); void setImageOverlay(const std::string& image_name, LLFontGL::HAlign alignment = LLFontGL::HCENTER, const LLColor4& color = LLColor4::white);
void setImageOverlay(const LLUUID& image_id, LLFontGL::HAlign alignment = LLFontGL::HCENTER, const LLColor4& color = LLColor4::white); void setImageOverlay(const LLUUID& image_id, LLFontGL::HAlign alignment = LLFontGL::HCENTER, const LLColor4& color = LLColor4::white);
@ -256,7 +256,7 @@ public:
virtual bool setLabelArg( const std::string& key, const LLStringExplicit& text ); virtual bool setLabelArg( const std::string& key, const LLStringExplicit& text );
void setLabelUnselected(const LLStringExplicit& label); void setLabelUnselected(const LLStringExplicit& label);
void setLabelSelected(const LLStringExplicit& label); void setLabelSelected(const LLStringExplicit& label);
void setDisabledLabelColor( const LLColor4& c ) { mDisabledLabelColor = c; } void setDisabledLabelColor( const LLUIColor& c ) { mDisabledLabelColor = c; }
void setFont(const LLFontGL *font) void setFont(const LLFontGL *font)
{ mGLFont = ( font ? font : LLFontGL::getFontSansSerif()); } { mGLFont = ( font ? font : LLFontGL::getFontSansSerif()); }

View File

@ -182,11 +182,11 @@ void LLCheckBoxCtrl::setEnabled(bool b)
if (b) if (b)
{ {
mLabel->setColor( mTextEnabledColor.get() ); mLabel->setColor( mTextEnabledColor );
} }
else else
{ {
mLabel->setColor( mTextDisabledColor.get() ); mLabel->setColor( mTextDisabledColor );
} }
} }

View File

@ -114,8 +114,8 @@ public:
void setBtnFocus() { mButton->setFocus(true); } void setBtnFocus() { mButton->setFocus(true); }
void setEnabledColor( const LLColor4 &color ) { mTextEnabledColor = color; } void setEnabledColor( const LLUIColor&color ) { mTextEnabledColor = color; }
void setDisabledColor( const LLColor4 &color ) { mTextDisabledColor = color; } void setDisabledColor( const LLUIColor&color ) { mTextDisabledColor = color; }
void setLabel( const LLStringExplicit& label ); void setLabel( const LLStringExplicit& label );
std::string getLabel() const; std::string getLabel() const;

View File

@ -222,7 +222,7 @@ void LLConsole::draw()
//static LLCachedControl<F32> console_bg_opacity(*LLUI::getInstance()->mSettingGroups["config"], "ConsoleBackgroundOpacity", 0.7f); //static LLCachedControl<F32> console_bg_opacity(*LLUI::getInstance()->mSettingGroups["config"], "ConsoleBackgroundOpacity", 0.7f);
//F32 console_opacity = llclamp(console_bg_opacity(), 0.f, 1.f); //F32 console_opacity = llclamp(console_bg_opacity(), 0.f, 1.f);
//static LLColor4 color = LLUIColorTable::instance().getColor("ConsoleBackground"); //static LLUIColor color = LLUIColorTable::instance().getColor("ConsoleBackground");
//color.mV[VALPHA] *= console_opacity; //color.mV[VALPHA] *= console_opacity;
//F32 line_height = (F32)mFont->getLineHeight(); //F32 line_height = (F32)mFont->getLineHeight();

View File

@ -853,7 +853,7 @@ void LLFolderViewItem::drawHighlight(const bool showContent, const bool hasKeybo
const S32 FOCUS_LEFT = 1; const S32 FOCUS_LEFT = 1;
// Determine which background color to use for highlighting // Determine which background color to use for highlighting
LLUIColor bgColor = (isFlashing() ? flashColor : selectColor); const LLUIColor& bgColor = (isFlashing() ? flashColor : selectColor);
//--------------------------------------------------------------------------------// //--------------------------------------------------------------------------------//
// Draw highlight for selected items // Draw highlight for selected items
@ -1090,7 +1090,7 @@ void LLFolderViewItem::draw()
// //
if (!mLabelSuffix.empty()) if (!mLabelSuffix.empty())
{ {
suffix_font->render( mLabelSuffix, 0, right_x, y, isFadeItem() ? color : (LLColor4)sSuffixColor, suffix_font->render( mLabelSuffix, 0, right_x, y, isFadeItem() ? color : sSuffixColor.get(),
LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW,
S32_MAX, S32_MAX, &right_x); S32_MAX, S32_MAX, &right_x);
} }

View File

@ -79,7 +79,7 @@ public:
std::string getImageName() const; std::string getImageName() const;
void setColor(const LLColor4& color) { mColor = color; } void setColor(const LLUIColor& color) { mColor = color; }
void setImage(LLPointer<LLUIImage> image) { mImagep = image; } void setImage(LLPointer<LLUIImage> image) { mImagep = image; }
const LLPointer<LLUIImage> getImage() { return mImagep; } const LLPointer<LLUIImage> getImage() { return mImagep; }

View File

@ -85,7 +85,7 @@ LLKeywords::~LLKeywords()
// Add the token as described // Add the token as described
void LLKeywords::addToken(LLKeywordToken::ETokenType type, void LLKeywords::addToken(LLKeywordToken::ETokenType type,
const std::string& key_in, const std::string& key_in,
const LLColor4& color, const LLUIColor& color,
const std::string& tool_tip_in, const std::string& tool_tip_in,
const std::string& delimiter_in) const std::string& delimiter_in)
{ {
@ -170,7 +170,7 @@ std::string LLKeywords::getAttribute(std::string_view key)
return (it != mAttributes.end()) ? it->second : ""; return (it != mAttributes.end()) ? it->second : "";
} }
LLColor4 LLKeywords::getColorGroup(std::string_view key_in) LLUIColor LLKeywords::getColorGroup(std::string_view key_in)
{ {
std::string color_group = "ScriptText"; std::string color_group = "ScriptText";
if (key_in == "functions") if (key_in == "functions")
@ -286,10 +286,10 @@ void LLKeywords::processTokens()
void LLKeywords::processTokensGroup(const LLSD& tokens, std::string_view group) void LLKeywords::processTokensGroup(const LLSD& tokens, std::string_view group)
{ {
LLColor4 color; LLUIColor color;
LLColor4 color_group; LLUIColor color_group;
LLColor4 color_deprecated = getColorGroup("deprecated"); LLUIColor color_deprecated = getColorGroup("deprecated");
LLColor4 color_god_mode = getColorGroup("god-mode"); LLUIColor color_god_mode = getColorGroup("god-mode");
LLKeywordToken::ETokenType token_type = LLKeywordToken::TT_UNKNOWN; LLKeywordToken::ETokenType token_type = LLKeywordToken::TT_UNKNOWN;
// If a new token type is added here, it must also be added to the 'addToken' method // If a new token type is added here, it must also be added to the 'addToken' method
@ -319,7 +319,7 @@ void LLKeywords::processTokensGroup(const LLSD& tokens, std::string_view group)
} }
color_group = getColorGroup(group); color_group = getColorGroup(group);
LL_DEBUGS("SyntaxLSL") << "Group: '" << group << "', using color: '" << color_group << "'" << LL_ENDL; LL_DEBUGS("SyntaxLSL") << "Group: '" << group << "', using color: '" << color_group.get() << "'" << LL_ENDL;
if (tokens.isMap()) if (tokens.isMap())
{ {
@ -401,7 +401,7 @@ void LLKeywords::processTokensGroup(const LLSD& tokens, std::string_view group)
} }
else if (tokens.isArray()) // Currently nothing should need this, but it's here for completeness else if (tokens.isArray()) // Currently nothing should need this, but it's here for completeness
{ {
LL_INFOS("SyntaxLSL") << "Curious, shouldn't be an array here; adding all using color " << color << LL_ENDL; LL_INFOS("SyntaxLSL") << "Curious, shouldn't be an array here; adding all using color " << color.get() << LL_ENDL;
for (S32 count = 0; count < tokens.size(); ++count) for (S32 count = 0; count < tokens.size(); ++count)
{ {
addToken(token_type, tokens[count], color, ""); addToken(token_type, tokens[count], color, "");
@ -780,7 +780,7 @@ void LLKeywords::insertSegments(const LLWString& wtext, std::vector<LLTextSegmen
insertSegment( seg_list, text_segment, text_len, style, editor); insertSegment( seg_list, text_segment, text_len, style, editor);
} }
void LLKeywords::insertSegment(std::vector<LLTextSegmentPtr>& seg_list, LLTextSegmentPtr new_segment, S32 text_len, const LLColor4 &defaultColor, LLTextEditor& editor ) void LLKeywords::insertSegment(std::vector<LLTextSegmentPtr>& seg_list, LLTextSegmentPtr new_segment, S32 text_len, const LLUIColor& defaultColor, LLTextEditor& editor )
{ {
LLTextSegmentPtr last = seg_list.back(); LLTextSegmentPtr last = seg_list.back();
S32 new_seg_end = new_segment->getEnd(); S32 new_seg_end = new_segment->getEnd();

View File

@ -76,7 +76,7 @@ public:
TT_TYPE // WORD TT_TYPE // WORD
} ETokenType; } ETokenType;
LLKeywordToken( ETokenType type, const LLColor4& color, const LLWString& token, const LLWString& tool_tip, const LLWString& delimiter ) LLKeywordToken( ETokenType type, const LLUIColor& color, const LLWString& token, const LLWString& tool_tip, const LLWString& delimiter )
: :
mType( type ), mType( type ),
mToken( token ), mToken( token ),
@ -91,7 +91,7 @@ public:
bool isHead(const llwchar* s) const; bool isHead(const llwchar* s) const;
bool isTail(const llwchar* s) const; bool isTail(const llwchar* s) const;
const LLWString& getToken() const { return mToken; } const LLWString& getToken() const { return mToken; }
const LLColor4& getColor() const { return mColor; } const LLUIColor& getColor() const { return mColor; }
ETokenType getType() const { return mType; } ETokenType getType() const { return mType; }
const LLWString& getToolTip() const { return mToolTip; } const LLWString& getToolTip() const { return mToolTip; }
const LLWString& getDelimiter() const { return mDelimiter; } const LLWString& getDelimiter() const { return mDelimiter; }
@ -103,7 +103,7 @@ public:
private: private:
ETokenType mType; ETokenType mType;
LLWString mToken; LLWString mToken;
LLColor4 mColor; LLUIColor mColor;
LLWString mToolTip; LLWString mToolTip;
LLWString mDelimiter; LLWString mDelimiter;
}; };
@ -115,7 +115,7 @@ public:
~LLKeywords(); ~LLKeywords();
void clearLoaded() { mLoaded = false; } void clearLoaded() { mLoaded = false; }
LLColor4 getColorGroup(std::string_view key_in); LLUIColor getColorGroup(std::string_view key_in);
bool isLoaded() const { return mLoaded; } bool isLoaded() const { return mLoaded; }
// <FS:Ansariel> Re-add support for Cinder's legacy file format // <FS:Ansariel> Re-add support for Cinder's legacy file format
bool loadFromLegacyFile(const std::string& filename); bool loadFromLegacyFile(const std::string& filename);
@ -130,7 +130,7 @@ public:
// Add the token as described // Add the token as described
void addToken(LLKeywordToken::ETokenType type, void addToken(LLKeywordToken::ETokenType type,
const std::string& key, const std::string& key,
const LLColor4& color, const LLUIColor& color,
const std::string& tool_tip = LLStringUtil::null, const std::string& tool_tip = LLStringUtil::null,
const std::string& delimiter = LLStringUtil::null); const std::string& delimiter = LLStringUtil::null);
@ -159,7 +159,7 @@ public:
bool mOwner; bool mOwner;
LLColor4 mColor; LLUIColor mColor;
}; };
typedef std::map<WStringMapIndex, LLKeywordToken*> word_token_map_t; typedef std::map<WStringMapIndex, LLKeywordToken*> word_token_map_t;
@ -167,7 +167,7 @@ public:
keyword_iterator_t begin() const { return mWordTokenMap.begin(); } keyword_iterator_t begin() const { return mWordTokenMap.begin(); }
keyword_iterator_t end() const { return mWordTokenMap.end(); } keyword_iterator_t end() const { return mWordTokenMap.end(); }
typedef std::map<WStringMapIndex, LLColor4> group_color_map_t; typedef std::map<WStringMapIndex, LLUIColor> group_color_map_t;
typedef group_color_map_t::const_iterator color_iterator_t; typedef group_color_map_t::const_iterator color_iterator_t;
group_color_map_t mColorGroupMap; group_color_map_t mColorGroupMap;
@ -180,7 +180,7 @@ protected:
void insertSegment(std::vector<LLTextSegmentPtr>& seg_list, void insertSegment(std::vector<LLTextSegmentPtr>& seg_list,
LLTextSegmentPtr new_segment, LLTextSegmentPtr new_segment,
S32 text_len, S32 text_len,
const LLColor4 &defaultColor, const LLUIColor &defaultColor,
class LLTextEditor& editor); class LLTextEditor& editor);
void insertSegments(const LLWString& wtext, void insertSegments(const LLWString& wtext,
std::vector<LLTextSegmentPtr>& seg_list, std::vector<LLTextSegmentPtr>& seg_list,

View File

@ -213,7 +213,7 @@ public:
void setText(const LLStringExplicit &new_text); void setText(const LLStringExplicit &new_text);
const std::string& getText() const override { return mText.getString(); } const std::string& getText() const override { return mText.getString(); }
LLWString getWText() const { return mText.getWString(); } const LLWString& getWText() const { return mText.getWString(); }
LLWString getConvertedText() const; // trimmed text with paragraphs converted to newlines LLWString getConvertedText() const; // trimmed text with paragraphs converted to newlines
S32 getLength() const { return mText.length(); } S32 getLength() const { return mText.length(); }
@ -233,12 +233,12 @@ public:
void setRevertOnEsc( bool b ) { mRevertOnEsc = b; } void setRevertOnEsc( bool b ) { mRevertOnEsc = b; }
void setKeystrokeOnEsc(bool b) { mKeystrokeOnEsc = b; } void setKeystrokeOnEsc(bool b) { mKeystrokeOnEsc = b; }
void setCursorColor(const LLColor4& c) { mCursorColor = c; } void setCursorColor(const LLUIColor& c) { mCursorColor = c; }
const LLColor4& getCursorColor() const { return mCursorColor.get(); } const LLColor4& getCursorColor() const { return mCursorColor.get(); }
void setFgColor( const LLColor4& c ) { mFgColor = c; } void setFgColor( const LLUIColor& c ) { mFgColor = c; }
void setReadOnlyFgColor( const LLColor4& c ) { mReadOnlyFgColor = c; } void setReadOnlyFgColor( const LLUIColor& c ) { mReadOnlyFgColor = c; }
void setTentativeFgColor(const LLColor4& c) { mTentativeFgColor = c; } void setTentativeFgColor(const LLUIColor& c) { mTentativeFgColor = c; }
const LLColor4& getFgColor() const { return mFgColor.get(); } const LLColor4& getFgColor() const { return mFgColor.get(); }
const LLColor4& getReadOnlyFgColor() const { return mReadOnlyFgColor.get(); } const LLColor4& getReadOnlyFgColor() const { return mReadOnlyFgColor.get(); }

View File

@ -440,7 +440,7 @@ void LLMultiSliderCtrl::setEnabled(bool b)
if( mLabelBox ) if( mLabelBox )
{ {
mLabelBox->setColor( b ? mTextEnabledColor.get() : mTextDisabledColor.get() ); mLabelBox->setColor( b ? mTextEnabledColor : mTextDisabledColor );
} }
mMultiSlider->setEnabled( b ); mMultiSlider->setEnabled( b );
@ -452,7 +452,7 @@ void LLMultiSliderCtrl::setEnabled(bool b)
if( mTextBox ) if( mTextBox )
{ {
mTextBox->setColor( b ? mTextEnabledColor.get() : mTextDisabledColor.get() ); mTextBox->setColor( b ? mTextEnabledColor : mTextDisabledColor );
} }
} }

View File

@ -130,8 +130,8 @@ public:
bool canAddSliders() { return mMultiSlider->canAddSliders(); } bool canAddSliders() { return mMultiSlider->canAddSliders(); }
void setLabel(const std::string& label) { if (mLabelBox) mLabelBox->setText(label); } void setLabel(const std::string& label) { if (mLabelBox) mLabelBox->setText(label); }
void setLabelColor(const LLColor4& c) { mTextEnabledColor = c; } void setLabelColor(const LLUIColor& c) { mTextEnabledColor = c; }
void setDisabledLabelColor(const LLColor4& c) { mTextDisabledColor = c; } void setDisabledLabelColor(const LLUIColor& c) { mTextDisabledColor = c; }
boost::signals2::connection setSliderMouseDownCallback( const commit_signal_t::slot_type& cb ); boost::signals2::connection setSliderMouseDownCallback( const commit_signal_t::slot_type& cb );
boost::signals2::connection setSliderMouseUpCallback( const commit_signal_t::slot_type& cb ); boost::signals2::connection setSliderMouseUpCallback( const commit_signal_t::slot_type& cb );

View File

@ -490,8 +490,8 @@ void LLPanel::initFromParams(const LLPanel::Params& p)
setBackgroundVisible(p.background_visible); setBackgroundVisible(p.background_visible);
setBackgroundOpaque(p.background_opaque); setBackgroundOpaque(p.background_opaque);
setBackgroundColor(p.bg_opaque_color().get()); setBackgroundColor(p.bg_opaque_color);
setTransparentColor(p.bg_alpha_color().get()); setTransparentColor(p.bg_alpha_color);
mBgOpaqueImage = p.bg_opaque_image(); mBgOpaqueImage = p.bg_opaque_image();
mBgAlphaImage = p.bg_alpha_image(); mBgAlphaImage = p.bg_alpha_image();
mBgOpaqueImageOverlay = p.bg_opaque_image_overlay; mBgOpaqueImageOverlay = p.bg_opaque_image_overlay;
@ -693,7 +693,7 @@ void LLPanel::childSetCommitCallback(std::string_view id, boost::function<void (
} }
} }
void LLPanel::childSetColor(std::string_view id, const LLColor4& color) void LLPanel::childSetColor(std::string_view id, const LLUIColor& color)
{ {
LLUICtrl* child = findChild<LLUICtrl>(id); LLUICtrl* child = findChild<LLUICtrl>(id);
if (child) if (child)

View File

@ -134,16 +134,16 @@ public:
bool hasBorder() const { return mBorder != NULL; } bool hasBorder() const { return mBorder != NULL; }
void setBorderVisible( bool b ); void setBorderVisible( bool b );
void setBackgroundColor( const LLColor4& color ) { mBgOpaqueColor = color; } void setBackgroundColor( const LLUIColor& color ) { mBgOpaqueColor = color; }
const LLColor4& getBackgroundColor() const { return mBgOpaqueColor; } const LLColor4& getBackgroundColor() const { return mBgOpaqueColor; }
void setTransparentColor(const LLColor4& color) { mBgAlphaColor = color; } void setTransparentColor(const LLUIColor& color) { mBgAlphaColor = color; }
const LLColor4& getTransparentColor() const { return mBgAlphaColor; } const LLColor4& getTransparentColor() const { return mBgAlphaColor; }
void setBackgroundImage(LLUIImage* image) { mBgOpaqueImage = image; } void setBackgroundImage(LLUIImage* image) { mBgOpaqueImage = image; }
void setTransparentImage(LLUIImage* image) { mBgAlphaImage = image; } void setTransparentImage(LLUIImage* image) { mBgAlphaImage = image; }
LLPointer<LLUIImage> getBackgroundImage() const { return mBgOpaqueImage; } LLPointer<LLUIImage> getBackgroundImage() const { return mBgOpaqueImage; }
LLPointer<LLUIImage> getTransparentImage() const { return mBgAlphaImage; } LLPointer<LLUIImage> getTransparentImage() const { return mBgAlphaImage; }
LLColor4 getBackgroundImageOverlay() { return mBgOpaqueImageOverlay; } const LLColor4& getBackgroundImageOverlay() { return mBgOpaqueImageOverlay; }
LLColor4 getTransparentImageOverlay() { return mBgAlphaImageOverlay; } const LLColor4& getTransparentImageOverlay() { return mBgAlphaImageOverlay; }
void setBackgroundVisible( bool b ) { mBgVisible = b; } void setBackgroundVisible( bool b ) { mBgVisible = b; }
bool isBackgroundVisible() const { return mBgVisible; } bool isBackgroundVisible() const { return mBgVisible; }
void setBackgroundOpaque(bool b) { mBgOpaque = b; } void setBackgroundOpaque(bool b) { mBgOpaque = b; }
@ -192,7 +192,7 @@ public:
// which takes a generic slot. Or use mCommitCallbackRegistrar.add() with // which takes a generic slot. Or use mCommitCallbackRegistrar.add() with
// a named callback and reference it in XML. // a named callback and reference it in XML.
void childSetCommitCallback(std::string_view id, boost::function<void (LLUICtrl*,void*)> cb, void* data); void childSetCommitCallback(std::string_view id, boost::function<void (LLUICtrl*,void*)> cb, void* data);
void childSetColor(std::string_view id, const LLColor4& color); void childSetColor(std::string_view id, const LLUIColor& color);
LLCtrlSelectionInterface* childGetSelectionInterface(std::string_view id) const; LLCtrlSelectionInterface* childGetSelectionInterface(std::string_view id) const;
LLCtrlListInterface* childGetListInterface(std::string_view id) const; LLCtrlListInterface* childGetListInterface(std::string_view id) const;

View File

@ -465,7 +465,7 @@ LLScrollListCheck::LLScrollListCheck(const LLScrollListCell::Params& p)
setWidth(rect.getWidth()); //check_box->getWidth(); setWidth(rect.getWidth()); //check_box->getWidth();
} }
mCheckBox->setColor(p.color); mCheckBox->setColor(p.color());
} }

View File

@ -43,7 +43,7 @@ namespace ll
virtual ~SearchableControl() virtual ~SearchableControl()
{ } { }
LLColor4 getHighlightColor( ) const const LLColor4& getHighlightColor( ) const
{ {
static LLUIColor highlight_color = LLUIColorTable::instance().getColor("SearchableControlHighlightColor", LLColor4::red); static LLUIColor highlight_color = LLUIColorTable::instance().getColor("SearchableControlHighlightColor", LLColor4::red);
return highlight_color.get(); return highlight_color.get();

View File

@ -393,7 +393,7 @@ void LLSliderCtrl::setEnabled(bool b)
if( mLabelBox ) if( mLabelBox )
{ {
mLabelBox->setColor( b ? mTextEnabledColor.get() : mTextDisabledColor.get() ); mLabelBox->setColor( b ? mTextEnabledColor : mTextDisabledColor );
} }
mSlider->setEnabled( b ); mSlider->setEnabled( b );
@ -405,7 +405,7 @@ void LLSliderCtrl::setEnabled(bool b)
if( mTextBox ) if( mTextBox )
{ {
mTextBox->setColor( b ? mTextEnabledColor.get() : mTextDisabledColor.get() ); mTextBox->setColor( b ? mTextEnabledColor : mTextDisabledColor );
} }
} }

View File

@ -107,8 +107,8 @@ public:
F32 getMaxValue() const { return mSlider->getMaxValue(); } F32 getMaxValue() const { return mSlider->getMaxValue(); }
void setLabel(const LLStringExplicit& label) { if (mLabelBox) mLabelBox->setText(label); } void setLabel(const LLStringExplicit& label) { if (mLabelBox) mLabelBox->setText(label); }
void setLabelColor(const LLColor4& c) { mTextEnabledColor = c; } void setLabelColor(const LLUIColor& c) { mTextEnabledColor = c; }
void setDisabledLabelColor(const LLColor4& c) { mTextDisabledColor = c; } void setDisabledLabelColor(const LLUIColor& c) { mTextDisabledColor = c; }
boost::signals2::connection setSliderMouseDownCallback( const commit_signal_t::slot_type& cb ); boost::signals2::connection setSliderMouseDownCallback( const commit_signal_t::slot_type& cb );
boost::signals2::connection setSliderMouseUpCallback( const commit_signal_t::slot_type& cb ); boost::signals2::connection setSliderMouseUpCallback( const commit_signal_t::slot_type& cb );

View File

@ -347,7 +347,7 @@ void LLSpinCtrl::updateLabelColor()
{ {
if( mLabelBox ) if( mLabelBox )
{ {
mLabelBox->setColor( getEnabled() ? mTextEnabledColor.get() : mTextDisabledColor.get() ); mLabelBox->setColor( getEnabled() ? mTextEnabledColor : mTextDisabledColor );
} }
} }

View File

@ -80,8 +80,8 @@ public:
virtual void setPrecision(S32 precision); virtual void setPrecision(S32 precision);
void setLabel(const LLStringExplicit& label); void setLabel(const LLStringExplicit& label);
void setLabelColor(const LLColor4& c) { mTextEnabledColor = c; updateLabelColor(); } void setLabelColor(const LLUIColor& c) { mTextEnabledColor = c; updateLabelColor(); }
void setDisabledLabelColor(const LLColor4& c) { mTextDisabledColor = c; updateLabelColor();} void setDisabledLabelColor(const LLUIColor& c) { mTextDisabledColor = c; updateLabelColor();}
void setAllowEdit(bool allow_edit); void setAllowEdit(bool allow_edit);
// <FS:Ansariel> Allow setting an argument on the label // <FS:Ansariel> Allow setting an argument on the label
virtual bool setLabelArg(const std::string& key, const LLStringExplicit& text); virtual bool setLabelArg(const std::string& key, const LLStringExplicit& text);

View File

@ -114,8 +114,8 @@ void LLStatGraph::draw()
it--; it--;
} }
static LLColor4 default_color = LLUIColorTable::instance().getColor( "MenuDefaultBgColor" ); static LLUIColor default_color = LLUIColorTable::instance().getColor( "MenuDefaultBgColor" );
gGL.color4fv(default_color.mV); gGL.color4fv(default_color.get().mV);
gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, true); gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, true);
gGL.color4fv(LLColor4::black.mV); gGL.color4fv(LLColor4::black.mV);

View File

@ -38,6 +38,7 @@ LLStyle::Params::Params()
color("color", LLColor4::black), color("color", LLColor4::black),
readonly_color("readonly_color", LLColor4::black), readonly_color("readonly_color", LLColor4::black),
selected_color("selected_color", LLColor4::black), selected_color("selected_color", LLColor4::black),
alpha("alpha", 1.f),
font("font", LLFontGL::getFontMonospace()), font("font", LLFontGL::getFontMonospace()),
image("image"), image("image"),
link_href("href"), link_href("href"),
@ -58,7 +59,8 @@ LLStyle::LLStyle(const LLStyle::Params& p)
mLink(p.link_href), mLink(p.link_href),
mIsLink(p.is_link.isProvided() ? p.is_link : !p.link_href().empty()), mIsLink(p.is_link.isProvided() ? p.is_link : !p.link_href().empty()),
mDropShadow(p.drop_shadow), mDropShadow(p.drop_shadow),
mImagep(p.image()) mImagep(p.image()),
mAlpha(p.alpha)
{} {}
void LLStyle::setFont(const LLFontGL* font) void LLStyle::setFont(const LLFontGL* font)

View File

@ -44,6 +44,7 @@ public:
Optional<LLUIColor> color, Optional<LLUIColor> color,
readonly_color, readonly_color,
selected_color; selected_color;
Optional<F32> alpha;
Optional<const LLFontGL*> font; Optional<const LLFontGL*> font;
Optional<LLUIImage*> image; Optional<LLUIImage*> image;
Optional<std::string> link_href; Optional<std::string> link_href;
@ -65,6 +66,9 @@ public:
const LLUIColor& getSelectedColor() const { return mSelectedColor; } const LLUIColor& getSelectedColor() const { return mSelectedColor; }
void setSelectedColor(const LLUIColor& color) { mSelectedColor = color; } void setSelectedColor(const LLUIColor& color) { mSelectedColor = color; }
F32 getAlpha() const { return mAlpha; }
void setAlpha(F32 alpha) { mAlpha = alpha; }
bool isVisible() const; bool isVisible() const;
void setVisible(bool is_visible); void setVisible(bool is_visible);
@ -93,7 +97,8 @@ public:
&& mFont == rhs.mFont && mFont == rhs.mFont
&& mLink == rhs.mLink && mLink == rhs.mLink
&& mImagep == rhs.mImagep && mImagep == rhs.mImagep
&& mDropShadow == rhs.mDropShadow; && mDropShadow == rhs.mDropShadow
&& mAlpha == rhs.mAlpha;
} }
bool operator!=(const LLStyle& rhs) const { return !(*this == rhs); } bool operator!=(const LLStyle& rhs) const { return !(*this == rhs); }
@ -102,18 +107,19 @@ public:
LLFontGL::ShadowType mDropShadow; LLFontGL::ShadowType mDropShadow;
protected: protected:
~LLStyle() { } ~LLStyle() = default;
private: private:
bool mVisible; std::string mFontName;
std::string mLink;
LLUIColor mColor; LLUIColor mColor;
LLUIColor mReadOnlyColor; LLUIColor mReadOnlyColor;
LLUIColor mSelectedColor; LLUIColor mSelectedColor;
std::string mFontName;
const LLFontGL* mFont; const LLFontGL* mFont;
std::string mLink;
bool mIsLink;
LLPointer<LLUIImage> mImagep; LLPointer<LLUIImage> mImagep;
F32 mAlpha;
bool mVisible;
bool mIsLink;
}; };
typedef LLPointer<LLStyle> LLStyleSP; typedef LLPointer<LLStyle> LLStyleSP;

View File

@ -723,9 +723,8 @@ void LLTextBase::drawCursor()
if (LL_KIM_OVERWRITE == gKeyboard->getInsertMode() && !hasSelection() && text[mCursorPos] != '\n') if (LL_KIM_OVERWRITE == gKeyboard->getInsertMode() && !hasSelection() && text[mCursorPos] != '\n')
{ {
LLColor4 text_color;
const LLFontGL* fontp; const LLFontGL* fontp;
text_color = segmentp->getColor(); const LLColor4& text_color = segmentp->getColor();
fontp = segmentp->getStyle()->getFont(); fontp = segmentp->getStyle()->getFont();
fontp->render(text, mCursorPos, cursor_rect, fontp->render(text, mCursorPos, cursor_rect,
LLColor4(1.f - text_color.mV[VRED], 1.f - text_color.mV[VGREEN], 1.f - text_color.mV[VBLUE], alpha), LLColor4(1.f - text_color.mV[VRED], 1.f - text_color.mV[VGREEN], 1.f - text_color.mV[VBLUE], alpha),
@ -1514,7 +1513,7 @@ void LLTextBase::draw()
{ {
bg_rect.intersectWith(text_rect); bg_rect.intersectWith(text_rect);
} }
LLColor4 bg_color = mReadOnly const LLColor4& bg_color = mReadOnly
? mReadOnlyBgColor.get() ? mReadOnlyBgColor.get()
: hasFocus() : hasFocus()
? mFocusBgColor.get() ? mFocusBgColor.get()
@ -1525,7 +1524,7 @@ void LLTextBase::draw()
// Draw highlighted if needed // Draw highlighted if needed
if( ll::ui::SearchableControl::getHighlighted() ) if( ll::ui::SearchableControl::getHighlighted() )
{ {
LLColor4 bg_color = ll::ui::SearchableControl::getHighlightColor(); const LLColor4& bg_color = ll::ui::SearchableControl::getHighlightColor();
LLRect bg_rect = mVisibleTextRect; LLRect bg_rect = mVisibleTextRect;
if( mScroller ) if( mScroller )
bg_rect.intersectWith( text_rect ); bg_rect.intersectWith( text_rect );
@ -1578,14 +1577,14 @@ void LLTextBase::draw()
//virtual //virtual
void LLTextBase::setColor( const LLColor4& c ) void LLTextBase::setColor( const LLUIColor& c )
{ {
mFgColor = c; mFgColor = c;
mStyleDirty = true; mStyleDirty = true;
} }
//virtual //virtual
void LLTextBase::setReadOnlyColor(const LLColor4 &c) void LLTextBase::setReadOnlyColor(const LLUIColor &c)
{ {
mReadOnlyFgColor = c; mReadOnlyFgColor = c;
mStyleDirty = true; mStyleDirty = true;
@ -2441,8 +2440,8 @@ static LLUIImagePtr image_from_icon_name(const std::string& icon_name)
void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Params& input_params) void LLTextBase::appendTextImpl(const std::string &new_text, const LLStyle::Params& input_params)
{ {
LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; LL_PROFILE_ZONE_SCOPED_CATEGORY_UI;
LLStyle::Params style_params(input_params); LLStyle::Params style_params(getStyleParams());
style_params.fillFrom(getStyleParams()); style_params.overwriteFrom(input_params);
S32 part = (S32)LLTextParser::WHOLE; S32 part = (S32)LLTextParser::WHOLE;
if (mParseHTML && !style_params.is_link) // Don't search for URLs inside a link segment (STORM-358). if (mParseHTML && !style_params.is_link) // Don't search for URLs inside a link segment (STORM-358).
@ -2705,16 +2704,14 @@ void LLTextBase::appendAndHighlightTextImpl(const std::string &new_text, S32 hig
{ {
LLStyle::Params highlight_params(style_params); LLStyle::Params highlight_params(style_params);
LLSD pieces = LLTextParser::instance().parsePartialLineHighlights(new_text, highlight_params.color(), (LLTextParser::EHighlightPosition)highlight_part); auto pieces = LLTextParser::instance().parsePartialLineHighlights(new_text, highlight_params.color, (LLTextParser::EHighlightPosition)highlight_part);
for (S32 i = 0; i < pieces.size(); i++) for (S32 i = 0; i < pieces.size(); i++)
{ {
LLSD color_llsd = pieces[i]["color"]; const auto& piece_pair = pieces[i];
LLColor4 lcolor; highlight_params.color = piece_pair.second;
lcolor.setValue(color_llsd);
highlight_params.color = lcolor;
LLWString wide_text; LLWString wide_text;
wide_text = utf8str_to_wstring(pieces[i]["text"].asString()); wide_text = utf8str_to_wstring(piece_pair.first);
S32 cur_length = getLength(); S32 cur_length = getLength();
LLStyleConstSP sp(new LLStyle(highlight_params)); LLStyleConstSP sp(new LLStyle(highlight_params));
@ -3600,8 +3597,8 @@ F32 LLTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 selection_e
bool LLTextSegment::canEdit() const { return false; } bool LLTextSegment::canEdit() const { return false; }
void LLTextSegment::unlinkFromDocument(LLTextBase*) {} void LLTextSegment::unlinkFromDocument(LLTextBase*) {}
void LLTextSegment::linkToDocument(LLTextBase*) {} void LLTextSegment::linkToDocument(LLTextBase*) {}
const LLColor4& LLTextSegment::getColor() const { return LLColor4::white; } const LLUIColor& LLTextSegment::getColor() const { static const LLUIColor white = LLUIColorTable::instance().getColor("White", LLColor4::white); return white; }
//void LLTextSegment::setColor(const LLColor4 &color) {} //void LLTextSegment::setColor(const LLUIColor &color) {}
LLStyleConstSP LLTextSegment::getStyle() const {static LLStyleConstSP sp(new LLStyle()); return sp; } LLStyleConstSP LLTextSegment::getStyle() const {static LLStyleConstSP sp(new LLStyle()); return sp; }
void LLTextSegment::setStyle(LLStyleConstSP style) {} void LLTextSegment::setStyle(LLStyleConstSP style) {}
void LLTextSegment::setToken( LLKeywordToken* token ) {} void LLTextSegment::setToken( LLKeywordToken* token ) {}
@ -3647,7 +3644,7 @@ LLNormalTextSegment::LLNormalTextSegment( LLStyleConstSP style, S32 start, S32 e
} }
} }
LLNormalTextSegment::LLNormalTextSegment( const LLColor4& color, S32 start, S32 end, LLTextBase& editor, bool is_visible) LLNormalTextSegment::LLNormalTextSegment( const LLUIColor& color, S32 start, S32 end, LLTextBase& editor, bool is_visible)
: LLTextSegment(start, end), : LLTextSegment(start, end),
mToken(NULL), mToken(NULL),
mEditor(editor) mEditor(editor)
@ -3687,7 +3684,7 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele
const LLFontGL* font = mStyle->getFont(); const LLFontGL* font = mStyle->getFont();
LLColor4 color = (mEditor.getReadOnly() ? mStyle->getReadOnlyColor() : mStyle->getColor()) % alpha; LLColor4 color = (mEditor.getReadOnly() ? mStyle->getReadOnlyColor() : mStyle->getColor()) % (alpha * mStyle->getAlpha());
if( selection_start > seg_start ) if( selection_start > seg_start )
{ {
@ -3970,7 +3967,7 @@ LLLabelTextSegment::LLLabelTextSegment( LLStyleConstSP style, S32 start, S32 end
{ {
} }
LLLabelTextSegment::LLLabelTextSegment( const LLColor4& color, S32 start, S32 end, LLTextBase& editor, bool is_visible) LLLabelTextSegment::LLLabelTextSegment( const LLUIColor& color, S32 start, S32 end, LLTextBase& editor, bool is_visible)
: LLNormalTextSegment(color, start, end, editor, is_visible) : LLNormalTextSegment(color, start, end, editor, is_visible)
{ {
} }
@ -3994,7 +3991,7 @@ LLEmojiTextSegment::LLEmojiTextSegment(LLStyleConstSP style, S32 start, S32 end,
{ {
} }
LLEmojiTextSegment::LLEmojiTextSegment(const LLColor4& color, S32 start, S32 end, LLTextBase& editor, bool is_visible) LLEmojiTextSegment::LLEmojiTextSegment(const LLUIColor& color, S32 start, S32 end, LLTextBase& editor, bool is_visible)
: LLNormalTextSegment(color, start, end, editor, is_visible) : LLNormalTextSegment(color, start, end, editor, is_visible)
{ {
} }

View File

@ -84,8 +84,8 @@ public:
virtual void unlinkFromDocument(class LLTextBase* editor); virtual void unlinkFromDocument(class LLTextBase* editor);
virtual void linkToDocument(class LLTextBase* editor); virtual void linkToDocument(class LLTextBase* editor);
virtual const LLColor4& getColor() const; virtual const LLUIColor& getColor() const;
//virtual void setColor(const LLColor4 &color); //virtual void setColor(const LLUIColor &color);
virtual LLStyleConstSP getStyle() const; virtual LLStyleConstSP getStyle() const;
virtual void setStyle(LLStyleConstSP style); virtual void setStyle(LLStyleConstSP style);
virtual void setToken( LLKeywordToken* token ); virtual void setToken( LLKeywordToken* token );
@ -125,7 +125,7 @@ class LLNormalTextSegment : public LLTextSegment
{ {
public: public:
LLNormalTextSegment( LLStyleConstSP style, S32 start, S32 end, LLTextBase& editor ); LLNormalTextSegment( LLStyleConstSP style, S32 start, S32 end, LLTextBase& editor );
LLNormalTextSegment( const LLColor4& color, S32 start, S32 end, LLTextBase& editor, bool is_visible = true); LLNormalTextSegment( const LLUIColor& color, S32 start, S32 end, LLTextBase& editor, bool is_visible = true);
virtual ~LLNormalTextSegment(); virtual ~LLNormalTextSegment();
/*virtual*/ bool getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const; /*virtual*/ bool getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const;
@ -133,7 +133,7 @@ public:
/*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars, S32 line_ind) const; /*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars, S32 line_ind) const;
/*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect); /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect);
/*virtual*/ bool canEdit() const { return true; } /*virtual*/ bool canEdit() const { return true; }
/*virtual*/ const LLColor4& getColor() const { return mStyle->getColor(); } /*virtual*/ const LLUIColor& getColor() const { return mStyle->getColor(); }
/*virtual*/ LLStyleConstSP getStyle() const { return mStyle; } /*virtual*/ LLStyleConstSP getStyle() const { return mStyle; }
/*virtual*/ void setStyle(LLStyleConstSP style) { mStyle = style; } /*virtual*/ void setStyle(LLStyleConstSP style) { mStyle = style; }
/*virtual*/ void setToken( LLKeywordToken* token ) { mToken = token; } /*virtual*/ void setToken( LLKeywordToken* token ) { mToken = token; }
@ -170,7 +170,7 @@ class LLLabelTextSegment : public LLNormalTextSegment
{ {
public: public:
LLLabelTextSegment( LLStyleConstSP style, S32 start, S32 end, LLTextBase& editor ); LLLabelTextSegment( LLStyleConstSP style, S32 start, S32 end, LLTextBase& editor );
LLLabelTextSegment( const LLColor4& color, S32 start, S32 end, LLTextBase& editor, bool is_visible = true); LLLabelTextSegment( const LLUIColor& color, S32 start, S32 end, LLTextBase& editor, bool is_visible = true);
protected: protected:
@ -184,7 +184,7 @@ class LLEmojiTextSegment : public LLNormalTextSegment
{ {
public: public:
LLEmojiTextSegment(LLStyleConstSP style, S32 start, S32 end, LLTextBase& editor); LLEmojiTextSegment(LLStyleConstSP style, S32 start, S32 end, LLTextBase& editor);
LLEmojiTextSegment(const LLColor4& color, S32 start, S32 end, LLTextBase& editor, bool is_visible = true); LLEmojiTextSegment(const LLUIColor& color, S32 start, S32 end, LLTextBase& editor, bool is_visible = true);
bool canEdit() const override { return false; } bool canEdit() const override { return false; }
bool handleToolTip(S32 x, S32 y, MASK mask) override; bool handleToolTip(S32 x, S32 y, MASK mask) override;
@ -399,8 +399,8 @@ public:
// LLUICtrl interface // LLUICtrl interface
/*virtual*/ bool acceptsTextInput() const override { return !mReadOnly; } /*virtual*/ bool acceptsTextInput() const override { return !mReadOnly; }
/*virtual*/ void setColor(const LLColor4& c) override; /*virtual*/ void setColor(const LLUIColor& c) override;
virtual void setReadOnlyColor(const LLColor4 &c); virtual void setReadOnlyColor(const LLUIColor& c);
/*virtual*/ void onVisibilityChange(bool new_visibility) override; /*virtual*/ void onVisibilityChange(bool new_visibility) override;
/*virtual*/ void setValue(const LLSD& value) override; /*virtual*/ void setValue(const LLSD& value) override;

View File

@ -36,6 +36,7 @@
#include "llmath.h" #include "llmath.h"
#include "v4color.h" #include "v4color.h"
#include "lldir.h" #include "lldir.h"
#include "lluicolor.h"
// //
// Member Functions // Member Functions
@ -80,14 +81,14 @@ S32 LLTextParser::findPattern(const std::string &text, LLSD highlight)
return static_cast<S32>(found); return static_cast<S32>(found);
} }
LLSD LLTextParser::parsePartialLineHighlights(const std::string &text, const LLColor4 &color, EHighlightPosition part, S32 index) LLTextParser::parser_out_vec_t LLTextParser::parsePartialLineHighlights(const std::string &text, const LLUIColor& color, EHighlightPosition part, S32 index)
{ {
loadKeywords(); loadKeywords();
//evil recursive string atomizer. //evil recursive string atomizer.
LLSD ret_llsd, start_llsd, middle_llsd, end_llsd; parser_out_vec_t ret_vec, start_vec, middle_vec, end_vec;
for (S32 i=index;i<mHighlights.size();i++) for (S32 i=index, size = (S32)mHighlights.size();i< size;i++)
{ {
S32 condition = mHighlights[i]["condition"]; S32 condition = mHighlights[i]["condition"];
if ((S32)mHighlights[i]["highlight"]==PART && condition!=MATCHES) if ((S32)mHighlights[i]["highlight"]==PART && condition!=MATCHES)
@ -104,72 +105,69 @@ LLSD LLTextParser::parsePartialLineHighlights(const std::string &text, const LLC
EHighlightPosition newpart; EHighlightPosition newpart;
if (start==0) if (start==0)
{ {
start_llsd[0]["text"] =text.substr(0,end); if (start_vec.empty())
start_llsd[0]["color"]=mHighlights[i]["color"]; {
start_vec.push_back(std::make_pair(text.substr(0, end), LLColor4(mHighlights[i]["color"])));
}
else
{
start_vec[0] = std::make_pair(text.substr(0, end), LLColor4(mHighlights[i]["color"]));
}
if (end < len) if (end < len)
{ {
if (part==END || part==WHOLE) newpart=END; else newpart=MIDDLE; if (part==END || part==WHOLE) newpart=END; else newpart=MIDDLE;
end_llsd=parsePartialLineHighlights(text.substr( end ),color,newpart,i); end_vec = parsePartialLineHighlights(text.substr( end ),color,newpart,i);
} }
} }
else else
{ {
if (part==START || part==WHOLE) newpart=START; else newpart=MIDDLE; if (part==START || part==WHOLE) newpart=START; else newpart=MIDDLE;
start_llsd=parsePartialLineHighlights(text.substr(0,start),color,newpart,i+1); start_vec = parsePartialLineHighlights(text.substr(0,start),color,newpart,i+1);
if (end < len) if (end < len)
{ {
middle_llsd[0]["text"] =text.substr(start,end); if (middle_vec.empty())
middle_llsd[0]["color"]=mHighlights[i]["color"]; {
middle_vec.push_back(std::make_pair(text.substr(start, end), LLColor4(mHighlights[i]["color"])));
}
else
{
middle_vec[0] = std::make_pair(text.substr(start, end), LLColor4(mHighlights[i]["color"]));
}
if (part==END || part==WHOLE) newpart=END; else newpart=MIDDLE; if (part==END || part==WHOLE) newpart=END; else newpart=MIDDLE;
end_llsd=parsePartialLineHighlights(text.substr( (start+end) ),color,newpart,i); end_vec = parsePartialLineHighlights(text.substr( (start+end) ),color,newpart,i);
} }
else else
{ {
end_llsd[0]["text"] =text.substr(start,end); if (end_vec.empty())
end_llsd[0]["color"]=mHighlights[i]["color"]; {
end_vec.push_back(std::make_pair(text.substr(start, end), LLColor4(mHighlights[i]["color"])));
}
else
{
end_vec[0] = std::make_pair(text.substr(start, end), LLColor4(mHighlights[i]["color"]));
}
} }
} }
S32 retcount=0; ret_vec.reserve(start_vec.size() + middle_vec.size() + end_vec.size());
ret_vec.insert(ret_vec.end(), start_vec.begin(), start_vec.end());
ret_vec.insert(ret_vec.end(), middle_vec.begin(), middle_vec.end());
ret_vec.insert(ret_vec.end(), end_vec.begin(), end_vec.end());
//FIXME These loops should be wrapped into a subroutine. return ret_vec;
for (LLSD::array_iterator iter = start_llsd.beginArray();
iter != start_llsd.endArray();++iter)
{
LLSD highlight = *iter;
ret_llsd[retcount++]=highlight;
}
for (LLSD::array_iterator iter = middle_llsd.beginArray();
iter != middle_llsd.endArray();++iter)
{
LLSD highlight = *iter;
ret_llsd[retcount++]=highlight;
}
for (LLSD::array_iterator iter = end_llsd.beginArray();
iter != end_llsd.endArray();++iter)
{
LLSD highlight = *iter;
ret_llsd[retcount++]=highlight;
}
return ret_llsd;
} }
} }
} }
} }
//No patterns found. Just send back what was passed in. //No patterns found. Just send back what was passed in.
ret_llsd[0]["text"] =text; ret_vec.push_back(std::make_pair(text, color));
LLSD color_sd = color.getValue(); return ret_vec;
ret_llsd[0]["color"]=color_sd;
return ret_llsd;
} }
bool LLTextParser::parseFullLineHighlights(const std::string &text, LLColor4 *color) bool LLTextParser::parseFullLineHighlights(const std::string &text, LLColor4 *color)

View File

@ -30,6 +30,7 @@
#include "llsd.h" #include "llsd.h"
#include "llsingleton.h" #include "llsingleton.h"
#include "lluicolor.h"
class LLUUID; class LLUUID;
class LLVector3d; class LLVector3d;
@ -45,7 +46,9 @@ public:
typedef enum e_highlight_position { WHOLE, START, MIDDLE, END } EHighlightPosition; typedef enum e_highlight_position { WHOLE, START, MIDDLE, END } EHighlightPosition;
typedef enum e_dialog_action { ACTION_NONE, ACTION_CLOSE, ACTION_ADD, ACTION_COPY, ACTION_UPDATE } EDialogAction; typedef enum e_dialog_action { ACTION_NONE, ACTION_CLOSE, ACTION_ADD, ACTION_COPY, ACTION_UPDATE } EDialogAction;
LLSD parsePartialLineHighlights(const std::string &text,const LLColor4 &color, EHighlightPosition part=WHOLE, S32 index=0); using parser_out_vec_t = std::vector<std::pair<std::string, LLUIColor>>;
parser_out_vec_t parsePartialLineHighlights(const std::string &text,const LLUIColor &color, EHighlightPosition part=WHOLE, S32 index=0);
bool parseFullLineHighlights(const std::string &text, LLColor4 *color); bool parseFullLineHighlights(const std::string &text, LLColor4 *color);
private: private:

View File

@ -198,7 +198,61 @@ LLUIColor LLUIColorTable::getColor(std::string_view name, const LLColor4& defaul
// update user color, loaded colors are parsed on initialization // update user color, loaded colors are parsed on initialization
void LLUIColorTable::setColor(std::string_view name, const LLColor4& color) void LLUIColorTable::setColor(std::string_view name, const LLColor4& color)
{ {
setColor(name, color, mUserSetColors); auto it = mUserSetColors.lower_bound(name);
if(it != mUserSetColors.end() && !(mUserSetColors.key_comp()(name, it->first)))
{
it->second = color;
}
else
{
string_color_map_t::iterator base_iter = mLoadedColors.find(name);
if (base_iter != mLoadedColors.end())
{
LLColor4 original_color = base_iter->second.get();
auto color_handle = mLoadedColors.extract(base_iter);
auto new_color_pair = mUserSetColors.insert(std::move(color_handle));
new_color_pair.position->second = color;
mLoadedColors.emplace(name, LLUIColor(original_color));
}
else
{
mUserSetColors.insert(it, std::make_pair(name, color));
}
}
}
bool LLUIColorTable::isDefault(std::string_view name) const
{
string_color_map_t::const_iterator base_iter = mLoadedColors.find(name);
string_color_map_t::const_iterator user_iter = mUserSetColors.find(name);
if (base_iter != mLoadedColors.end())
{
if(user_iter != mUserSetColors.end())
return user_iter->second == base_iter->second;
return true;
}
else if (user_iter != mUserSetColors.end()) // user only color ???
{
return true;
}
return false;
}
void LLUIColorTable::resetToDefault(std::string_view name)
{
string_color_map_t::iterator iter = mUserSetColors.find(name);
if (iter != mUserSetColors.end())
{
auto default_iter = mLoadedColors.find(name);
if (default_iter != mLoadedColors.end())
{
iter->second = default_iter->second.get();
}
}
} }
bool LLUIColorTable::loadFromSettings() bool LLUIColorTable::loadFromSettings()
@ -223,18 +277,16 @@ void LLUIColorTable::saveUserSettings() const
{ {
Params params; Params params;
for(string_color_map_t::const_iterator it = mUserSetColors.begin(); for (const auto& color_pair : mUserSetColors)
it != mUserSetColors.end();
++it)
{ {
// Compare user color value with the default value, skip if equal // Compare user color value with the default value, skip if equal
string_color_map_t::const_iterator itd = mLoadedColors.find(it->first); string_color_map_t::const_iterator itd = mLoadedColors.find(color_pair.first);
if(itd != mLoadedColors.end() && itd->second == it->second) if(itd != mLoadedColors.end() && itd->second == color_pair.second)
continue; continue;
ColorEntryParams color_entry; ColorEntryParams color_entry;
color_entry.name = it->first; color_entry.name = color_pair.first;
color_entry.color.value = it->second; color_entry.color.value = color_pair.second;
params.color_entries.add(color_entry); params.color_entries.add(color_entry);
} }

View File

@ -83,6 +83,10 @@ public:
// returns true if color_name exists in the table // returns true if color_name exists in the table
bool colorExists(std::string_view color_name) const; bool colorExists(std::string_view color_name) const;
bool isDefault(std::string_view color_name) const;
void resetToDefault(std::string_view color_name);
// loads colors from settings files // loads colors from settings files
bool loadFromSettings(); bool loadFromSettings();
@ -90,6 +94,9 @@ public:
void saveUserSettings() const; void saveUserSettings() const;
void saveUserSettingsPaletteOnly() const; // AO, saves the user pallete, excluding skips skin-related files void saveUserSettingsPaletteOnly() const; // AO, saves the user pallete, excluding skips skin-related files
const auto& getLoadedColors() { return mLoadedColors; }
const auto& getUserColors() { return mUserSetColors; }
private: private:
bool loadFromFilename(const std::string& filename, string_color_map_t& table); bool loadFromFilename(const std::string& filename, string_color_map_t& table);

View File

@ -1053,7 +1053,7 @@ bool LLUICtrl::getTentative() const
} }
// virtual // virtual
void LLUICtrl::setColor(const LLColor4& color) void LLUICtrl::setColor(const LLUIColor& color)
{ } { }
F32 LLUICtrl::getCurrentTransparency() F32 LLUICtrl::getCurrentTransparency()

View File

@ -230,7 +230,7 @@ public:
// selected radio button, etc.). Defaults to no-op. // selected radio button, etc.). Defaults to no-op.
virtual void clear(); virtual void clear();
virtual void setColor(const LLColor4& color); virtual void setColor(const LLUIColor& color);
// Ansariel: Changed to virtual. We might want to change the transparency ourself! // Ansariel: Changed to virtual. We might want to change the transparency ourself!
virtual F32 getCurrentTransparency(); virtual F32 getCurrentTransparency();

View File

@ -73,14 +73,14 @@ LLViewBorder::LLViewBorder(const LLViewBorder::Params& p)
mStyle(p.render_style) mStyle(p.render_style)
{} {}
void LLViewBorder::setColors( const LLColor4& shadow_dark, const LLColor4& highlight_light ) void LLViewBorder::setColors( const LLUIColor& shadow_dark, const LLUIColor& highlight_light )
{ {
mShadowDark = shadow_dark; mShadowDark = shadow_dark;
mHighlightLight = highlight_light; mHighlightLight = highlight_light;
} }
void LLViewBorder::setColorsExtended( const LLColor4& shadow_light, const LLColor4& shadow_dark, void LLViewBorder::setColorsExtended( const LLUIColor& shadow_light, const LLUIColor& shadow_dark,
const LLColor4& highlight_light, const LLColor4& highlight_dark ) const LLUIColor& highlight_light, const LLUIColor& highlight_dark )
{ {
mShadowDark = shadow_dark; mShadowDark = shadow_dark;
mShadowLight = shadow_light; mShadowLight = shadow_light;

View File

@ -77,9 +77,9 @@ public:
S32 getBorderWidth() const { return mBorderWidth; } S32 getBorderWidth() const { return mBorderWidth; }
void setBevel(EBevel bevel) { mBevel = bevel; } void setBevel(EBevel bevel) { mBevel = bevel; }
EBevel getBevel() const { return mBevel; } EBevel getBevel() const { return mBevel; }
void setColors( const LLColor4& shadow_dark, const LLColor4& highlight_light ); void setColors( const LLUIColor& shadow_dark, const LLUIColor& highlight_light );
void setColorsExtended( const LLColor4& shadow_light, const LLColor4& shadow_dark, void setColorsExtended( const LLUIColor& shadow_light, const LLUIColor& shadow_dark,
const LLColor4& highlight_light, const LLColor4& highlight_dark ); const LLUIColor& highlight_light, const LLUIColor& highlight_dark );
void setTexture( const class LLUUID &image_id ); void setTexture( const class LLUUID &image_id );
LLColor4 getHighlightLight() {return mHighlightLight.get();} LLColor4 getHighlightLight() {return mHighlightLight.get();}

View File

@ -402,6 +402,7 @@ set(viewer_SOURCE_FILES
llfloatersearch.cpp llfloatersearch.cpp
llfloatersearchreplace.cpp llfloatersearchreplace.cpp
llfloatersellland.cpp llfloatersellland.cpp
llfloatersettingscolor.cpp
llfloatersettingsdebug.cpp llfloatersettingsdebug.cpp
llfloatersidepanelcontainer.cpp llfloatersidepanelcontainer.cpp
llfloatersnapshot.cpp llfloatersnapshot.cpp
@ -1212,6 +1213,7 @@ set(viewer_HEADER_FILES
llfloatersearch.h llfloatersearch.h
llfloatersearchreplace.h llfloatersearchreplace.h
llfloatersellland.h llfloatersellland.h
llfloatersettingscolor.h
llfloatersettingsdebug.h llfloatersettingsdebug.h
llfloatersidepanelcontainer.h llfloatersidepanelcontainer.h
llfloatersnapshot.h llfloatersnapshot.h

View File

@ -21619,6 +21619,17 @@ Change of this parameter will affect the layout of buttons in notification toast
<string>U32</string> <string>U32</string>
<key>Value</key> <key>Value</key>
<integer>0</integer> <integer>0</integer>
</map>
<key>ColorSettingsHideDefault</key>
<map>
<key>Comment</key>
<string>Show non-default settings only in Color Settings list</string>
<key>Persist</key>
<integer>0</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map> </map>
<key>UpdateAppWindowTitleBar</key> <key>UpdateAppWindowTitleBar</key>
<map> <map>

View File

@ -775,7 +775,7 @@ public:
mNeedsTimeBox = false; mNeedsTimeBox = false;
mUserNameTextBox->setValue(mFrom); mUserNameTextBox->setValue(mFrom);
updateMinUserNameWidth(); updateMinUserNameWidth();
LLColor4 sep_color = LLUIColorTable::instance().getColor("ChatTeleportSeparatorColor"); LLUIColor sep_color = LLUIColorTable::instance().getColor("ChatTeleportSeparatorColor");
setTransparentColor(sep_color); setTransparentColor(sep_color);
mTimeBoxTextBox->setVisible(false); mTimeBoxTextBox->setVisible(false);
} }
@ -1195,7 +1195,7 @@ private:
!av_name.isDisplayNameDefault()) !av_name.isDisplayNameDefault())
{ {
LLStyle::Params style_params_name; LLStyle::Params style_params_name;
LLColor4 userNameColor = LLUIColorTable::instance().getColor("EmphasisColor"); LLUIColor userNameColor = LLUIColorTable::instance().getColor("EmphasisColor");
style_params_name.color(userNameColor); style_params_name.color(userNameColor);
style_params_name.font.name("SansSerifSmall"); style_params_name.font.name("SansSerifSmall");
style_params_name.font.style(mNameStyleParams.font.style); style_params_name.font.style(mNameStyleParams.font.style);
@ -1435,9 +1435,10 @@ void FSChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
} }
} }
LLColor4 txt_color = LLUIColorTable::instance().getColor("White"); F32 alpha = 1.f;
LLColor4 name_color = LLUIColorTable::instance().getColor("ChatNameColor"); LLUIColor txt_color = LLUIColorTable::instance().getColor("White");
LLViewerChat::getChatColor(chat, txt_color, LLSD().with("is_local", is_local)); LLUIColor name_color = LLUIColorTable::instance().getColor("ChatNameColor");
LLViewerChat::getChatColor(chat, txt_color, alpha, LLSD().with("is_local", is_local));
LLFontGL* fontp = LLViewerChat::getChatFont(); LLFontGL* fontp = LLViewerChat::getChatFont();
std::string font_name = LLFontGL::nameFromFont(fontp); std::string font_name = LLFontGL::nameFromFont(fontp);
std::string font_size = LLFontGL::sizeFromFont(fontp); std::string font_size = LLFontGL::sizeFromFont(fontp);
@ -1445,6 +1446,7 @@ void FSChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
LLStyle::Params body_message_params; LLStyle::Params body_message_params;
body_message_params.color(txt_color); body_message_params.color(txt_color);
body_message_params.readonly_color(txt_color); body_message_params.readonly_color(txt_color);
body_message_params.alpha(alpha);
body_message_params.font.name(font_name); body_message_params.font.name(font_name);
body_message_params.font.size(font_size); body_message_params.font.size(font_size);
body_message_params.font.style(input_append_params.font.style); body_message_params.font.style(input_append_params.font.style);
@ -1585,7 +1587,7 @@ void FSChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
// out of the timestamp // out of the timestamp
if (args["show_time"].asBoolean() && !teleport_separator) if (args["show_time"].asBoolean() && !teleport_separator)
{ {
LLColor4 timestamp_color = LLUIColorTable::instance().getColor("ChatTimestampColor"); LLUIColor timestamp_color = LLUIColorTable::instance().getColor("ChatTimestampColor");
timestamp_style.color(timestamp_color); timestamp_style.color(timestamp_color);
timestamp_style.readonly_color(timestamp_color); timestamp_style.readonly_color(timestamp_color);
if (message_from_log && !is_conversation_log) if (message_from_log && !is_conversation_log)
@ -1634,7 +1636,7 @@ void FSChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
// (don't let object names with hyperlinks override our objectim Url) // (don't let object names with hyperlinks override our objectim Url)
LLStyle::Params link_params(body_message_params); LLStyle::Params link_params(body_message_params);
link_params.color.control = "ChatNameObjectColor"; link_params.color.control = "ChatNameObjectColor";
LLColor4 link_color = LLUIColorTable::instance().getColor("ChatNameObjectColor"); LLUIColor link_color = LLUIColorTable::instance().getColor("ChatNameObjectColor");
link_params.color = link_color; link_params.color = link_color;
link_params.readonly_color = link_color; link_params.readonly_color = link_color;
if (message_from_log && !is_conversation_log) if (message_from_log && !is_conversation_log)

View File

@ -91,9 +91,10 @@ bool FSConsoleUtils::ProcessChatMessage(const LLChat& chat_msg, const LLSD &args
std::string message = irc_me ? chat_msg.mText.substr(3) : chat_msg.mText; std::string message = irc_me ? chat_msg.mText.substr(3) : chat_msg.mText;
console_chat = sender_name + delimiter + message; console_chat = sender_name + delimiter + message;
LLColor4 chatcolor; F32 alpha = 1.f;
LLViewerChat::getChatColor(chat_msg, chatcolor); LLUIColor chatcolor;
gConsole->addConsoleLine(console_chat, chatcolor); LLViewerChat::getChatColor(chat_msg, chatcolor, alpha);
gConsole->addConsoleLine(console_chat, chatcolor % alpha);
} }
else else
{ {
@ -113,9 +114,10 @@ bool FSConsoleUtils::ProcessChatMessage(const LLChat& chat_msg, const LLSD &args
} }
// FS:LO FIRE-1439 - Clickable avatar names on local chat radar crossing reports // FS:LO FIRE-1439 - Clickable avatar names on local chat radar crossing reports
LLColor4 chatcolor; F32 alpha = 1.f;
LLViewerChat::getChatColor(chat_msg, chatcolor); LLUIColor chatcolor;
gConsole->addConsoleLine(console_chat, chatcolor); LLViewerChat::getChatColor(chat_msg, chatcolor, alpha);
gConsole->addConsoleLine(console_chat, chatcolor % alpha);
} }
return true; return true;
@ -157,9 +159,10 @@ void FSConsoleUtils::onProcessChatAvatarNameLookup(const LLUUID& agent_id, const
} }
console_chat = sender_name + delimiter + message; console_chat = sender_name + delimiter + message;
LLColor4 chatcolor; F32 alpha = 1.f;
LLViewerChat::getChatColor(chat_msg, chatcolor); LLUIColor chatcolor;
gConsole->addConsoleLine(console_chat, chatcolor); LLViewerChat::getChatColor(chat_msg, chatcolor, alpha);
gConsole->addConsoleLine(console_chat, chatcolor % alpha);
} }
//static //static
@ -238,8 +241,9 @@ void FSConsoleUtils::onProccessInstantMessageNameLookup(const LLUUID& agent_id,
chat.mText = message_str; chat.mText = message_str;
chat.mSourceType = CHAT_SOURCE_AGENT; chat.mSourceType = CHAT_SOURCE_AGENT;
chat.mChatType = is_group ? CHAT_TYPE_IM_GROUP : CHAT_TYPE_IM; chat.mChatType = is_group ? CHAT_TYPE_IM_GROUP : CHAT_TYPE_IM;
LLColor4 textcolor; F32 alpha = 1.f;
LLViewerChat::getChatColor(chat, textcolor, LLSD().with("is_local", false).with("for_console", true)); LLUIColor textcolor;
LLViewerChat::getChatColor(chat, textcolor, alpha, LLSD().with("is_local", false).with("for_console", true));
gConsole->addConsoleLine("IM: " + sender_name + delimiter + message, textcolor, session_id); gConsole->addConsoleLine("IM: " + sender_name + delimiter + message, textcolor % alpha, session_id);
} }

View File

@ -717,7 +717,7 @@ public:
mNeedsTimeBox = false; mNeedsTimeBox = false;
user_name->setValue(mFrom); user_name->setValue(mFrom);
updateMinUserNameWidth(); updateMinUserNameWidth();
LLColor4 sep_color = LLUIColorTable::instance().getColor("ChatTeleportSeparatorColor"); LLUIColor sep_color = LLUIColorTable::instance().getColor("ChatTeleportSeparatorColor");
setTransparentColor(sep_color); setTransparentColor(sep_color);
mTimeBoxTextBox->setVisible(false); mTimeBoxTextBox->setVisible(false);
} }
@ -779,7 +779,7 @@ public:
std::string username = chat.mFromName.substr(username_start + 2); std::string username = chat.mFromName.substr(username_start + 2);
username = username.substr(0, username.length() - 1); username = username.substr(0, username.length() - 1);
LLStyle::Params style_params_name; LLStyle::Params style_params_name;
LLColor4 userNameColor = LLUIColorTable::instance().getColor("EmphasisColor"); LLUIColor userNameColor = LLUIColorTable::instance().getColor("EmphasisColor");
style_params_name.color(userNameColor); style_params_name.color(userNameColor);
style_params_name.font.name("SansSerifSmall"); style_params_name.font.name("SansSerifSmall");
style_params_name.font.style("NORMAL"); style_params_name.font.style("NORMAL");
@ -1093,7 +1093,7 @@ private:
!av_name.isDisplayNameDefault()) !av_name.isDisplayNameDefault())
{ {
LLStyle::Params style_params_name; LLStyle::Params style_params_name;
LLColor4 userNameColor = LLUIColorTable::instance().getColor("EmphasisColor"); LLUIColor userNameColor = LLUIColorTable::instance().getColor("EmphasisColor");
style_params_name.color(userNameColor); style_params_name.color(userNameColor);
style_params_name.font.name("SansSerifSmall"); style_params_name.font.name("SansSerifSmall");
style_params_name.font.style("NORMAL"); style_params_name.font.style("NORMAL");
@ -1299,10 +1299,11 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
mMoreChatPanel->reshape(mMoreChatPanel->getRect().getWidth(), height); mMoreChatPanel->reshape(mMoreChatPanel->getRect().getWidth(), height);
} }
LLColor4 txt_color = LLUIColorTable::instance().getColor("White"); F32 alpha = 1.f;
LLColor4 name_color(txt_color); LLUIColor txt_color = LLUIColorTable::instance().getColor("White");
LLUIColor name_color(txt_color);
LLViewerChat::getChatColor(chat, txt_color, alpha);
LLViewerChat::getChatColor(chat,txt_color);
LLFontGL* fontp = LLViewerChat::getChatFont(); LLFontGL* fontp = LLViewerChat::getChatFont();
std::string font_name = LLFontGL::nameFromFont(fontp); std::string font_name = LLFontGL::nameFromFont(fontp);
std::string font_size = LLFontGL::sizeFromFont(fontp); std::string font_size = LLFontGL::sizeFromFont(fontp);
@ -1310,6 +1311,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
LLStyle::Params body_message_params; LLStyle::Params body_message_params;
body_message_params.color(txt_color); body_message_params.color(txt_color);
body_message_params.readonly_color(txt_color); body_message_params.readonly_color(txt_color);
body_message_params.alpha(alpha);
body_message_params.font.name(font_name); body_message_params.font.name(font_name);
body_message_params.font.size(font_size); body_message_params.font.size(font_size);
body_message_params.font.style(input_append_params.font.style); body_message_params.font.style(input_append_params.font.style);
@ -1377,7 +1379,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
{ {
if (!message_from_log) if (!message_from_log)
{ {
LLColor4 timestamp_color = LLUIColorTable::instance().getColor("ChatTimestampColor"); LLUIColor timestamp_color = LLUIColorTable::instance().getColor("ChatTimestampColor");
timestamp_style.color(timestamp_color); timestamp_style.color(timestamp_color);
timestamp_style.readonly_color(timestamp_color); timestamp_style.readonly_color(timestamp_color);
} }
@ -1414,7 +1416,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
// set the link for the object name to be the objectim SLapp // set the link for the object name to be the objectim SLapp
// (don't let object names with hyperlinks override our objectim Url) // (don't let object names with hyperlinks override our objectim Url)
LLStyle::Params link_params(body_message_params); LLStyle::Params link_params(body_message_params);
LLColor4 link_color = LLUIColorTable::instance().getColor("HTMLLinkColor"); LLUIColor link_color = LLUIColorTable::instance().getColor("HTMLLinkColor");
link_params.color = link_color; link_params.color = link_color;
link_params.readonly_color = link_color; link_params.readonly_color = link_color;
link_params.is_link = true; link_params.is_link = true;

View File

@ -142,8 +142,8 @@ void LLFloaterIMNearbyChatToastPanel::addMessage(LLSD& notification)
std::string color_name = notification["text_color"].asString(); std::string color_name = notification["text_color"].asString();
LLColor4 textColor = LLUIColorTable::instance().getColor(color_name); LLUIColor textColor = LLUIColorTable::instance().getColor(color_name);
textColor.mV[VALPHA] = (F32)notification["color_alpha"].asReal(); F32 textAlpha = (F32)notification["color_alpha"].asReal();
S32 font_size = notification["font_size"].asInteger(); S32 font_size = notification["font_size"].asInteger();
@ -161,6 +161,7 @@ void LLFloaterIMNearbyChatToastPanel::addMessage(LLSD& notification)
{ {
LLStyle::Params style_params; LLStyle::Params style_params;
style_params.color(textColor); style_params.color(textColor);
style_params.alpha(textAlpha);
std::string font_name = LLFontGL::nameFromFont(messageFont); std::string font_name = LLFontGL::nameFromFont(messageFont);
std::string font_style_size = LLFontGL::sizeFromFont(messageFont); std::string font_style_size = LLFontGL::sizeFromFont(messageFont);
style_params.font.name(font_name); style_params.font.name(font_name);
@ -205,8 +206,8 @@ void LLFloaterIMNearbyChatToastPanel::init(LLSD& notification)
std::string color_name = notification["text_color"].asString(); std::string color_name = notification["text_color"].asString();
LLColor4 textColor = LLUIColorTable::instance().getColor(color_name); LLUIColor textColor = LLUIColorTable::instance().getColor(color_name);
textColor.mV[VALPHA] = (F32)notification["color_alpha"].asReal(); F32 textAlpha = (F32)notification["color_alpha"].asReal();
S32 font_size = notification["font_size"].asInteger(); S32 font_size = notification["font_size"].asInteger();
@ -238,14 +239,9 @@ void LLFloaterIMNearbyChatToastPanel::init(LLSD& notification)
if (mSourceType == CHAT_SOURCE_AGENT || mSourceType == CHAT_SOURCE_OBJECT) if (mSourceType == CHAT_SOURCE_AGENT || mSourceType == CHAT_SOURCE_OBJECT)
{ {
LLStyle::Params style_params_name; LLStyle::Params style_params_name;
style_params_name.color = LLUIColorTable::instance().getColor("HTMLLinkColor");
LLColor4 user_name_color = LLUIColorTable::instance().getColor("HTMLLinkColor"); style_params_name.font.name = LLFontGL::nameFromFont(messageFont);
style_params_name.color(user_name_color); style_params_name.font.size = LLFontGL::sizeFromFont(messageFont);
std::string font_name = LLFontGL::nameFromFont(messageFont);
std::string font_style_size = LLFontGL::sizeFromFont(messageFont);
style_params_name.font.name(font_name);
style_params_name.font.size(font_style_size);
// style_params_name.link_href = notification["sender_slurl"].asString(); // style_params_name.link_href = notification["sender_slurl"].asString();
// style_params_name.is_link = true; // style_params_name.is_link = true;
@ -297,6 +293,7 @@ void LLFloaterIMNearbyChatToastPanel::init(LLSD& notification)
{ {
LLStyle::Params style_params; LLStyle::Params style_params;
style_params.color(textColor); style_params.color(textColor);
style_params.alpha(textAlpha);
std::string font_name = LLFontGL::nameFromFont(messageFont); std::string font_name = LLFontGL::nameFromFont(messageFont);
std::string font_style_size = LLFontGL::sizeFromFont(messageFont); std::string font_style_size = LLFontGL::sizeFromFont(messageFont);
style_params.font.name(font_name); style_params.font.name(font_name);

View File

@ -681,7 +681,7 @@ public:
Optional<bool> show_speaker; Optional<bool> show_speaker;
Optional<LLColor4> avatar_icon_color; Optional<LLUIColor> avatar_icon_color;
Params(); Params();
}; };

View File

@ -654,6 +654,7 @@ void LLConversationViewParticipant::draw()
static LLUIColor sFlashBgColor = LLUIColorTable::instance().getColor("MenuItemFlashBgColor", DEFAULT_WHITE); static LLUIColor sFlashBgColor = LLUIColorTable::instance().getColor("MenuItemFlashBgColor", DEFAULT_WHITE);
static LLUIColor sFocusOutlineColor = LLUIColorTable::instance().getColor("InventoryFocusOutlineColor", DEFAULT_WHITE); static LLUIColor sFocusOutlineColor = LLUIColorTable::instance().getColor("InventoryFocusOutlineColor", DEFAULT_WHITE);
static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("InventoryMouseOverColor", DEFAULT_WHITE); static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("InventoryMouseOverColor", DEFAULT_WHITE);
static LLUIColor sFriendColor = LLUIColorTable::instance().getColor("ConversationFriendColor");
const bool show_context = (getRoot() ? getRoot()->getShowSelectionContext() : false); const bool show_context = (getRoot() ? getRoot()->getShowSelectionContext() : false);
@ -663,23 +664,23 @@ void LLConversationViewParticipant::draw()
F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad; F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad;
F32 text_left = (F32)getLabelXPos(); F32 text_left = (F32)getLabelXPos();
LLColor4 color; LLUIColor* color;
LLLocalSpeakerMgr *speakerMgr = LLLocalSpeakerMgr::getInstance(); LLLocalSpeakerMgr *speakerMgr = LLLocalSpeakerMgr::getInstance();
if (speakerMgr && speakerMgr->isSpeakerToBeRemoved(mUUID)) if (speakerMgr && speakerMgr->isSpeakerToBeRemoved(mUUID))
{ {
color = sFgDisabledColor; color = &sFgDisabledColor;
} }
else else
{ {
if (LLAvatarActions::isFriend(mUUID)) if (LLAvatarActions::isFriend(mUUID))
{ {
color = LLUIColorTable::instance().getColor("ConversationFriendColor"); color = &sFriendColor;
} }
else else
{ {
color = mIsSelected ? sHighlightFgColor : sFgColor; color = mIsSelected ? &sHighlightFgColor : &sFgColor;
} }
} }
@ -690,7 +691,7 @@ void LLConversationViewParticipant::draw()
} }
drawHighlight(show_context, mIsSelected, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor); drawHighlight(show_context, mIsSelected, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor);
drawLabel(font, text_left, y, color, right_x); drawLabel(font, text_left, y, color->get(), right_x);
LLView::draw(); LLView::draw();
} }

View File

@ -113,12 +113,6 @@ LLFloaterColorPicker::LLFloaterColorPicker (LLColorSwatchCtrl* swatch, bool show
// create user interface for this picker // create user interface for this picker
createUI (); createUI ();
if (!mCanApplyImmediately)
{
mApplyImmediateCheck->setEnabled(false);
mApplyImmediateCheck->set(false);
}
} }
LLFloaterColorPicker::~LLFloaterColorPicker() LLFloaterColorPicker::~LLFloaterColorPicker()
@ -229,6 +223,12 @@ bool LLFloaterColorPicker::postBuild()
mApplyImmediateCheck->set(gSavedSettings.getBOOL("ApplyColorImmediately")); mApplyImmediateCheck->set(gSavedSettings.getBOOL("ApplyColorImmediately"));
mApplyImmediateCheck->setCommitCallback(onImmediateCheck, this); mApplyImmediateCheck->setCommitCallback(onImmediateCheck, this);
if (!mCanApplyImmediately)
{
mApplyImmediateCheck->setEnabled(false);
mApplyImmediateCheck->set(false);
}
childSetCommitCallback("rspin", onTextCommit, (void*)this ); childSetCommitCallback("rspin", onTextCommit, (void*)this );
childSetCommitCallback("gspin", onTextCommit, (void*)this ); childSetCommitCallback("gspin", onTextCommit, (void*)this );
childSetCommitCallback("bspin", onTextCommit, (void*)this ); childSetCommitCallback("bspin", onTextCommit, (void*)this );

View File

@ -210,8 +210,7 @@ public:
F32 centerY = 0.5f * clientHeight; F32 centerY = 0.5f * clientHeight;
drawIcon(centerX, centerY - 1, iconWidth); drawIcon(centerX, centerY - 1, iconWidth);
static LLColor4 defaultColor(0.75f, 0.75f, 0.75f, 1.0f); static LLUIColor textColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", LLColor4(0.75f, 0.75f, 0.75f, 1.0f));
static LLUIColor textColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", defaultColor);
S32 max_pixels = clientWidth - iconWidth; S32 max_pixels = clientWidth - iconWidth;
drawName((F32)iconWidth, centerY, max_pixels, textColor.get()); drawName((F32)iconWidth, centerY, max_pixels, textColor.get());
} }
@ -718,8 +717,7 @@ void LLFloaterEmojiPicker::fillEmojis(bool fromResize)
LLPanel::Params icon_params; LLPanel::Params icon_params;
LLRect icon_rect(0, icon_size, icon_size, 0); LLRect icon_rect(0, icon_size, icon_size, 0);
static LLColor4 default_color(0.75f, 0.75f, 0.75f, 1.0f); static LLUIColor bg_color = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", LLColor4(0.75f, 0.75f, 0.75f, 1.0f));
LLColor4 bg_color = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", default_color);
if (!mSelectedGroupIndex) if (!mSelectedGroupIndex)
{ {

View File

@ -642,15 +642,14 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg,
// <FS:Ansariel> Script debug icon // <FS:Ansariel> Script debug icon
//if (gSavedSettings.getS32("ShowScriptErrorsLocation") == 1)// show error in window //("ScriptErrorsAsChat")) //if (gSavedSettings.getS32("ShowScriptErrorsLocation") == 1)// show error in window //("ScriptErrorsAsChat"))
{ {
// <FS:Kadah> [FSllOwnerSayToScriptDebugWindow] // <FS:Kadah> [FSllOwnerSayToScriptDebugWindow]
// LLColor4 txt_color; //LLUIColor txt_color;
//F32 alpha = 1.f;
// LLViewerChat::getChatColor(chat_msg,txt_color); //LLViewerChat::getChatColor(chat_msg, txt_color, alpha);
// LLFloaterScriptDebug::addScriptLine(chat_msg.mText, // LLFloaterScriptDebug::addScriptLine(chat_msg.mText,
// chat_msg.mFromName, // chat_msg.mFromName,
// txt_color, // txt_color % alpha,
// chat_msg.mFromID); // chat_msg.mFromID);
LLFloaterScriptDebug::addScriptLine(chat_msg); LLFloaterScriptDebug::addScriptLine(chat_msg);
// <FS:Ansariel> Script debug icon // <FS:Ansariel> Script debug icon

View File

@ -64,8 +64,6 @@ bool LLFloaterScriptEdPrefs::postBuild()
void LLFloaterScriptEdPrefs::applyUIColor(LLUICtrl* ctrl, const LLSD& param) void LLFloaterScriptEdPrefs::applyUIColor(LLUICtrl* ctrl, const LLSD& param)
{ {
LLUIColorTable::instance().setColor(param.asString(), LLColor4(ctrl->getValue())); LLUIColorTable::instance().setColor(param.asString(), LLColor4(ctrl->getValue()));
mEditor->initKeywords();
mEditor->loadKeywords();
// <FS:Ansariel> FIRE-16740: Color syntax highlighting changes don't immediately appear in script window // <FS:Ansariel> FIRE-16740: Color syntax highlighting changes don't immediately appear in script window
// This will return both LLPreviewLSL as well as LLLiveLSLEditor instances because they are grouped into "preview_script"! // This will return both LLPreviewLSL as well as LLLiveLSLEditor instances because they are grouped into "preview_script"!

View File

@ -0,0 +1,334 @@
/**
* @file llfloatersettingscolor.cpp
* @brief Implementation of LLFloaterSettingsColor
* @author Rye Cogtail<rye@alchemyviewer.org>
*
* $LicenseInfo:firstyear=2024&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2024, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#include "llviewerprecompiledheaders.h"
#include "llfloatersettingscolor.h"
#include "llfloater.h"
#include "llfiltereditor.h"
#include "lluictrlfactory.h"
#include "llcombobox.h"
#include "llspinctrl.h"
#include "llcolorswatch.h"
#include "llviewercontrol.h"
#include "lltexteditor.h"
LLFloaterSettingsColor::LLFloaterSettingsColor(const LLSD& key)
: LLFloater(key),
mSettingList(NULL)
{
mCommitCallbackRegistrar.add("CommitSettings", boost::bind(&LLFloaterSettingsColor::onCommitSettings, this));
mCommitCallbackRegistrar.add("ClickDefault", boost::bind(&LLFloaterSettingsColor::onClickDefault, this));
}
LLFloaterSettingsColor::~LLFloaterSettingsColor()
{}
bool LLFloaterSettingsColor::postBuild()
{
enableResizeCtrls(true, false, true);
mAlphaSpinner = getChild<LLSpinCtrl>("alpha_spinner");
mColorSwatch = getChild<LLColorSwatchCtrl>("color_swatch");
mDefaultButton = getChild<LLUICtrl>("default_btn");
mSettingNameText = getChild<LLTextBox>("color_name_txt");
getChild<LLFilterEditor>("filter_input")->setCommitCallback(boost::bind(&LLFloaterSettingsColor::setSearchFilter, this, _2));
mSettingList = getChild<LLScrollListCtrl>("setting_list");
mSettingList->setCommitOnSelectionChange(true);
mSettingList->setCommitCallback(boost::bind(&LLFloaterSettingsColor::onSettingSelect, this));
updateList();
gSavedSettings.getControl("ColorSettingsHideDefault")->getCommitSignal()->connect(boost::bind(&LLFloaterSettingsColor::updateList, this, false));
return LLFloater::postBuild();
}
void LLFloaterSettingsColor::draw()
{
LLScrollListItem* first_selected = mSettingList->getFirstSelected();
if (first_selected)
{
if(auto cell = first_selected->getColumn(1))
{
updateControl(cell->getValue().asString());
}
}
LLFloater::draw();
}
void LLFloaterSettingsColor::onCommitSettings()
{
LLScrollListItem* first_selected = mSettingList->getFirstSelected();
if (!first_selected)
{
return;
}
auto cell = first_selected->getColumn(1);
if (!cell)
{
return;
}
auto color_name = cell->getValue().asString();
if (color_name.empty())
{
return;
}
LLColor4 col4;
LLColor3 col3;
col3.setValue(mColorSwatch->getValue());
col4 = LLColor4(col3, (F32)mAlphaSpinner->getValue().asReal());
LLUIColorTable::instance().setColor(color_name, col4);
updateDefaultColumn(color_name);
}
// static
void LLFloaterSettingsColor::onClickDefault()
{
LLScrollListItem* first_selected = mSettingList->getFirstSelected();
if (first_selected)
{
auto cell = first_selected->getColumn(1);
if (cell)
{
auto name = cell->getValue().asString();
LLUIColorTable::instance().resetToDefault(name);
updateDefaultColumn(name);
updateControl(name);
}
}
}
// we've switched controls, or doing per-frame update, so update spinners, etc.
void LLFloaterSettingsColor::updateControl(const std::string& color_name)
{
hideUIControls();
if (!isSettingHidden(color_name))
{
mDefaultButton->setVisible(true);
mSettingNameText->setVisible(true);
mSettingNameText->setText(color_name);
mSettingNameText->setToolTip(color_name);
LLColor4 clr = LLUIColorTable::instance().getColor(color_name);
mColorSwatch->setVisible(true);
// only set if changed so color picker doesn't update
if (clr != LLColor4(mColorSwatch->getValue()))
{
mColorSwatch->setOriginal(clr);
}
mAlphaSpinner->setVisible(true);
mAlphaSpinner->setLabel(std::string("Alpha"));
if (!mAlphaSpinner->hasFocus())
{
mAlphaSpinner->setPrecision(3);
mAlphaSpinner->setMinValue(0.0);
mAlphaSpinner->setMaxValue(1.f);
mAlphaSpinner->setValue(clr.mV[VALPHA]);
}
}
}
void LLFloaterSettingsColor::updateList(bool skip_selection)
{
std::string last_selected;
LLScrollListItem* item = mSettingList->getFirstSelected();
if (item)
{
LLScrollListCell* cell = item->getColumn(1);
if (cell)
{
last_selected = cell->getValue().asString();
}
}
mSettingList->deleteAllItems();
const auto& base_colors = LLUIColorTable::instance().getLoadedColors();
for (const auto& pair : base_colors)
{
const auto& name = pair.first;
if (matchesSearchFilter(name) && !isSettingHidden(name))
{
LLSD row;
row["columns"][0]["column"] = "changed_color";
row["columns"][0]["value"] = LLUIColorTable::instance().isDefault(name) ? "" : "*";
row["columns"][1]["column"] = "color";
row["columns"][1]["value"] = name;
LLScrollListItem* item = mSettingList->addElement(row, ADD_BOTTOM, nullptr);
if (!mSearchFilter.empty() && (last_selected == name) && !skip_selection)
{
std::string lower_name(name);
LLStringUtil::toLower(lower_name);
if (LLStringUtil::startsWith(lower_name, mSearchFilter))
{
item->setSelected(true);
}
}
}
}
for (const auto& pair : LLUIColorTable::instance().getUserColors())
{
const auto& name = pair.first;
if (base_colors.find(name) == base_colors.end() && matchesSearchFilter(name) && !isSettingHidden(name))
{
LLSD row;
row["columns"][0]["column"] = "changed_color";
row["columns"][0]["value"] = LLUIColorTable::instance().isDefault(name) ? "" : "*";
row["columns"][1]["column"] = "color";
row["columns"][1]["value"] = name;
LLScrollListItem* item = mSettingList->addElement(row, ADD_BOTTOM, nullptr);
if (!mSearchFilter.empty() && (last_selected == name) && !skip_selection)
{
std::string lower_name(name);
LLStringUtil::toLower(lower_name);
if (LLStringUtil::startsWith(lower_name, mSearchFilter))
{
item->setSelected(true);
}
}
}
}
mSettingList->updateSort();
if (!mSettingList->isEmpty())
{
if (mSettingList->hasSelectedItem())
{
mSettingList->scrollToShowSelected();
}
else if (!mSettingList->hasSelectedItem() && !mSearchFilter.empty() && !skip_selection)
{
if (!mSettingList->selectItemByPrefix(mSearchFilter, false, 1))
{
mSettingList->selectFirstItem();
}
mSettingList->scrollToShowSelected();
}
}
else
{
LLSD row;
row["columns"][0]["column"] = "changed_color";
row["columns"][0]["value"] = "";
row["columns"][1]["column"] = "color";
row["columns"][1]["value"] = "No matching colors.";
mSettingList->addElement(row);
hideUIControls();
}
}
void LLFloaterSettingsColor::onSettingSelect()
{
LLScrollListItem* first_selected = mSettingList->getFirstSelected();
if (first_selected)
{
auto cell = first_selected->getColumn(1);
if (cell)
{
updateControl(cell->getValue().asString());
}
}
}
void LLFloaterSettingsColor::setSearchFilter(const std::string& filter)
{
if(mSearchFilter == filter)
return;
mSearchFilter = filter;
LLStringUtil::toLower(mSearchFilter);
updateList();
}
bool LLFloaterSettingsColor::matchesSearchFilter(std::string setting_name)
{
// If the search filter is empty, everything passes.
if (mSearchFilter.empty()) return true;
LLStringUtil::toLower(setting_name);
std::string::size_type match_name = setting_name.find(mSearchFilter);
return (std::string::npos != match_name);
}
bool LLFloaterSettingsColor::isSettingHidden(const std::string& color_name)
{
static LLCachedControl<bool> hide_default(gSavedSettings, "ColorSettingsHideDefault", false);
return hide_default && LLUIColorTable::instance().isDefault(color_name);
}
void LLFloaterSettingsColor::updateDefaultColumn(const std::string& color_name)
{
if (isSettingHidden(color_name))
{
hideUIControls();
updateList(true);
return;
}
LLScrollListItem* item = mSettingList->getFirstSelected();
if (item)
{
LLScrollListCell* cell = item->getColumn(0);
if (cell)
{
std::string is_default = LLUIColorTable::instance().isDefault(color_name) ? "" : "*";
cell->setValue(is_default);
}
}
}
void LLFloaterSettingsColor::hideUIControls()
{
mColorSwatch->setVisible(false);
mAlphaSpinner->setVisible(false);
mDefaultButton->setVisible(false);
mSettingNameText->setVisible(false);
}

View File

@ -0,0 +1,81 @@
/**
* @file llfloatersettingscolor.h
* @brief Header file for LLFloaterSettingsColor
* @author Rye Cogtail<rye@alchemyviewer.org>
*
* $LicenseInfo:firstyear=2024&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2024, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#ifndef LLFLOATERCOLORSETTINGS_H
#define LLFLOATERCOLORSETTINGS_H
#include "llcontrol.h"
#include "llfloater.h"
class LLColorSwatchCtrl;
class LLScrollListCtrl;
class LLSpinCtrl;
class LLTextBox;
class LLFloaterSettingsColor final
: public LLFloater
{
friend class LLFloaterReg;
public:
bool postBuild() override;
void draw() override;
void updateControl(const std::string& color_name);
void onCommitSettings();
void onClickDefault();
bool matchesSearchFilter(std::string setting_name);
bool isSettingHidden(const std::string& color_name);
private:
LLFloaterSettingsColor(const LLSD& key);
virtual ~LLFloaterSettingsColor();
void updateList(bool skip_selection = false);
void onSettingSelect();
void setSearchFilter(const std::string& filter);
void updateDefaultColumn(const std::string& color_name);
void hideUIControls();
LLScrollListCtrl* mSettingList;
protected:
LLUICtrl* mDefaultButton = nullptr;
LLTextBox* mSettingNameText = nullptr;
LLSpinCtrl* mAlphaSpinner = nullptr;
LLColorSwatchCtrl* mColorSwatch = nullptr;
std::string mSearchFilter;
};
#endif //LLFLOATERCOLORSETTINGS_H

View File

@ -279,15 +279,11 @@ void LLHUDNameTag::renderText(bool for_select)
mOffsetY = lltrunc(mHeight * ((mVertAlignment == ALIGN_VERT_CENTER) ? 0.5f : 1.f)); mOffsetY = lltrunc(mHeight * ((mVertAlignment == ALIGN_VERT_CENTER) ? 0.5f : 1.f));
// *TODO: make this a per-text setting // *TODO: make this a per-text setting
//LLColor4 bg_color = LLUIColorTable::instance().getColor("NameTagBackground"); static LLCachedControl<F32> bubble_opacity(gSavedSettings, "ChatBubbleOpacity");
//bg_color.setAlpha(gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor); static LLUIColor nametag_bg_color = LLUIColorTable::instance().getColor("NameTagBackground");
F32 color_alpha = bubble_opacity * alpha_factor;
static LLUIColor s_bg_color = LLUIColorTable::instance().getColor("NameTagBackground"); LLColor4 bg_color = nametag_bg_color;
static LLCachedControl<F32> chatBubbleOpacity(gSavedSettings, "ChatBubbleOpacity");
LLColor4 bg_color = s_bg_color.get();
F32 color_alpha = chatBubbleOpacity * alpha_factor;
bg_color.setAlpha(color_alpha); bg_color.setAlpha(color_alpha);
// </FS:Ansariel>
// scale screen size of borders down // scale screen size of borders down
//RN: for now, text on hud objects is never occluded //RN: for now, text on hud objects is never occluded
@ -350,8 +346,7 @@ void LLHUDNameTag::renderText(bool for_select)
x_offset = -0.5f * mWidth + (HORIZONTAL_PADDING / 2.f); x_offset = -0.5f * mWidth + (HORIZONTAL_PADDING / 2.f);
} }
LLColor4 label_color(0.f, 0.f, 0.f, 1.f); LLColor4 label_color(0.f, 0.f, 0.f, alpha_factor);
label_color.mV[VALPHA] = alpha_factor;
hud_render_text(segment_iter->getText(), render_position, *fontp, segment_iter->mStyle, LLFontGL::NO_SHADOW, x_offset, y_offset, label_color, false); hud_render_text(segment_iter->getText(), render_position, *fontp, segment_iter->mStyle, LLFontGL::NO_SHADOW, x_offset, y_offset, label_color, false);
} }
} }

View File

@ -148,14 +148,10 @@ void LLHUDText::renderText()
mOffsetY = lltrunc(mHeight * ((mVertAlignment == ALIGN_VERT_CENTER) ? 0.5f : 1.f)); mOffsetY = lltrunc(mHeight * ((mVertAlignment == ALIGN_VERT_CENTER) ? 0.5f : 1.f));
// *TODO: make this a per-text setting // *TODO: make this a per-text setting
// <FS:Ansariel> Performance improvement static LLCachedControl<F32> bubble_opacity(gSavedSettings, "ChatBubbleOpacity");
//LLColor4 bg_color = LLUIColorTable::instance().getColor("ObjectBubbleColor"); static LLUIColor nametag_bg_color = LLUIColorTable::instance().getColor("ObjectBubbleColor");
//bg_color.setAlpha(gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor); LLColor4 bg_color = nametag_bg_color;
static LLUIColor s_bg_color = LLUIColorTable::instance().getColor("ObjectBubbleColor"); bg_color.setAlpha(bubble_opacity * alpha_factor);
static LLCachedControl<F32> chatBubbleOpacity(gSavedSettings, "ChatBubbleOpacity");
LLColor4 bg_color = s_bg_color.get();
bg_color.setAlpha(chatBubbleOpacity * alpha_factor);
// </FS:Ansariel>
const S32 border_height = 16; const S32 border_height = 16;
const S32 border_width = 16; const S32 border_width = 16;

View File

@ -2887,11 +2887,13 @@ void LLInventoryGalleryItem::draw()
LLPanel::draw(); LLPanel::draw();
// Draw border // Draw border
LLUIColor border_color = LLUIColorTable::instance().getColor(mSelected ? "MenuItemHighlightBgColor" : "TextFgTentativeColor", LLColor4::white); static LLUIColor menu_highlighted_color = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", LLColor4::white);;
static LLUIColor text_fg_tentative_color = LLUIColorTable::instance().getColor("TextFgTentativeColor", LLColor4::white);;
const LLColor4& border_color = mSelected ? menu_highlighted_color : text_fg_tentative_color;
LLRect border = mThumbnailCtrl->getRect(); LLRect border = mThumbnailCtrl->getRect();
border.mRight = border.mRight + 1; border.mRight = border.mRight + 1;
border.mTop = border.mTop + 1; border.mTop = border.mTop + 1;
gl_rect_2d(border, border_color.get(), false); gl_rect_2d(border, border_color, false);
} }
} }

View File

@ -652,9 +652,9 @@ void LLManip::renderTickValue(const LLVector3& pos, F32 value, const std::string
LLColor4 LLManip::setupSnapGuideRenderPass(S32 pass) LLColor4 LLManip::setupSnapGuideRenderPass(S32 pass)
{ {
static LLColor4 grid_color_fg = LLUIColorTable::instance().getColor("GridlineColor"); static LLUIColor grid_color_fg = LLUIColorTable::instance().getColor("GridlineColor");
static LLColor4 grid_color_bg = LLUIColorTable::instance().getColor("GridlineBGColor"); static LLUIColor grid_color_bg = LLUIColorTable::instance().getColor("GridlineBGColor");
static LLColor4 grid_color_shadow = LLUIColorTable::instance().getColor("GridlineShadowColor"); static LLUIColor grid_color_shadow = LLUIColorTable::instance().getColor("GridlineShadowColor");
LLColor4 line_color; LLColor4 line_color;
F32 line_alpha = gSavedSettings.getF32("GridOpacity"); F32 line_alpha = gSavedSettings.getF32("GridOpacity");

View File

@ -283,9 +283,10 @@ void LLHandlerUtil::logToNearbyChat(const LLNotificationPtr& notification, EChat
// Ansariel: Also log to console if enabled // Ansariel: Also log to console if enabled
if (gSavedSettings.getBOOL("FSUseNearbyChatConsole")) if (gSavedSettings.getBOOL("FSUseNearbyChatConsole"))
{ {
LLColor4 chatcolor; F32 alpha = 1.f;
LLViewerChat::getChatColor(chat_msg, chatcolor); LLUIColor chatcolor;
gConsole->addConsoleLine(chat_msg.mText, chatcolor); LLViewerChat::getChatColor(chat_msg, chatcolor, alpha);
gConsole->addConsoleLine(chat_msg.mText, chatcolor % alpha);
} }
} }
} }

View File

@ -1020,8 +1020,8 @@ void LLOutfitGalleryItem::setOutfitWorn(bool value)
LLStringUtil::format_map_t worn_string_args; LLStringUtil::format_map_t worn_string_args;
std::string worn_string = getString("worn_string", worn_string_args); std::string worn_string = getString("worn_string", worn_string_args);
LLUIColor text_color = LLUIColorTable::instance().getColor("White", LLColor4::white); LLUIColor text_color = LLUIColorTable::instance().getColor("White", LLColor4::white);
mOutfitWornText->setReadOnlyColor(text_color.get()); mOutfitWornText->setReadOnlyColor(text_color);
mOutfitNameText->setReadOnlyColor(text_color.get()); mOutfitNameText->setReadOnlyColor(text_color);
mOutfitWornText->setFont(value ? LLFontGL::getFontSansSerifBold() : LLFontGL::getFontSansSerifSmall()); mOutfitWornText->setFont(value ? LLFontGL::getFontSansSerifBold() : LLFontGL::getFontSansSerifSmall());
mOutfitNameText->setFont(value ? LLFontGL::getFontSansSerifBold() : LLFontGL::getFontSansSerifSmall()); mOutfitNameText->setFont(value ? LLFontGL::getFontSansSerifBold() : LLFontGL::getFontSansSerifSmall());
mOutfitWornText->setValue(value ? worn_string : ""); mOutfitWornText->setValue(value ? worn_string : "");

View File

@ -468,7 +468,7 @@ void LLPanelPermissions::refresh()
// // Style for creator and owner links (both group and agent) // // Style for creator and owner links (both group and agent)
// LLStyle::Params style_params; // LLStyle::Params style_params;
// LLColor4 link_color = LLUIColorTable::instance().getColor("HTMLLinkColor"); // LLUIColor link_color = LLUIColorTable::instance().getColor("HTMLLinkColor");
// style_params.color = link_color; // style_params.color = link_color;
// style_params.readonly_color = link_color; // style_params.readonly_color = link_color;
// style_params.is_link = true; // link will be added later // style_params.is_link = true; // link will be added later

View File

@ -130,7 +130,7 @@ void LLScriptEditor::drawLineNumbers()
const LLWString ltext = utf8str_to_wstring(llformat("%d", line.mLineNum )); const LLWString ltext = utf8str_to_wstring(llformat("%d", line.mLineNum ));
bool is_cur_line = cursor_line == line.mLineNum; bool is_cur_line = cursor_line == line.mLineNum;
const U8 style = is_cur_line ? LLFontGL::BOLD : LLFontGL::NORMAL; const U8 style = is_cur_line ? LLFontGL::BOLD : LLFontGL::NORMAL;
const LLColor4 fg_color = is_cur_line ? mCursorColor : mReadOnlyFgColor; const LLColor4& fg_color = is_cur_line ? mCursorColor : mReadOnlyFgColor;
getFont()->render( getFont()->render(
ltext, // string to draw ltext, // string to draw
0, // begin offset 0, // begin offset
@ -187,7 +187,7 @@ void LLScriptEditor::loadKeywords(const std::string& filename,
for (size_t i = 0; i < count; i++) for (size_t i = 0; i < count; i++)
{ {
std::string name = utf8str_trim(funcs[i]); std::string name = utf8str_trim(funcs[i]);
mKeywords.addToken(LLKeywordToken::TT_WORD, name, color, tooltips[i] ); mKeywords.addToken(LLKeywordToken::TT_WORD, name, LLUIColor(color), tooltips[i] );
} }
segment_vec_t segment_list; segment_vec_t segment_list;
LLStyleConstSP style = new LLStyle(LLStyle::Params().font(getFont()).color(mDefaultColor.get())); LLStyleConstSP style = new LLStyle(LLStyle::Params().font(getFont()).color(mDefaultColor.get()));

View File

@ -146,12 +146,12 @@ F32 LLSelectMgr::sHighlightAlpha = 0.f;
F32 LLSelectMgr::sHighlightAlphaTest = 0.f; F32 LLSelectMgr::sHighlightAlphaTest = 0.f;
F32 LLSelectMgr::sHighlightUAnim = 0.f; F32 LLSelectMgr::sHighlightUAnim = 0.f;
F32 LLSelectMgr::sHighlightVAnim = 0.f; F32 LLSelectMgr::sHighlightVAnim = 0.f;
LLColor4 LLSelectMgr::sSilhouetteParentColor; LLUIColor LLSelectMgr::sSilhouetteParentColor;
LLColor4 LLSelectMgr::sSilhouetteChildColor; LLUIColor LLSelectMgr::sSilhouetteChildColor;
LLColor4 LLSelectMgr::sHighlightInspectColor; LLUIColor LLSelectMgr::sHighlightInspectColor;
LLColor4 LLSelectMgr::sHighlightParentColor; LLUIColor LLSelectMgr::sHighlightParentColor;
LLColor4 LLSelectMgr::sHighlightChildColor; LLUIColor LLSelectMgr::sHighlightChildColor;
LLColor4 LLSelectMgr::sContextSilhouetteColor; LLUIColor LLSelectMgr::sContextSilhouetteColor;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// struct LLDeRezInfo // struct LLDeRezInfo
@ -6705,8 +6705,10 @@ void LLSelectMgr::renderSilhouettes(bool for_hud)
bool wireframe_selection = (gFloaterTools && gFloaterTools->getVisible()) || LLSelectMgr::sRenderHiddenSelections; bool wireframe_selection = (gFloaterTools && gFloaterTools->getVisible()) || LLSelectMgr::sRenderHiddenSelections;
F32 fogCfx = (F32)llclamp((getSelectionCenterGlobal() - gAgentCamera.getCameraPositionGlobal()).magVec() / (getBBoxOfSelection().getExtentLocal().magVec() * 4), 0.0, 1.0); // <FS:Ansariel> Performance improvement F32 fogCfx = (F32)llclamp((getSelectionCenterGlobal() - gAgentCamera.getCameraPositionGlobal()).magVec() / (getBBoxOfSelection().getExtentLocal().magVec() * 4), 0.0, 1.0); // <FS:Ansariel> Performance improvement
static LLColor4 sParentColor = LLColor4(sSilhouetteParentColor[VRED], sSilhouetteParentColor[VGREEN], sSilhouetteParentColor[VBLUE], LLSelectMgr::sHighlightAlpha); LLColor4 sParentColor = sSilhouetteParentColor;
static LLColor4 sChildColor = LLColor4(sSilhouetteChildColor[VRED], sSilhouetteChildColor[VGREEN], sSilhouetteChildColor[VBLUE], LLSelectMgr::sHighlightAlpha); sParentColor.mV[VALPHA] = LLSelectMgr::sHighlightAlpha;
LLColor4 sChildColor = sSilhouetteChildColor;
sChildColor.mV[VALPHA] = LLSelectMgr::sHighlightAlpha;
auto renderMeshSelection_f = [fogCfx, wireframe_selection](LLSelectNode* node, LLViewerObject* objectp, LLColor4 hlColor) auto renderMeshSelection_f = [fogCfx, wireframe_selection](LLSelectNode* node, LLViewerObject* objectp, LLColor4 hlColor)
{ {
@ -8350,12 +8352,9 @@ S32 LLObjectSelection::getSelectedObjectRenderCost()
cost += object->getRenderCost(textures); cost += object->getRenderCost(textures);
computed_objects.insert(object->getID()); computed_objects.insert(object->getID());
const_child_list_t children = object->getChildren(); const const_child_list_t& children = object->getChildren();
for (const_child_list_t::const_iterator child_iter = children.begin(); for (LLViewerObject* child_obj : children)
child_iter != children.end();
++child_iter)
{ {
LLViewerObject* child_obj = *child_iter;
LLVOVolume *child = dynamic_cast<LLVOVolume*>( child_obj ); LLVOVolume *child = dynamic_cast<LLVOVolume*>( child_obj );
if (child) if (child)
{ {

View File

@ -44,6 +44,7 @@
#include "llcontrol.h" #include "llcontrol.h"
#include "llviewerobject.h" // LLObjectSelection::getSelectedTEValue template #include "llviewerobject.h" // LLObjectSelection::getSelectedTEValue template
#include "llmaterial.h" #include "llmaterial.h"
#include "lluicolor.h"
#include <deque> #include <deque>
#include <boost/iterator/filter_iterator.hpp> #include <boost/iterator/filter_iterator.hpp>
@ -517,12 +518,12 @@ public:
static F32 sHighlightAlphaTest; static F32 sHighlightAlphaTest;
static F32 sHighlightUAnim; static F32 sHighlightUAnim;
static F32 sHighlightVAnim; static F32 sHighlightVAnim;
static LLColor4 sSilhouetteParentColor; static LLUIColor sSilhouetteParentColor;
static LLColor4 sSilhouetteChildColor; static LLUIColor sSilhouetteChildColor;
static LLColor4 sHighlightParentColor; static LLUIColor sHighlightParentColor;
static LLColor4 sHighlightChildColor; static LLUIColor sHighlightChildColor;
static LLColor4 sHighlightInspectColor; static LLUIColor sHighlightInspectColor;
static LLColor4 sContextSilhouetteColor; static LLUIColor sContextSilhouetteColor;
LLCachedControl<bool> mHideSelectedObjects; LLCachedControl<bool> mHideSelectedObjects;
LLCachedControl<bool> mRenderHighlightSelections; LLCachedControl<bool> mRenderHighlightSelections;

View File

@ -355,7 +355,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item)
// Style for creator and owner links // Style for creator and owner links
LLStyle::Params style_params; LLStyle::Params style_params;
LLColor4 link_color = LLUIColorTable::instance().getColor("HTMLLinkColor"); LLUIColor link_color = LLUIColorTable::instance().getColor("HTMLLinkColor");
style_params.color = link_color; style_params.color = link_color;
style_params.readonly_color = link_color; style_params.readonly_color = link_color;
style_params.is_link = true; // link will be added later style_params.is_link = true; // link will be added later

View File

@ -374,8 +374,8 @@ void LLSpeakerMgr::update(bool resort_ok)
return; return;
} }
LLColor4 speaking_color = LLUIColorTable::instance().getColor("SpeakingColor"); static const LLUIColor speaking_color = LLUIColorTable::instance().getColor("SpeakingColor");
LLColor4 overdriven_color = LLUIColorTable::instance().getColor("OverdrivenColor"); static const LLUIColor overdriven_color = LLUIColorTable::instance().getColor("OverdrivenColor");
if(resort_ok) // only allow list changes when user is not interacting with it if(resort_ok) // only allow list changes when user is not interacting with it
{ {

View File

@ -472,6 +472,7 @@ private:
// Locks: Mw (ctor invokes without lock) // Locks: Mw (ctor invokes without lock)
void setDesiredDiscard(S32 discard, S32 size); void setDesiredDiscard(S32 discard, S32 size);
// <FS:Ansariel> OpenSim compatibility
// Threads: T* // Threads: T*
// Locks: Mw // Locks: Mw
bool insertPacket(S32 index, U8* data, S32 size); bool insertPacket(S32 index, U8* data, S32 size);
@ -479,7 +480,6 @@ private:
// Locks: Mw // Locks: Mw
void clearPackets(); void clearPackets();
// <FS:Ansariel> OpenSim compatibility
// Locks: Mw // Locks: Mw
void setupPacketData(); void setupPacketData();
// </FS:Ansariel> // </FS:Ansariel>
@ -608,6 +608,7 @@ private:
// Work Data // Work Data
LLMutex mWorkMutex; LLMutex mWorkMutex;
// <FS:Ansariel> OpenSim compatibility
struct PacketData struct PacketData
{ {
PacketData(U8* data, S32 size) PacketData(U8* data, S32 size)
@ -623,6 +624,7 @@ private:
S32 mFirstPacket; S32 mFirstPacket;
S32 mLastPacket; S32 mLastPacket;
U16 mTotalPackets; U16 mTotalPackets;
// </FS:Ansariel>
U8 mImageCodec; U8 mImageCodec;
LLViewerAssetStats::duration_t mMetricsStartTime; LLViewerAssetStats::duration_t mMetricsStartTime;
@ -939,9 +941,11 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher,
mRetryAttempt(0), mRetryAttempt(0),
mActiveCount(0), mActiveCount(0),
mWorkMutex(), mWorkMutex(),
// <FS:Ansariel> OpenSim compatibility
mFirstPacket(0), mFirstPacket(0),
mLastPacket(-1), mLastPacket(-1),
mTotalPackets(0), mTotalPackets(0),
// </FS:Ansariel>
mImageCodec(IMG_CODEC_INVALID), mImageCodec(IMG_CODEC_INVALID),
mMetricsStartTime(0), mMetricsStartTime(0),
mHttpHandle(LLCORE_HTTP_HANDLE_INVALID), mHttpHandle(LLCORE_HTTP_HANDLE_INVALID),
@ -1000,7 +1004,7 @@ LLTextureFetchWorker::~LLTextureFetchWorker()
mFetcher->mTextureCache->writeComplete(mCacheWriteHandle, true); mFetcher->mTextureCache->writeComplete(mCacheWriteHandle, true);
} }
mFormattedImage = NULL; mFormattedImage = NULL;
clearPackets(); clearPackets(); // <FS:Ansariel> OpenSim compatibility
if (mHttpBufferArray) if (mHttpBufferArray)
{ {
mHttpBufferArray->release(); mHttpBufferArray->release();
@ -1012,6 +1016,7 @@ LLTextureFetchWorker::~LLTextureFetchWorker()
mFetcher->updateStateStats(mCacheReadCount, mCacheWriteCount, mResourceWaitCount); mFetcher->updateStateStats(mCacheReadCount, mCacheWriteCount, mResourceWaitCount);
} }
// <FS:Ansariel> OpenSim compatibility
// Locks: Mw // Locks: Mw
void LLTextureFetchWorker::clearPackets() void LLTextureFetchWorker::clearPackets()
{ {
@ -1022,7 +1027,6 @@ void LLTextureFetchWorker::clearPackets()
mFirstPacket = 0; mFirstPacket = 0;
} }
// <FS:Ansariel> OpenSim compatibility
// Locks: Mw // Locks: Mw
void LLTextureFetchWorker::setupPacketData() void LLTextureFetchWorker::setupPacketData()
{ {
@ -1235,7 +1239,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
mHttpReplySize = 0; mHttpReplySize = 0;
mHttpReplyOffset = 0; mHttpReplyOffset = 0;
mHaveAllData = false; mHaveAllData = false;
clearPackets(); // TODO: Shouldn't be necessary clearPackets(); // <FS:Ansariel> OpenSim compatibility
mCacheReadHandle = LLTextureCache::nullHandle(); mCacheReadHandle = LLTextureCache::nullHandle();
mCacheWriteHandle = LLTextureCache::nullHandle(); mCacheWriteHandle = LLTextureCache::nullHandle();
setState(LOAD_FROM_TEXTURE_CACHE); setState(LOAD_FROM_TEXTURE_CACHE);
@ -2666,8 +2670,8 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, bool threaded, bool qa_mod
: LLWorkerThread("TextureFetch", threaded, true), : LLWorkerThread("TextureFetch", threaded, true),
mDebugCount(0), mDebugCount(0),
mDebugPause(false), mDebugPause(false),
mPacketCount(0), mPacketCount(0), // <FS:Ansariel> OpenSim compatibility
mBadPacketCount(0), mBadPacketCount(0), // <FS:Ansariel> OpenSim compatibility
mQueueMutex(), mQueueMutex(),
mNetworkQueueMutex(), mNetworkQueueMutex(),
mTextureCache(cache), mTextureCache(cache),
@ -3543,7 +3547,6 @@ void LLTextureFetch::sendRequestListToSimulators()
} }
} // -Mfnq } // -Mfnq
} }
// </FS:Ansariel>
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
@ -3581,6 +3584,7 @@ bool LLTextureFetchWorker::insertPacket(S32 index, U8* data, S32 size)
} }
return true; return true;
} }
// </FS:Ansariel>
void LLTextureFetchWorker::setState(e_state new_state) void LLTextureFetchWorker::setState(e_state new_state)
{ {

View File

@ -314,8 +314,10 @@ public:
LLUUID mDebugID; LLUUID mDebugID;
S32 mDebugCount; S32 mDebugCount;
bool mDebugPause; bool mDebugPause;
// <FS:Ansariel> OpenSim compatibility
S32 mPacketCount; S32 mPacketCount;
S32 mBadPacketCount; S32 mBadPacketCount;
// </FS:Ansariel>
static LLTrace::CountStatHandle<F64> sCacheHit; static LLTrace::CountStatHandle<F64> sCacheHit;
static LLTrace::CountStatHandle<F64> sCacheAttempt; static LLTrace::CountStatHandle<F64> sCacheAttempt;

View File

@ -328,13 +328,6 @@ void LLTextureBar::draw()
{ {
LLGLSUIDefault gls_ui; LLGLSUIDefault gls_ui;
// draw the packet data
// {
// std::string num_str = llformat("%3d/%3d", mImagep->mLastPacket+1, mImagep->mPackets);
// LLFontGL::getFontMonospace()->renderUTF8(num_str, 0, bar_left + 100, getRect().getHeight(), color,
// LLFontGL::LEFT, LLFontGL::TOP);
// }
// draw the image size at the end // draw the image size at the end
{ {
std::string num_str = llformat("%3dx%3d (%2d) %7d", mImagep->getWidth(), mImagep->getHeight(), std::string num_str = llformat("%3dx%3d (%2d) %7d", mImagep->getWidth(), mImagep->getHeight(),
@ -717,7 +710,6 @@ void LLGLTexMemBar::draw()
// </FS:Ansariel> // </FS:Ansariel>
gTextureList.getNumImages(), gTextureList.getNumImages(),
LLAppViewer::getTextureFetch()->getNumRequests(), LLAppViewer::getTextureFetch()->getNumDeletes(), LLAppViewer::getTextureFetch()->getNumRequests(), LLAppViewer::getTextureFetch()->getNumDeletes(),
LLAppViewer::getTextureFetch()->mPacketCount, LLAppViewer::getTextureFetch()->mBadPacketCount,
LLAppViewer::getTextureCache()->getNumReads(), LLAppViewer::getTextureCache()->getNumWrites(), LLAppViewer::getTextureCache()->getNumReads(), LLAppViewer::getTextureCache()->getNumWrites(),
LLLFSThread::sLocal->getPending(), LLLFSThread::sLocal->getPending(),
LLImageRaw::sRawImageCount, LLImageRaw::sRawImageCount,

View File

@ -668,7 +668,7 @@ void LLToolBarView::draw()
// Draw drop zones if drop of a tool is active // Draw drop zones if drop of a tool is active
if (isToolDragged()) if (isToolDragged())
{ {
LLColor4 drop_color = LLUIColorTable::instance().getColor( "ToolbarDropZoneColor" ); static const LLUIColor drop_color = LLUIColorTable::instance().getColor( "ToolbarDropZoneColor" );
for (S32 i = LLToolBarEnums::TOOLBAR_FIRST; i <= LLToolBarEnums::TOOLBAR_LAST; i++) for (S32 i = LLToolBarEnums::TOOLBAR_FIRST; i <= LLToolBarEnums::TOOLBAR_LAST; i++)
{ {

View File

@ -48,9 +48,9 @@ LLViewerChat::font_change_signal_t LLViewerChat::sChatFontChangedSignal;
//static //static
// <FS:Ansariel> Add additional options // <FS:Ansariel> Add additional options
//void LLViewerChat::getChatColor(const LLChat& chat, LLColor4& r_color) //void LLViewerChat::getChatColor(const LLChat& chat, LLUIColor& r_color, F32& r_color_alpha)
//{ //{
void LLViewerChat::getChatColor(const LLChat& chat, LLColor4& r_color, LLSD args) void LLViewerChat::getChatColor(const LLChat& chat, LLUIColor& r_color, F32& r_color_alpha, LLSD args)
{ {
const bool is_local = args.has("is_local") ? args["is_local"].asBoolean() : true; const bool is_local = args.has("is_local") ? args["is_local"].asBoolean() : true;
const bool for_console = args.has("for_console") && args["for_console"].asBoolean(); const bool for_console = args.has("for_console") && args["for_console"].asBoolean();
@ -108,7 +108,10 @@ void LLViewerChat::getChatColor(const LLChat& chat, LLColor4& r_color, LLSD args
// </FS:CR> // </FS:CR>
//color based on contact sets prefs //color based on contact sets prefs
LGGContactSets::getInstance()->hasFriendColorThatShouldShow(chat.mFromID, ContactSetType::CHAT, r_color); if (LLColor4 cscolor; LGGContactSets::getInstance()->hasFriendColorThatShouldShow(chat.mFromID, ContactSetType::CHAT, cscolor))
{
r_color = cscolor;
}
} }
break; break;
case CHAT_SOURCE_OBJECT: case CHAT_SOURCE_OBJECT:
@ -134,7 +137,7 @@ void LLViewerChat::getChatColor(const LLChat& chat, LLColor4& r_color, LLSD args
} }
break; break;
default: default:
r_color.setToWhite(); r_color = LLUIColorTable::instance().getColor("White");
} }
// <FS:KC> Keyword alerts // <FS:KC> Keyword alerts
@ -142,7 +145,7 @@ void LLViewerChat::getChatColor(const LLChat& chat, LLColor4& r_color, LLSD args
static LLCachedControl<bool> sFSKeywordChangeColor(gSavedPerAccountSettings, "FSKeywordChangeColor"); static LLCachedControl<bool> sFSKeywordChangeColor(gSavedPerAccountSettings, "FSKeywordChangeColor");
if (sFSKeywordChangeColor && FSKeywords::getInstance()->chatContainsKeyword(chat, is_local)) if (sFSKeywordChangeColor && FSKeywords::getInstance()->chatContainsKeyword(chat, is_local))
{ {
r_color = sFSKeywordColor; r_color = sFSKeywordColor();
} }
// </FS:KC> // </FS:KC>
@ -159,11 +162,15 @@ void LLViewerChat::getChatColor(const LLChat& chat, LLColor4& r_color, LLSD args
{ {
// diminish far-off chat // diminish far-off chat
// <FS:Ansariel> FIRE-3572: Customize local chat color brightness change based on distance // <FS:Ansariel> FIRE-3572: Customize local chat color brightness change based on distance
//r_color.mV[VALPHA] = 0.8f; //r_color_alpha = 0.8f;
static LLCachedControl<F32> fsBeyondNearbyChatColorDiminishFactor(gSavedSettings, "FSBeyondNearbyChatColorDiminishFactor", 0.8f); static LLCachedControl<F32> fsBeyondNearbyChatColorDiminishFactor(gSavedSettings, "FSBeyondNearbyChatColorDiminishFactor", 0.8f);
r_color.mV[VALPHA] = fsBeyondNearbyChatColorDiminishFactor(); r_color_alpha = fsBeyondNearbyChatColorDiminishFactor();
// </FS:Ansariel> // </FS:Ansariel>
} }
else
{
r_color_alpha = 1.0f;
}
} }
} }
} }

View File

@ -29,8 +29,7 @@
#include "llchat.h" #include "llchat.h"
#include "llfontgl.h" #include "llfontgl.h"
#include "v4color.h" #include "lluicolor.h"
class LLViewerChat class LLViewerChat
{ {
@ -38,8 +37,8 @@ public:
typedef boost::signals2::signal<void (LLFontGL*)> font_change_signal_t; typedef boost::signals2::signal<void (LLFontGL*)> font_change_signal_t;
// <FS:AO> // <FS:AO>
//static void getChatColor(const LLChat& chat, LLColor4& r_color); //static void getChatColor(const LLChat& chat, LLUIColor& r_color, F32& r_color_alpha);
static void getChatColor(const LLChat& chat, LLColor4& r_color, LLSD args = LLSD::emptyMap()); static void getChatColor(const LLChat& chat, LLUIColor& r_color, F32& r_color_alpha, LLSD args = LLSD::emptyMap());
// </FS:AO> // </FS:AO>
static void getChatColor(const LLChat& chat, std::string& r_color_name, F32& r_color_alpha); static void getChatColor(const LLChat& chat, std::string& r_color_name, F32& r_color_alpha);
static LLFontGL* getChatFont(); static LLFontGL* getChatFont();

View File

@ -136,6 +136,7 @@
#include "llfloaterscriptlimits.h" #include "llfloaterscriptlimits.h"
#include "llfloatersearch.h" #include "llfloatersearch.h"
#include "llfloatersellland.h" #include "llfloatersellland.h"
#include "llfloatersettingscolor.h"
#include "llfloatersettingsdebug.h" #include "llfloatersettingsdebug.h"
#include "llfloatersidepanelcontainer.h" #include "llfloatersidepanelcontainer.h"
#include "llfloatersnapshot.h" #include "llfloatersnapshot.h"
@ -579,6 +580,7 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("script_limits", "floater_script_limits.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterScriptLimits>); LLFloaterReg::add("script_limits", "floater_script_limits.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterScriptLimits>);
LLFloaterReg::add("my_scripts", "floater_my_scripts.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMyScripts>); LLFloaterReg::add("my_scripts", "floater_my_scripts.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMyScripts>);
LLFloaterReg::add("sell_land", "floater_sell_land.xml", &LLFloaterSellLand::buildFloater); LLFloaterReg::add("sell_land", "floater_sell_land.xml", &LLFloaterSellLand::buildFloater);
LLFloaterReg::add("settings_color", "floater_settings_color.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSettingsColor>);
LLFloaterReg::add("settings_debug", "floater_settings_debug.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSettingsDebug>); LLFloaterReg::add("settings_debug", "floater_settings_debug.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSettingsDebug>);
LLFloaterReg::add("sound_devices", "floater_sound_devices.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSoundDevices>); LLFloaterReg::add("sound_devices", "floater_sound_devices.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSoundDevices>);
// <FS:LO> Add ability for the statistics window to not be able to receive focus // <FS:LO> Add ability for the statistics window to not be able to receive focus

View File

@ -661,11 +661,9 @@ void init_menus()
/// ///
/// set up the colors /// set up the colors
/// ///
LLColor4 color;
// do not set colors in code, let the skin decide. -Zi // do not set colors in code, let the skin decide. -Zi
/* /*
LLColor4 context_menu_color = LLUIColorTable::instance().getColor("MenuPopupBgColor"); LLUIColor context_menu_color = LLUIColorTable::instance().getColor("MenuPopupBgColor");
gMenuAvatarSelf->setBackgroundColor( context_menu_color ); gMenuAvatarSelf->setBackgroundColor( context_menu_color );
gMenuAvatarOther->setBackgroundColor( context_menu_color ); gMenuAvatarOther->setBackgroundColor( context_menu_color );
@ -675,7 +673,7 @@ void init_menus()
gMenuLand->setBackgroundColor( context_menu_color ); gMenuLand->setBackgroundColor( context_menu_color );
color = LLUIColorTable::instance().getColor( "MenuPopupBgColor" ); LLUIColor color = LLUIColorTable::instance().getColor( "MenuPopupBgColor" );
gPopupMenuView->setBackgroundColor( color ); gPopupMenuView->setBackgroundColor( color );
*/ */
@ -700,7 +698,7 @@ void init_menus()
// ONLY change the color IF we are in beta. Otherwise leave it alone so it can use the skinned color. -Zi // ONLY change the color IF we are in beta. Otherwise leave it alone so it can use the skinned color. -Zi
if(LLGridManager::getInstance()->isInSLBeta()) if(LLGridManager::getInstance()->isInSLBeta())
{ {
color = LLUIColorTable::instance().getColor( "MenuNonProductionBgColor" ); LLUIColor color = LLUIColorTable::instance().getColor( "MenuNonProductionBgColor" );
gMenuBarView->setBackgroundColor( color ); gMenuBarView->setBackgroundColor( color );
} }

View File

@ -1959,26 +1959,23 @@ void LLViewerObjectList::clearAllMapObjectsInRegion(LLViewerRegion* regionp)
void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap) void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap)
{ {
// <FS:Ansariel> Factor out calls to getInstance static const LLUIColor above_water_color = LLUIColorTable::instance().getColor( "NetMapOtherOwnAboveWater" );
LLUIColorTable& colortable = LLUIColorTable::instance(); static const LLUIColor below_water_color = LLUIColorTable::instance().getColor( "NetMapOtherOwnBelowWater" );
static const LLUIColor you_own_above_water_color =
LLColor4 above_water_color = colortable.getColor( "NetMapOtherOwnAboveWater" ); LLUIColorTable::instance().getColor( "NetMapYouOwnAboveWater" );
LLColor4 below_water_color = colortable.getColor( "NetMapOtherOwnBelowWater" ); static const LLUIColor you_own_below_water_color =
LLColor4 you_own_above_water_color = LLUIColorTable::instance().getColor( "NetMapYouOwnBelowWater" );
colortable.getColor( "NetMapYouOwnAboveWater" ); static const LLUIColor group_own_above_water_color =
LLColor4 you_own_below_water_color = LLUIColorTable::instance().getColor( "NetMapGroupOwnAboveWater" );
colortable.getColor( "NetMapYouOwnBelowWater" ); static const LLUIColor group_own_below_water_color =
LLColor4 group_own_above_water_color = LLUIColorTable::instance().getColor( "NetMapGroupOwnBelowWater" );
colortable.getColor( "NetMapGroupOwnAboveWater" );
LLColor4 group_own_below_water_color =
colortable.getColor( "NetMapGroupOwnBelowWater" );
// <FS:CR> FIRE-1846: Firestorm netmap enhancements // <FS:CR> FIRE-1846: Firestorm netmap enhancements
LLColor4 you_own_physical_color = colortable.getColor ( "NetMapYouPhysical", LLColor4::red ); static const LLUIColor you_own_physical_color = LLUIColorTable::instance().getColor ( "NetMapYouPhysical", LLColor4::red );
LLColor4 group_own_physical_color = colortable.getColor ( "NetMapGroupPhysical", LLColor4::green ); static const LLUIColor group_own_physical_color = LLUIColorTable::instance().getColor ( "NetMapGroupPhysical", LLColor4::green );
LLColor4 other_own_physical_color = colortable.getColor ( "NetMapOtherPhysical", LLColor4::green ); static const LLUIColor other_own_physical_color = LLUIColorTable::instance().getColor ( "NetMapOtherPhysical", LLColor4::green );
LLColor4 scripted_object_color = colortable.getColor ( "NetMapScripted", LLColor4::orange ); static const LLUIColor scripted_object_color = LLUIColorTable::instance().getColor ( "NetMapScripted", LLColor4::orange );
LLColor4 temp_on_rez_object_color = colortable.getColor ( "NetMapTempOnRez", LLColor4::orange ); static const LLUIColor temp_on_rez_object_color = LLUIColorTable::instance().getColor ( "NetMapTempOnRez", LLColor4::orange );
static LLCachedControl<bool> fs_netmap_physical(gSavedSettings, "FSNetMapPhysical", false); static LLCachedControl<bool> fs_netmap_physical(gSavedSettings, "FSNetMapPhysical", false);
static LLCachedControl<bool> fs_netmap_scripted(gSavedSettings, "FSNetMapScripted", false); static LLCachedControl<bool> fs_netmap_scripted(gSavedSettings, "FSNetMapScripted", false);
static LLCachedControl<bool> fs_netmap_temp_on_rez(gSavedSettings, "FSNetMapTempOnRez", false); static LLCachedControl<bool> fs_netmap_temp_on_rez(gSavedSettings, "FSNetMapTempOnRez", false);
@ -2022,7 +2019,7 @@ void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap)
// See DEV-17370 and DEV-29869/SNOW-79 for details. // See DEV-17370 and DEV-29869/SNOW-79 for details.
approx_radius = llmin(approx_radius, (F32)max_radius); approx_radius = llmin(approx_radius, (F32)max_radius);
LLColor4U color = above_water_color; LLColor4U color = above_water_color.get();
if( objectp->permYouOwner() ) if( objectp->permYouOwner() )
{ {
const F32 MIN_RADIUS_FOR_OWNED_OBJECTS = 2.f; const F32 MIN_RADIUS_FOR_OWNED_OBJECTS = 2.f;
@ -2035,35 +2032,35 @@ void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap)
{ {
if ( objectp->permGroupOwner() ) if ( objectp->permGroupOwner() )
{ {
color = group_own_above_water_color; color = group_own_above_water_color.get();
} }
else else
{ {
color = you_own_above_water_color; color = you_own_above_water_color.get();
} }
} }
else else
{ {
if ( objectp->permGroupOwner() ) if ( objectp->permGroupOwner() )
{ {
color = group_own_below_water_color; color = group_own_below_water_color.get();
} }
else else
{ {
color = you_own_below_water_color; color = you_own_below_water_color.get();
} }
} }
} }
else else
if( pos.mdV[VZ] < water_height ) if( pos.mdV[VZ] < water_height )
{ {
color = below_water_color; color = below_water_color.get();
} }
// <FS:CR> FIRE-1846: Firestorm netmap enhancements // <FS:CR> FIRE-1846: Firestorm netmap enhancements
if (fs_netmap_scripted && objectp->flagScripted()) if (fs_netmap_scripted && objectp->flagScripted())
{ {
color = scripted_object_color; color = scripted_object_color.get();
if( approx_radius < MIN_RADIUS_FOR_ACCENTED_OBJECTS ) if( approx_radius < MIN_RADIUS_FOR_ACCENTED_OBJECTS )
{ {
approx_radius = MIN_RADIUS_FOR_ACCENTED_OBJECTS; approx_radius = MIN_RADIUS_FOR_ACCENTED_OBJECTS;
@ -2074,15 +2071,15 @@ void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap)
{ {
if (objectp->permYouOwner()) if (objectp->permYouOwner())
{ {
color = you_own_physical_color; color = you_own_physical_color.get();
} }
else if (objectp->permGroupOwner()) else if (objectp->permGroupOwner())
{ {
color = group_own_physical_color; color = group_own_physical_color.get();
} }
else else
{ {
color = other_own_physical_color; color = other_own_physical_color.get();
} }
if( approx_radius < MIN_RADIUS_FOR_ACCENTED_OBJECTS ) if( approx_radius < MIN_RADIUS_FOR_ACCENTED_OBJECTS )
{ {
@ -2092,7 +2089,7 @@ void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap)
if (fs_netmap_temp_on_rez && objectp->flagTemporaryOnRez()) if (fs_netmap_temp_on_rez && objectp->flagTemporaryOnRez())
{ {
color = temp_on_rez_object_color; color = temp_on_rez_object_color.get();
if( approx_radius < MIN_RADIUS_FOR_ACCENTED_OBJECTS ) if( approx_radius < MIN_RADIUS_FOR_ACCENTED_OBJECTS )
{ {
approx_radius = MIN_RADIUS_FOR_ACCENTED_OBJECTS; approx_radius = MIN_RADIUS_FOR_ACCENTED_OBJECTS;

View File

@ -53,6 +53,14 @@
static const U8 OVERLAY_IMG_COMPONENTS = 4; static const U8 OVERLAY_IMG_COMPONENTS = 4;
static const F32 LINE_WIDTH = 0.0625f; static const F32 LINE_WIDTH = 0.0625f;
bool LLViewerParcelOverlay::sColorSetInitialized = false;
LLUIColor LLViewerParcelOverlay::sAvailColor;
LLUIColor LLViewerParcelOverlay::sOwnedColor;
LLUIColor LLViewerParcelOverlay::sGroupColor;
LLUIColor LLViewerParcelOverlay::sSelfColor;
LLUIColor LLViewerParcelOverlay::sForSaleColor;
LLUIColor LLViewerParcelOverlay::sAuctionColor;
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3) // [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3)
LLViewerParcelOverlay::update_signal_t* LLViewerParcelOverlay::mUpdateSignal = NULL; LLViewerParcelOverlay::update_signal_t* LLViewerParcelOverlay::mUpdateSignal = NULL;
// [/SL:KB] // [/SL:KB]
@ -67,6 +75,17 @@ LLViewerParcelOverlay::LLViewerParcelOverlay(LLViewerRegion* region, F32 region_
mTimeSinceLastUpdate(), mTimeSinceLastUpdate(),
mOverlayTextureIdx(-1) mOverlayTextureIdx(-1)
{ {
if (!sColorSetInitialized)
{
sColorSetInitialized = true;
sAvailColor = LLUIColorTable::instance().getColor("PropertyColorAvail").get();
sOwnedColor = LLUIColorTable::instance().getColor("PropertyColorOther").get();
sGroupColor = LLUIColorTable::instance().getColor("PropertyColorGroup").get();
sSelfColor = LLUIColorTable::instance().getColor("PropertyColorSelf").get();
sForSaleColor = LLUIColorTable::instance().getColor("PropertyColorForSale").get();
sAuctionColor = LLUIColorTable::instance().getColor("PropertyColorAuction").get();
}
// Create a texture to hold color information. // Create a texture to hold color information.
// 4 components // 4 components
// Use mipmaps = false, clamped, NEAREST filter, for sharp edges // Use mipmaps = false, clamped, NEAREST filter, for sharp edges
@ -328,12 +347,12 @@ void LLViewerParcelOverlay::updateOverlayTexture()
mOverlayTextureIdx = 0; mOverlayTextureIdx = 0;
} }
const LLColor4U avail = LLUIColorTable::instance().getColor("PropertyColorAvail").get(); const LLColor4U avail = sAvailColor.get();
const LLColor4U owned = LLUIColorTable::instance().getColor("PropertyColorOther").get(); const LLColor4U owned = sOwnedColor.get();
const LLColor4U group = LLUIColorTable::instance().getColor("PropertyColorGroup").get(); const LLColor4U group = sGroupColor.get();
const LLColor4U self = LLUIColorTable::instance().getColor("PropertyColorSelf").get(); const LLColor4U self = sSelfColor.get();
const LLColor4U for_sale = LLUIColorTable::instance().getColor("PropertyColorForSale").get(); const LLColor4U for_sale = sForSaleColor.get();
const LLColor4U auction = LLUIColorTable::instance().getColor("PropertyColorAuction").get(); const LLColor4U auction = sAuctionColor.get();
// Create the base texture. // Create the base texture.
U8 *raw = mImageRaw->getData(); U8 *raw = mImageRaw->getData();
@ -346,7 +365,7 @@ void LLViewerParcelOverlay::updateOverlayTexture()
{ {
U8 ownership = mOwnership[i]; U8 ownership = mOwnership[i];
F32 r,g,b,a; U8 r,g,b,a;
// Color stored in low three bits // Color stored in low three bits
switch( ownership & 0x7 ) switch( ownership & 0x7 )
@ -445,11 +464,11 @@ void LLViewerParcelOverlay::updatePropertyLines()
return; return;
LLColor4U colors[PARCEL_COLOR_MASK + 1]; LLColor4U colors[PARCEL_COLOR_MASK + 1];
colors[PARCEL_SELF] = LLUIColorTable::instance().getColor("PropertyColorSelf").get(); colors[PARCEL_SELF] = sSelfColor.get();
colors[PARCEL_OWNED] = LLUIColorTable::instance().getColor("PropertyColorOther").get(); colors[PARCEL_OWNED] = sOwnedColor.get();
colors[PARCEL_GROUP] = LLUIColorTable::instance().getColor("PropertyColorGroup").get(); colors[PARCEL_GROUP] = sGroupColor.get();
colors[PARCEL_FOR_SALE] = LLUIColorTable::instance().getColor("PropertyColorForSale").get(); colors[PARCEL_FOR_SALE] = sForSaleColor.get();
colors[PARCEL_AUCTION] = LLUIColorTable::instance().getColor("PropertyColorAuction").get(); colors[PARCEL_AUCTION] = sAuctionColor.get();
mEdges.clear(); mEdges.clear();

View File

@ -35,6 +35,7 @@
#include "lluuid.h" #include "lluuid.h"
#include "llviewertexture.h" #include "llviewertexture.h"
#include "llgl.h" #include "llgl.h"
#include "lluicolor.h"
class LLViewerRegion; class LLViewerRegion;
class LLVector3; class LLVector3;
@ -135,6 +136,14 @@ private:
std::vector<Edge> mEdges; std::vector<Edge> mEdges;
static bool sColorSetInitialized;
static LLUIColor sAvailColor;
static LLUIColor sOwnedColor;
static LLUIColor sGroupColor;
static LLUIColor sSelfColor;
static LLUIColor sForSaleColor;
static LLUIColor sAuctionColor;
// [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3) // [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3)
static update_signal_t* mUpdateSignal; static update_signal_t* mUpdateSignal;
// [/SL:KB] // [/SL:KB]

View File

@ -262,15 +262,9 @@ public:
image_rect.mTop = image_rect.mBottom + mImage->getHeight(); image_rect.mTop = image_rect.mBottom + mImage->getHeight();
mImage->draw(LLRect((S32)image_rect.mLeft, (S32)image_rect.mTop, (S32)image_rect.mRight, (S32)image_rect.mBottom)); mImage->draw(LLRect((S32)image_rect.mLeft, (S32)image_rect.mTop, (S32)image_rect.mRight, (S32)image_rect.mBottom));
LLColor4 color; static const LLUIColor embedded_item_readonly_col = LLUIColorTable::instance().getColor("TextEmbeddedItemReadOnlyColor");
if (mEditor.getReadOnly()) static const LLUIColor embedded_item_col = LLUIColorTable::instance().getColor("TextEmbeddedItemColor");
{ const LLColor4& color = mEditor.getReadOnly() ? embedded_item_readonly_col : embedded_item_col;
color = LLUIColorTable::instance().getColor("TextEmbeddedItemReadOnlyColor");
}
else
{
color = LLUIColorTable::instance().getColor("TextEmbeddedItemColor");
}
F32 right_x; F32 right_x;
mStyle->getFont()->render(mLabel, 0, image_rect.mRight + EMBEDDED_ITEM_LABEL_PADDING, draw_rect.mTop, color, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::UNDERLINE, LLFontGL::NO_SHADOW, static_cast<S32>(mLabel.length()), S32_MAX, &right_x); mStyle->getFont()->render(mLabel, 0, image_rect.mRight + EMBEDDED_ITEM_LABEL_PADDING, draw_rect.mTop, color, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::UNDERLINE, LLFontGL::NO_SHADOW, static_cast<S32>(mLabel.length()), S32_MAX, &right_x);

View File

@ -2383,7 +2383,7 @@ void LLViewerWindow::initWorldUI()
// gStatusBar->setFollows(FOLLOWS_LEFT | FOLLOWS_TOP | FOLLOWS_RIGHT); // gStatusBar->setFollows(FOLLOWS_LEFT | FOLLOWS_TOP | FOLLOWS_RIGHT);
// gStatusBar->setShape(status_bar_container->getLocalRect()); // gStatusBar->setShape(status_bar_container->getLocalRect());
// // sync bg color with menu bar // // sync bg color with menu bar
// gStatusBar->setBackgroundColor(gMenuBarView->getBackgroundColor().get()); // gStatusBar->setBackgroundColor(gMenuBarView->getBackgroundColor());
// // add InBack so that gStatusBar won't be drawn over menu // // add InBack so that gStatusBar won't be drawn over menu
// status_bar_container->addChildInBack(gStatusBar, 2/*tab order, after menu*/); // status_bar_container->addChildInBack(gStatusBar, 2/*tab order, after menu*/);
// status_bar_container->setVisible(true); // status_bar_container->setVisible(true);
@ -2392,7 +2392,7 @@ void LLViewerWindow::initWorldUI()
// LLView* nav_bar_container = getRootView()->getChild<LLView>("nav_bar_container"); // LLView* nav_bar_container = getRootView()->getChild<LLView>("nav_bar_container");
// navbar->setShape(nav_bar_container->getLocalRect()); // navbar->setShape(nav_bar_container->getLocalRect());
// navbar->setBackgroundColor(gMenuBarView->getBackgroundColor().get()); // navbar->setBackgroundColor(gMenuBarView->getBackgroundColor());
// nav_bar_container->addChild(navbar); // nav_bar_container->addChild(navbar);
// nav_bar_container->setVisible(true); // nav_bar_container->setVisible(true);
//} //}
@ -2878,7 +2878,7 @@ void LLViewerWindow::setNormalControlsVisible( bool visible )
void LLViewerWindow::setMenuBackgroundColor(bool god_mode, bool dev_grid) void LLViewerWindow::setMenuBackgroundColor(bool god_mode, bool dev_grid)
{ {
LLSD args; LLSD args;
LLColor4 new_bg_color; LLUIColor new_bg_color;
// god more important than project, proj more important than grid // god more important than project, proj more important than grid
if ( god_mode ) if ( god_mode )

View File

@ -3352,7 +3352,7 @@ void LLVOAvatar::idleUpdateLipSync(bool voice_enabled)
void LLVOAvatar::idleUpdateLoadingEffect() void LLVOAvatar::idleUpdateLoadingEffect()
{ {
// update visibility when avatar is partially loaded // update visibility when avatar is partially loaded
if (updateIsFullyLoaded()) // changed? if (!mFullyLoaded && updateIsFullyLoaded()) // Avoid repeat calculations by checking if mFullyLoaded is true first.
{ {
if (isFullyLoaded()) if (isFullyLoaded())
{ {
@ -4045,7 +4045,11 @@ void LLVOAvatar::idleUpdateNameTagText(bool new_name)
std::deque<LLChat>::iterator chat_iter = mChats.begin(); std::deque<LLChat>::iterator chat_iter = mChats.begin();
mNameText->clearString(); mNameText->clearString();
LLColor4 new_chat = LLUIColorTable::instance().getColor( isSelf() ? "UserChatColor" : "AgentChatColor" ); static const LLUIColor user_chat_color = LLUIColorTable::instance().getColor("UserChatColor");
static const LLUIColor agent_chat_color = LLUIColorTable::instance().getColor("AgentChatColor");
// <FS:CR> Colorize tags
//const LLColor4& new_chat = isSelf() ? user_chat_color : agent_chat_color;
LLColor4 new_chat = isSelf() ? user_chat_color : agent_chat_color;
// <FS:CR> Colorize tags // <FS:CR> Colorize tags
new_chat = LGGContactSets::getInstance()->colorize(getID(), new_chat, ContactSetType::CHAT); new_chat = LGGContactSets::getInstance()->colorize(getID(), new_chat, ContactSetType::CHAT);

View File

@ -987,7 +987,7 @@ LLTerrainPartition::LLTerrainPartition(LLViewerRegion* regionp)
} }
// Do not add vertices; honor strict vertex count specified by strider_vertex_count // Do not add vertices; honor strict vertex count specified by strider_vertex_count
void gen_terrain_tangents(U32 strider_vertex_count, // <FS/> [FIRE-34363] Fix implicit cast from U32->U16 that can cause a crash void gen_terrain_tangents(U32 strider_vertex_count,
U32 strider_index_count, U32 strider_index_count,
LLStrider<LLVector3> &verticesp, LLStrider<LLVector3> &verticesp,
LLStrider<LLVector3> &normalsp, LLStrider<LLVector3> &normalsp,
@ -1003,7 +1003,7 @@ void gen_terrain_tangents(U32 strider_vertex_count, // <FS/>
std::vector<LLVector2> texcoords(strider_vertex_count); std::vector<LLVector2> texcoords(strider_vertex_count);
std::vector<U16> indices(strider_index_count); std::vector<U16> indices(strider_index_count);
for (U32 v = 0; v < strider_vertex_count; ++v) // <FS/> [FIRE-34363] Fix implicit cast from U32->U16 that can cause a crash for (U32 v = 0; v < strider_vertex_count; ++v)
{ {
F32 *vert = verticesp[v].mV; F32 *vert = verticesp[v].mV;
vertices[v] = LLVector4a(vert[0], vert[1], vert[2], 1.f); vertices[v] = LLVector4a(vert[0], vert[1], vert[2], 1.f);
@ -1019,7 +1019,7 @@ void gen_terrain_tangents(U32 strider_vertex_count, // <FS/>
LLCalculateTangentArray(strider_vertex_count, vertices, normals, texcoords.data(), strider_index_count / 3, indices.data(), tangents); LLCalculateTangentArray(strider_vertex_count, vertices, normals, texcoords.data(), strider_index_count / 3, indices.data(), tangents);
for (U32 v = 0; v < strider_vertex_count; ++v) // <FS/> [FIRE-34363] Fix implicit cast from U32->U16 that can cause a crash for (U32 v = 0; v < strider_vertex_count; ++v)
{ {
tangentsp[v] = tangents[v]; tangentsp[v] = tangents[v];
} }

View File

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater
legacy_header_height="18"
can_minimize="false"
height="360"
min_height="367"
layout="topleft"
name="settings_color"
help_topic="settings_color"
title="Color Settings"
reuse_instance="true"
can_resize="true"
min_width="550"
width="570">
<filter_editor
follows="left|top|right"
height="23"
layout="topleft"
left="10"
right="-10"
label="Enter search text"
max_length_chars="300"
name="filter_input"
text_pad_left="10"
top="30" />
<scroll_list
column_padding="0"
draw_heading="true"
draw_stripes="false"
heading_height="23"
height="266"
layout="topleft"
search_column="1"
sort_column="1"
left="10"
follows="left|top|bottom"
name="setting_list"
top_pad="2"
width="300">
<scroll_list.columns
name="changed_color"
relative_width="0.05" />
<scroll_list.columns
label="Color"
name="color" />
</scroll_list>
<text
type="string"
length="1"
follows="left|top"
height="16"
layout="topleft"
name="color_name_txt"
font="SansSerifSmallBold"
top_delta="8"
left_pad="10"
visible="true"
use_ellipses="true"
text_color="White"
width="240">
Color name
</text>
<color_swatch
top_pad="0"
left_delta="0"
follows="top|left"
can_apply_immediately="true"
height="180"
name="color_swatch"
visible="true"
layout="topleft"
width="240">
<color_swatch.commit_callback
function="CommitSettings" />
</color_swatch>
<spinner
height="20"
label="Alpha"
layout="topleft"
follows="top|left"
left_delta="0"
min_val="0"
max_val="1"
decimal_digits="3"
name="alpha_spinner"
top_pad="5"
visible="true"
width="120">
<spinner.commit_callback
function="CommitSettings" />
</spinner>
<button
height="22"
label="Reset to default"
follows="left|top"
layout="topleft"
left_delta="0"
name="default_btn"
visible="true"
top_pad="15"
width="240">
<button.commit_callback
function="ClickDefault" />
</button>
<check_box
control_name="ColorSettingsHideDefault"
height="16"
initial_value="true"
label="Show changed colors only"
layout="topleft"
top_pad="10"
left="10"
follows="left|bottom"
name="hide_default"
width="500">
</check_box>
</floater>

View File

@ -183,6 +183,13 @@
function="Advanced.ShowDebugSettings" function="Advanced.ShowDebugSettings"
parameter="all" /> parameter="all" />
</menu_item_call> </menu_item_call>
<menu_item_call
label="Show Color settings"
name="Color Settings">
<menu_item_call.on_click
function="Floater.Toggle"
parameter="settings_color" />
</menu_item_call>
<menu_item_separator /> <menu_item_separator />
<menu_item_call <menu_item_call
label="XUI Preview Tool" label="XUI Preview Tool"

View File

@ -5142,6 +5142,13 @@
label="XUI" label="XUI"
name="XUI" name="XUI"
tear_off="true"> tear_off="true">
<menu_item_call
label="Show Color settings"
name="Color Settings">
<menu_item_call.on_click
function="Floater.Toggle"
parameter="settings_color" />
</menu_item_call>
<menu_item_call <menu_item_call
label="Reload Color Settings" label="Reload Color Settings"
name="Reload Color Settings"> name="Reload Color Settings">