Merge xui-army-5 to viewer-2, includes layout, art, and color changes, also UI color refactoring and new FreeType font library on Linux.

svn merge -r126038:126164 svn+ssh://svn.lindenlab.com/svn/linden/branches/skinning/xui-army-5
master
James Cook 2009-07-06 21:58:04 +00:00
parent 39905b927d
commit d6101558a1
320 changed files with 5275 additions and 3323 deletions

View File

@ -227,7 +227,6 @@ else (STANDALONE)
glib-2.0
gstreamer-0.10
gtk-2.0
llfreetype2
pango-1.0
)
endif (STANDALONE)

View File

@ -81,6 +81,7 @@ set(llui_SOURCE_FILES
lltextparser.cpp
lltrans.cpp
llui.cpp
lluicolor.cpp
lluicolortable.cpp
lluictrl.cpp
lluictrlfactory.cpp
@ -154,6 +155,7 @@ set(llui_HEADER_FILES
lltexteditor.h
lltextparser.h
lltrans.h
lluicolor.h
lluicolortable.h
lluiconstants.h
lluictrlfactory.h

View File

@ -83,12 +83,12 @@ LLComboBox::Params::Params()
: allow_text_entry("allow_text_entry", false),
show_text_as_tentative("show_text_as_tentative", true),
max_chars("max_chars", 20),
arrow_image("arrow_image"),
list_position("list_position", BELOW),
items("item"),
combo_button("combo_button"),
combo_list("combo_list"),
combo_editor("combo_editor")
combo_editor("combo_editor"),
drop_down_button("drop_down_button")
{
addSynonym(items, "combo_item");
}
@ -104,19 +104,29 @@ LLComboBox::LLComboBox(const LLComboBox::Params& p)
mPrearrangeCallback(p.prearrange_callback()),
mTextEntryCallback(p.text_entry_callback()),
mSelectionCallback(p.selection_callback()),
mArrowImage(p.arrow_image),
mListPosition(p.list_position)
{
// Text label button
LLButton::Params button_params = p.combo_button;
LLButton::Params button_params = (mAllowTextEntry ? p.combo_button : p.drop_down_button);
button_params.mouse_down_callback.function(boost::bind(&LLComboBox::onButtonDown, this));
button_params.follows.flags(FOLLOWS_LEFT|FOLLOWS_BOTTOM|FOLLOWS_RIGHT);
button_params.rect(p.rect);
button_params.pad_right(2);
if(mAllowTextEntry)
{
button_params.pad_right(2);
}
mArrowImage = button_params.image_unselected;
mButton = LLUICtrlFactory::create<LLButton>(button_params);
mButton->setRightHPad(2); //redo to compensate for button hack that leaves space for a character
if(mAllowTextEntry)
{
//redo to compensate for button hack that leaves space for a character
//unless it is a "minimal combobox"(drop down)
mButton->setRightHPad(2);
}
addChild(mButton);
LLScrollListCtrl::Params params = p.combo_list;

View File

@ -84,7 +84,6 @@ public:
Optional<commit_callback_t> prearrange_callback,
text_entry_callback,
selection_callback;
Optional<LLUIImage*> arrow_image;
Optional<EPreferredPosition, PreferredPositionValues> list_position;
@ -93,6 +92,8 @@ public:
Optional<LLScrollListCtrl::Params> combo_list;
Optional<LLLineEditor::Params> combo_editor;
Optional<LLButton::Params> drop_down_button;
Multiple<ItemParams> items;
Params();

View File

@ -177,8 +177,8 @@ void LLConsole::draw()
// F32 console_opacity = llclamp(gSavedSettings.getF32("ConsoleBackgroundOpacity"), 0.f, 1.f);
F32 console_opacity = llclamp(LLUI::sSettingGroups["config"]->getF32("ConsoleBackgroundOpacity"), 0.f, 1.f);
// LLColor4 color = gSavedSkinSettings.getColor("ConsoleBackground");
LLColor4 color = LLUI::sSettingGroups["color"]->getColor("ConsoleBackground");
// LLColor4 color = LLUIColorTable::instance().getColor("ConsoleBackground");
LLColor4 color = LLUIColorTable::instance().getColor("ConsoleBackground");
color.mV[VALPHA] *= console_opacity;
F32 line_height = mFont->getLineHeight();

View File

@ -53,8 +53,8 @@ public:
Optional<LLUIColor> drag_shadow_color;
Params()
: drag_highlight_color("", LLUI::getCachedColorFunctor("DefaultHighlightLight")),
drag_shadow_color("", LLUI::getCachedColorFunctor("DefaultShadowDark"))
: drag_highlight_color("", LLUIColorTable::instance().getColor("DefaultHighlightLight")),
drag_shadow_color("", LLUIColorTable::instance().getColor("DefaultShadowDark"))
{
mouse_opaque(true);
follows.flags(FOLLOWS_ALL);

View File

@ -66,7 +66,7 @@ const S32 TABBED_FLOATER_OFFSET = 0;
std::string LLFloater::sButtonActiveImageNames[BUTTON_COUNT] =
{
"closebox.tga", //BUTTON_CLOSE
"Icon_Close_Foreground", //BUTTON_CLOSE
"restore.tga", //BUTTON_RESTORE
"minimize.tga", //BUTTON_MINIMIZE
"tearoffbox.tga", //BUTTON_TEAR_OFF
@ -84,7 +84,7 @@ std::string LLFloater::sButtonInactiveImageNames[BUTTON_COUNT] =
std::string LLFloater::sButtonPressedImageNames[BUTTON_COUNT] =
{
"close_in_blue.tga", //BUTTON_CLOSE
"Icon_Close_Press", //BUTTON_CLOSE
"restore_pressed.tga", //BUTTON_RESTORE
"minimize_pressed.tga", //BUTTON_MINIMIZE
"tearoff_pressed.tga", //BUTTON_TEAR_OFF
@ -221,8 +221,8 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p)
mPreviousMinimizedLeft(0),
mNotificationContext(NULL)
{
static LLUICachedControl<LLColor4> default_background_color ("FloaterDefaultBackgroundColor", *(new LLColor4));
static LLUICachedControl<LLColor4> focus_background_color ("FloaterFocusBackgroundColor", *(new LLColor4));
static LLUIColor default_background_color = LLUIColorTable::instance().getColor("FloaterDefaultBackgroundColor");
static LLUIColor focus_background_color = LLUIColorTable::instance().getColor("FloaterFocusBackgroundColor");
for (S32 i = 0; i < BUTTON_COUNT; i++)
{
@ -1449,7 +1449,7 @@ void LLFloater::draw()
S32 bottom = LLPANEL_BORDER_WIDTH;
static LLUICachedControl<S32> shadow_offset_S32 ("DropShadowFloater", 0);
static LLUICachedControl<LLColor4> shadow_color_cached ("ColorDropShadow", *(new LLColor4));
static LLUIColor shadow_color_cached = LLUIColorTable::instance().getColor("ColorDropShadow");
LLColor4 shadow_color = shadow_color_cached;
F32 shadow_offset = (F32)shadow_offset_S32;
@ -1474,7 +1474,7 @@ void LLFloater::draw()
if(gFocusMgr.childHasKeyboardFocus(this) && !getIsChrome() && !getCurrentTitle().empty())
{
static LLUICachedControl<LLColor4> titlebar_focus_color ("TitleBarFocusColor", *(new LLColor4));
static LLUIColor titlebar_focus_color = LLUIColorTable::instance().getColor("TitleBarFocusColor");
// draw highlight on title bar to indicate focus. RDW
const LLFontGL* font = LLFontGL::getFontSansSerif();
LLRect r = getRect();
@ -1533,10 +1533,10 @@ void LLFloater::draw()
{
// add in a border to improve spacialized visual aclarity ;)
// use lines instead of gl_rect_2d so we can round the edges as per james' recommendation
static LLUICachedControl<LLColor4> focus_border_color ("FloaterFocusBorderColor", *(new LLColor4));
static LLUICachedControl<LLColor4> unfocus_border_color ("FloaterUnfocusBorderColor", *(new LLColor4));
static LLUIColor focus_border_color = LLUIColorTable::instance().getColor("FloaterFocusBorderColor");
static LLUIColor unfocus_border_color = LLUIColorTable::instance().getColor("FloaterUnfocusBorderColor");
LLUI::setLineWidth(1.5f);
LLColor4 outlineColor = gFocusMgr.childHasKeyboardFocus(this) ? focus_border_color() : unfocus_border_color;
LLColor4 outlineColor = gFocusMgr.childHasKeyboardFocus(this) ? focus_border_color : unfocus_border_color;
gl_rect_2d_offset_local(0, getRect().getHeight() + 1, getRect().getWidth() + 1, 0, outlineColor, -LLPANEL_BORDER_WIDTH, FALSE);
LLUI::setLineWidth(1.f);
}
@ -1699,7 +1699,6 @@ void LLFloater::buildButtons()
p.tab_stop(false);
p.follows.flags(FOLLOWS_TOP|FOLLOWS_RIGHT);
p.tool_tip(sButtonToolTips[i]);
p.image_color(LLUI::getCachedColorFunctor("FloaterButtonImageColor"));
p.scale_image(true);
LLButton* buttonp = LLUICtrlFactory::create<LLButton>(p);

View File

@ -54,11 +54,6 @@ LLFlyoutButton::LLFlyoutButton(const Params& p)
mActionButton = LLUICtrlFactory::create<LLButton>(bp);
addChild(mActionButton);
mButton->setOrigin(getRect().getWidth() - FLYOUT_BUTTON_ARROW_WIDTH, 0);
mButton->reshape(FLYOUT_BUTTON_ARROW_WIDTH, getRect().getHeight());
mButton->setFollows(FOLLOWS_RIGHT | FOLLOWS_TOP | FOLLOWS_BOTTOM);
mButton->setImageOverlay(mListPosition == BELOW ? "down_arrow.tga" : "up_arrow.tga", LLFontGL::RIGHT);
}
void LLFlyoutButton::onActionButtonClick(const LLSD& data)
@ -75,7 +70,7 @@ void LLFlyoutButton::draw()
//FIXME: this should be an attribute of comboboxes, whether they have a distinct label or
// the label reflects the last selected item, for now we have to manually remove the label
mButton->setLabel(LLStringUtil::null);
setLabel(LLStringUtil::null);
LLComboBox::draw();
}

View File

@ -46,10 +46,14 @@ public:
struct Params : public LLInitParam::Block<Params, LLComboBox::Params>
{
Optional<LLButton::Params> action_button;
Deprecated allow_text_entry;
Params()
: action_button("action_button")
{}
: action_button("action_button"),
allow_text_entry("allow_text_entry")
{
LLComboBox::Params::allow_text_entry = false;
}
};
protected:

View File

@ -323,7 +323,7 @@ F32 LLFocusMgr::getFocusFlashAmt() const
LLColor4 LLFocusMgr::getFocusColor() const
{
static LLUICachedControl<LLColor4> focus_color_cached ("FocusColor", *(new LLColor4));
static LLUIColor focus_color_cached = LLUIColorTable::instance().getColor("FocusColor");
LLColor4 focus_color = lerp(focus_color_cached, LLColor4::white, getFocusFlashAmt());
// de-emphasize keyboard focus when app has lost focus (to avoid typing into wrong window problem)
if (!mAppHasFocus)

View File

@ -184,6 +184,11 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p)
mBorder = LLUICtrlFactory::create<LLViewBorder>(border_p);
addChild( mBorder );
if(p.background_image.isProvided())
{
mImage = p.background_image;
}
// clamp text padding to current editor size
updateTextPadding();
setCursor(mText.length());
@ -1525,12 +1530,12 @@ void LLLineEditor::draw()
LLColor4 bg_color = mReadOnlyBgColor.get();
#if 0 // for when we're ready for image art.
#if 1 // for when we're ready for image art.
if( hasFocus())
{
mImage->drawBorder(0, 0, getRect().getWidth(), getRect().getHeight(), gFocusMgr.getFocusColor(), gFocusMgr.getFocusFlashWidth());
}
mImage->draw(getLocalRect(), mReadOnly ? mReadOnlyBgColor : mWriteableBgColor );
mImage->draw(getLocalRect());
#else // the old programmer art.
// drawing solids requires texturing be disabled
{
@ -1691,7 +1696,7 @@ void LLLineEditor::draw()
mMaxHPixels - llround(rendered_pixels_right),
&rendered_pixels_right);
}
#if 0 // for when we're ready for image art.
#if 1 // for when we're ready for image art.
mBorder->setVisible(FALSE); // no more programmatic art.
#endif

View File

@ -2333,10 +2333,10 @@ BOOL LLMenuGL::appendMenu( LLMenuGL* menu )
p.label = menu->getLabel();
p.branch = menu;
p.jump_key = menu->getJumpKey();
p.enabled_color=LLUI::getCachedColorFunctor("MenuItemEnabledColor");
p.disabled_color=LLUI::getCachedColorFunctor("MenuItemDisabledColor");
p.highlight_bg_color=LLUI::getCachedColorFunctor("MenuItemHighlightBgColor");
p.highlight_fg_color=LLUI::getCachedColorFunctor("MenuItemHighlightFgColor");
p.enabled_color=LLUIColorTable::instance().getColor("MenuItemEnabledColor");
p.disabled_color=LLUIColorTable::instance().getColor("MenuItemDisabledColor");
p.highlight_bg_color=LLUIColorTable::instance().getColor("MenuItemHighlightBgColor");
p.highlight_fg_color=LLUIColorTable::instance().getColor("MenuItemHighlightFgColor");
LLMenuItemBranchGL* branch = LLUICtrlFactory::create<LLMenuItemBranchGL>(p);
success &= append( branch );
@ -2743,7 +2743,7 @@ void LLMenuGL::draw( void )
if (mDropShadowed && !mTornOff)
{
static LLUICachedControl<S32> drop_shadow_floater ("DropShadowFloater", 0);
static LLUICachedControl<LLColor4> color_drop_shadow ("ColorDropShadow", *(new LLColor4));
static LLUIColor color_drop_shadow = LLUIColorTable::instance().getColor("ColorDropShadow");
gl_drop_shadow(0, getRect().getHeight(), getRect().getWidth(), 0,
color_drop_shadow, drop_shadow_floater );
}
@ -3117,10 +3117,10 @@ BOOL LLMenuBarGL::appendMenu( LLMenuGL* menu )
p.label = menu->getLabel();
p.visible = menu->getVisible();
p.branch = menu;
p.enabled_color=LLUI::getCachedColorFunctor("MenuItemEnabledColor");
p.disabled_color=LLUI::getCachedColorFunctor("MenuItemDisabledColor");
p.highlight_bg_color=LLUI::getCachedColorFunctor("MenuItemHighlightBgColor");
p.highlight_fg_color=LLUI::getCachedColorFunctor("MenuItemHighlightFgColor");
p.enabled_color=LLUIColorTable::instance().getColor("MenuItemEnabledColor");
p.disabled_color=LLUIColorTable::instance().getColor("MenuItemDisabledColor");
p.highlight_bg_color=LLUIColorTable::instance().getColor("MenuItemHighlightBgColor");
p.highlight_fg_color=LLUIColorTable::instance().getColor("MenuItemHighlightFgColor");
LLMenuItemBranchDownGL* branch = LLUICtrlFactory::create<LLMenuItemBranchDownGL>(p);
success &= branch->addToAcceleratorList(&mAccelerators);
@ -3804,10 +3804,10 @@ BOOL LLContextMenu::appendContextSubMenu(LLContextMenu *menu)
p.name = menu->getName();
p.label = menu->getLabel();
p.branch = menu;
p.enabled_color=LLUI::getCachedColorFunctor("MenuItemEnabledColor");
p.disabled_color=LLUI::getCachedColorFunctor("MenuItemDisabledColor");
p.highlight_bg_color=LLUI::getCachedColorFunctor("MenuItemHighlightBgColor");
p.highlight_fg_color=LLUI::getCachedColorFunctor("MenuItemHighlightFgColor");
p.enabled_color=LLUIColorTable::instance().getColor("MenuItemEnabledColor");
p.disabled_color=LLUIColorTable::instance().getColor("MenuItemDisabledColor");
p.highlight_bg_color=LLUIColorTable::instance().getColor("MenuItemHighlightBgColor");
p.highlight_fg_color=LLUIColorTable::instance().getColor("MenuItemHighlightFgColor");
item = LLUICtrlFactory::create<LLContextMenuBranch>(p);
LLMenuGL::sMenuContainer->addChild(item->getBranch());

View File

@ -379,7 +379,7 @@ public:
drop_shadow("drop_shadow", true),
bg_visible("bg_visible", true),
create_jump_keys("create_jump_keys", false),
bg_color("bg_color", LLUI::getCachedColorFunctor( "MenuDefaultBgColor" )),
bg_color("bg_color", LLUIColorTable::instance().getColor( "MenuDefaultBgColor" )),
scrollable("scrollable", false)
{
addSynonym(bg_visible, "opaque");

View File

@ -244,7 +244,7 @@ void LLModalDialog::onClose(bool app_quitting)
// virtual
void LLModalDialog::draw()
{
static LLUICachedControl<LLColor4> shadow_color ("ColorDropShadow", *(new LLColor4));
static LLUIColor shadow_color = LLUIColorTable::instance().getColor("ColorDropShadow");
static LLUICachedControl<S32> shadow_lines ("DropShadowFloater", 0);
gl_drop_shadow( 0, getRect().getHeight(), getRect().getWidth(), 0,

View File

@ -428,14 +428,10 @@ void LLPanel::initFromParams(const LLPanel::Params& p)
mUIStrings[it->name] = it->text;
}
setName(p.name());
setLabel(p.label());
setShape(p.rect);
parseFollowsFlags(p);
setEnabled(p.enabled);
setVisible(p.visible);
setToolTip(p.tool_tip());
setSaveToXML(p.serializable);

View File

@ -63,7 +63,7 @@ LLResizeHandle::LLResizeHandle(const LLResizeHandle::Params& p)
{
if( RIGHT_BOTTOM == mCorner)
{
mImage = LLUI::getUIImage("resize_handle_bottom_right_blue.tga");
mImage = LLUI::getUIImage("Resize_Corner");
}
switch( p.corner )
{

View File

@ -111,8 +111,8 @@ LLSpinCtrl::LLSpinCtrl(const LLSpinCtrl::Params& p)
.right(btn_right)
.height(spinctrl_btn_height);
up_button_params.follows.flags(FOLLOWS_LEFT|FOLLOWS_BOTTOM);
up_button_params.image_unselected.name("spin_up_out_blue.tga");
up_button_params.image_selected.name("spin_up_in_blue.tga");
up_button_params.image_unselected.name("ScrollArrow_Up");
up_button_params.image_selected.name("ScrollArrow_Up");
up_button_params.click_callback.function(boost::bind(&LLSpinCtrl::onUpBtn, this, _2));
up_button_params.mouse_held_callback.function(boost::bind(&LLSpinCtrl::onUpBtn, this, _2));
up_button_params.tab_stop(false);
@ -130,8 +130,8 @@ LLSpinCtrl::LLSpinCtrl(const LLSpinCtrl::Params& p)
.bottom(bottom)
.height(spinctrl_btn_height);
down_button_params.follows.flags(FOLLOWS_LEFT|FOLLOWS_BOTTOM);
down_button_params.image_unselected.name("spin_down_out_blue.tga");
down_button_params.image_selected.name("spin_down_in_blue.tga");
down_button_params.image_unselected.name("ScrollArrow_Down");
down_button_params.image_selected.name("ScrollArrow_Down");
down_button_params.click_callback.function(boost::bind(&LLSpinCtrl::onDownBtn, this, _2));
down_button_params.mouse_held_callback.function(boost::bind(&LLSpinCtrl::onDownBtn, this, _2));
down_button_params.tab_stop(false);

View File

@ -107,10 +107,10 @@ void LLStatGraph::draw()
}
//gl_drop_shadow(0, getRect().getHeight(), getRect().getWidth(), 0,
// gSavedSkinSettings.getColor("ColorDropShadow"),
// LLUIColorTable::instance().getColor("ColorDropShadow"),
// (S32) gSavedSettings.getF32("DropShadowFloater") );
color = LLUI::sSettingGroups["color"]->getColor( "MenuDefaultBgColor" );
color = LLUIColorTable::instance().getColor( "MenuDefaultBgColor" );
gGL.color4fv(color.mV);
gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, TRUE);

View File

@ -106,7 +106,7 @@ protected:
private:
BOOL mVisible;
LLColor4 mColor;
LLUIColor mColor;
std::string mFontName;
LLFontGL* mFont; // cached for performance
std::string mLink;

View File

@ -314,7 +314,7 @@ void LLTextBox::draw()
if( mBorderDropShadowVisible )
{
static LLUICachedControl<LLColor4> color_drop_shadow ("ColorDropShadow", *(new LLColor4));
static LLUIColor color_drop_shadow = LLUIColorTable::instance().getColor("ColorDropShadow");
static LLUICachedControl<S32> drop_shadow_tooltip ("DropShadowTooltip", 0);
gl_drop_shadow(0, getRect().getHeight(), getRect().getWidth(), 0,
color_drop_shadow, drop_shadow_tooltip);

View File

@ -75,7 +75,7 @@ const S32 CURSOR_THICKNESS = 2;
const S32 SPACES_PER_TAB = 4;
LLColor4 LLTextEditor::mLinkColor = LLColor4::blue;
LLUIColor LLTextEditor::mLinkColor = LLColor4::blue;
void (* LLTextEditor::mURLcallback)(const std::string&) = NULL;
bool (* LLTextEditor::mSecondlifeURLcallback)(const std::string&) = NULL;
bool (* LLTextEditor::mSecondlifeURLcallbackRightClick)(const std::string&) = NULL;
@ -3083,8 +3083,8 @@ void LLTextEditor::drawClippedSegment(const LLWString &text, S32 seg_start, S32
if (style->getIsEmbeddedItem())
{
static LLUICachedControl<LLColor4> text_embedded_item_readonly_color ("TextEmbeddedItemReadOnlyColor", *(new LLColor4));
static LLUICachedControl<LLColor4> text_embedded_item_color ("TextEmbeddedItemColor", *(new LLColor4));
static LLUIColor text_embedded_item_readonly_color = LLUIColorTable::instance().getColor("TextEmbeddedItemReadOnlyColor");
static LLUIColor text_embedded_item_color = LLUIColorTable::instance().getColor("TextEmbeddedItemColor");
if (mReadOnly)
{
color = text_embedded_item_readonly_color;

View File

@ -512,7 +512,7 @@ private:
// Data
//
LLKeywords mKeywords;
static LLColor4 mLinkColor;
static LLUIColor mLinkColor;
static void (*mURLcallback) (const std::string& url);
static bool (*mSecondlifeURLcallback) (const std::string& url);
static bool (*mSecondlifeURLcallbackRightClick) (const std::string& url);

View File

@ -1579,7 +1579,6 @@ void LLUI::initClass(const settings_map_t& settings,
sSettingGroups = settings;
if ((get_ptr_in_map(sSettingGroups, std::string("config")) == NULL) ||
(get_ptr_in_map(sSettingGroups, std::string("color")) == NULL) ||
(get_ptr_in_map(sSettingGroups, std::string("floater")) == NULL) ||
(get_ptr_in_map(sSettingGroups, std::string("ignores")) == NULL))
{
@ -1590,7 +1589,7 @@ void LLUI::initClass(const settings_map_t& settings,
sAudioCallback = audio_callback;
sGLScaleFactor = (scale_factor == NULL) ? LLVector2(1.f, 1.f) : *scale_factor;
sWindow = NULL; // set later in startup
LLFontGL::sShadowColor = LLUI::sSettingGroups["color"]->getColor("ColorDropShadow");
LLFontGL::sShadowColor = LLUIColorTable::instance().getColor("ColorDropShadow");
static LLUICachedControl<bool> show_xui_names ("ShowXUINames", false);
LLUI::sShowXUINames = show_xui_names;
@ -1855,13 +1854,6 @@ void LLUI::setHtmlHelp(LLHtmlHelp* html_help)
LLUI::sHtmlHelp = html_help;
}
// static
boost::function<const LLColor4&()> LLUI::getCachedColorFunctor(const std::string& color_name)
{
return LLCachedControl<LLColor4>(*sSettingGroups["color"], color_name, LLColor4::magenta);
}
// static
LLControlGroup& LLUI::getControlControlGroup (const std::string& controlname)
{
for (settings_map_t::iterator itor = sSettingGroups.begin();

View File

@ -45,6 +45,8 @@
#include "lluiimage.h" // *TODO: break this dependency, need to add #include "lluiimage.h" to all widgets that hold an Optional<LLUIImage*> in their paramblocks
#include "llinitparam.h"
#include "llregistry.h"
#include "lluicolor.h"
#include "lluicolortable.h"
#include <boost/signals2.hpp>
#include "lllazyvalue.h"
@ -202,7 +204,6 @@ public:
static void screenRectToGL(const LLRect& screen, LLRect *gl);
static void glRectToScreen(const LLRect& gl, LLRect *screen);
static void setHtmlHelp(LLHtmlHelp* html_help);
static boost::function<const LLColor4&()> getCachedColorFunctor(const std::string& color_name);
// Returns the control group containing the control name, or the default group
static LLControlGroup& getControlControlGroup (const std::string& controlname);
@ -690,8 +691,6 @@ public:
{}
};
typedef LLLazyValue<LLColor4> LLUIColor;
namespace LLInitParam
{
template<>
@ -767,11 +766,4 @@ namespace LLInitParam
};
}
namespace LLInitParam
{
template<>
bool ParamCompare<LLLazyValue<LLColor4> >::equals(
const LLLazyValue<LLColor4> &a, const LLLazyValue<LLColor4> &b);
}
#endif

View File

@ -11,7 +11,10 @@
#include <queue>
#include "lldir.h"
#include "llui.h"
#include "lluicolortable.h"
#include "lluictrlfactory.h"
LLUIColorTable::ColorParams::ColorParams()
: value("value"),
@ -26,17 +29,16 @@ LLUIColorTable::ColorEntryParams::ColorEntryParams()
}
LLUIColorTable::Params::Params()
: color_entries("color_entries")
: color_entries("color")
{
}
void LLUIColorTable::init(const Params& p)
void LLUIColorTable::insertFromParams(const Params& p)
{
// this map will contain all color references after the following loop
typedef std::map<std::string, std::string> string_string_map_t;
string_string_map_t unresolved_refs;
mColors.clear();
for(LLInitParam::ParamIterator<ColorEntryParams>::const_iterator it = p.color_entries().begin();
it != p.color_entries().end();
++it)
@ -44,7 +46,7 @@ void LLUIColorTable::init(const Params& p)
ColorEntryParams color_entry = *it;
if(color_entry.color.value.isChosen())
{
mColors.insert(string_color_map_t::value_type(color_entry.name, color_entry.color.value));
setColor(color_entry.name, color_entry.color.value, mLoadedColors);
}
else
{
@ -66,19 +68,21 @@ void LLUIColorTable::init(const Params& p)
// we haven't visited any references yet
visited_refs.clear();
string_string_map_t::iterator it = unresolved_refs.begin();
string_string_map_t::iterator current = unresolved_refs.begin();
string_string_map_t::iterator previous;
while(true)
{
if(it != unresolved_refs.end())
if(current != unresolved_refs.end())
{
// locate the current reference in the previously visited references...
string_color_ref_iter_map_t::iterator visited = visited_refs.lower_bound(it->first);
string_color_ref_iter_map_t::iterator visited = visited_refs.lower_bound(current->first);
if(visited != visited_refs.end()
&& !(visited_refs.key_comp()(it->first, visited->first)))
&& !(visited_refs.key_comp()(current->first, visited->first)))
{
// ...if we find the current reference in the previously visited references
// we know that there is a cycle
std::string ending_ref = it->first;
std::string ending_ref = current->first;
std::string warning("The following colors form a cycle: ");
// warn about the references in the chain and remove them from
@ -102,17 +106,17 @@ void LLUIColorTable::init(const Params& p)
else
{
// ...continue along the reference chain
ref_chain.push(it->first);
visited_refs.insert(visited, string_color_ref_iter_map_t::value_type(it->first, it));
ref_chain.push(current->first);
visited_refs.insert(visited, string_color_ref_iter_map_t::value_type(current->first, current));
}
}
else
{
// since this reference does not refer to another reference it must refer to an
// actual color, lets find it...
string_color_map_t::iterator color_value = mColors.find(it->second);
string_color_map_t::iterator color_value = mLoadedColors.find(previous->second);
if(color_value != mColors.end())
if(color_value != mLoadedColors.end())
{
// ...we found the color, and we now add every reference in the reference chain
// to the color map
@ -120,7 +124,7 @@ void LLUIColorTable::init(const Params& p)
iter != visited_refs.end();
++iter)
{
mColors.insert(string_color_map_t::value_type(iter->first, color_value->second));
setColor(iter->first, color_value->second, mLoadedColors);
unresolved_refs.erase(iter->second);
}
@ -143,13 +147,142 @@ void LLUIColorTable::init(const Params& p)
}
// find the next color reference in the reference chain
it = unresolved_refs.find(it->second);
previous = current;
current = unresolved_refs.find(current->second);
}
}
}
const LLColor4& LLUIColorTable::getColor(const std::string& name) const
void LLUIColorTable::clear()
{
string_color_map_t::const_iterator iter = mColors.find(name);
return (iter != mColors.end() ? iter->second : LLColor4::magenta);
clearTable(mLoadedColors);
clearTable(mUserSetColors);
}
LLUIColor LLUIColorTable::getColor(const std::string& name, const LLColor4& default_color) const
{
string_color_map_t::const_iterator iter = mUserSetColors.find(name);
if(iter != mUserSetColors.end())
{
return LLUIColor(&iter->second);
}
iter = mLoadedColors.find(name);
return (iter != mLoadedColors.end() ? LLUIColor(&iter->second) : LLUIColor(default_color));
}
// update user color, loaded colors are parsed on initialization
void LLUIColorTable::setColor(const std::string& name, const LLColor4& color)
{
setColor(name, color, mUserSetColors);
}
bool LLUIColorTable::loadFromSettings()
{
bool result = false;
std::string default_filename = gDirUtilp->getExpandedFilename(LL_PATH_DEFAULT_SKIN, "colors_def.xml");
result |= loadFromFilename(default_filename);
std::string current_filename = gDirUtilp->getExpandedFilename(LL_PATH_TOP_SKIN, "colors_def.xml");
if(current_filename != default_filename)
{
result |= loadFromFilename(current_filename);
}
std::string user_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SKIN, "colors_def.xml");
loadFromFilename(user_filename);
return result;
}
void LLUIColorTable::saveUserSettings() const
{
Params params;
for(string_color_map_t::const_iterator it = mUserSetColors.begin();
it != mUserSetColors.end();
++it)
{
ColorEntryParams color_entry;
color_entry.name = it->first;
color_entry.color.value = it->second;
params.color_entries.add(color_entry);
}
LLXMLNodePtr output_node = new LLXMLNode("colors", false);
LLXUIParser::instance().writeXUI(output_node, params);
if(!output_node->isNull())
{
const std::string& filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SKIN, "colors_def.xml");
LLFILE *fp = LLFile::fopen(filename, "w");
if(fp != NULL)
{
LLXMLNode::writeHeaderToFile(fp);
output_node->writeToFile(fp);
fclose(fp);
}
}
}
bool LLUIColorTable::colorExists(const std::string& color_name) const
{
return ((mLoadedColors.find(color_name) != mLoadedColors.end())
|| (mUserSetColors.find(color_name) != mUserSetColors.end()));
}
void LLUIColorTable::clearTable(string_color_map_t& table)
{
for(string_color_map_t::iterator it = table.begin();
it != table.end();
++it)
{
it->second = LLColor4::magenta;
}
}
// this method inserts a color into the table if it does not exist
// if the color already exists it changes the color
void LLUIColorTable::setColor(const std::string& name, const LLColor4& color, string_color_map_t& table)
{
string_color_map_t::iterator it = table.lower_bound(name);
if(it != table.end()
&& !(table.key_comp()(name, it->first)))
{
it->second = color;
}
else
{
table.insert(it, string_color_map_t::value_type(name, color));
}
}
bool LLUIColorTable::loadFromFilename(const std::string& filename)
{
LLXMLNodePtr root;
if(!LLXMLNode::parseFile(filename, root, NULL))
{
llwarns << "Unable to parse color file " << filename << llendl;
return false;
}
Params params;
LLXUIParser::instance().readXUI(root, params);
if(params.validateBlock())
{
insertFromParams(params);
}
else
{
llwarns << filename << " failed to load" << llendl;
return false;
}
return true;
}

View File

@ -17,8 +17,11 @@
#include "v4color.h"
class LLUIColor;
class LLUIColorTable : public LLSingleton<LLUIColorTable>
{
LOG_CLASS(LLUIColorTable);
public:
struct ColorParams : LLInitParam::Choice<ColorParams>
{
@ -44,15 +47,37 @@ public:
};
// define colors by passing in a param block that can be generated via XUI file or manually
void init(const Params& p);
void insertFromParams(const Params& p);
// reset all colors to default magenta color
void clear();
// color lookup
const LLColor4& getColor(const std::string& name) const;
LLUIColor getColor(const std::string& name, const LLColor4& default_color = LLColor4::magenta) const;
// if the color is in the table, it's value is changed, otherwise it is added
void setColor(const std::string& name, const LLColor4& color);
// returns true if color_name exists in the table
bool colorExists(const std::string& color_name) const;
// loads colors from settings files
bool loadFromSettings();
// saves colors specified by the user to the users skin directory
void saveUserSettings() const;
private:
// consider using sorted vector
bool loadFromFilename(const std::string& filename);
// consider using sorted vector, can be much faster
typedef std::map<std::string, LLColor4> string_color_map_t;
string_color_map_t mColors;
void clearTable(string_color_map_t& table);
void setColor(const std::string& name, const LLColor4& color, string_color_map_t& table);
string_color_map_t mLoadedColors;
string_color_map_t mUserSetColors;
};
#endif // LL_LLUICOLORTABLE_H

View File

@ -918,12 +918,4 @@ namespace LLInitParam
{
return false;
}
template<>
bool ParamCompare<LLLazyValue<LLColor4> >::equals(
const LLLazyValue<LLColor4> &a,
const LLLazyValue<LLColor4> &b)
{
return a.get() == b.get();
}
}

View File

@ -398,11 +398,11 @@ BOOL LLUICtrlFactory::getAttributeColor(LLXMLNodePtr node, const std::string& na
{
std::string colorstring;
BOOL res = node->getAttributeString(name.c_str(), colorstring);
if (res && LLUI::sSettingGroups["color"])
if (res)
{
if (LLUI::sSettingGroups["color"]->controlExists(colorstring))
if (LLUIColorTable::instance().colorExists(colorstring))
{
color.setVec(LLUI::sSettingGroups["color"]->getColor(colorstring));
color.setVec(LLUIColorTable::instance().getColor(colorstring));
}
else
{
@ -1010,7 +1010,7 @@ bool LLXUIParser::writeUIColorValue(const void* val_ptr, const name_stack_t& sta
LLUIColor color = *((LLUIColor*)val_ptr);
//RN: don't write out the color that is represented by a function
// rely on param block exporting to get the reference to the color settings
if (color.isUsingFunction()) return false;
if (color.isReference()) return false;
node->setFloatValue(4, color.get().mV);
return true;
}

View File

@ -305,7 +305,7 @@ fail:
static T* getDefaultWidget(const std::string& name)
{
dummy_widget_creator_func_t* dummy_func = LLDummyWidgetRegistry::instance().getValue(&typeid(T));
return dynamic_cast<T*>((*dummy_func)(name));
return dummy_func ? dynamic_cast<T*>((*dummy_func)(name)) : NULL;
}
template <class T>

View File

@ -74,7 +74,7 @@ void LLUIImage::setScaleRegion(const LLRectf& region)
//TODO: move drawing implementation inside class
void LLUIImage::draw(S32 x, S32 y, const LLColor4& color) const
{
gl_draw_image(x, y, mImage, color, mClipRegion);
gl_draw_scaled_image(x, y, getWidth(), getHeight(), mImage, color, mClipRegion);
}
void LLUIImage::draw(S32 x, S32 y, S32 width, S32 height, const LLColor4& color) const

View File

@ -60,11 +60,11 @@ public:
void drawSolid(S32 x, S32 y, S32 width, S32 height, const LLColor4& color) const;
void drawSolid(const LLRect& rect, const LLColor4& color) const { drawSolid(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(), color); }
void drawSolid(S32 x, S32 y, const LLColor4& color) const { drawSolid(x, y, mImage->getWidth(0), mImage->getHeight(0), color); }
void drawSolid(S32 x, S32 y, const LLColor4& color) const { drawSolid(x, y, getWidth(), getHeight(), color); }
void drawBorder(S32 x, S32 y, S32 width, S32 height, const LLColor4& color, S32 border_width) const;
void drawBorder(const LLRect& rect, const LLColor4& color, S32 border_width) const { drawBorder(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(), color, border_width); }
void drawBorder(S32 x, S32 y, const LLColor4& color, S32 border_width) const { drawBorder(x, y, mImage->getWidth(0), mImage->getHeight(0), color, border_width); }
void drawBorder(S32 x, S32 y, const LLColor4& color, S32 border_width) const { drawBorder(x, y, getWidth(), getHeight(), color, border_width); }
const std::string& getName() const { return mName; }

View File

@ -1325,13 +1325,6 @@ void LLView::draw()
LLRect rootRect = getRootView()->getRect();
LLRect screenRect;
// draw focused control on top of everything else
LLView* focus_view = gFocusMgr.getKeyboardFocus();
if (focus_view && focus_view->getParent() != this)
{
focus_view = NULL;
}
++sDepth;
for (child_list_reverse_iter_t child_iter = mChildList.rbegin(); child_iter != mChildList.rend();) // ++child_iter)
@ -1339,7 +1332,7 @@ void LLView::draw()
child_list_reverse_iter_t child = child_iter++;
LLView *viewp = *child;
if (viewp->getVisible() && viewp != focus_view && viewp->getRect().isValid())
if (viewp->getVisible() && viewp->getRect().isValid())
{
// Only draw views that are within the root view
localRectToScreen(viewp->getRect(),&screenRect);
@ -1357,11 +1350,6 @@ void LLView::draw()
}
--sDepth;
if (focus_view && focus_view->getVisible())
{
drawChild(focus_view);
}
}
gGL.getTexUnit(0)->disable();
@ -1398,7 +1386,7 @@ void LLView::drawDebugRect()
}
else
{
static LLUICachedControl<LLColor4> scroll_highlighted_color ("ScrollHighlightedColor", *(new LLColor4));
static LLUIColor scroll_highlighted_color = LLUIColorTable::instance().getColor("ScrollHighlightedColor");
border_color = scroll_highlighted_color;
}
}

View File

@ -142,8 +142,25 @@ LLDir_Mac::LLDir_Mac()
CFURLRefToLLString(executableParentURLRef, mExecutableDir, true);
// mAppRODataDir
CFURLRef resourcesURLRef = CFBundleCopyResourcesDirectoryURL(mainBundleRef);
CFURLRefToLLString(resourcesURLRef, mAppRODataDir, true);
// *NOTE: When running in a dev tree, use the copy of app_settings and
// skins in indra/newview/ rather than in the application bundle. This
// mirrors Windows dev environment behavior and allows direct checkin
// of edited skins/xui files. JC
U32 indra_pos = mExecutableDir.find("/indra");
if (indra_pos != std::string::npos)
{
// ...we're in a dev checkout
mAppRODataDir = mExecutableDir.substr(0, indra_pos)
+ "/indra/newview";
llinfos << "Running in dev checkout with mAppRODataDir "
<< mAppRODataDir << llendl;
}
else
{
// ...normal installation running
CFURLRef resourcesURLRef = CFBundleCopyResourcesDirectoryURL(mainBundleRef);
CFURLRefToLLString(resourcesURLRef, mAppRODataDir, true);
}
// mOSUserDir
error = FSFindFolder(kUserDomain, kApplicationSupportFolderType, true, &fileRef);

View File

@ -64,7 +64,7 @@ if (NOT LINUX OR VIEWER)
${UI_LIBRARIES} # for GTK
${SDL_LIBRARY}
)
endif (VIEWER)
endif (NOT LINUX OR VIEWER)
if (DARWIN)
list(APPEND llwindow_SOURCE_FILES
@ -96,7 +96,7 @@ if (LINUX AND VIEWER)
llkeyboardsdl.h
llwindowsdl.h
)
endif (LINUX)
endif (LINUX AND VIEWER)
if (WINDOWS)
list(APPEND llwindow_SOURCE_FILES

View File

@ -3329,17 +3329,6 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>NotFullScreen</key>
<map>
<key>Comment</key>
<string>Run SL in non fullscreen mode</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>FullScreenAspectRatio</key>
<map>
<key>Comment</key>
@ -5460,17 +5449,6 @@
<key>Value</key>
<integer>1</integer>
</map>
<key>RenderCustomSettings</key>
<map>
<key>Comment</key>
<string>Do you want to set the graphics settings yourself</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>RenderDebugAlphaMask</key>
<map>
<key>Comment</key>
@ -5758,6 +5736,21 @@
<key>Value</key>
<integer>2</integer>
</map>
<key>RenderGlowLumWeights</key>
<map>
<key>Comment</key>
<string>Weights for each color channel to be used in calculating luminance (should add up to 1.0)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Vector3</string>
<key>Value</key>
<array>
<real>0.299</real>
<real>0.587</real>
<real>0.114</real>
</array>
</map>
<key>RenderGlowMaxExtractAlpha</key>
<map>
<key>Comment</key>
@ -5813,6 +5806,21 @@
<key>Value</key>
<real>0.0</real>
</map>
<key>RenderGlowWarmthWeights</key>
<map>
<key>Comment</key>
<string>Weight of each color channel used before finding the max warmth</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Vector3</string>
<key>Value</key>
<array>
<real>1.0</real>
<real>0.5</real>
<real>0.7</real>
</array>
</map>
<key>RenderGlowWidth</key>
<map>
<key>Comment</key>
@ -6589,6 +6597,17 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>ShowAdvancedGraphicsSettings</key>
<map>
<key>Comment</key>
<string>Show advanced graphics settings</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ShowAllObjectHoverTip</key>
<map>
<key>Comment</key>
@ -7230,6 +7249,21 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>SkyNightColorShift</key>
<map>
<key>Comment</key>
<string>Controls moonlight color (base color applied to moon as light source)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Color3</string>
<key>Value</key>
<array>
<real>0.67</real>
<real>0.67</real>
<real>1.0</real>
</array>
</map>
<key>SkyOverrideSimSunPosition</key>
<map>
<key>Comment</key>
@ -9314,6 +9348,17 @@
<key>Value</key>
<integer>1</integer>
</map>
<key>WindowFullScreen</key>
<map>
<key>Comment</key>
<string>Run SL in fullscreen mode</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>WindowHeight</key>
<map>
<key>Comment</key>

View File

@ -361,7 +361,7 @@ LLAgent::LLAgent() :
mAutoPilotFinishedCallback(NULL),
mAutoPilotCallbackData(NULL),
mEffectColor(0.f, 1.f, 1.f, 1.f),
mEffectColor(LLColor4(0.f, 1.f, 1.f, 1.f)),
mHaveHomePosition(FALSE),
mHomeRegionHandle( 0 ),
@ -413,7 +413,7 @@ void LLAgent::init()
mCameraZoomFraction = 1.f;
mTrackFocusObject = gSavedSettings.getBOOL("TrackFocusObject");
mEffectColor = gSavedSkinSettings.getColor4("EffectColor");
mEffectColor = LLUIColorTable::instance().getColor("EffectColor");
gSavedSettings.getControl("PreferredMaturity")->getValidateSignal()->connect(boost::bind(&LLAgent::validateMaturity, this, _2));
gSavedSettings.getControl("PreferredMaturity")->getSignal()->connect(boost::bind(&LLAgent::handleMaturity, this, _2));

View File

@ -44,6 +44,7 @@
#include "llcharacter.h" // LLAnimPauseRequest
#include "llfollowcam.h" // Ventrella
#include "llagentdata.h" // gAgentID, gAgentSessionID
#include "lluicolor.h"
#include "llvoavatardefines.h"
extern const BOOL ANIMATE;
@ -829,7 +830,7 @@ public:
F32 mHUDTargetZoom; // Target zoom level for HUD objects (used when editing)
F32 mHUDCurZoom; // Current animated zoom level for HUD objects
private:
LLColor4 mEffectColor;
LLUIColor mEffectColor;
/** Camera
** **

View File

@ -668,7 +668,6 @@ bool LLAppViewer::init()
// Widget construction depends on LLUI being initialized
LLUI::settings_map_t settings_map;
settings_map["config"] = &gSavedSettings;
settings_map["color"] = &gSavedSkinSettings;
settings_map["ignores"] = &gWarningSettings;
settings_map["floater"] = &gSavedSettings; // *TODO: New settings file
settings_map["account"] = &gSavedPerAccountSettings;
@ -1346,8 +1345,8 @@ bool LLAppViewer::cleanup()
// save their rects on delete.
gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), TRUE);
//*FIX: don't overwrite user color tweaks with *all* colors
gSavedSkinSettings.saveToFile(gSavedSettings.getString("SkinningSettingsFile"), TRUE);
LLUIColorTable::instance().saveUserSettings();
// PerAccountSettingsFile should be empty if no use has been logged on.
// *FIX:Mani This should get really saved in a "logoff" mode.
gSavedPerAccountSettings.saveToFile(gSavedSettings.getString("PerAccountSettingsFile"), TRUE);
@ -1361,7 +1360,7 @@ bool LLAppViewer::cleanup()
gWarningSettings.saveToFile(warnings_settings_filename, TRUE);
gSavedSettings.cleanup();
gSavedSkinSettings.cleanup();
LLUIColorTable::instance().clear();
gCrashSettings.cleanup();
// Save URL history file
@ -1701,43 +1700,11 @@ std::string LLAppViewer::getSettingsFilename(const std::string& location_key,
void LLAppViewer::loadColorSettings()
{
gSavedSkinSettings.cleanup();
loadSettingsFromDirectory("DefaultSkin");
loadSettingsFromDirectory("CurrentSkin", true);
loadSettingsFromDirectory("UserSkin");
class ColorConverterFunctor : public LLControlGroup::ApplyFunctor
if(!LLUIColorTable::instance().loadFromSettings())
{
public:
explicit ColorConverterFunctor(LLUIColorTable::Params& result)
:mResult(result)
{
}
void apply(const std::string& name, LLControlVariable* control)
{
if(control->isType(TYPE_COL4))
{
LLUIColorTable::ColorParams color;
color.value = (LLColor4)control->getValue();
LLUIColorTable::ColorEntryParams color_entry;
color_entry.name = name;
color_entry.color = color;
mResult.color_entries.add(color_entry);
}
}
private:
LLUIColorTable::Params& mResult;
};
LLUIColorTable::Params params;
ColorConverterFunctor ccf(params);
LLControlGroup::getInstance("Skinning")->applyToAll(&ccf);
LLUIColorTable::instance().init(params);
convert_legacy_color_settings();
LLUIColorTable::instance().loadFromSettings();
}
}
bool LLAppViewer::initConfiguration()
@ -1781,9 +1748,6 @@ bool LLAppViewer::initConfiguration()
gSavedSettings.setString("ClientSettingsFile",
gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, getSettingsFilename("Default", "Global")));
gSavedSettings.setString("SkinningSettingsFile",
gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, getSettingsFilename("UserSkin", "Skinning")));
gSavedSettings.setString("VersionChannelName", LL_CHANNEL);
#ifndef LL_RELEASE_FOR_DOWNLOAD
@ -2039,9 +2003,6 @@ bool LLAppViewer::initConfiguration()
if(skinfolder && LLStringUtil::null != skinfolder->getValue().asString())
{
gDirUtilp->setSkinFolder(skinfolder->getValue().asString());
gSavedSettings.setString("SkinningSettingsFile",
gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, getSettingsFilename("UserSkin", "Skinning")));
}
mYieldTime = gSavedSettings.getS32("YieldTime");
@ -2265,10 +2226,10 @@ bool LLAppViewer::initWindow()
gSavedSettings.getS32("WindowWidth"), gSavedSettings.getS32("WindowHeight"),
FALSE, ignorePixelDepth);
if (!gSavedSettings.getBOOL("NotFullScreen"))
if (gSavedSettings.getBOOL("WindowFullScreen"))
{
// request to go full screen... which will be delayed until login
gViewerWindow->toggleFullscreen(FALSE);
// request to go full screen... which will be delayed until login
}
if (gSavedSettings.getBOOL("WindowMaximized"))

View File

@ -93,6 +93,11 @@ LLBottomTray::LLBottomTray()
}
LLIMMgr::getInstance()->addSessionObserver(this);
//this is to fix a crash that occurs because LLBottomTray is a singleton
//and thus is deleted at the end of the viewers lifetime, but to be cleanly
//destroyed LLBottomTray requires some subsystems that are long gone
LLUI::getRootView()->addChild(this);
}
LLBottomTray::~LLBottomTray()
@ -495,4 +500,3 @@ LLWString LLBottomTray::stripChannelNumber(const LLWString &mesg, S32* channel)
return mesg;
}
}

View File

@ -684,7 +684,7 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online)
{
std::string notifyMsg = notification->getMessage();
if (!notifyMsg.empty())
floater->addHistoryLine(notifyMsg,gSavedSkinSettings.getColor4("SystemChatColor"));
floater->addHistoryLine(notifyMsg,LLUIColorTable::instance().getColor("SystemChatColor"));
}
}

View File

@ -729,13 +729,11 @@ LLTalkButton::LLTalkButton(const LLUICtrl::Params& p)
speak_params.label("Speak");
speak_params.label_selected("Speak");
speak_params.font(LLFontGL::getFontSansSerifSmall());
speak_params.label_color(LLColor4::black);
speak_params.label_color_selected(LLColor4::black);
speak_params.tab_stop(false);
speak_params.is_toggle(true);
speak_params.picture_style(true);
speak_params.image_selected(LLUI::getUIImage("flyout_btn_left_selected.tga"));
speak_params.image_unselected(LLUI::getUIImage("flyout_btn_left.tga"));
speak_params.image_selected(LLUI::getUIImage("SegmentedBtn_Left_Selected"));
speak_params.image_unselected(LLUI::getUIImage("SegmentedBtn_Left_Off"));
mSpeakBtn = LLUICtrlFactory::create<LLButton>(speak_params);
addChild(mSpeakBtn);
@ -749,8 +747,8 @@ LLTalkButton::LLTalkButton(const LLUICtrl::Params& p)
show_params.tab_stop(false);
show_params.is_toggle(true);
show_params.picture_style(true);
show_params.image_selected(LLUI::getUIImage("talk_btn_right_selected.tga"));
show_params.image_unselected(LLUI::getUIImage("talk_btn_right.tga"));
show_params.image_selected(LLUI::getUIImage("ComboButton_Selected"));
show_params.image_unselected(LLUI::getUIImage("ComboButton_Off"));
mShowBtn = LLUICtrlFactory::create<LLButton>(show_params);
addChild(mShowBtn);

View File

@ -369,7 +369,7 @@ BOOL LLFavoritesBarCtrl::postBuild()
{
menu = LLUICtrlFactory::getDefaultWidget<LLMenuGL>("inventory_menu");
}
menu->setBackgroundColor(gSavedSkinSettings.getColor("MenuPopupBgColor"));
menu->setBackgroundColor(LLUIColorTable::instance().getColor("MenuPopupBgColor"));
mInventoryItemsPopupMenuHandle = menu->getHandle();
return TRUE;

View File

@ -434,7 +434,6 @@ void LLFeatureManager::applyRecommendedSettings()
setGraphicsLevel(level, false);
gSavedSettings.setU32("RenderQualityPerformance", level);
gSavedSettings.setBOOL("RenderCustomSettings", FALSE);
// now apply the tweaks to draw distance
// these are double negatives, because feature masks only work by

View File

@ -106,7 +106,7 @@ BOOL LLFloaterAbout::postBuild()
viewer_link_style->setVisible(true);
viewer_link_style->setFontName(LLStringUtil::null);
viewer_link_style->setLinkHREF(get_viewer_release_notes_url());
viewer_link_style->setColor(gSavedSkinSettings.getColor4("HTMLLinkColor"));
viewer_link_style->setColor(LLUIColorTable::instance().getColor("HTMLLinkColor"));
// Version string
std::string version = LLTrans::getString("SECOND_LIFE_VIEWER")
@ -114,7 +114,7 @@ BOOL LLFloaterAbout::postBuild()
LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VIEWER_BUILD,
__DATE__, __TIME__,
gSavedSettings.getString("VersionChannelName").c_str());
support_widget->appendColoredText(version, FALSE, FALSE, LLUI::sSettingGroups["color"]->getColor("TextFgReadOnlyColor"));
support_widget->appendColoredText(version, FALSE, FALSE, LLUIColorTable::instance().getColor("TextFgReadOnlyColor"));
support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, viewer_link_style);
std::string support;
@ -136,7 +136,7 @@ BOOL LLFloaterAbout::postBuild()
server_link_style->setVisible(true);
server_link_style->setFontName(LLStringUtil::null);
server_link_style->setLinkHREF(region->getCapability("ServerReleaseNotes"));
server_link_style->setColor(gSavedSkinSettings.getColor4("HTMLLinkColor"));
server_link_style->setColor(LLUIColorTable::instance().getColor("HTMLLinkColor"));
const LLVector3d &pos = gAgent.getPositionGlobal();
LLUIString pos_text = getString("you_are_at");
@ -158,7 +158,7 @@ BOOL LLFloaterAbout::postBuild()
support.append(gLastVersionChannel);
support.append("\n");
support_widget->appendColoredText(support, FALSE, FALSE, LLUI::sSettingGroups["color"]->getColor("TextFgReadOnlyColor"));
support_widget->appendColoredText(support, FALSE, FALSE, LLUIColorTable::instance().getColor("TextFgReadOnlyColor"));
support_widget->appendStyledText(LLTrans::getString("ReleaseNotes"), false, false, server_link_style);
support = "\n\n";
@ -246,7 +246,7 @@ BOOL LLFloaterAbout::postBuild()
support.append(getString ("PacketsLost", args) + "\n");
}
support_widget->appendColoredText(support, FALSE, FALSE, LLUI::sSettingGroups["color"]->getColor("TextFgReadOnlyColor"));
support_widget->appendColoredText(support, FALSE, FALSE, LLUIColorTable::instance().getColor("TextFgReadOnlyColor"));
// Fix views
support_widget->setCursorPos(0);

View File

@ -368,11 +368,11 @@ void LLFloaterChat::addChat(const LLChat& chat,
F32 size = CHAT_MSG_SIZE;
if (chat.mSourceType == CHAT_SOURCE_SYSTEM)
{
text_color = gSavedSkinSettings.getColor("SystemChatColor");
text_color = LLUIColorTable::instance().getColor("SystemChatColor");
}
else if(from_instant_message)
{
text_color = gSavedSkinSettings.getColor("IMChatColor");
text_color = LLUIColorTable::instance().getColor("IMChatColor");
size = INSTANT_MSG_SIZE;
}
// We display anything if it's not an IM. If it's an IM, check pref...
@ -453,37 +453,37 @@ LLColor4 get_text_color(const LLChat& chat)
switch(chat.mSourceType)
{
case CHAT_SOURCE_SYSTEM:
text_color = gSavedSkinSettings.getColor4("SystemChatColor");
text_color = LLUIColorTable::instance().getColor("SystemChatColor");
break;
case CHAT_SOURCE_AGENT:
if (chat.mFromID.isNull())
{
text_color = gSavedSkinSettings.getColor4("SystemChatColor");
text_color = LLUIColorTable::instance().getColor("SystemChatColor");
}
else
{
if(gAgent.getID() == chat.mFromID)
{
text_color = gSavedSkinSettings.getColor4("UserChatColor");
text_color = LLUIColorTable::instance().getColor("UserChatColor");
}
else
{
text_color = gSavedSkinSettings.getColor4("AgentChatColor");
text_color = LLUIColorTable::instance().getColor("AgentChatColor");
}
}
break;
case CHAT_SOURCE_OBJECT:
if (chat.mChatType == CHAT_TYPE_DEBUG_MSG)
{
text_color = gSavedSkinSettings.getColor4("ScriptErrorColor");
text_color = LLUIColorTable::instance().getColor("ScriptErrorColor");
}
else if ( chat.mChatType == CHAT_TYPE_OWNER )
{
text_color = gSavedSkinSettings.getColor4("llOwnerSayChatColor");
text_color = LLUIColorTable::instance().getColor("llOwnerSayChatColor");
}
else
{
text_color = gSavedSkinSettings.getColor4("ObjectChatColor");
text_color = LLUIColorTable::instance().getColor("ObjectChatColor");
}
break;
default:

View File

@ -173,7 +173,7 @@ void LLFloaterColorPicker::createUI ()
// argh!
const std::string s ( codec.str () );
mPalette.push_back ( new LLColor4 ( gSavedSkinSettings.getColor4 ( s ) ) );
mPalette.push_back ( new LLColor4 ( LLUIColorTable::instance().getColor ( s ) ) );
}
}
@ -1017,7 +1017,7 @@ BOOL LLFloaterColorPicker::handleMouseUp ( S32 x, S32 y, MASK mask )
std::ostringstream codec;
codec << "ColorPaletteEntry" << std::setfill ( '0' ) << std::setw ( 2 ) << curEntry + 1;
const std::string s ( codec.str () );
gSavedSkinSettings.setColor4( s, *mPalette [ curEntry ] );
LLUIColorTable::instance().setColor(s, *mPalette [ curEntry ] );
}
}

View File

@ -45,6 +45,7 @@
#include "llagent.h"
#include "llavatarconstants.h"
#include "llcheckboxctrl.h"
#include "llcolorswatch.h"
#include "llcombobox.h"
#include "llcommandhandler.h"
#include "lldirpicker.h"
@ -332,7 +333,6 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)
mCommitCallbackRegistrar.add("Pref.LogPath", boost::bind(&LLFloaterPreference::onClickLogPath, this));
mCommitCallbackRegistrar.add("Pref.Logging", boost::bind(&LLFloaterPreference::onCommitLogging, this));
mCommitCallbackRegistrar.add("Pref.OpenHelp", boost::bind(&LLFloaterPreference::onOpenHelp, this));
mCommitCallbackRegistrar.add("Pref.ChangeCustom", boost::bind(&LLFloaterPreference::onChangeCustom, this));
mCommitCallbackRegistrar.add("Pref.UpdateMeterText", boost::bind(&LLFloaterPreference::updateMeterText, this, _1));
mCommitCallbackRegistrar.add("Pref.HardwareSettings", boost::bind(&LLFloaterPreference::onOpenHardwareSettings, this));
mCommitCallbackRegistrar.add("Pref.HardwareDefaults", boost::bind(&LLFloaterPreference::setHardwareDefaults, this));
@ -342,8 +342,6 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)
mCommitCallbackRegistrar.add("Pref.AutoDetectAspect", boost::bind(&LLFloaterPreference::onCommitAutoDetectAspect, this));
mCommitCallbackRegistrar.add("Pref.onSelectAspectRatio", boost::bind(&LLFloaterPreference::onKeystrokeAspectRatio, this));
mCommitCallbackRegistrar.add("Pref.QualityPerformance", boost::bind(&LLFloaterPreference::onChangeQuality, this, _2));
gSavedSkinSettings.getControl("HTMLLinkColor")->getCommitSignal()->connect(boost::bind(&handleHTMLLinkColorChanged, _2));
}
@ -459,7 +457,7 @@ void LLFloaterPreference::apply()
applyResolution();
// Only set window size if we're not in fullscreen mode
if(gSavedSettings.getBOOL("NotFullScreen"))
if(!gSavedSettings.getBOOL("WindowFullScreen"))
{
applyWindowSize();
}
@ -544,7 +542,7 @@ void LLFloaterPreference::onBtnOK()
apply();
closeFloater(false);
gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE );
gSavedSkinSettings.saveToFile(gSavedSettings.getString("SkinningSettingsFile") , TRUE );
LLUIColorTable::instance().saveUserSettings();
std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE);
// save all settings, even if equals defaults
gCrashSettings.saveToFile(crash_settings_filename, FALSE);
@ -605,19 +603,6 @@ void LLFloaterPreference::updateUserInfo(const std::string& visibility, bool im_
}
void LLFloaterPreference::onChangeCustom()
{
// if custom is turned off, reset everything to defaults
if (this && getChild<LLCheckBoxCtrl>("CustomSettings")->getValue())
{
U32 set = (U32)getChild<LLSliderCtrl>("QualityPerformanceSelection")->getValueF32();
LLFeatureManager::getInstance()->setGraphicsLevel(set, true);
updateMeterText(getChild<LLSliderCtrl>("DrawDistance"));
}
refreshEnabledGraphics();
}
void LLFloaterPreference::refreshEnabledGraphics()
{
LLFloaterPreference* instance = LLFloaterReg::findTypedInstance<LLFloaterPreference>("preferences");
@ -781,12 +766,6 @@ void LLFloaterPreference::buildLists(void* data)
void LLFloaterPreference::refreshEnabledState()
{
// disable graphics settings and exit if it's not set to custom
if(!gSavedSettings.getBOOL("RenderCustomSettings"))
{
return;
}
LLCheckBoxCtrl* ctrl_reflections = getChild<LLCheckBoxCtrl>("Reflections");
LLRadioGroup* radio_reflection_detail = getChild<LLRadioGroup>("ReflectionDetailRadio");
@ -1249,7 +1228,7 @@ void LLFloaterPreference::applyResolution()
gSavedSettings.setS32("FullScreenWidth", supported_resolutions[resIndex].mWidth);
gSavedSettings.setS32("FullScreenHeight", supported_resolutions[resIndex].mHeight);
gViewerWindow->requestResolutionUpdate(!gSavedSettings.getBOOL("NotFullScreen"));
gViewerWindow->requestResolutionUpdate(gSavedSettings.getBOOL("WindowFullScreen"));
send_agent_update(TRUE);
@ -1298,6 +1277,12 @@ LLPanelPreference::LLPanelPreference()
//
mCommitCallbackRegistrar.add("setControlFalse", boost::bind(&LLPanelPreference::setControlFalse,this, _2));
}
static void applyUIColor(const std::string& color_name, LLUICtrl* ctrl, const LLSD& param)
{
LLUIColorTable::instance().setColor(color_name, LLColor4(param));
}
//virtual
BOOL LLPanelPreference::postBuild()
{
@ -1460,6 +1445,55 @@ BOOL LLPanelPreference::postBuild()
refresh();
}
if(hasChild("user") && hasChild("agent") && hasChild("im")
&& hasChild("system") && hasChild("script_error") && hasChild("objects")
&& hasChild("owner") && hasChild("background") && hasChild("links"))
{
LLColorSwatchCtrl* color_swatch = getChild<LLColorSwatchCtrl>("user");
color_swatch->setCommitCallback(boost::bind(&applyUIColor, "UserChatColor", _1, _2));
color_swatch->setOriginal(LLUIColorTable::instance().getColor("UserChatColor"));
color_swatch = getChild<LLColorSwatchCtrl>("agent");
color_swatch->setCommitCallback(boost::bind(&applyUIColor, "AgentChatColor", _1, _2));
color_swatch->setOriginal(LLUIColorTable::instance().getColor("AgentChatColor"));
color_swatch = getChild<LLColorSwatchCtrl>("im");
color_swatch->setCommitCallback(boost::bind(&applyUIColor, "IMChatColor", _1, _2));
color_swatch->setOriginal(LLUIColorTable::instance().getColor("IMChatColor"));
color_swatch = getChild<LLColorSwatchCtrl>("system");
color_swatch->setCommitCallback(boost::bind(&applyUIColor, "SystemChatColor", _1, _2));
color_swatch->setOriginal(LLUIColorTable::instance().getColor("SystemChatColor"));
color_swatch = getChild<LLColorSwatchCtrl>("script_error");
color_swatch->setCommitCallback(boost::bind(&applyUIColor, "ScriptErrorColor", _1, _2));
color_swatch->setOriginal(LLUIColorTable::instance().getColor("ScriptErrorColor"));
color_swatch = getChild<LLColorSwatchCtrl>("objects");
color_swatch->setCommitCallback(boost::bind(&applyUIColor, "ObjectChatColor", _1, _2));
color_swatch->setOriginal(LLUIColorTable::instance().getColor("ObjectChatColor"));
color_swatch = getChild<LLColorSwatchCtrl>("owner");
color_swatch->setCommitCallback(boost::bind(&applyUIColor, "llOwnerSayChatColor", _1, _2));
color_swatch->setOriginal(LLUIColorTable::instance().getColor("llOwnerSayChatColor"));
color_swatch = getChild<LLColorSwatchCtrl>("background");
color_swatch->setCommitCallback(boost::bind(&applyUIColor, "BackgroundChatColor", _1, _2));
color_swatch->setOriginal(LLUIColorTable::instance().getColor("BackgroundChatColor"));
color_swatch = getChild<LLColorSwatchCtrl>("links");
color_swatch->setCommitCallback(boost::bind(&applyUIColor, "HTMLLinkColor", _1, _2));
color_swatch->setOriginal(LLUIColorTable::instance().getColor("HTMLLinkColor"));
}
if(hasChild("effect_color_swatch"))
{
LLColorSwatchCtrl* color_swatch = getChild<LLColorSwatchCtrl>("effect_color_swatch");
color_swatch->setCommitCallback(boost::bind(&applyUIColor, "EffectColor", _1, _2));
color_swatch->setOriginal(LLUIColorTable::instance().getColor("EffectColor"));
}
apply();
return true;
}
@ -1475,16 +1509,25 @@ void LLPanelPreference::apply()
// Process view on top of the stack
LLView* curview = view_stack.front();
view_stack.pop_front();
LLUICtrl* ctrl = dynamic_cast<LLUICtrl*>(curview);
if (ctrl)
LLColorSwatchCtrl* color_swatch = dynamic_cast<LLColorSwatchCtrl *>(curview);
if (color_swatch)
{
LLControlVariable* control = ctrl->getControlVariable();
if (control)
mSavedColors[color_swatch->getName()] = color_swatch->get();
}
else
{
LLUICtrl* ctrl = dynamic_cast<LLUICtrl*>(curview);
if (ctrl)
{
mSavedValues[control] = control->getValue();
LLControlVariable* control = ctrl->getControlVariable();
if (control)
{
mSavedValues[control] = control->getValue();
}
}
}
// Push children onto the end of the work stack
for (child_list_t::const_iterator iter = curview->getChildList()->begin();
iter != curview->getChildList()->end(); ++iter)
@ -1504,6 +1547,17 @@ void LLPanelPreference::cancel()
LLSD ctrl_value = iter->second;
control->set(ctrl_value);
}
for (string_color_map_t::iterator iter = mSavedColors.begin();
iter != mSavedColors.end(); ++iter)
{
LLColorSwatchCtrl* color_swatch = findChild<LLColorSwatchCtrl>(iter->first);
if(color_swatch)
{
color_swatch->set(iter->second);
color_swatch->onCommit();
}
}
}
void LLPanelPreference::setControlFalse(const LLSD& user_data)

View File

@ -163,6 +163,9 @@ public:
private:
typedef std::map<LLControlVariable*, LLSD> control_values_map_t;
control_values_map_t mSavedValues;
typedef std::map<std::string, LLColor4> string_color_map_t;
string_color_map_t mSavedColors;
};
#endif // LL_LLPREFERENCEFLOATER_H

View File

@ -80,10 +80,6 @@ BOOL LLFloaterSettingsDebug::postBuild()
{
gSavedPerAccountSettings.applyToAll(&func);
}
if (key == "all" || key == "skin")
{
gSavedSkinSettings.applyToAll(&func);
}
settings_combo->sortByName();
settings_combo->updateSelection();

View File

@ -1297,7 +1297,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater)
floater->childSetColor("file_size_label",
shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD
&& got_bytes
&& previewp->getDataSize() > MAX_POSTCARD_DATASIZE ? LLColor4::red : LLUI::sSettingGroups["color"]->getColor( "LabelTextColor" ));
&& previewp->getDataSize() > MAX_POSTCARD_DATASIZE ? LLUIColor(LLColor4::red) : LLUIColorTable::instance().getColor( "LabelTextColor" ));
switch(shot_type)
{

View File

@ -113,7 +113,7 @@ void LLPanelVoiceDeviceSettings::draw()
{
if (power_bar_idx < discrete_power)
{
LLColor4 color = (power_bar_idx >= 3) ? gSavedSkinSettings.getColor4("OverdrivenColor") : gSavedSkinSettings.getColor4("SpeakingColor");
LLColor4 color = (power_bar_idx >= 3) ? LLUIColorTable::instance().getColor("OverdrivenColor") : LLUIColorTable::instance().getColor("SpeakingColor");
gl_rect_2d(bar_view->getRect(), color, TRUE);
}
gl_rect_2d(bar_view->getRect(), LLColor4::grey, FALSE);

View File

@ -387,8 +387,8 @@ void LLFloaterWorldMap::reshape( S32 width, S32 height, BOOL called_from_parent
// virtual
void LLFloaterWorldMap::draw()
{
static LLCachedControl<LLColor4> map_track_color(gSavedSkinSettings, "MapTrackColor", LLColor4::white);
static LLCachedControl<LLColor4> map_track_disabled_color(gSavedSkinSettings, "MapTrackDisabledColor", LLColor4::white);
static LLUIColor map_track_color = LLUIColorTable::instance().getColor("MapTrackColor", LLColor4::white);
static LLUIColor map_track_disabled_color = LLUIColorTable::instance().getColor("MapTrackDisabledColor", LLColor4::white);
// Hide/Show Mature Events controls
childSetVisible("events_mature_icon", gAgent.canAccessMature());

View File

@ -793,13 +793,13 @@ BOOL LLFolderViewItem::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
void LLFolderViewItem::draw()
{
static LLCachedControl<LLColor4> sFgColor(gSavedSkinSettings, "MenuItemEnabledColor", DEFAULT_WHITE);
static LLCachedControl<LLColor4> sHighlightBgColor(gSavedSkinSettings, "MenuItemHighlightBgColor", DEFAULT_WHITE);
static LLCachedControl<LLColor4> sHighlightFgColor(gSavedSkinSettings, "MenuItemHighlightFgColor", DEFAULT_WHITE);
static LLCachedControl<LLColor4> sFilterBGColor(gSavedSkinSettings, "FilterBackgroundColor", DEFAULT_WHITE);
static LLCachedControl<LLColor4> sFilterTextColor(gSavedSkinSettings, "FilterTextColor", DEFAULT_WHITE);
static LLCachedControl<LLColor4> sSuffixColor(gSavedSkinSettings, "InventoryItemSuffixColor", DEFAULT_WHITE);
static LLCachedControl<LLColor4> sSearchStatusColor(gSavedSkinSettings, "InventorySearchStatusColor", DEFAULT_WHITE);
static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE);
static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE);
static LLUIColor sHighlightFgColor = LLUIColorTable::instance().getColor("MenuItemHighlightFgColor", DEFAULT_WHITE);
static LLUIColor sFilterBGColor = LLUIColorTable::instance().getColor("FilterBackgroundColor", DEFAULT_WHITE);
static LLUIColor sFilterTextColor = LLUIColorTable::instance().getColor("FilterTextColor", DEFAULT_WHITE);
static LLUIColor sSuffixColor = LLUIColorTable::instance().getColor("InventoryItemSuffixColor", DEFAULT_WHITE);
static LLUIColor sSearchStatusColor = LLUIColorTable::instance().getColor("InventorySearchStatusColor", DEFAULT_WHITE);
bool possibly_has_children = false;
bool up_to_date = mListener && mListener->isUpToDate();
@ -2562,7 +2562,7 @@ LLFolderView::LLFolderView(const Params& p)
{
menu = LLUICtrlFactory::getDefaultWidget<LLMenuGL>("inventory_menu");
}
menu->setBackgroundColor(gSavedSkinSettings.getColor("MenuPopupBgColor"));
menu->setBackgroundColor(LLUIColorTable::instance().getColor("MenuPopupBgColor"));
mPopupMenuHandle = menu->getHandle();
}
@ -3148,7 +3148,7 @@ void LLFolderView::commitRename( const LLSD& data )
void LLFolderView::draw()
{
static LLCachedControl<LLColor4> sSearchStatusColor(gSavedSkinSettings, "InventorySearchStatusColor", DEFAULT_WHITE);
static LLUIColor sSearchStatusColor = LLUIColorTable::instance().getColor("InventorySearchStatusColor", DEFAULT_WHITE);
if (mDebugFilters)
{
std::string current_filter_string = llformat("Current Filter: %d, Least Filter: %d, Auto-accept Filter: %d",

View File

@ -40,6 +40,7 @@
#include "llagent.h"
#include "llhudeffect.h"
#include "pipeline.h"
#include "llui.h"
#include "llviewercontrol.h"
#include "llviewerobjectlist.h"
@ -52,9 +53,9 @@ LLColor4 LLHUDManager::sChildColor;
LLHUDManager::LLHUDManager()
{
LLHUDManager::sParentColor = gSavedSkinSettings.getColor("FocusColor");
LLHUDManager::sParentColor = LLUIColorTable::instance().getColor("FocusColor");
// rdw commented out since it's not used. Also removed from colors_base.xml
//LLHUDManager::sChildColor =gSavedSkinSettings.getColor("FocusSecondaryColor");
//LLHUDManager::sChildColor =LLUIColorTable::instance().getColor("FocusSecondaryColor");
}
LLHUDManager::~LLHUDManager()

View File

@ -292,7 +292,7 @@ void LLHUDText::renderText(BOOL for_select)
LLUIImagePtr imagep = LLUI::getUIImage("rounded_square.tga");
// *TODO: make this a per-text setting
LLColor4 bg_color = gSavedSkinSettings.getColor4("BackgroundChatColor");
LLColor4 bg_color = LLUIColorTable::instance().getColor("BackgroundChatColor");
bg_color.setAlpha(gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor);
const S32 border_height = 16;

View File

@ -1222,7 +1222,7 @@ LLFloaterIMPanel::LLFloaterIMPanel(const std::string& session_label,
addHistoryLine(
session_start,
gSavedSkinSettings.getColor4("SystemChatColor"),
LLUIColorTable::instance().getColor("SystemChatColor"),
false);
}
}
@ -2004,7 +2004,7 @@ void LLFloaterIMPanel::sendMsg()
BOOL other_was_typing = mOtherTyping;
addHistoryLine(history_echo, gSavedSkinSettings.getColor("IMChatColor"), true, gAgent.getID());
addHistoryLine(history_echo, LLUIColorTable::instance().getColor("IMChatColor"), true, gAgent.getID());
if (other_was_typing)
{
@ -2175,7 +2175,7 @@ void LLFloaterIMPanel::addTypingIndicator(const std::string &name)
mTypingLineStartIndex = mHistoryEditor->getWText().length();
LLUIString typing_start = sTypingStartString;
typing_start.setArg("[NAME]", name);
addHistoryLine(typing_start, gSavedSkinSettings.getColor4("SystemChatColor"), false);
addHistoryLine(typing_start, LLUIColorTable::instance().getColor("SystemChatColor"), false);
mOtherTypingName = name;
mOtherTyping = TRUE;
}
@ -2232,7 +2232,7 @@ void LLFloaterIMPanel::chatFromLogFile(LLLogChat::ELogLineType type, std::string
}
//self->addHistoryLine(line, LLColor4::grey, FALSE);
self->mHistoryEditor->appendColoredText(message, false, true, gSavedSkinSettings.getColor4("ChatHistoryTextColor"));
self->mHistoryEditor->appendColoredText(message, false, true, LLUIColorTable::instance().getColor("ChatHistoryTextColor"));
}
void LLFloaterIMPanel::showSessionStartError(

View File

@ -745,7 +745,7 @@ void LLIMMgr::addMessage(
//<< "*** region_id: " << region_id << std::endl
//<< "*** position: " << position << std::endl;
floater->addHistoryLine(bonus_info.str(), gSavedSkinSettings.getColor4("SystemChatColor"));
floater->addHistoryLine(bonus_info.str(), LLUIColorTable::instance().getColor("SystemChatColor"));
}
make_ui_sound("UISndNewIncomingIMSession");
@ -754,8 +754,8 @@ void LLIMMgr::addMessage(
// now add message to floater
bool is_from_system = target_id.isNull() || (from == SYSTEM_FROM);
const LLColor4& color = ( is_from_system ?
gSavedSkinSettings.getColor4("SystemChatColor") :
gSavedSkinSettings.getColor("IMChatColor"));
LLUIColorTable::instance().getColor("SystemChatColor") :
LLUIColorTable::instance().getColor("IMChatColor"));
if ( !link_name )
{
floater->addHistoryLine(msg,color); // No name to prepend, so just add the message normally
@ -1332,7 +1332,7 @@ void LLIMMgr::noteOfflineUsers(
S32 count = ids.count();
if(count == 0)
{
floater->addHistoryLine(sOnlyUserMessage, gSavedSkinSettings.getColor4("SystemChatColor"));
floater->addHistoryLine(sOnlyUserMessage, LLUIColorTable::instance().getColor("SystemChatColor"));
}
else
{
@ -1348,7 +1348,7 @@ void LLIMMgr::noteOfflineUsers(
LLUIString offline = sOfflineMessage;
offline.setArg("[FIRST]", first);
offline.setArg("[LAST]", last);
floater->addHistoryLine(offline, gSavedSkinSettings.getColor4("SystemChatColor"));
floater->addHistoryLine(offline, LLUIColorTable::instance().getColor("SystemChatColor"));
}
}
}

View File

@ -174,8 +174,7 @@ LLLocationInputCtrl::Params::Params()
add_landmark_image_disabled("add_landmark_image_disabled"),
add_landmark_button("add_landmark_button"),
add_landmark_hpad("add_landmark_hpad", 0),
info_button("info_button"),
background("background")
info_button("info_button")
{
}
@ -185,11 +184,6 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p)
mInfoBtn(NULL),
mAddLandmarkBtn(NULL)
{
// Background image.
LLButton::Params bg_params = p.background;
mBackground = LLUICtrlFactory::create<LLButton>(bg_params);
addChildInBack(mBackground);
// "Place information" button.
LLButton::Params info_params = p.info_button;
mInfoBtn = LLUICtrlFactory::create<LLButton>(info_params);
@ -213,8 +207,6 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p)
enableAddLandmarkButton(true);
addChild(mAddLandmarkBtn);
setFocusReceivedCallback(boost::bind(&LLLocationInputCtrl::onFocusReceived, this));
setFocusLostCallback(boost::bind(&LLLocationInputCtrl::onFocusLost, this));
setPrearrangeCallback(boost::bind(&LLLocationInputCtrl::onLocationPrearrange, this, _2));
updateWidgetlayout();
@ -354,6 +346,7 @@ void LLLocationInputCtrl::onFocusReceived()
void LLLocationInputCtrl::onFocusLost()
{
LLUICtrl::onFocusLost();
refreshLocation();
}
@ -462,7 +455,6 @@ void LLLocationInputCtrl::enableAddLandmarkButton(bool val)
void LLLocationInputCtrl::updateAddLandmarkButton()
{
bool cur_parcel_landmarked = false;
// Determine whether there are landmarks pointing to the current parcel.
LLInventoryModel::cat_array_t cats;
LLInventoryModel::item_array_t items;
@ -481,21 +473,14 @@ void LLLocationInputCtrl::updateWidgetlayout()
{
const LLRect& rect = getLocalRect();
const LLRect& hist_btn_rect = mButton->getRect();
LLRect info_btn_rect = mButton->getRect();
LLRect info_btn_rect = mInfoBtn->getRect();
// info button
info_btn_rect.setOriginAndSize(
0, (rect.getHeight() - info_btn_rect.getHeight()) / 2,
2, (rect.getHeight() - info_btn_rect.getHeight()) / 2,
info_btn_rect.getWidth(), info_btn_rect.getHeight());
mInfoBtn->setRect(info_btn_rect);
// background
mBackground->setRect(LLRect(info_btn_rect.getWidth(), rect.mTop,
rect.mRight - hist_btn_rect.getWidth(), rect.mBottom));
// history button
mButton->setRightHPad(0);
// "Add Landmark" button
{
LLRect al_btn_rect = mAddLandmarkBtn->getRect();
@ -504,14 +489,4 @@ void LLLocationInputCtrl::updateWidgetlayout()
(rect.getHeight() - al_btn_rect.getHeight()) / 2);
mAddLandmarkBtn->setRect(al_btn_rect);
}
// text entry
if (mTextEntry)
{
LLRect text_entry_rect(rect);
text_entry_rect.mLeft = info_btn_rect.getWidth();
text_entry_rect.mRight = mAddLandmarkBtn->getRect().mLeft;
text_entry_rect.stretch(0, -1); // make space for border
mTextEntry->setRect(text_entry_rect);
}
}

View File

@ -61,8 +61,7 @@ public:
add_landmark_image_disabled;
Optional<S32> add_landmark_hpad;
Optional<LLButton::Params> add_landmark_button,
info_button,
background;
info_button;
Params();
};
@ -70,6 +69,8 @@ public:
/*virtual*/ void setEnabled(BOOL enabled);
/*virtual*/ BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect);
/*virtual*/ BOOL handleKeyHere(KEY key, MASK mask);
/*virtual*/ void onFocusReceived();
/*virtual*/ void onFocusLost();
//========================================================================
// LLUICtrl interface
@ -98,8 +99,6 @@ private:
void updateAddLandmarkButton();
void updateWidgetlayout();
void onFocusReceived();
void onFocusLost();
void onInfoButtonClicked();
void onLocationHistoryLoaded();
void onLocationPrearrange(const LLSD& data);
@ -107,7 +106,6 @@ private:
void onAddLandmarkButtonClicked();
void onAgentParcelChange();
LLButton* mBackground;
LLButton* mAddLandmarkBtn;
LLButton* mInfoBtn;
S32 mAddLandmarkHPad;

View File

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

View File

@ -1107,8 +1107,8 @@ BOOL LLManipRotate::updateVisiblity()
mCenterToProfilePlaneMag = mRadiusMeters * mRadiusMeters / mCenterToCamMag;
mCenterToProfilePlane = -mCenterToProfilePlaneMag * mCenterToCamNorm;
mCenterScreen.set((S32)((0.5f - mRotationCenter.mdV[VY]) / gAgent.mHUDCurZoom * gViewerWindow->getWindowWidth()),
(S32)((mRotationCenter.mdV[VZ] + 0.5f) / gAgent.mHUDCurZoom * gViewerWindow->getWindowHeight()));
mCenterScreen.set((S32)((0.5f - mRotationCenter.mdV[VY]) / gAgent.mHUDCurZoom * gViewerWindow->getWorldViewWidth()),
(S32)((mRotationCenter.mdV[VZ] + 0.5f) / gAgent.mHUDCurZoom * gViewerWindow->getWorldViewHeight()));
visible = TRUE;
}
else
@ -1624,8 +1624,8 @@ void LLManipRotate::mouseToRay( S32 x, S32 y, LLVector3* ray_pt, LLVector3* ray_
{
if (LLSelectMgr::getInstance()->getSelection()->getSelectType() == SELECT_TYPE_HUD)
{
F32 mouse_x = (((F32)x / gViewerWindow->getWindowWidth()) - 0.5f) / gAgent.mHUDCurZoom;
F32 mouse_y = ((((F32)y) / gViewerWindow->getWindowHeight()) - 0.5f) / gAgent.mHUDCurZoom;
F32 mouse_x = (((F32)x / gViewerWindow->getWorldViewWidth()) - 0.5f) / gAgent.mHUDCurZoom;
F32 mouse_y = ((((F32)y) / gViewerWindow->getWorldViewHeight()) - 0.5f) / gAgent.mHUDCurZoom;
*ray_pt = LLVector3(-1.f, -mouse_x, mouse_y);
*ray_dir = LLVector3(1.f, 0.f, 0.f);
@ -1699,7 +1699,7 @@ void LLManipRotate::highlightManipulators( S32 x, S32 y )
F32 dist_y = mouse_dir_y.normVec();
F32 dist_z = mouse_dir_z.normVec();
F32 distance_threshold = (MAX_MANIP_SELECT_DISTANCE * mRadiusMeters) / gViewerWindow->getWindowHeight();
F32 distance_threshold = (MAX_MANIP_SELECT_DISTANCE * mRadiusMeters) / gViewerWindow->getWorldViewHeight();
if (llabs(dist_x - mRadiusMeters) * llmax(0.05f, proj_rot_x_axis) < distance_threshold)
{

View File

@ -493,8 +493,8 @@ void LLManipScale::highlightManipulators(S32 x, S32 y)
mProjectedManipulators.insert(projManipulator);
}
F32 half_width = (F32)gViewerWindow->getWindowWidth() / 2.f;
F32 half_height = (F32)gViewerWindow->getWindowHeight() / 2.f;
F32 half_width = (F32)gViewerWindow->getWorldViewWidth() / 2.f;
F32 half_height = (F32)gViewerWindow->getWorldViewHeight() / 2.f;
LLVector2 manip2d;
LLVector2 mousePos((F32)x - half_width, (F32)y - half_height);
LLVector2 delta;
@ -1368,7 +1368,7 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox)
else
{
F32 object_distance = dist_vec(mScaleCenter, LLViewerCamera::getInstance()->getOrigin());
mSnapRegimeOffset = (SNAP_GUIDE_SCREEN_OFFSET * gViewerWindow->getWindowWidth() * object_distance) / LLViewerCamera::getInstance()->getPixelMeterRatio();
mSnapRegimeOffset = (SNAP_GUIDE_SCREEN_OFFSET * gViewerWindow->getWorldViewWidth() * object_distance) / LLViewerCamera::getInstance()->getPixelMeterRatio();
}
LLVector3 cam_at_axis;
F32 snap_guide_length;
@ -1381,7 +1381,7 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox)
{
cam_at_axis = LLViewerCamera::getInstance()->getAtAxis();
F32 manipulator_distance = dist_vec(box_corner_agent, LLViewerCamera::getInstance()->getOrigin());
snap_guide_length = (SNAP_GUIDE_SCREEN_LENGTH * gViewerWindow->getWindowWidth() * manipulator_distance) / LLViewerCamera::getInstance()->getPixelMeterRatio();
snap_guide_length = (SNAP_GUIDE_SCREEN_LENGTH * gViewerWindow->getWorldViewWidth() * manipulator_distance) / LLViewerCamera::getInstance()->getPixelMeterRatio();
}
mSnapGuideLength = snap_guide_length / llmax(0.1f, (llmin(mSnapGuideDir1 * cam_at_axis, mSnapGuideDir2 * cam_at_axis)));

View File

@ -414,7 +414,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
// Handle auto-rotation if necessary.
const F32 ROTATE_ANGLE_PER_SECOND = 30.f * DEG_TO_RAD;
const S32 ROTATE_H_MARGIN = gViewerWindow->getWindowWidth() / 20;
const S32 ROTATE_H_MARGIN = gViewerWindow->getWorldViewWidth() / 20;
const F32 rotate_angle = ROTATE_ANGLE_PER_SECOND / gFPSClamped;
BOOL rotated = FALSE;
@ -426,7 +426,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
gAgent.cameraOrbitAround(rotate_angle);
rotated = TRUE;
}
else if (x > gViewerWindow->getWindowWidth() - ROTATE_H_MARGIN)
else if (x > gViewerWindow->getWorldViewWidth() - ROTATE_H_MARGIN)
{
gAgent.cameraOrbitAround(-rotate_angle);
rotated = TRUE;
@ -960,8 +960,8 @@ void LLManipTranslate::highlightManipulators(S32 x, S32 y)
LLVector2 manip_start_2d;
LLVector2 manip_end_2d;
LLVector2 manip_dir;
F32 half_width = gViewerWindow->getWindowWidth() / 2.f;
F32 half_height = gViewerWindow->getWindowHeight() / 2.f;
F32 half_width = gViewerWindow->getWorldViewWidth() / 2.f;
F32 half_height = gViewerWindow->getWorldViewHeight() / 2.f;
LLVector2 mousePos((F32)x - half_width, (F32)y - half_height);
LLVector2 mouse_delta;
@ -1225,7 +1225,7 @@ void LLManipTranslate::renderSnapGuides()
{
LLVector3 cam_to_selection = getPivotPoint() - LLViewerCamera::getInstance()->getOrigin();
F32 current_range = cam_to_selection.normVec();
guide_size_meters = SNAP_GUIDE_SCREEN_SIZE * gViewerWindow->getWindowHeight() * current_range / LLViewerCamera::getInstance()->getPixelMeterRatio();
guide_size_meters = SNAP_GUIDE_SCREEN_SIZE * gViewerWindow->getWorldViewHeight() * current_range / LLViewerCamera::getInstance()->getPixelMeterRatio();
F32 fraction_of_fov = mAxisArrowLength / (F32) LLViewerCamera::getInstance()->getViewHeightInPixels();
F32 apparent_angle = fraction_of_fov * LLViewerCamera::getInstance()->getView(); // radians
@ -1522,7 +1522,7 @@ void LLManipTranslate::renderSnapGuides()
float a = line_alpha;
LLColor4 col = gSavedSkinSettings.getColor("SilhouetteChildColor");
LLColor4 col = LLUIColorTable::instance().getColor("SilhouetteChildColor");
{
//draw grid behind objects
LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
@ -1800,7 +1800,7 @@ void LLManipTranslate::renderTranslationHandles()
// Drag handles
if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
{
mArrowLengthMeters = mAxisArrowLength / gViewerWindow->getWindowHeight();
mArrowLengthMeters = mAxisArrowLength / gViewerWindow->getWorldViewHeight();
mArrowLengthMeters /= gAgent.mHUDCurZoom;
}
else

View File

@ -119,7 +119,7 @@ void LLMemoryView::draw()
const S32 UPDATE_INTERVAL = 60;
const S32 MARGIN_AMT = 10;
static S32 curUpdate = UPDATE_INTERVAL;
static LLCachedControl<LLColor4> s_console_color(gSavedSkinSettings, "ConsoleBackground", LLColor4U::black);
static LLUIColor s_console_color = LLUIColorTable::instance().getColor("ConsoleBackground", LLColor4U::black);
// setup update interval
if (curUpdate >= UPDATE_INTERVAL)

View File

@ -112,12 +112,12 @@ void LLNetMap::translatePan( F32 delta_x, F32 delta_y )
void LLNetMap::draw()
{
static LLFrameTimer map_timer;
static LLCachedControl<LLColor4> map_avatar_color(gSavedSkinSettings, "MapAvatarColor", LLColor4::white);
static LLCachedControl<LLColor4> map_avatar_friend_color(gSavedSkinSettings, "MapAvatarFriendColor", LLColor4::white);
static LLCachedControl<LLColor4> map_track_color(gSavedSkinSettings, "MapTrackColor", LLColor4::white);
static LLCachedControl<LLColor4> map_track_disabled_color(gSavedSkinSettings, "MapTrackDisabledColor", LLColor4::white);
static LLCachedControl<LLColor4> map_frustum_color(gSavedSkinSettings, "MapFrustumColor", LLColor4::white);
static LLCachedControl<LLColor4> map_frustum_rotating_color(gSavedSkinSettings, "MapFrustumRotatingColor", LLColor4::white);
static LLUIColor map_avatar_color = LLUIColorTable::instance().getColor("MapAvatarColor", LLColor4::white);
static LLUIColor map_avatar_friend_color = LLUIColorTable::instance().getColor("MapAvatarFriendColor", LLColor4::white);
static LLUIColor map_track_color = LLUIColorTable::instance().getColor("MapTrackColor", LLColor4::white);
static LLUIColor map_track_disabled_color = LLUIColorTable::instance().getColor("MapTrackDisabledColor", LLColor4::white);
static LLUIColor map_frustum_color = LLUIColorTable::instance().getColor("MapFrustumColor", LLColor4::white);
static LLUIColor map_frustum_rotating_color = LLUIColorTable::instance().getColor("MapFrustumRotatingColor", LLColor4::white);
if (mObjectImagep.isNull())
{

View File

@ -55,10 +55,10 @@ LLOutputMonitorCtrl::LLOutputMonitorCtrl(const LLOutputMonitorCtrl::Params& p)
mPower(0),
mIsMuted(true)
{
static LLUICachedControl<LLColor4> output_monitor_muted_color("OutputMonitorMutedColor", LLColor4::orange);
static LLUICachedControl<LLColor4> output_monitor_overdriven_color("OutputMonitorOverdrivenColor", LLColor4::red);
static LLUICachedControl<LLColor4> output_monitor_normal_color("OutputMonitorNotmalColor", LLColor4::green);
static LLUICachedControl<LLColor4> output_monitor_bound_color("OutputMonitorBoundColor", LLColor4::white);
static LLUIColor output_monitor_muted_color = LLUIColorTable::instance().getColor("OutputMonitorMutedColor", LLColor4::orange);
static LLUIColor output_monitor_overdriven_color = LLUIColorTable::instance().getColor("OutputMonitorOverdrivenColor", LLColor4::red);
static LLUIColor output_monitor_normal_color = LLUIColorTable::instance().getColor("OutputMonitorNotmalColor", LLColor4::green);
static LLUIColor output_monitor_bound_color = LLUIColorTable::instance().getColor("OutputMonitorBoundColor", LLColor4::white);
static LLUICachedControl<S32> output_monitor_rects_number("OutputMonitorRectanglesNumber", 20);
static LLUICachedControl<F32> output_monitor_rect_width_ratio("OutputMonitorRectangleWidthRatio", 0.5f);
static LLUICachedControl<F32> output_monitor_rect_height_ratio("OutputMonitorRectangleHeightRatio", 0.8f);

View File

@ -187,12 +187,12 @@ LLSelectMgr::LLSelectMgr()
sHighlightUAnim = gSavedSettings.getF32("SelectionHighlightUAnim");
sHighlightVAnim = gSavedSettings.getF32("SelectionHighlightVAnim");
sSilhouetteParentColor =gSavedSkinSettings.getColor("SilhouetteParentColor");
sSilhouetteChildColor = gSavedSkinSettings.getColor("SilhouetteChildColor");
sHighlightParentColor = gSavedSkinSettings.getColor("HighlightParentColor");
sHighlightChildColor = gSavedSkinSettings.getColor("HighlightChildColor");
sHighlightInspectColor = gSavedSkinSettings.getColor("HighlightInspectColor");
sContextSilhouetteColor = gSavedSkinSettings.getColor("ContextSilhouetteColor")*0.5f;
sSilhouetteParentColor =LLUIColorTable::instance().getColor("SilhouetteParentColor");
sSilhouetteChildColor = LLUIColorTable::instance().getColor("SilhouetteChildColor");
sHighlightParentColor = LLUIColorTable::instance().getColor("HighlightParentColor");
sHighlightChildColor = LLUIColorTable::instance().getColor("HighlightChildColor");
sHighlightInspectColor = LLUIColorTable::instance().getColor("HighlightInspectColor");
sContextSilhouetteColor = LLUIColorTable::instance().getColor("ContextSilhouetteColor")*0.5f;
sRenderLightRadius = gSavedSettings.getBOOL("RenderLightRadius");

View File

@ -162,8 +162,8 @@ BOOL LLSideTrayTab::postBuild()
title_panel->getChild<LLTextBox>(TAB_PANEL_CAPTION_TITLE_BOX)->setValue(mTabTitle);
static LLUICachedControl<LLColor4> default_background_color ("FloaterDefaultBackgroundColor", *(new LLColor4));
static LLUICachedControl<LLColor4> focus_background_color ("FloaterFocusBackgroundColor", *(new LLColor4));
static LLUIColor default_background_color = LLUIColorTable::instance().getColor("FloaterDefaultBackgroundColor");
static LLUIColor focus_background_color = LLUIColorTable::instance().getColor("FloaterFocusBackgroundColor");
setTransparentColor(default_background_color);
setBackgroundColor(focus_background_color);

View File

@ -469,13 +469,24 @@ bool idle_startup()
#if LL_WINDOWS
// On the windows dev builds, unpackaged, the message_template.msg
// file will be located in
// indra/build-vc**/newview/<config>/app_settings.
// file will be located in:
// build-vc**/newview/<config>/app_settings
if (!found_template)
{
message_template_path = gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "app_settings", "message_template.msg");
found_template = LLFile::fopen(message_template_path.c_str(), "r"); /* Flawfinder: ignore */
}
#elif LL_DARWIN
// On Mac dev builds, message_template.msg lives in:
// indra/build-*/newview/<config>/Second Life/Contents/Resources/app_settings
if (!found_template)
{
message_template_path =
gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE,
"../Resources/app_settings",
"message_template.msg");
found_template = LLFile::fopen(message_template_path.c_str(), "r"); /* Flawfinder: ignore */
}
#endif
if (found_template)
@ -929,7 +940,7 @@ bool idle_startup()
//For HTML parsing in text boxes.
LLTextEditor::setLinkColor( gSavedSkinSettings.getColor4("HTMLLinkColor") );
LLTextEditor::setLinkColor( LLUIColorTable::instance().getColor("HTMLLinkColor") );
// Load URL History File
LLURLHistory::loadFile("url_history.xml");
@ -1604,7 +1615,7 @@ bool idle_startup()
// Since we connected, save off the settings so the user doesn't have to
// type the name/password again if we crash.
gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), TRUE);
gSavedSkinSettings.saveToFile(gSavedSettings.getString("SkinningSettingsFile"), TRUE);
LLUIColorTable::instance().saveUserSettings();
//
// Initialize classes w/graphics stuff.
@ -2187,7 +2198,7 @@ bool idle_startup()
// and make sure it's saved
gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile") , TRUE );
gSavedSkinSettings.saveToFile( gSavedSettings.getString("SkinningSettingsFile") , TRUE );
LLUIColorTable::instance().saveUserSettings();
};
if (!gNoRender)
@ -2576,7 +2587,7 @@ void login_callback(S32 option, void *userdata)
{
// turn off the setting and write out to disk
gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile") , TRUE );
gSavedSkinSettings.saveToFile( gSavedSettings.getString("SkinningSettingsFile") , TRUE );
LLUIColorTable::instance().saveUserSettings();
}
// Next iteration through main loop should shut down the app cleanly.
@ -2786,7 +2797,7 @@ void update_app(BOOL mandatory, const std::string& auth_msg)
{
// store off config state, as we might quit soon
gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), TRUE);
gSavedSkinSettings.saveToFile(gSavedSettings.getString("SkinningSettingsFile"), TRUE);
LLUIColorTable::instance().saveUserSettings();
std::ostringstream message;
std::string msg;

View File

@ -237,7 +237,7 @@ void LLStatusBar::draw()
if (isBackgroundVisible())
{
static LLUICachedControl<S32> drop_shadow_floater ("DropShadowFloater", 0);
static LLUICachedControl<LLColor4> color_drop_shadow ("ColorDropShadow");
static LLUIColor color_drop_shadow = LLUIColorTable::instance().getColor("ColorDropShadow");
gl_drop_shadow(0, getRect().getHeight(), getRect().getWidth(), 0,
color_drop_shadow, drop_shadow_floater );
}

View File

@ -64,7 +64,7 @@ const LLStyleSP &LLStyleMap::lookupAgent(const LLUUID &source)
style->setFontName(LLStringUtil::null);
if (source != LLUUID::null && source != gAgent.getID() )
{
style->setColor(gSavedSkinSettings.getColor4("HTMLLinkColor"));
style->setColor(LLUIColorTable::instance().getColor("HTMLLinkColor"));
std::string link = llformat("secondlife:///app/agent/%s/about",source.asString().c_str());
style->setLinkHREF(link);
}
@ -90,7 +90,7 @@ const LLStyleSP &LLStyleMap::lookup(const LLUUID& id, const std::string& link)
style->setFontName(LLStringUtil::null);
if (id != LLUUID::null && !link.empty())
{
style->setColor(gSavedSkinSettings.getColor4("HTMLLinkColor"));
style->setColor(LLUIColorTable::instance().getColor("HTMLLinkColor"));
style->setLinkHREF(link);
}
else
@ -115,6 +115,6 @@ void LLStyleMap::update()
{
LLStyleSP &style = iter->second;
// Update the link color in case it has been changed.
style->setColor(gSavedSkinSettings.getColor4("HTMLLinkColor"));
style->setColor(LLUIColorTable::instance().getColor("HTMLLinkColor"));
}
}

View File

@ -359,7 +359,7 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
// Orbit tool
if (hasMouseCapture())
{
const F32 RADIANS_PER_PIXEL = 360.f * DEG_TO_RAD / gViewerWindow->getWindowWidth();
const F32 RADIANS_PER_PIXEL = 360.f * DEG_TO_RAD / gViewerWindow->getWorldViewWidth();
if (dx != 0)
{
@ -387,7 +387,7 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
F32 dist = (F32) camera_to_focus.normVec();
// Fudge factor for pan
F32 meters_per_pixel = 3.f * dist / gViewerWindow->getWindowWidth();
F32 meters_per_pixel = 3.f * dist / gViewerWindow->getWorldViewWidth();
if (dx != 0)
{
@ -409,7 +409,7 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
if (hasMouseCapture())
{
const F32 RADIANS_PER_PIXEL = 360.f * DEG_TO_RAD / gViewerWindow->getWindowWidth();
const F32 RADIANS_PER_PIXEL = 360.f * DEG_TO_RAD / gViewerWindow->getWorldViewWidth();
if (dx != 0)
{

View File

@ -510,8 +510,8 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask)
const F32 RADIANS_PER_PIXEL_X = 0.01f;
const F32 RADIANS_PER_PIXEL_Y = 0.01f;
S32 dx = x - (gViewerWindow->getWindowWidth() / 2);
S32 dy = y - (gViewerWindow->getWindowHeight() / 2);
S32 dx = x - (gViewerWindow->getWorldViewWidth() / 2);
S32 dy = y - (gViewerWindow->getWorldViewHeight() / 2);
if (dx != 0 || dy != 0)
{
@ -631,10 +631,10 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask)
// Handle auto-rotation at screen edge.
LLVector3 grab_pos_agent = gAgent.getPosAgentFromGlobal( grab_point_global );
LLCoordGL grab_center_gl( gViewerWindow->getWindowWidth() / 2, gViewerWindow->getWindowHeight() / 2);
LLCoordGL grab_center_gl( gViewerWindow->getWorldViewWidth() / 2, gViewerWindow->getWorldViewHeight() / 2);
LLViewerCamera::getInstance()->projectPosAgentToScreen(grab_pos_agent, grab_center_gl);
const S32 ROTATE_H_MARGIN = gViewerWindow->getWindowWidth() / 20;
const S32 ROTATE_H_MARGIN = gViewerWindow->getWorldViewWidth() / 20;
const F32 ROTATE_ANGLE_PER_SECOND = 30.f * DEG_TO_RAD;
const F32 rotate_angle = ROTATE_ANGLE_PER_SECOND / gFPSClamped;
// ...build mode moves camera about focus point
@ -649,7 +649,7 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask)
gAgent.cameraOrbitAround(rotate_angle);
}
}
else if (grab_center_gl.mX > gViewerWindow->getWindowWidth() - ROTATE_H_MARGIN)
else if (grab_center_gl.mX > gViewerWindow->getWorldViewWidth() - ROTATE_H_MARGIN)
{
if (gAgent.getFocusOnAvatar())
{
@ -662,7 +662,7 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask)
}
// Don't move above top of screen or below bottom
if ((grab_center_gl.mY < gViewerWindow->getWindowHeight() - 6)
if ((grab_center_gl.mY < gViewerWindow->getWorldViewHeight() - 6)
&& (grab_center_gl.mY > 24))
{
// Transmit update to simulator
@ -884,7 +884,7 @@ void LLToolGrab::handleHoverInactive(S32 x, S32 y, MASK mask)
// Look for cursor against the edge of the screen
// Only works in fullscreen
if (!gSavedSettings.getBOOL("NotFullScreen"))
if (gSavedSettings.getBOOL("WindowFullScreen"))
{
if (gAgent.cameraThirdPerson() )
{
@ -893,7 +893,7 @@ void LLToolGrab::handleHoverInactive(S32 x, S32 y, MASK mask)
gAgent.yaw(rotate_angle);
//gAgent.setControlFlags(AGENT_CONTROL_YAW_POS);
}
else if (x == (gViewerWindow->getWindowWidth() - 1) )
else if (x == (gViewerWindow->getWorldViewWidth() - 1) )
{
gAgent.yaw(-rotate_angle);
//gAgent.setControlFlags(AGENT_CONTROL_YAW_NEG);

View File

@ -137,7 +137,7 @@ void LLToolGun::draw()
{
LLUIImagePtr crosshair = LLUI::getUIImage("crosshairs.tga");
crosshair->draw(
( gViewerWindow->getWindowWidth() - crosshair->getWidth() ) / 2,
( gViewerWindow->getWindowHeight() - crosshair->getHeight() ) / 2);
( gViewerWindow->getWorldViewWidth() - crosshair->getWidth() ) / 2,
( gViewerWindow->getWorldViewHeight() - crosshair->getHeight() ) / 2);
}
}

View File

@ -180,6 +180,8 @@ void LLToolMgr::setCurrentTool( LLTool* tool )
mBaseTool = tool;
updateToolStatus();
mSavedTool = NULL;
}
LLTool* LLToolMgr::getCurrentTool()

View File

@ -112,7 +112,7 @@ void LLTracker::stopTracking(void* userdata)
// static virtual
void LLTracker::drawHUDArrow()
{
static LLCachedControl<LLColor4> map_track_color(gSavedSkinSettings, "MapTrackColor", LLColor4::white);
static LLUIColor map_track_color = LLUIColorTable::instance().getColor("MapTrackColor", LLColor4::white);
/* tracking autopilot destination has been disabled
-- 2004.01.09, Leviathan
@ -163,7 +163,7 @@ void LLTracker::render3D()
return;
}
static LLCachedControl<LLColor4> map_track_color(gSavedSkinSettings, "MapTrackColor", LLColor4::white);
static LLUIColor map_track_color = LLUIColorTable::instance().getColor("MapTrackColor", LLColor4::white);
// Arbitary location beacon
if( instance()->mIsTrackingLocation )

View File

@ -144,7 +144,7 @@ void LLUploadDialog::setMessage( const std::string& msg)
msg_rect.setOriginAndSize( msg_x, msg_y, max_msg_width, line_height );
mLabelBox[line_num]->setRect(msg_rect);
mLabelBox[line_num]->setText(cur_line);
mLabelBox[line_num]->setColor( gSavedSkinSettings.getColor( "LabelTextColor" ) );
mLabelBox[line_num]->setColor( LLUIColorTable::instance().getColor( "LabelTextColor" ) );
mLabelBox[line_num]->setVisible(TRUE);
msg_y -= line_height;
++line_num;

View File

@ -78,7 +78,6 @@ BOOL gHackGodmode = FALSE;
LLControlGroup gSavedSettings("Global"); // saved at end of session
LLControlGroup gSavedSkinSettings("Skinning"); // saved at end of session
LLControlGroup gSavedPerAccountSettings("PerAccount"); // saved at end of session
LLControlGroup gCrashSettings("CrashSettings"); // saved at end of session
LLControlGroup gWarningSettings("Warnings"); // persists ignored dialogs/warnings
@ -585,7 +584,6 @@ void settings_setup_listeners()
gSavedSettings.getControl("DebugViews")->getSignal()->connect(boost::bind(&handleDebugViewsChanged, _2));
gSavedSettings.getControl("UserLogFile")->getSignal()->connect(boost::bind(&handleLogFileChanged, _2));
gSavedSettings.getControl("RenderHideGroupTitle")->getSignal()->connect(boost::bind(handleHideGroupTitleChanged, _2));
gSavedSkinSettings.getControl("EffectColor")->getSignal()->connect(boost::bind(handleEffectColorChanged, _2));
gSavedSettings.getControl("HighResSnapshot")->getSignal()->connect(boost::bind(handleHighResSnapshotChanged, _2));
gSavedSettings.getControl("VectorizePerfTest")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _2));
gSavedSettings.getControl("VectorizeEnable")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _2));
@ -603,6 +601,69 @@ void settings_setup_listeners()
gSavedSettings.getControl("VelocityInterpolate")->getSignal()->connect(boost::bind(&handleVelocityInterpolate, _2));
}
class ColorConvertFunctor : public LLControlGroup::ApplyFunctor
{
public:
ColorConvertFunctor(LLUIColorTable::Params& params)
:mParams(params)
{
}
void apply(const std::string& name, LLControlVariable* control)
{
if(control->isType(TYPE_COL4))
{
LLUIColorTable::ColorParams color_params;
color_params.value = LLColor4(control->getValue());
mParams.color_entries.add(LLUIColorTable::ColorEntryParams().name(name).color(color_params));
}
}
private:
LLUIColorTable::Params& mParams;
};
static void convert_legacy_color_settings(const std::string& location_key, ELLPath path)
{
LLControlGroup::getInstance("Skinning")->cleanup();
LLAppViewer::instance()->loadSettingsFromDirectory(location_key);
LLUIColorTable::Params params;
ColorConvertFunctor ccf(params);
LLControlGroup::getInstance("Skinning")->applyToAll(&ccf);
LLXMLNodePtr output_node = new LLXMLNode("colors", false);
LLXUIParser::instance().writeXUI(output_node, params);
if(!output_node->isNull())
{
std::string filename = gDirUtilp->getExpandedFilename(path, "colors_def.xml");
LLFILE *fp = LLFile::fopen(filename, "w");
if(fp != NULL)
{
LLXMLNode::writeHeaderToFile(fp);
output_node->writeToFile(fp);
fclose(fp);
}
}
LLControlGroup::getInstance("Skinning")->cleanup();
}
void convert_legacy_color_settings()
{
LLControlGroup saved_skin_settings("Skinning");
convert_legacy_color_settings("DefaultSkin", LL_PATH_DEFAULT_SKIN);
convert_legacy_color_settings("CurrentSkin", LL_PATH_TOP_SKIN);
convert_legacy_color_settings("UserSkin", LL_PATH_USER_SKIN);
saved_skin_settings.cleanup();
}
#if TEST_CACHED_CONTROL

View File

@ -50,9 +50,12 @@ void settings_setup_listeners();
// for the graphics settings
void create_graphics_group(LLControlGroup& group);
// convert legacy colors.xml LLSD based color settings to
// newer colors_def.xml XUI/Params based color settings
void convert_legacy_color_settings();
// saved at end of session
extern LLControlGroup gSavedSettings;
extern LLControlGroup gSavedSkinSettings;
extern LLControlGroup gSavedPerAccountSettings;
extern LLControlGroup gWarningSettings;

View File

@ -523,7 +523,7 @@ void init_menus()
///
LLColor4 color;
LLColor4 context_menu_color = gSavedSkinSettings.getColor("MenuPopupBgColor");
LLColor4 context_menu_color = LLUIColorTable::instance().getColor("MenuPopupBgColor");
gPieSelf->setBackgroundColor( context_menu_color );
gPieAvatar->setBackgroundColor( context_menu_color );
@ -532,17 +532,17 @@ void init_menus()
gPieLand->setBackgroundColor( context_menu_color );
color = gSavedSkinSettings.getColor( "MenuPopupBgColor" );
color = LLUIColorTable::instance().getColor( "MenuPopupBgColor" );
gPopupMenuView->setBackgroundColor( color );
// If we are not in production, use a different color to make it apparent.
if (LLViewerLogin::getInstance()->isInProductionGrid())
{
color = gSavedSkinSettings.getColor( "MenuBarBgColor" );
color = LLUIColorTable::instance().getColor( "MenuBarBgColor" );
}
else
{
color = gSavedSkinSettings.getColor( "MenuNonProductionBgColor" );
color = LLUIColorTable::instance().getColor( "MenuNonProductionBgColor" );
}
gMenuBarView = LLUICtrlFactory::getInstance()->createFromFile<LLMenuBarGL>("menu_viewer.xml", gMenuHolder);
gMenuBarView->setRect(LLRect(0, top, 0, top - MENU_BAR_HEIGHT));
@ -7983,6 +7983,7 @@ void initialize_menus()
// Advanced > XUI
commit.add("Advanced.ReloadColorSettings", boost::bind(&LLUIColorTable::loadFromSettings, LLUIColorTable::getInstance()));
view_listener_t::addMenu(new LLAdvancedShowFontTest(), "Advanced.ShowFontTest");
view_listener_t::addMenu(new LLAdvancedLoadUIFromXML(), "Advanced.LoadUIFromXML");
view_listener_t::addMenu(new LLAdvancedSaveUIToXML(), "Advanced.SaveUIToXML");

View File

@ -1020,16 +1020,16 @@ void LLViewerObjectList::shiftObjects(const LLVector3 &offset)
void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap)
{
LLColor4 above_water_color = gSavedSkinSettings.getColor( "NetMapOtherOwnAboveWater" );
LLColor4 below_water_color = gSavedSkinSettings.getColor( "NetMapOtherOwnBelowWater" );
LLColor4 above_water_color = LLUIColorTable::instance().getColor( "NetMapOtherOwnAboveWater" );
LLColor4 below_water_color = LLUIColorTable::instance().getColor( "NetMapOtherOwnBelowWater" );
LLColor4 you_own_above_water_color =
gSavedSkinSettings.getColor( "NetMapYouOwnAboveWater" );
LLUIColorTable::instance().getColor( "NetMapYouOwnAboveWater" );
LLColor4 you_own_below_water_color =
gSavedSkinSettings.getColor( "NetMapYouOwnBelowWater" );
LLUIColorTable::instance().getColor( "NetMapYouOwnBelowWater" );
LLColor4 group_own_above_water_color =
gSavedSkinSettings.getColor( "NetMapGroupOwnAboveWater" );
LLUIColorTable::instance().getColor( "NetMapGroupOwnAboveWater" );
LLColor4 group_own_below_water_color =
gSavedSkinSettings.getColor( "NetMapGroupOwnBelowWater" );
LLUIColorTable::instance().getColor( "NetMapGroupOwnBelowWater" );
for (S32 i = 0; i < mMapObjects.count(); i++)

View File

@ -206,12 +206,12 @@ void LLViewerParcelOverlay::updateOverlayTexture()
{
return;
}
const LLColor4U avail = gSavedSkinSettings.getColor4("PropertyColorAvail");
const LLColor4U owned = gSavedSkinSettings.getColor4("PropertyColorOther");
const LLColor4U group = gSavedSkinSettings.getColor4("PropertyColorGroup");
const LLColor4U self = gSavedSkinSettings.getColor4("PropertyColorSelf");
const LLColor4U for_sale = gSavedSkinSettings.getColor4("PropertyColorForSale");
const LLColor4U auction = gSavedSkinSettings.getColor4("PropertyColorAuction");
const LLColor4U avail = LLUIColorTable::instance().getColor("PropertyColorAvail").get();
const LLColor4U owned = LLUIColorTable::instance().getColor("PropertyColorOther").get();
const LLColor4U group = LLUIColorTable::instance().getColor("PropertyColorGroup").get();
const LLColor4U self = LLUIColorTable::instance().getColor("PropertyColorSelf").get();
const LLColor4U for_sale = LLUIColorTable::instance().getColor("PropertyColorForSale").get();
const LLColor4U auction = LLUIColorTable::instance().getColor("PropertyColorAuction").get();
// Create the base texture.
U8 *raw = mImageRaw->getData();
@ -314,11 +314,11 @@ void LLViewerParcelOverlay::updatePropertyLines()
S32 row, col;
const LLColor4U self_coloru = gSavedSkinSettings.getColor4("PropertyColorSelf");
const LLColor4U other_coloru = gSavedSkinSettings.getColor4("PropertyColorOther");
const LLColor4U group_coloru = gSavedSkinSettings.getColor4("PropertyColorGroup");
const LLColor4U for_sale_coloru = gSavedSkinSettings.getColor4("PropertyColorForSale");
const LLColor4U auction_coloru = gSavedSkinSettings.getColor4("PropertyColorAuction");
const LLColor4U self_coloru = LLUIColorTable::instance().getColor("PropertyColorSelf").get();
const LLColor4U other_coloru = LLUIColorTable::instance().getColor("PropertyColorOther").get();
const LLColor4U group_coloru = LLUIColorTable::instance().getColor("PropertyColorGroup").get();
const LLColor4U for_sale_coloru = LLUIColorTable::instance().getColor("PropertyColorForSale").get();
const LLColor4U auction_coloru = LLUIColorTable::instance().getColor("PropertyColorAuction").get();
// Build into dynamic arrays, then copy into static arrays.
LLDynamicArray<LLVector3, 256> new_vertex_array;

View File

@ -1526,10 +1526,10 @@ void LLViewerWindow::initBase()
params.rect(LLRect (0, 1, 1, 0));
params.h_pad(4);
params.v_pad(2);
params.text_color(gSavedSkinSettings.getColor( "ToolTipTextColor" ));
params.border_color(gSavedSkinSettings.getColor( "ToolTipBorderColor" ));
params.text_color(LLUIColorTable::instance().getColor( "ToolTipTextColor" ));
params.border_color(LLUIColorTable::instance().getColor( "ToolTipBorderColor" ));
params.border_visible(false);
params.background_color(gSavedSkinSettings.getColor( "ToolTipBgColor" ));
params.background_color(LLUIColorTable::instance().getColor( "ToolTipBgColor" ));
params.bg_visible(true);
params.font.style("NORMAL");
params.border_drop_shadow_visible(true);
@ -1824,7 +1824,7 @@ void LLViewerWindow::reshape(S32 width, S32 height)
// store the mode the user wants (even if not there yet)
gSavedSettings.setBOOL("NotFullScreen", !mWantFullscreen);
gSavedSettings.setBOOL("WindowFullScreen", mWantFullscreen);
// store new settings for the mode we are in, regardless
if (!mWindow->getFullscreen())
@ -1887,19 +1887,19 @@ void LLViewerWindow::setMenuBackgroundColor(bool god_mode, bool dev_grid)
if(god_mode && LLViewerLogin::getInstance()->isInProductionGrid())
{
new_bg_color = gSavedSkinSettings.getColor( "MenuBarGodBgColor" );
new_bg_color = LLUIColorTable::instance().getColor( "MenuBarGodBgColor" );
}
else if(god_mode && !LLViewerLogin::getInstance()->isInProductionGrid())
{
new_bg_color = gSavedSkinSettings.getColor( "MenuNonProductionGodBgColor" );
new_bg_color = LLUIColorTable::instance().getColor( "MenuNonProductionGodBgColor" );
}
else if(!god_mode && !LLViewerLogin::getInstance()->isInProductionGrid())
{
new_bg_color = gSavedSkinSettings.getColor( "MenuNonProductionBgColor" );
new_bg_color = LLUIColorTable::instance().getColor( "MenuNonProductionBgColor" );
}
else
{
new_bg_color = gSavedSkinSettings.getColor( "MenuBarBgColor" );
new_bg_color = LLUIColorTable::instance().getColor( "MenuBarBgColor" );
}
if(gMenuBarView)
@ -2162,10 +2162,11 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
LLUICtrl* keyboard_focus = gFocusMgr.getKeyboardFocus();
if( keyboard_focus )
{
LLLineEditor* chat_bar = gBottomTray ? gBottomTray->getChatBox() : NULL;
// arrow keys move avatar while chatting hack
if (gChatBar && gChatBar->inputEditorHasFocus())
if (chat_bar && chat_bar->hasFocus())
{
if (gChatBar->getCurrentChat().empty() || gSavedSettings.getBOOL("ArrowKeysMoveAvatar"))
if (chat_bar->getText().empty() || gSavedSettings.getBOOL("ArrowKeysMoveAvatar"))
{
switch(key)
{
@ -2895,15 +2896,17 @@ void LLViewerWindow::updateKeyboardFocus()
if(LLSideTray::instanceCreated())//just getInstance will create sidetray. we don't want this
LLSideTray::getInstance()->highlightFocused();
if (gSavedSettings.getBOOL("ChatBarStealsFocus")
&& gChatBar
&& gFocusMgr.getKeyboardFocus() == NULL
&& gChatBar->isInVisibleChain())
{
gChatBar->startChat(NULL);
}
//NOTE: this behavior is no longer desirable with a permanently visible chat batr
// which would *always* steal focus, disallowing navigation of the world via WASD controls --RN
//if (gSavedSettings.getBOOL("ChatBarStealsFocus")
// && gChatBar
// && gFocusMgr.getKeyboardFocus() == NULL
// && gChatBar->isInVisibleChain())
//{
// gChatBar->startChat(NULL);
//}
}
@ -4649,7 +4652,7 @@ BOOL LLViewerWindow::changeDisplaySettings(BOOL fullscreen, LLCoordScreen size,
BOOL was_maximized = gSavedSettings.getBOOL("WindowMaximized");
mWantFullscreen = fullscreen;
mShowFullscreenProgress = show_progress_bar;
gSavedSettings.setBOOL("NotFullScreen", !mWantFullscreen);
gSavedSettings.setBOOL("WindowFullScreen", mWantFullscreen);
//gResizeScreenTexture = TRUE;

View File

@ -2660,7 +2660,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
new_name = TRUE;
}
LLColor4 avatar_name_color = gSavedSkinSettings.getColor( "AvatarNameColor" );
LLColor4 avatar_name_color = LLUIColorTable::instance().getColor( "AvatarNameColor" );
avatar_name_color.setAlpha(alpha);
mNameText->setColor(avatar_name_color);
@ -2802,7 +2802,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
std::deque<LLChat>::iterator chat_iter = mChats.begin();
mNameText->clearString();
LLColor4 new_chat = gSavedSkinSettings.getColor( "AvatarNameColor" );
LLColor4 new_chat = LLUIColorTable::instance().getColor( "AvatarNameColor" );
LLColor4 normal_chat = lerp(new_chat, LLColor4(0.8f, 0.8f, 0.8f, 1.f), 0.7f);
LLColor4 old_chat = lerp(normal_chat, LLColor4(0.6f, 0.6f, 0.6f, 1.f), 0.7f);
if (mTyping && mChats.size() >= MAX_BUBBLE_CHAT_UTTERANCES)

View File

@ -368,7 +368,7 @@ LLVOSky::LLVOSky(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp)
initSunDirection(mSunDefaultPosition, LLVector3(0, 0, 0));
}
mAmbientScale = gSavedSettings.getF32("SkyAmbientScale");
mNightColorShift = gSavedSkinSettings.getColor3("SkyNightColorShift");
mNightColorShift = gSavedSettings.getColor3("SkyNightColorShift");
mFogColor.mV[VRED] = mFogColor.mV[VGREEN] = mFogColor.mV[VBLUE] = 0.5f;
mFogColor.mV[VALPHA] = 0.0f;
mFogRatio = 1.2f;

View File

@ -284,7 +284,7 @@ BOOL is_agent_in_region(LLViewerRegion* region, LLSimInfo* info)
void LLWorldMapView::draw()
{
static LLCachedControl<LLColor4> map_track_color(gSavedSkinSettings, "MapTrackColor", LLColor4::white);
static LLUIColor map_track_color = LLUIColorTable::instance().getColor("MapTrackColor", LLColor4::white);
LLTextureView::clearDebugImages();
@ -908,8 +908,8 @@ void LLWorldMapView::drawImageStack(const LLVector3d& global_pos, LLUIImagePtr i
void LLWorldMapView::drawAgents()
{
static LLCachedControl<LLColor4> map_avatar_color(gSavedSkinSettings, "MapAvatarColor", LLColor4::white);
static LLCachedControl<LLColor4> map_avatar_friend_color(gSavedSkinSettings, "MapAvatarFriendColor", LLColor4::white);
static LLUIColor map_avatar_color = LLUIColorTable::instance().getColor("MapAvatarColor", LLColor4::white);
static LLUIColor map_avatar_friend_color = LLUIColorTable::instance().getColor("MapAvatarFriendColor", LLColor4::white);
F32 agents_scale = (gMapScale * 0.9f) / 256.f;

View File

@ -5094,8 +5094,8 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
F32 minLum = llmax(gSavedSettings.getF32("RenderGlowMinLuminance"), 0.0f);
F32 maxAlpha = gSavedSettings.getF32("RenderGlowMaxExtractAlpha");
F32 warmthAmount = gSavedSettings.getF32("RenderGlowWarmthAmount");
LLVector3 lumWeights = gSavedSkinSettings.getVector3("RenderGlowLumWeights");
LLVector3 warmthWeights = gSavedSkinSettings.getVector3("RenderGlowWarmthWeights");
LLVector3 lumWeights = gSavedSettings.getVector3("RenderGlowLumWeights");
LLVector3 warmthWeights = gSavedSettings.getVector3("RenderGlowWarmthWeights");
gGlowExtractProgram.uniform1f("minLuminance", minLum);
gGlowExtractProgram.uniform1f("maxExtractAlpha", maxAlpha);
gGlowExtractProgram.uniform3f("lumWeights", lumWeights.mV[0], lumWeights.mV[1], lumWeights.mV[2]);

View File

@ -123,9 +123,9 @@
<string>Color4</string>
<key>Value</key>
<array>
<real>0.94</real>
<real>0.61</real>
<real>0</real>
<real>1</real>
<real>1</real>
<real>1</real>
<real>1</real>
</array>
</map>
@ -171,9 +171,9 @@
<string>Color4</string>
<key>Value</key>
<array>
<real>1</real>
<real>0.75</real>
<real>0.24</real>
<real>0.334399998188018798828125</real>
<real>0.545599997043609619140625</real>
<real>0.51590001583099365234375</real>
<real>0.5</real>
</array>
</map>
@ -203,10 +203,10 @@
<string>Color4</string>
<key>Value</key>
<array>
<real>0.86</real>
<real>0.86</real>
<real>0.86</real>
<real>1</real>
<real>1</real>
<real>1</real>
<real>1</real>
<real>1</real>
</array>
</map>
<key>ButtonLabelDisabledColor</key>
@ -219,10 +219,10 @@
<string>Color4</string>
<key>Value</key>
<array>
<real>0.58</real>
<real>0.66</real>
<real>0.84</real>
<real>0.78</real>
<real>0.75</real>
<real>0.75</real>
<real>0.75</real>
<real>0.7799999713897705078125</real>
</array>
</map>
<key>ButtonLabelSelectedColor</key>
@ -251,10 +251,10 @@
<string>Color4</string>
<key>Value</key>
<array>
<real>0.64</real>
<real>0.75</real>
<real>0.93</real>
<real>0.78</real>
<real>1</real>
<real>1</real>
<real>1</real>
<real>0.7799999713897705078125</real>
</array>
</map>
<key>ButtonSelectedBgColor</key>
@ -267,9 +267,9 @@
<string>Color4</string>
<key>Value</key>
<array>
<real>0.24</real>
<real>0.24</real>
<real>0.24</real>
<real>1</real>
<real>1</real>
<real>1</real>
<real>1</real>
</array>
</map>
@ -299,9 +299,9 @@
<string>Color4</string>
<key>Value</key>
<array>
<real>0.24</real>
<real>0.24</real>
<real>0.24</real>
<real>1</real>
<real>1</real>
<real>1</real>
<real>1</real>
</array>
</map>
@ -411,9 +411,9 @@
<string>Color4</string>
<key>Value</key>
<array>
<real>0.5</real>
<real>0.0</real>
<real>0.0</real>
<real>0.334399998188018798828125</real>
<real>0.545599997043609619140625</real>
<real>0.51590001583099365234375</real>
<real>1.0</real>
</array>
</map>
@ -1003,9 +1003,9 @@
<string>Color4</string>
<key>Value</key>
<array>
<real>0</real>
<real>0</real>
<real>0.08</real>
<real>1</real>
<real>1</real>
<real>1</real>
<real>1</real>
</array>
</map>
@ -1035,9 +1035,9 @@
<string>Color4</string>
<key>Value</key>
<array>
<real>0.94</real>
<real>0.61</real>
<real>0</real>
<real>0.334399998188018798828125</real>
<real>0.545599997043609619140625</real>
<real>0.51590001583099365234375</real>
<real>1</real>
</array>
</map>
@ -1115,9 +1115,9 @@
<string>Color4</string>
<key>Value</key>
<array>
<real>0.94</real>
<real>0.61</real>
<real>0</real>
<real>0.272800028324127197265625</real>
<real>0.607199966907501220703125</real>
<real>0.5601749420166015625</real>
<real>1</real>
</array>
</map>
@ -1131,9 +1131,9 @@
<string>Color4</string>
<key>Value</key>
<array>
<real>0.94</real>
<real>0.65</real>
<real>0.35</real>
<real>0.334399998188018798828125</real>
<real>0.545599997043609619140625</real>
<real>0.51590001583099365234375</real>
<real>1</real>
</array>
</map>
@ -1211,9 +1211,9 @@
<string>Color4</string>
<key>Value</key>
<array>
<real>0.27</real>
<real>0.67</real>
<real>1</real>
<real>0.334399998188018798828125</real>
<real>0.545599997043609619140625</real>
<real>0.51590001583099365234375</real>
<real>1</real>
</array>
</map>
@ -1259,10 +1259,10 @@
<string>Color4</string>
<key>Value</key>
<array>
<real>0.60</real>
<real>0.60</real>
<real>1.0</real>
<real>1.0</real>
<real>0.334399998188018798828125</real>
<real>0.545599997043609619140625</real>
<real>0.51590001583099365234375</real>
<real>1</real>
</array>
</map>
<key>HealthTextColor</key>
@ -1404,9 +1404,9 @@
<key>Value</key>
<array>
<real>1</real>
<real>0.5</real>
<real>0</real>
<real>1</real>
<real>1</real>
</array>
</map>
<key>HighlightParentColor</key>
@ -1595,9 +1595,9 @@
<string>Color4</string>
<key>Value</key>
<array>
<real>0.64</real>
<real>0.75</real>
<real>0.93</real>
<real>1</real>
<real>1</real>
<real>1</real>
<real>0.5</real>
</array>
</map>
@ -1611,9 +1611,9 @@
<string>Color4</string>
<key>Value</key>
<array>
<real>0.58</real>
<real>0.66</real>
<real>0.84</real>
<real>1</real>
<real>1</real>
<real>1</real>
<real>1</real>
</array>
</map>
@ -1724,9 +1724,9 @@
<string>Color4</string>
<key>Value</key>
<array>
<real>0.0</real>
<real>1.0</real>
<real>0.0</real>
<real>1.0</real>
<real>1.0</real>
<real>1.0</real>
</array>
</map>
@ -1756,10 +1756,10 @@
<string>Color4</string>
<key>Value</key>
<array>
<real>1.0</real>
<real>1.0</real>
<real>1.0</real>
<real>1.0</real>
<real>0.53125</real>
<real>0</real>
<real>0.498047053813934326171875</real>
<real>1</real>
</array>
</map>
<key>MapFrustumColor</key>
@ -1854,9 +1854,9 @@
<string>Color4</string>
<key>Value</key>
<array>
<real>0.24</real>
<real>0.5</real>
<real>0.24</real>
<real>0.0</real>
<real>0.0</real>
<real>0.0</real>
<real>1</real>
</array>
</map>
@ -2014,9 +2014,9 @@
<string>Color4</string>
<key>Value</key>
<array>
<real>0.72</real>
<real>0.72</real>
<real>0.74</real>
<real>1</real>
<real>1</real>
<real>1</real>
<real>1</real>
</array>
</map>
@ -2500,36 +2500,6 @@
<real>0.4</real>
</array>
</map>
<key>RenderGlowLumWeights</key>
<map>
<key>Comment</key>
<string>Weights for each color channel to be used in calculating luminance (should add up to 1.0)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Vector3</string>
<key>Value</key>
<array>
<real>0.299</real>
<real>0.587</real>
<real>0.114</real>
</array>
</map>
<key>RenderGlowWarmthWeights</key>
<map>
<key>Comment</key>
<string>Weight of each color channel used before finding the max warmth</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Vector3</string>
<key>Value</key>
<array>
<real>1.0</real>
<real>0.5</real>
<real>0.7</real>
</array>
</map>
<key>ScriptBgReadOnlyColor</key>
<map>
<key>Comment</key>
@ -2572,10 +2542,10 @@
<string>Color4</string>
<key>Value</key>
<array>
<real>0.39</real>
<real>0.39</real>
<real>0.39</real>
<real>0.16</real>
<real>0.334399998188018798828125</real>
<real>0.545599997043609619140625</real>
<real>0.51590001583099365234375</real>
<real>0.1599999964237213134765625</real>
</array>
</map>
<key>ScrollBgReadOnlyColor</key>
@ -2716,9 +2686,9 @@
<string>Color4</string>
<key>Value</key>
<array>
<real>0.24</real>
<real>0.3</real>
<real>0.49</real>
<real>1</real>
<real>1</real>
<real>1</real>
<real>1</real>
</array>
</map>
@ -2732,9 +2702,9 @@
<string>Color4</string>
<key>Value</key>
<array>
<real>0.6</real>
<real>0.6</real>
<real>0.62</real>
<real>1</real>
<real>1</real>
<real>1</real>
<real>1</real>
</array>
</map>
@ -2770,21 +2740,6 @@
<real>1</real>
</array>
</map>
<key>SkyNightColorShift</key>
<map>
<key>Comment</key>
<string>Controls moonlight color (base color applied to moon as light source)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Color3</string>
<key>Value</key>
<array>
<real>0.67</real>
<real>0.67</real>
<real>1.0</real>
</array>
</map>
<key>SliderDisabledThumbColor</key>
<map>
<key>Comment</key>
@ -2795,9 +2750,9 @@
<string>Color4</string>
<key>Value</key>
<array>
<real>0</real>
<real>0</real>
<real>0</real>
<real>1</real>
<real>1</real>
<real>1</real>
<real>1</real>
</array>
</map>
@ -2811,9 +2766,9 @@
<string>Color4</string>
<key>Value</key>
<array>
<real>0.78</real>
<real>0.78</real>
<real>0.78</real>
<real>1</real>
<real>1</real>
<real>1</real>
<real>1</real>
</array>
</map>

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 458 B

Some files were not shown because too many files have changed in this diff Show More