From 672a76d0ea08a0d0fc824e103ee4c4242b7e03ec Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Sat, 15 Mar 2008 01:18:27 +0000 Subject: reverting premature commit at 82410. --- indra/llcommon/indra_constants.h | 2 +- indra/llcommon/llevent.h | 7 + indra/llcommon/llfile.cpp | 11 +- indra/llui/llbutton.cpp | 5 +- indra/llui/llmenugl.cpp | 101 +- indra/llui/llmenugl.h | 7 +- indra/llui/llui.cpp | 15 +- indra/llui/llview.cpp | 65 +- indra/llui/llview.h | 22 +- indra/llvfs/llvfile.cpp | 1 + indra/llvfs/llvfile.h | 2 + indra/llxml/llcontrol.cpp | 816 +- indra/llxml/llcontrol.h | 210 +- indra/newview/app_settings/cmd_line.xml | 323 - indra/newview/app_settings/settings.xml | 9604 -------------------- .../app_settings/settings_crash_behavior.xml | 15 - indra/newview/app_settings/settings_files.xml | 22 - .../newview/app_settings/settings_per_account.xml | 114 - .../installers/windows/installer_template.nsi | 8 +- indra/newview/llagent.cpp | 18 +- indra/newview/llagent.h | 21 +- indra/newview/llappviewer.cpp | 1178 ++- indra/newview/llappviewer.h | 57 +- indra/newview/llappviewerlinux.cpp | 30 +- indra/newview/llappviewerlinux.h | 3 - indra/newview/llappviewermacosx.cpp | 43 +- indra/newview/llappviewermacosx.h | 1 - indra/newview/llappviewerwin32.cpp | 83 +- indra/newview/llappviewerwin32.h | 9 +- indra/newview/llcommandlineparser.cpp | 535 -- indra/newview/llcommandlineparser.h | 131 - indra/newview/llfeaturemanager.cpp | 2 +- indra/newview/llfirstuse.cpp | 19 +- indra/newview/llfloaterabout.cpp | 2 +- indra/newview/llfloatergroups.cpp | 3 +- indra/newview/llfloatergroups.h | 2 +- indra/newview/llfloaterpreference.cpp | 2 +- indra/newview/llfloatersettingsdebug.cpp | 490 - indra/newview/llfloatersettingsdebug.h | 61 - indra/newview/llnetmap.cpp | 8 + indra/newview/llnetmap.h | 8 + indra/newview/llpanellogin.cpp | 34 +- indra/newview/llstartup.cpp | 84 +- indra/newview/lltoolgun.cpp | 12 +- indra/newview/llvectorperfoptions.cpp | 99 +- indra/newview/llvectorperfoptions.h | 6 +- indra/newview/llvieweraudio.cpp | 2 +- indra/newview/llviewercontrol.cpp | 858 +- indra/newview/llviewercontrol.h | 31 +- indra/newview/llviewerjointmesh.cpp | 55 +- indra/newview/llviewerjointmesh.h | 3 - indra/newview/llviewermedia.cpp | 5 +- indra/newview/llviewermenu.cpp | 13 +- indra/newview/llviewernetwork.cpp | 7 +- indra/newview/llviewernetwork.h | 7 +- indra/newview/llvoiceclient.cpp | 39 +- indra/newview/llxmlrpctransaction.cpp | 5 +- indra/newview/viewer_manifest.py | 8 +- 58 files changed, 2519 insertions(+), 12805 deletions(-) delete mode 100644 indra/newview/app_settings/cmd_line.xml delete mode 100644 indra/newview/app_settings/settings.xml delete mode 100644 indra/newview/app_settings/settings_crash_behavior.xml delete mode 100644 indra/newview/app_settings/settings_files.xml delete mode 100644 indra/newview/app_settings/settings_per_account.xml delete mode 100644 indra/newview/llcommandlineparser.cpp delete mode 100644 indra/newview/llcommandlineparser.h delete mode 100644 indra/newview/llfloatersettingsdebug.cpp delete mode 100644 indra/newview/llfloatersettingsdebug.h diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h index 89b276e3b3..a0fb086029 100644 --- a/indra/llcommon/indra_constants.h +++ b/indra/llcommon/indra_constants.h @@ -339,7 +339,7 @@ const U32 MAP_ITEM_LAND_FOR_SALE = 0x07; const U32 MAP_ITEM_CLASSIFIED = 0x08; // Crash reporter behavior -const char* const CRASH_SETTINGS_FILE = "settings_crash_behavior.xml"; +const char* const CRASH_SETTINGS_FILE = "crash_settings.xml"; const char* const CRASH_BEHAVIOR_SETTING = "CrashSubmitBehavior"; const S32 CRASH_BEHAVIOR_ASK = 0; const S32 CRASH_BEHAVIOR_ALWAYS_SEND = 1; diff --git a/indra/llcommon/llevent.h b/indra/llcommon/llevent.h index 741b40b787..8ba883a0ee 100644 --- a/indra/llcommon/llevent.h +++ b/indra/llcommon/llevent.h @@ -185,6 +185,13 @@ protected: LLPointer mDispatcher; }; +// Utility mixer class which fires & handles events +class LLSimpleListenerObservable : public LLObservable, public LLSimpleListener +{ +public: + virtual bool handleEvent(LLPointer event, const LLSD& userdata) = 0; +}; + class LLValueChangedEvent : public LLEvent { public: diff --git a/indra/llcommon/llfile.cpp b/indra/llcommon/llfile.cpp index c44650009d..2a18e5c64c 100644 --- a/indra/llcommon/llfile.cpp +++ b/indra/llcommon/llfile.cpp @@ -271,11 +271,9 @@ void llofstream::open(const char* _Filename, /* Flawfinder: ignore */ void llofstream::close() { // close the C stream - if(is_open()) - { - if (_Filebuffer->close() == 0) - _Myios::setstate(ios_base::failbit); /*Flawfinder: ignore*/ - } + llassert(_Filebuffer); + if (_Filebuffer->close() == 0) + _Myios::setstate(ios_base::failbit); /*Flawfinder: ignore*/ } llofstream::llofstream(const char *_Filename, @@ -287,8 +285,7 @@ llofstream::llofstream(const char *_Filename, } llofstream::~llofstream() -{ - // destroy the object +{ // destroy the object close(); delete _Filebuffer; } diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 8ae6dd2ea5..2bcc89b59f 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -778,8 +778,9 @@ void LLButton::setToggleState(BOOL b) { if( b != mToggleState ) { - setControlValue(b); // will fire LLControlVariable callbacks (if any) - mToggleState = b; // may or may not be redundant + mToggleState = b; + LLValueChangedEvent *evt = new LLValueChangedEvent(this, mToggleState); + fireEvent(evt, ""); } } diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 8c62a10f2b..00b4c37bb0 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -827,33 +827,57 @@ void LLMenuItemCallGL::setEnabledControl(LLString enabled_control, LLView *conte // Register new listener if (!enabled_control.empty()) { - LLControlVariable *control = context->findControl(enabled_control); - if (!control) + LLControlBase *control = context->findControl(enabled_control); + if (control) + { + LLSD state = control->registerListener(this, "ENABLED"); + setEnabled(state); + } + else { context->addBoolControl(enabled_control, getEnabled()); control = context->findControl(enabled_control); - llassert_always(control); + control->registerListener(this, "ENABLED"); } - control->getSignal()->connect(boost::bind(&LLView::controlListener, _1, getHandle(), std::string("enabled"))); - setEnabled(control->getValue()); } } -void LLMenuItemCallGL::setVisibleControl(LLString visible_control, LLView *context) +void LLMenuItemCallGL::setVisibleControl(LLString enabled_control, LLView *context) { // Register new listener - if (!visible_control.empty()) + if (!enabled_control.empty()) { - LLControlVariable *control = context->findControl(visible_control); - if (!control) + LLControlBase *control = context->findControl(enabled_control); + if (control) { - context->addBoolControl(visible_control, getVisible()); - control = context->findControl(visible_control); - llassert_always(control); + LLSD state = control->registerListener(this, "VISIBLE"); + setVisible(state); } - control->getSignal()->connect(boost::bind(&LLView::controlListener, _1, getHandle(), std::string("visible"))); - setVisible(control->getValue()); + else + { + context->addBoolControl(enabled_control, getEnabled()); + control = context->findControl(enabled_control); + control->registerListener(this, "VISIBLE"); + } + } +} + +// virtual +bool LLMenuItemCallGL::handleEvent(LLPointer event, const LLSD& userdata) +{ + if (userdata.asString() == "ENABLED" && event->desc() == "value_changed") + { + LLSD state = event->getValue(); + setEnabled(state); + return TRUE; } + if (userdata.asString() == "VISIBLE" && event->desc() == "value_changed") + { + LLSD state = event->getValue(); + setVisible(state); + return TRUE; + } + return LLMenuItemGL::handleEvent(event, userdata); } // virtual @@ -976,35 +1000,44 @@ LLMenuItemCheckGL::LLMenuItemCheckGL ( const LLString& name, setControlName(control_name, context); } -//virtual -void LLMenuItemCheckGL::setValue(const LLSD& value) -{ - mChecked = value.asBoolean(); - if(mChecked) - { - mDrawBoolLabel = BOOLEAN_TRUE_PREFIX; - } - else - { - mDrawBoolLabel.clear(); - } -} - void LLMenuItemCheckGL::setCheckedControl(LLString checked_control, LLView *context) { // Register new listener if (!checked_control.empty()) { - LLControlVariable *control = context->findControl(checked_control); - if (!control) + LLControlBase *control = context->findControl(checked_control); + if (control) + { + LLSD state = control->registerListener(this, "CHECKED"); + mChecked = state; + } + else { context->addBoolControl(checked_control, mChecked); control = context->findControl(checked_control); - llassert_always(control); + control->registerListener(this, "CHECKED"); + } + } +} + +// virtual +bool LLMenuItemCheckGL::handleEvent(LLPointer event, const LLSD& userdata) +{ + if (userdata.asString() == "CHECKED" && event->desc() == "value_changed") + { + LLSD state = event->getValue(); + mChecked = state; + if(mChecked) + { + mDrawBoolLabel = BOOLEAN_TRUE_PREFIX; } - control->getSignal()->connect(boost::bind(&LLView::controlListener, _1, getHandle(), std::string("value"))); - mChecked = control->getValue(); + else + { + mDrawBoolLabel.clear(); + } + return TRUE; } + return LLMenuItemCallGL::handleEvent(event, userdata); } // virtual @@ -1913,7 +1946,7 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory { continue; } - LLControlVariable *control = parent->findControl(control_name); + LLControlBase *control = parent->findControl(control_name); if (!control) { parent->addBoolControl(control_name, FALSE); diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index 33b226fd99..e9b80e562b 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -225,7 +225,7 @@ private: // calls a user defined callback. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLMenuItemCallGL : public LLMenuItemGL, public LLObservable +class LLMenuItemCallGL : public LLMenuItemGL { public: // normal constructor @@ -291,6 +291,7 @@ public: //virtual void draw(); + virtual bool handleEvent(LLPointer event, const LLSD& userdata); private: menu_callback mCallback; @@ -340,7 +341,7 @@ public: void setCheckedControl(LLString checked_control, LLView *context); - virtual void setValue(const LLSD& value); + virtual void setValue(const LLSD& value) { mChecked = value.asBoolean(); } virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_MENU_ITEM_CHECK; } virtual LLString getWidgetTag() const { return LL_MENU_ITEM_CHECK_GL_TAG; } @@ -349,6 +350,8 @@ public: // called to rebuild the draw label virtual void buildDrawLabel( void ); + virtual bool handleEvent(LLPointer event, const LLSD& userdata); + private: check_callback mCheckCallback; BOOL mChecked; diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 1e9442805f..aed7893df7 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -1555,11 +1555,16 @@ void gl_segmented_rect_3d_tex_top(const LLVector2& border_scale, const LLVector3 gl_segmented_rect_3d_tex(border_scale, border_width, border_height, width_vec, height_vec, ROUNDED_RECT_TOP); } -bool handleShowXUINamesChanged(const LLSD& newvalue) +class LLShowXUINamesListener: public LLSimpleListener { - LLUI::sShowXUINames = newvalue.asBoolean(); - return true; -} + bool handleEvent(LLPointer event, const LLSD& userdata) + { + LLUI::sShowXUINames = (BOOL) event->getValue().asBoolean(); + return true; + } +}; +static LLShowXUINamesListener show_xui_names_listener; + void LLUI::initClass(LLControlGroup* config, LLControlGroup* colors, @@ -1579,7 +1584,7 @@ void LLUI::initClass(LLControlGroup* config, LLFontGL::sShadowColor = colors->getColor("ColorDropShadow"); LLUI::sShowXUINames = LLUI::sConfigGroup->getBOOL("ShowXUINames"); - LLUI::sConfigGroup->getControl("ShowXUINames")->getSignal()->connect(boost::bind(&handleShowXUINamesChanged, _1)); + LLUI::sConfigGroup->getControl("ShowXUINames")->addListener(&show_xui_names_listener); } void LLUI::cleanupClass() diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 269796e5de..0a37c03ac5 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -2426,7 +2426,16 @@ LLSimpleListener* LLView::getListenerByName(const LLString& callback_name) return callback; } -LLControlVariable *LLView::findControl(LLString name) +void LLView::addListenerToControl(LLEventDispatcher *dispatcher, const LLString& name, LLSD filter, LLSD userdata) +{ + LLSimpleListener* listener = getListenerByName(name); + if (listener) + { + dispatcher->addListener(listener, filter, userdata); + } +} + +LLControlBase *LLView::findControl(LLString name) { control_map_t::iterator itor = mFloaterControls.find(name); if (itor != mFloaterControls.end()) @@ -2782,15 +2791,9 @@ LLFontGL::StyleFlags LLView::selectFontStyle(LLXMLNodePtr node) return gl_font_style; } -bool LLView::setControlValue(const LLSD& value) +void LLView::setControlValue(const LLSD& value) { - LLString ctrlname = getControlName(); - if (!ctrlname.empty()) - { - LLUI::sConfigGroup->setValue(ctrlname, value); - return true; - } - return false; + LLUI::sConfigGroup->setValue(getControlName(), value); } //virtual @@ -2801,57 +2804,43 @@ void LLView::setControlName(const LLString& control_name, LLView *context) context = this; } + // Unregister from existing listeners if (!mControlName.empty()) { - llwarns << "setControlName called twice on same control!" << llendl; - mControlConnection.disconnect(); // disconnect current signal - mControlName.clear(); + clearDispatchers(); } - + // Register new listener if (!control_name.empty()) { - LLControlVariable *control = context->findControl(control_name); + LLControlBase *control = context->findControl(control_name); if (control) { mControlName = control_name; - mControlConnection = control->getSignal()->connect(boost::bind(&controlListener, _1, getHandle(), std::string("value"))); - setValue(control->getValue()); + LLSD state = control->registerListener(this, "DEFAULT"); + setValue(state); } } } -// static -bool LLView::controlListener(const LLSD& newvalue, LLHandle handle, std::string type) +// virtual +bool LLView::handleEvent(LLPointer event, const LLSD& userdata) { - LLView* view = handle.get(); - if (view) + if (userdata.asString() == "DEFAULT" && event->desc() == "value_changed") { - if (type == "value") - { - view->setValue(newvalue); - return true; - } - else if (type == "enabled") - { - view->setEnabled(newvalue.asBoolean()); - return true; - } - else if (type == "visible") - { - view->setVisible(newvalue.asBoolean()); - return true; - } + LLSD state = event->getValue(); + setValue(state); + return TRUE; } - return false; + return FALSE; } void LLView::addBoolControl(LLString name, bool initial_value) { - mFloaterControls[name] = new LLControlVariable(name, TYPE_BOOLEAN, initial_value, "Internal floater control"); + mFloaterControls[name] = new LLControl(name, TYPE_BOOLEAN, initial_value, "Internal floater control"); } -LLControlVariable *LLView::getControl(LLString name) +LLControlBase *LLView::getControl(LLString name) { control_map_t::iterator itor = mFloaterControls.find(name); if (itor != mFloaterControls.end()) diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 24a5eb4f89..c8556c7edc 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -65,6 +65,7 @@ const BOOL NOT_MOUSE_OPAQUE = FALSE; const U32 GL_NAME_UI_RESERVED = 2; + /* // virtual functions defined in LLView: @@ -149,7 +150,7 @@ virtual BOOL handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent); * */ -class LLView : public LLMouseHandler, public LLMortician +class LLView : public LLMouseHandler, public LLMortician, public LLSimpleListenerObservable { public: @@ -293,6 +294,7 @@ public: LLHandle getHandle() { mHandle.bind(this); return mHandle; } + U32 getFollows() const { return mReshapeFlags; } BOOL followsLeft() const { return mReshapeFlags & FOLLOWS_LEFT; } BOOL followsRight() const { return mReshapeFlags & FOLLOWS_RIGHT; } @@ -391,13 +393,13 @@ public: void addListenerToControl(LLEventDispatcher *observer, const LLString& name, LLSD filter, LLSD userdata); void addBoolControl(LLString name, bool initial_value); - LLControlVariable *getControl(LLString name); - LLControlVariable *findControl(LLString name); + LLControlBase *getControl(LLString name); + LLControlBase *findControl(LLString name); - bool setControlValue(const LLSD& value); + void setControlValue(const LLSD& value); virtual void setControlName(const LLString& control, LLView *context); virtual LLString getControlName() const { return mControlName; } -// virtual bool handleEvent(LLPointer event, const LLSD& userdata); + virtual bool handleEvent(LLPointer event, const LLSD& userdata); virtual void setValue(const LLSD& value); virtual LLSD getValue() const; @@ -492,12 +494,11 @@ protected: LLView* childrenHandleRightMouseDown(S32 x, S32 y, MASK mask); LLView* childrenHandleRightMouseUp(S32 x, S32 y, MASK mask); - static bool controlListener(const LLSD& newvalue, LLHandle handle, std::string type); - - typedef std::map control_map_t; + typedef std::map control_map_t; control_map_t mFloaterControls; virtual LLView* getChildByName(const LLString& name, BOOL recurse = FALSE) const; + private: LLView* mParentView; child_list_t mChildList; @@ -536,8 +537,9 @@ private: dispatch_list_t mDispatchList; LLString mControlName; - boost::signals::connection mControlConnection; - + + +// Just debugging stuff? We should try to hide anything that's not. -MG public: static BOOL sDebugRects; // Draw debug rects behind everything. static BOOL sDebugKeys; diff --git a/indra/llvfs/llvfile.cpp b/indra/llvfs/llvfile.cpp index bd4dfc2d78..b25ec4a86e 100644 --- a/indra/llvfs/llvfile.cpp +++ b/indra/llvfs/llvfile.cpp @@ -45,6 +45,7 @@ const S32 LLVFile::APPEND = 0x00000006; // 0x00000004 & LLVFile::WRITE //---------------------------------------------------------------------------- LLVFSThread* LLVFile::sVFSThread = NULL; BOOL LLVFile::sAllocdVFSThread = FALSE; +BOOL LLVFile::ALLOW_ASYNC = TRUE; //---------------------------------------------------------------------------- //============================================================================ diff --git a/indra/llvfs/llvfile.h b/indra/llvfs/llvfile.h index cd4fc59174..3d81483308 100644 --- a/indra/llvfs/llvfile.h +++ b/indra/llvfs/llvfile.h @@ -78,6 +78,8 @@ public: static const S32 WRITE; static const S32 READ_WRITE; static const S32 APPEND; + + static BOOL ALLOW_ASYNC; protected: LLAssetType::EType mFileType; diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp index 9de426fc03..4ad44f455f 100644 --- a/indra/llxml/llcontrol.cpp +++ b/indra/llxml/llcontrol.cpp @@ -57,9 +57,19 @@ #endif //this defines the current version of the settings file +U32 LLControlBase::sMaxControlNameLength = 0; + +//These lists are used to store the ID's of registered event listeners. +std::list LLControlBase::mFreeIDs; +std::list LLControlBase::mUsedIDs; + +S32 LLControlBase::mTopID; + +std::set LLControlBase::mChangedControls; + const S32 CURRENT_VERSION = 101; -BOOL LLControlVariable::llsd_compare(const LLSD& a, const LLSD & b) +BOOL LLControl::llsd_compare(const LLSD& a, const LLSD & b) { switch (mType) { @@ -91,154 +101,58 @@ BOOL LLControlVariable::llsd_compare(const LLSD& a, const LLSD & b) return FALSE; } -LLControlVariable::LLControlVariable(const LLString& name, eControlType type, - LLSD initial, const LLString& comment, - BOOL persist) - : mName(name), - mComment(comment), - mType(type), - mPersist(persist) -{ - if (mPersist && mComment.empty()) - { - llerrs << "Must supply a comment for control " << mName << llendl; - } - //Push back versus setValue'ing here, since we don't want to call a signal yet - mValues.push_back(initial); -} - - - -LLControlVariable::~LLControlVariable() -{ -} - -void LLControlVariable::setValue(const LLSD& value, bool saved_value) -{ - bool value_changed = llsd_compare(getValue(), value) == FALSE; - if(saved_value) - { - // If we're going to save this value, return to default but don't fire - resetToDefault(false); - if (llsd_compare(mValues.back(), value) == FALSE) - { - mValues.push_back(value); - } - } - else - { - // This is a unsaved value. Its needs to reside at - // mValues[2] (or greater). It must not affect - // the result of getSaveValue() - if (llsd_compare(mValues.back(), value) == FALSE) - { - while(mValues.size() > 2) - { - // Remove any unsaved values. - mValues.pop_back(); - } - - if(mValues.size() < 2) - { - // Add the default to the 'save' value. - mValues.push_back(mValues[0]); - } - - // Add the 'un-save' value. - mValues.push_back(value); - } - } - - if(value_changed) - { - mSignal(value); - } -} - -void LLControlVariable::resetToDefault(bool fire_signal) +LLControlBase::~LLControlBase() { - //The first setting is always the default - //Pop to it and fire off the listener - while(mValues.size() > 1) mValues.pop_back(); - if(fire_signal) firePropertyChanged(); -} - -bool LLControlVariable::isSaveValueDefault() -{ - return (mValues.size() == 1) - || ((mValues.size() > 1) && llsd_compare(mValues[1], mValues[0])); } -LLSD LLControlVariable::getSaveValue() const +// virtual +void LLControlBase::resetToDefault() { - //The first level of the stack is default - //We assume that the second level is user preferences that should be saved - if(mValues.size() > 1) return mValues[1]; - return mValues[0]; } -LLControlVariable* LLControlGroup::getControl(const LLString& name) +LLControlGroup::LLControlGroup(): mNameTable() { - ctrl_name_table_t::iterator iter = mNameTable.find(name); - return iter == mNameTable.end() ? NULL : iter->second; + //mFreeStringOffset = 0; } - -//////////////////////////////////////////////////////////////////////////// - -LLControlGroup::LLControlGroup() +LLControlGroup::~LLControlGroup() { - mTypeString[TYPE_U32] = "U32"; - mTypeString[TYPE_S32] = "S32"; - mTypeString[TYPE_F32] = "F32"; - mTypeString[TYPE_BOOLEAN] = "Boolean"; - mTypeString[TYPE_STRING] = "String"; - mTypeString[TYPE_VEC3] = "Vector3"; - mTypeString[TYPE_VEC3D] = "Vector3D"; - mTypeString[TYPE_RECT] = "Rect"; - mTypeString[TYPE_COL4] = "Color4"; - mTypeString[TYPE_COL3] = "Color3"; - mTypeString[TYPE_COL4U] = "Color4u"; - mTypeString[TYPE_LLSD] = "LLSD"; } -LLControlGroup::~LLControlGroup() +LLSD LLControlBase::registerListener(LLSimpleListenerObservable *listener, LLSD userdata) { - cleanup(); + // Symmetric listener relationship + addListener(listener, "", userdata); + listener->addListener(this, "", userdata); + return getValue(); } void LLControlGroup::cleanup() { - for_each(mNameTable.begin(), mNameTable.end(), DeletePairedPointer()); mNameTable.clear(); } -eControlType LLControlGroup::typeStringToEnum(const LLString& typestr) -{ - for(int i = 0; i < (int)TYPE_COUNT; ++i) - { - if(mTypeString[i] == typestr) return (eControlType)i; - } - return (eControlType)-1; -} - -LLString LLControlGroup::typeEnumToString(eControlType typeenum) +LLControlBase* LLControlGroup::getControl(const LLString& name) { - return mTypeString[typeenum]; + ctrl_name_table_t::iterator iter = mNameTable.find(name); + return iter == mNameTable.end() ? NULL : (LLControlBase*)iter->second; } BOOL LLControlGroup::declareControl(const LLString& name, eControlType type, const LLSD initial_val, const LLString& comment, BOOL persist) { - if(mNameTable.find(name) != mNameTable.end()) + if(!mNameTable[name]) { - llwarns << "LLControlGroup::declareControl: Control named " << name << " already exists." << llendl; - mNameTable[name]->setValue(initial_val); + // if not, create the control and add it to the name table + LLControl* control = new LLControl(name, type, initial_val, comment, persist); + mNameTable[name] = control; return TRUE; } - // if not, create the control and add it to the name table - LLControlVariable* control = new LLControlVariable(name, type, initial_val, comment, persist); - mNameTable[name] = control; - return TRUE; + else + { + llwarns << "LLControlGroup::declareControl: Control named " << name << " already exists." << llendl; + mNameTable.erase(name); + return FALSE; + } } BOOL LLControlGroup::declareU32(const LLString& name, const U32 initial_val, const LLString& comment, BOOL persist) @@ -296,14 +210,19 @@ BOOL LLControlGroup::declareColor3(const LLString& name, const LLColor3 &initial return declareControl(name, TYPE_COL3, initial_val.getValue(), comment, persist); } -BOOL LLControlGroup::declareLLSD(const LLString& name, const LLSD &initial_val, const LLString& comment, BOOL persist ) +LLSD LLControlGroup::registerListener(const LLString& name, LLSimpleListenerObservable *listener) { - return declareControl(name, TYPE_LLSD, initial_val, comment, persist); + LLControlBase *control = getControl(name); + if (control) + { + return control->registerListener(listener); + } + return LLSD(); } BOOL LLControlGroup::getBOOL(const LLString& name) { - LLControlVariable* control = getControl(name); + LLControlBase* control = getControl(name); if (control && control->isType(TYPE_BOOLEAN)) return control->get().asBoolean(); @@ -316,7 +235,7 @@ BOOL LLControlGroup::getBOOL(const LLString& name) S32 LLControlGroup::getS32(const LLString& name) { - LLControlVariable* control = getControl(name); + LLControlBase* control = getControl(name); if (control && control->isType(TYPE_S32)) return control->get().asInteger(); @@ -329,7 +248,7 @@ S32 LLControlGroup::getS32(const LLString& name) U32 LLControlGroup::getU32(const LLString& name) { - LLControlVariable* control = getControl(name); + LLControlBase* control = getControl(name); if (control && control->isType(TYPE_U32)) return control->get().asInteger(); @@ -342,7 +261,7 @@ U32 LLControlGroup::getU32(const LLString& name) F32 LLControlGroup::getF32(const LLString& name) { - LLControlVariable* control = getControl(name); + LLControlBase* control = getControl(name); if (control && control->isType(TYPE_F32)) return (F32) control->get().asReal(); @@ -355,7 +274,7 @@ F32 LLControlGroup::getF32(const LLString& name) LLString LLControlGroup::findString(const LLString& name) { - LLControlVariable* control = getControl(name); + LLControlBase* control = getControl(name); if (control && control->isType(TYPE_STRING)) return control->get().asString(); @@ -364,7 +283,7 @@ LLString LLControlGroup::findString(const LLString& name) LLString LLControlGroup::getString(const LLString& name) { - LLControlVariable* control = getControl(name); + LLControlBase* control = getControl(name); if (control && control->isType(TYPE_STRING)) return control->get().asString(); @@ -390,7 +309,7 @@ LLString LLControlGroup::getText(const LLString& name) LLVector3 LLControlGroup::getVector3(const LLString& name) { - LLControlVariable* control = getControl(name); + LLControlBase* control = getControl(name); if (control && control->isType(TYPE_VEC3)) return control->get(); @@ -403,7 +322,7 @@ LLVector3 LLControlGroup::getVector3(const LLString& name) LLVector3d LLControlGroup::getVector3d(const LLString& name) { - LLControlVariable* control = getControl(name); + LLControlBase* control = getControl(name); if (control && control->isType(TYPE_VEC3D)) return control->get(); @@ -416,7 +335,7 @@ LLVector3d LLControlGroup::getVector3d(const LLString& name) LLRect LLControlGroup::getRect(const LLString& name) { - LLControlVariable* control = getControl(name); + LLControlBase* control = getControl(name); if (control && control->isType(TYPE_RECT)) return control->get(); @@ -434,7 +353,7 @@ LLColor4 LLControlGroup::getColor(const LLString& name) if (i != mNameTable.end()) { - LLControlVariable* control = i->second; + LLControlBase* control = i->second; switch(control->mType) { @@ -462,7 +381,7 @@ LLColor4 LLControlGroup::getColor(const LLString& name) LLColor4U LLControlGroup::getColor4U(const LLString& name) { - LLControlVariable* control = getControl(name); + LLControlBase* control = getControl(name); if (control && control->isType(TYPE_COL4U)) return control->get(); @@ -475,7 +394,7 @@ LLColor4U LLControlGroup::getColor4U(const LLString& name) LLColor4 LLControlGroup::getColor4(const LLString& name) { - LLControlVariable* control = getControl(name); + LLControlBase* control = getControl(name); if (control && control->isType(TYPE_COL4)) return control->get(); @@ -488,7 +407,7 @@ LLColor4 LLControlGroup::getColor4(const LLString& name) LLColor3 LLControlGroup::getColor3(const LLString& name) { - LLControlVariable* control = getControl(name); + LLControlBase* control = getControl(name); if (control && control->isType(TYPE_COL3)) return control->get(); @@ -499,16 +418,6 @@ LLColor3 LLControlGroup::getColor3(const LLString& name) } } -LLSD LLControlGroup::getLLSD(const LLString& name) -{ - LLControlVariable* control = getControl(name); - - if (control && control->isType(TYPE_LLSD)) - return control->getValue(); - CONTROL_ERRS << "Invalid LLSD control " << name << llendl; - return LLSD(); -} - BOOL LLControlGroup::controlExists(const LLString& name) { ctrl_name_table_t::iterator iter = mNameTable.find(name); @@ -521,7 +430,7 @@ BOOL LLControlGroup::controlExists(const LLString& name) void LLControlGroup::setBOOL(const LLString& name, BOOL val) { - LLControlVariable* control = getControl(name); + LLControlBase* control = getControl(name); if (control && control->isType(TYPE_BOOLEAN)) { @@ -536,7 +445,7 @@ void LLControlGroup::setBOOL(const LLString& name, BOOL val) void LLControlGroup::setS32(const LLString& name, S32 val) { - LLControlVariable* control = getControl(name); + LLControlBase* control = getControl(name); if (control && control->isType(TYPE_S32)) { @@ -551,7 +460,7 @@ void LLControlGroup::setS32(const LLString& name, S32 val) void LLControlGroup::setF32(const LLString& name, F32 val) { - LLControlVariable* control = getControl(name); + LLControlBase* control = getControl(name); if (control && control->isType(TYPE_F32)) { @@ -566,7 +475,7 @@ void LLControlGroup::setF32(const LLString& name, F32 val) void LLControlGroup::setU32(const LLString& name, U32 val) { - LLControlVariable* control = getControl(name); + LLControlBase* control = getControl(name); if (control && control->isType(TYPE_U32)) { @@ -581,7 +490,7 @@ void LLControlGroup::setU32(const LLString& name, U32 val) void LLControlGroup::setString(const LLString& name, const LLString &val) { - LLControlVariable* control = getControl(name); + LLControlBase* control = getControl(name); if (control && control->isType(TYPE_STRING)) { @@ -596,7 +505,7 @@ void LLControlGroup::setString(const LLString& name, const LLString &val) void LLControlGroup::setVector3(const LLString& name, const LLVector3 &val) { - LLControlVariable* control = getControl(name); + LLControlBase* control = getControl(name); if (control && control->isType(TYPE_VEC3)) { @@ -610,7 +519,7 @@ void LLControlGroup::setVector3(const LLString& name, const LLVector3 &val) void LLControlGroup::setVector3d(const LLString& name, const LLVector3d &val) { - LLControlVariable* control = getControl(name); + LLControlBase* control = getControl(name); if (control && control->isType(TYPE_VEC3D)) { @@ -624,7 +533,7 @@ void LLControlGroup::setVector3d(const LLString& name, const LLVector3d &val) void LLControlGroup::setRect(const LLString& name, const LLRect &val) { - LLControlVariable* control = getControl(name); + LLControlBase* control = getControl(name); if (control && control->isType(TYPE_RECT)) { @@ -638,7 +547,7 @@ void LLControlGroup::setRect(const LLString& name, const LLRect &val) void LLControlGroup::setColor4U(const LLString& name, const LLColor4U &val) { - LLControlVariable* control = getControl(name); + LLControlBase* control = getControl(name); if (control && control->isType(TYPE_COL4U)) { @@ -652,7 +561,7 @@ void LLControlGroup::setColor4U(const LLString& name, const LLColor4U &val) void LLControlGroup::setColor4(const LLString& name, const LLColor4 &val) { - LLControlVariable* control = getControl(name); + LLControlBase* control = getControl(name); if (control && control->isType(TYPE_COL4)) { @@ -664,20 +573,6 @@ void LLControlGroup::setColor4(const LLString& name, const LLColor4 &val) } } -void LLControlGroup::setLLSD(const LLString& name, const LLSD& val) -{ - LLControlVariable* control = getControl(name); - - if (control && control->isType(TYPE_LLSD)) - { - setValue(name, val); - } - else - { - CONTROL_ERRS << "Invalid LLSD control " << name << llendl; - } -} - void LLControlGroup::setValue(const LLString& name, const LLSD& val) { if (name.empty()) @@ -685,7 +580,7 @@ void LLControlGroup::setValue(const LLString& name, const LLSD& val) return; } - LLControlVariable* control = getControl(name); + LLControlBase* control = getControl(name); if (control) { @@ -701,8 +596,238 @@ void LLControlGroup::setValue(const LLString& name, const LLSD& val) // Load and save //--------------------------------------------------------------- -// Returns number of controls loaded, so 0 if failure U32 LLControlGroup::loadFromFileLegacy(const LLString& filename, BOOL require_declaration, eControlType declare_as) +{ + U32 item = 0; + U32 validitems = 0; + llifstream file; + S32 version; + + file.open(filename.c_str()); /*Flawfinder: ignore*/ + + if (!file) + { + llinfos << "LLControlGroup::loadFromFile unable to open." << llendl; + return 0; + } + + // Check file version + LLString name; + file >> name; + file >> version; + if (name != "version" || version != CURRENT_VERSION) + { + llinfos << filename << " does not appear to be a version " << CURRENT_VERSION << " controls file" << llendl; + return 0; + } + + while (!file.eof()) + { + file >> name; + + if (name.empty()) + { + continue; + } + + if (name.substr(0,2) == "//") + { + // This is a comment. + char buffer[MAX_STRING]; /*Flawfinder: ignore*/ + file.getline(buffer, MAX_STRING); + continue; + } + + BOOL declared = mNameTable.find(name) != mNameTable.end(); + + if (require_declaration && !declared) + { + // Declaration required, but this name not declared. + // Complain about non-empty names. + if (!name.empty()) + { + //read in to end of line + char buffer[MAX_STRING]; /*Flawfinder: ignore*/ + file.getline(buffer, MAX_STRING); + llwarns << "LLControlGroup::loadFromFile() : Trying to set \"" << name << "\", setting doesn't exist." << llendl; + } + continue; + } + + // Got an item. Load it up. + item++; + + // If not declared, assume it's a string + if (!declared) + { + switch(declare_as) + { + case TYPE_COL4: + declareColor4(name, LLColor4::white, LLString::null, NO_PERSIST); + break; + case TYPE_COL4U: + declareColor4U(name, LLColor4U::white, LLString::null, NO_PERSIST); + break; + case TYPE_STRING: + default: + declareString(name, LLString::null, LLString::null, NO_PERSIST); + break; + } + } + + // Control name has been declared in code. + LLControlBase *control = getControl(name); + + llassert(control); + + mLoadedSettings.insert(name); + + switch(control->mType) + { + case TYPE_F32: + { + F32 initial; + + file >> initial; + + control->set(initial); + validitems++; + } + break; + case TYPE_S32: + { + S32 initial; + + file >> initial; + + control->set(initial); + validitems++; + } + break; + case TYPE_U32: + { + U32 initial; + + file >> initial; + control->set((LLSD::Integer) initial); + validitems++; + } + break; + case TYPE_BOOLEAN: + { + char boolstring[256]; /*Flawfinder: ignore*/ + BOOL valid = FALSE; + BOOL initial = FALSE; + + file >> boolstring; + if (!strcmp("TRUE", boolstring)) + { + initial = TRUE; + valid = TRUE; + } + else if (!strcmp("FALSE", boolstring)) + { + initial = FALSE; + valid = TRUE; + } + + if (valid) + { + control->set(initial); + } + else + { + llinfos << filename << "Item " << item << ": Invalid BOOL control " << name << ", " << boolstring << llendl; + } + + validitems++; + } + break; + case TYPE_STRING: + { + LLString string; + + file >> string; + + control->set(string); + validitems++; + } + break; + case TYPE_VEC3: + { + F32 x, y, z; + + file >> x >> y >> z; + + LLVector3 vector(x, y, z); + + control->set(vector.getValue()); + validitems++; + } + break; + case TYPE_VEC3D: + { + F64 x, y, z; + + file >> x >> y >> z; + + LLVector3d vector(x, y, z); + + control->set(vector.getValue()); + validitems++; + } + break; + case TYPE_RECT: + { + S32 left, bottom, width, height; + + file >> left >> bottom >> width >> height; + + LLRect rect; + rect.setOriginAndSize(left, bottom, width, height); + + control->set(rect.getValue()); + validitems++; + } + break; + case TYPE_COL4U: + { + S32 red, green, blue, alpha; + LLColor4U color; + file >> red >> green >> blue >> alpha; + color.setVec(red, green, blue, alpha); + control->set(color.getValue()); + validitems++; + } + break; + case TYPE_COL4: + { + LLColor4 color; + file >> color.mV[VRED] >> color.mV[VGREEN] + >> color.mV[VBLUE] >> color.mV[VALPHA]; + control->set(color.getValue()); + validitems++; + } + break; + case TYPE_COL3: + { + LLColor3 color; + file >> color.mV[VRED] >> color.mV[VGREEN] + >> color.mV[VBLUE]; + control->set(color.getValue()); + validitems++; + } + break; + } + } + + file.close(); + + return validitems; +} + +// Returns number of controls loaded, so 0 if failure +U32 LLControlGroup::loadFromFile(const LLString& filename, BOOL require_declaration, eControlType declare_as) { LLString name; @@ -776,9 +901,11 @@ U32 LLControlGroup::loadFromFileLegacy(const LLString& filename, BOOL require_de } // Control name has been declared in code. - LLControlVariable *control = getControl(name); + LLControlBase *control = getControl(name); llassert(control); + + mLoadedSettings.insert(name); switch(control->mType) { @@ -892,43 +1019,59 @@ U32 LLControlGroup::loadFromFileLegacy(const LLString& filename, BOOL require_de LLVector3 color; child_nodep->getAttributeVector3("value", color); - control->set(LLColor3(color.mV).getValue()); + control->set(LLColor3(color.mV).getValue()); validitems++; } break; - - default: - break; - } - + child_nodep = rootp->getNextChild(); } return validitems; } +struct compare_controls +{ + bool operator() (const LLControlBase* const a, const LLControlBase* const b) const + { + return a->getName() < b->getName(); + } +}; + U32 LLControlGroup::saveToFile(const LLString& filename, BOOL nondefault_only) { - LLSD settings; - int num_saved = 0; + const char ENDL = '\n'; + + llinfos << "Saving settings to file: " << filename << llendl; + + // place the objects in a temporary container that enforces a sort + // order to ease manual editing of the file + + typedef std::set< LLControlBase*, compare_controls > control_list_t; + control_list_t controls; + for (ctrl_name_table_t::iterator iter = mNameTable.begin(); iter != mNameTable.end(); iter++) { - LLControlVariable* control = iter->second; + LLString name = iter->first; + if (name.empty()) + { + CONTROL_ERRS << "Control with no name found!!!" << llendl; + break; + } + + LLControlBase* control = (LLControlBase *)iter->second; if (!control) { - llwarns << "Tried to save invalid control: " << iter->first << llendl; + llwarns << "Tried to save invalid control: " << name << llendl; } - if( control && control->isPersisted() ) + if( control && control->mPersist ) { - if (!(nondefault_only && (control->isSaveValueDefault()))) + if (!(nondefault_only && (control->mIsDefault))) { - settings[iter->first]["Type"] = typeEnumToString(control->type()); - settings[iter->first]["Comment"] = control->getComment(); - settings[iter->first]["Value"] = control->getSaveValue(); - ++num_saved; + controls.insert( control ); } else { @@ -937,58 +1080,156 @@ U32 LLControlGroup::saveToFile(const LLString& filename, BOOL nondefault_only) } } } + llofstream file; - file.open(filename.c_str()); - if (file.is_open()) - { - LLSDSerialize::toPrettyXML(settings, file); - file.close(); - llinfos << "Saved to " << filename << llendl; - } - else - { - // This is a warning because sometime we want to use settings files which can't be written... - llwarns << "Unable to open settings file: " << filename << llendl; - return 0; - } - return num_saved; -} + file.open(filename.c_str()); /*Flawfinder: ignore*/ -U32 LLControlGroup::loadFromFile(const LLString& filename, BOOL require_declaration, eControlType declare_as) -{ - LLString name; - LLSD settings; - LLSD control_map; - llifstream infile; - infile.open(filename.c_str()); - if(!infile.is_open()) + if (!file.is_open()) { - llwarns << "Cannot find file " << filename << " to load." << llendl; + // This is a warning because sometime we want to use settings files which can't be written... + llwarns << "LLControlGroup::saveToFile unable to open file for writing" << llendl; return 0; } - S32 ret = LLSDSerialize::fromXML(settings, infile); - if (ret <= 0) + + // Write file version + file << "\n"; + file << "\n"; + for (control_list_t::iterator iter = controls.begin(); + iter != controls.end(); ++iter) { - infile.close(); - llwarns << "Unable to open LLSD control file " << filename << ". Trying Legacy Method." << llendl; - return loadFromFileLegacy(filename, require_declaration, declare_as); - } + LLControlBase* control = *iter; + file << "\t" << ENDL; + LLString name = control->getName(); + switch (control->type()) + { + case TYPE_U32: + { + file << "\t<" << name << " value=\"" << (U32) control->get().asInteger() << "\"/>\n"; + break; + } + case TYPE_S32: + { + file << "\t<" << name << " value=\"" << (S32) control->get().asInteger() << "\"/>\n"; + break; + } + case TYPE_F32: + { + file << "\t<" << name << " value=\"" << (F32) control->get().asReal() << "\"/>\n"; + break; + } + case TYPE_VEC3: + { + LLVector3 vector(control->get()); + file << "\t<" << name << " value=\"" << vector.mV[VX] << " " << vector.mV[VY] << " " << vector.mV[VZ] << "\"/>\n"; + break; + } + case TYPE_VEC3D: + { + LLVector3d vector(control->get()); + file << "\t<" << name << " value=\"" << vector.mdV[VX] << " " << vector.mdV[VY] << " " << vector.mdV[VZ] << "\"/>\n"; + break; + } + case TYPE_RECT: + { + LLRect rect(control->get()); + file << "\t<" << name << " value=\"" << rect.mLeft << " " << rect.mBottom << " " << rect.getWidth() << " " << rect.getHeight() << "\"/>\n"; + break; + } + case TYPE_COL4: + { + LLColor4 color(control->get()); + file << "\t<" << name << " value=\"" << color.mV[VRED] << ", " << color.mV[VGREEN] << ", " << color.mV[VBLUE] << ", " << color.mV[VALPHA] << "\"/>\n"; + break; + } + case TYPE_COL3: + { + LLColor3 color(control->get()); + file << "\t<" << name << " value=\"" << color.mV[VRED] << ", " << color.mV[VGREEN] << ", " << color.mV[VBLUE] << "\"/>\n"; + break; + } + case TYPE_BOOLEAN: + { + file << "\t<" << name << " value=\"" << (control->get().asBoolean() ? "TRUE" : "FALSE") << "\"/>\n"; + break; + } + case TYPE_STRING: + { + file << "\t<" << name << " value=\"" << LLSDXMLFormatter::escapeString(control->get().asString()) << "\"/>\n"; + break; + } + default: + { + CONTROL_ERRS << "LLControlGroup::saveToFile - unknown control type!" << llendl; + break; + } + } - U32 validitems = 0; - int persist = 1; - for(LLSD::map_const_iterator itr = settings.beginMap(); itr != settings.endMap(); ++itr) + // Debug spam + // llinfos << name << " " << control->getValue().asString() << llendl; + }// next + + file << "\n"; + file.close(); + + return controls.size(); +} + +void LLControlGroup::applyOverrides(const std::map& overrides) +{ + for (std::map::const_iterator iter = overrides.begin(); + iter != overrides.end(); ++iter) { - name = (*itr).first; - control_map = (*itr).second; - - if(control_map.has("Persist")) persist = control_map["Persist"].asInteger(); - - declareControl(name, typeStringToEnum(control_map["Type"].asString()), control_map["Value"], control_map["Comment"].asString(), persist); - - ++validitems; + const std::string& command = iter->first; + const std::string& value = iter->second; + LLControlBase* control = (LLControlBase *)mNameTable[command]; + if (control) + { + switch(control->mType) + { + case TYPE_U32: + control->set((LLSD::Integer)atof(value.c_str())); + break; + case TYPE_S32: + control->set((S32)atof(value.c_str())); + break; + case TYPE_F32: + control->set((F32)atof(value.c_str())); + break; + case TYPE_BOOLEAN: + if (!LLString::compareInsensitive(value.c_str(), "TRUE")) + { + control->set(TRUE); + } + else if (!LLString::compareInsensitive(value.c_str(), "FALSE")) + { + control->set(FALSE); + } + else + { + control->set((BOOL)atof(value.c_str())); + } + break; + case TYPE_STRING: + control->set(value); + break; +// // *FIX: implement this given time and need. +// case TYPE_UUID: +// break; + // we don't support command line overrides of vec3 or col4 + // yet - requires parsing of multiple values + case TYPE_VEC3: + case TYPE_VEC3D: + case TYPE_COL4: + case TYPE_COL3: + default: + break; + } + } + else + { + llinfos << "There is no control variable " << command << llendl; + } } - - return validitems; } void LLControlGroup::resetToDefaults() @@ -998,20 +1239,11 @@ void LLControlGroup::resetToDefaults() control_iter != mNameTable.end(); ++control_iter) { - LLControlVariable* control = (*control_iter).second; + LLControlBase* control = (*control_iter).second; control->resetToDefault(); } } -void LLControlGroup::applyToAll(ApplyFunctor* func) -{ - for (ctrl_name_table_t::iterator iter = mNameTable.begin(); - iter != mNameTable.end(); iter++) - { - func->apply(iter->first, iter->second); - } -} - //============================================================================ // First-use @@ -1032,7 +1264,7 @@ static LLString get_warn_name(const LLString& name) void LLControlGroup::addWarning(const LLString& name) { LLString warnname = get_warn_name(name); - if(mNameTable.find(warnname) == mNameTable.end()) + if(!mNameTable[warnname]) { LLString comment = LLString("Enables ") + name + LLString(" warning dialog"); declareBOOL(warnname, TRUE, comment); @@ -1061,6 +1293,91 @@ void LLControlGroup::resetWarnings() } } + + +//============================================================================= +// Listener ID generator/management + +void LLControlBase::releaseListenerID(S32 id) +{ + mFreeIDs.push_back(id); +} + +S32 LLControlBase::allocateListenerID() +{ + if(mFreeIDs.size() == 0) + { //Out of IDs so generate some new ones. + for(int t=0;t<32;t++) + { + mFreeIDs.push_back(mTopID++); + } + } + S32 rtn = mFreeIDs.front(); + mFreeIDs.pop_front(); + mUsedIDs.push_back(rtn); + return rtn; +} + +bool LLControlBase::handleEvent(LLPointer event, const LLSD& userdata) +{ + if (event->desc() == "value_changed") + { + setValue(((LLValueChangedEvent*)(LLEvent*)event)->mValue); + return TRUE; + } + return TRUE; +} + +void LLControlBase::firePropertyChanged() +{ + LLValueChangedEvent *evt = new LLValueChangedEvent(this, getValue()); + fireEvent(evt, ""); +} + +//============================================================================ +// Used to add a listener callback that will be called on the frame that the controls value changes + +S32 LLControl::addListener(LLControl::tListenerCallback* cbfn) +{ + S32 id = allocateListenerID(); + mListeners.push_back(cbfn); + mListenerIDs.push_back( id ); + return id; +} + +void LLControl::updateListeners() { + LLControl::tPropertyChangedListIter iter = mChangeEvents.begin(); + while(iter!=mChangeEvents.end()){ + LLControl::tPropertyChangedEvent& evt = *iter; + (*evt.mCBFN)(evt.mNewValue,evt.mID,*this); + iter++; + } + mChangeEvents.clear(); +} + +//static +void LLControlBase::updateAllListeners() +{ + std::set< LLControlBase* >::iterator iter = mChangedControls.begin(); + while(iter != mChangedControls.end()){ + (*iter)->updateListeners(); + iter++; + } + mChangedControls.clear(); +} + +LLControl::LLControl( + const LLString& name, + eControlType type, + LLSD initial, + const LLString& comment, + BOOL persist) : + LLControlBase(name, type, comment, persist), + mCurrent(initial), + mDefault(initial) +{ +} + //============================================================================ #ifdef TEST_HARNESS @@ -1076,17 +1393,17 @@ void main() llinfos << "Loaded " << count << " controls" << llendl; // test insertion - foo = new LLControlVariable("gFoo", 5.f, 1.f, 20.f); + foo = new LLControl("gFoo", 5.f, 1.f, 20.f); gGlobals.addEntry("gFoo", foo); - bar = new LLControlVariable("gBar", 10, 2, 22); + bar = new LLControl("gBar", 10, 2, 22); gGlobals.addEntry("gBar", bar); - baz = new LLControlVariable("gBaz", FALSE); + baz = new LLControl("gBaz", FALSE); gGlobals.addEntry("gBaz", baz); // test retrieval - getfoo = (LLControlVariable*) gGlobals.resolveName("gFoo"); + getfoo = (LLControl*) gGlobals.resolveName("gFoo"); getfoo->dump(); getbar = (S32_CONTROL) gGlobals.resolveName("gBar"); @@ -1099,10 +1416,10 @@ void main() // Failure modes // ...min > max - // badfoo = new LLControlVariable("gFoo2", 100.f, 20.f, 5.f); + // badfoo = new LLControl("gFoo2", 100.f, 20.f, 5.f); // ...initial > max - // badbar = new LLControlVariable("gBar2", 10, 20, 100000); + // badbar = new LLControl("gBar2", 10, 20, 100000); // ...misspelled name // getfoo = (F32_CONTROL) gGlobals.resolveName("fooMisspelled"); @@ -1124,4 +1441,3 @@ void main() } #endif - diff --git a/indra/llxml/llcontrol.h b/indra/llxml/llcontrol.h index 7a638a7b73..a1a2a4c851 100644 --- a/indra/llxml/llcontrol.h +++ b/indra/llxml/llcontrol.h @@ -38,26 +38,6 @@ #include "llstring.h" #include "llrect.h" -#include - -// *NOTE: boost::visit_each<> generates warning 4675 on .net 2003 -// Disable the warning for the boost includes. -#if LL_WINDOWS -# if (_MSC_VER >= 1300 && _MSC_VER < 1400) -# pragma warning(push) -# pragma warning( disable : 4675 ) -# endif -#endif - -#include -#include - -#if LL_WINDOWS -# if (_MSC_VER >= 1300 && _MSC_VER < 1400) -# pragma warning(pop) -# endif -#endif - class LLVector3; class LLVector3d; class LLColor4; @@ -68,7 +48,7 @@ const BOOL NO_PERSIST = FALSE; typedef enum e_control_type { - TYPE_U32 = 0, + TYPE_U32, TYPE_S32, TYPE_F32, TYPE_BOOLEAN, @@ -78,82 +58,159 @@ typedef enum e_control_type TYPE_RECT, TYPE_COL4, TYPE_COL3, - TYPE_COL4U, - TYPE_LLSD, - TYPE_COUNT + TYPE_COL4U } eControlType; -class LLControlVariable +class LLControlBase : public LLSimpleListenerObservable { - friend class LLControlGroup; - typedef boost::signal signal_t; - -private: +friend class LLControlGroup; +protected: LLString mName; LLString mComment; eControlType mType; + BOOL mHasRange; BOOL mPersist; - std::vector mValues; - - signal_t mSignal; - + BOOL mIsDefault; + + static std::set mChangedControls; + static std::list mFreeIDs;//These lists are used to store the ID's of registered event listeners. + static std::list mUsedIDs; + static S32 mTopID;//This is the index of the highest ID event listener ID. When the free pool is exhausted, new IDs are allocated from here. + public: - LLControlVariable(const LLString& name, eControlType type, - LLSD initial, const LLString& comment, - BOOL persist = TRUE); + static void releaseListenerID(S32 id); + static S32 allocateListenerID(); + static void updateAllListeners(); + virtual void updateListeners() = 0; + + LLControlBase(const LLString& name, eControlType type, const LLString& comment, BOOL persist) + : mName(name), + mComment(comment), + mType(type), + mHasRange(FALSE), + mPersist(persist), + mIsDefault(TRUE) + { + if (mPersist && mComment.empty()) + { + llerrs << "Must supply a comment for control " << mName << llendl; + } + sMaxControlNameLength = llmax((U32)mName.size(), sMaxControlNameLength); + } + + virtual ~LLControlBase(); - virtual ~LLControlVariable(); - const LLString& getName() const { return mName; } const LLString& getComment() const { return mComment; } eControlType type() { return mType; } - BOOL isType(eControlType tp) { return tp == mType; } - - void resetToDefault(bool fire_signal = TRUE); - - signal_t* getSignal() { return &mSignal; } - - bool isDefault() { return (mValues.size() == 1); } - bool isSaveValueDefault(); - bool isPersisted() { return mPersist; } - void set(const LLSD& val) { setValue(val); } - LLSD get() const { return getValue(); } - LLSD getDefault() const { return mValues.front(); } - LLSD getValue() const { return mValues.back(); } - LLSD getSaveValue() const; - void setValue(const LLSD& value, bool saved_value = TRUE); - void firePropertyChanged() + BOOL isType(eControlType tp) { return tp == mType; } + + // Defaults to no-op + virtual void resetToDefault(); + + LLSD registerListener(LLSimpleListenerObservable *listener, LLSD userdata = ""); + + virtual LLSD get() const = 0; + virtual LLSD getValue() const = 0; + virtual void setValue(LLSD value) = 0; + virtual void set(LLSD value) = 0; + + // From LLSimpleListener + virtual bool handleEvent(LLPointer event, const LLSD& userdata); + + void firePropertyChanged(); + + static U32 sMaxControlNameLength; + +protected: + const char* name() { return mName.c_str(); } + const char* comment() { return mComment.c_str(); } +}; + +class LLControl +: public LLControlBase +{ +friend class LLControlGroup; +protected: + LLSD mCurrent; + LLSD mDefault; + +public: + + typedef void tListenerCallback(const LLSD& newValue,S32 listenerID, LLControl& control); + typedef struct{ + S32 mID; + LLSD mNewValue; + tListenerCallback* mCBFN; + }tPropertyChangedEvent; + + typedef std::list::iterator tPropertyChangedListIter; + std::list mChangeEvents; + std::list< tListenerCallback* > mListeners; + std::list< S32 > mListenerIDs; + + virtual void updateListeners(); + S32 addListener(tListenerCallback* cbfn); + + LLControl( + const LLString& name, + eControlType type, + LLSD initial, const + LLString& comment, + BOOL persist = TRUE); + + void set(LLSD val) { setValue(val); } + LLSD get() const { return getValue(); } + LLSD getdefault() const { return mDefault; } + LLSD getValue() const { return mCurrent; } + BOOL llsd_compare(const LLSD& a, const LLSD& b); + + void setValue(LLSD value) + { + if (llsd_compare(mCurrent, value) == FALSE) + { + mCurrent = value; + mIsDefault = llsd_compare(mCurrent, mDefault); + firePropertyChanged(); + } + } + + /*virtual*/ void resetToDefault() + { + setValue(mDefault); + } + + virtual ~LLControl() { - mSignal(mValues.back()); + //Remove and deregister all listeners.. + while(mListenerIDs.size()) + { + S32 id = mListenerIDs.front(); + mListenerIDs.pop_front(); + releaseListenerID(id); + } } - BOOL llsd_compare(const LLSD& a, const LLSD& b); }; //const U32 STRING_CACHE_SIZE = 10000; class LLControlGroup { -protected: - typedef std::map ctrl_name_table_t; +public: + typedef std::map > ctrl_name_table_t; ctrl_name_table_t mNameTable; std::set mWarnings; - LLString mTypeString[TYPE_COUNT]; + std::set mLoadedSettings; // Filled in with names loaded from settings.xml - eControlType typeStringToEnum(const LLString& typestr); - LLString typeEnumToString(eControlType typeenum); public: LLControlGroup(); ~LLControlGroup(); void cleanup(); + bool hasLoaded(const LLString& name) { return mLoadedSettings.find(name) != mLoadedSettings.end(); } + void clearLoaded() { mLoadedSettings.clear(); } // Call once we've done any settings tweaks which may need this data - LLControlVariable* getControl(const LLString& name); - - struct ApplyFunctor - { - virtual ~ApplyFunctor() {}; - virtual void apply(const LLString& name, LLControlVariable* control) = 0; - }; - void applyToAll(ApplyFunctor* func); + LLControlBase* getControl(const LLString& name); + LLSD registerListener(const LLString& name, LLSimpleListenerObservable *listener); BOOL declareControl(const LLString& name, eControlType type, const LLSD initial_val, const LLString& comment, BOOL persist); BOOL declareU32(const LLString& name, U32 initial_val, const LLString& comment, BOOL persist = TRUE); @@ -167,7 +224,6 @@ public: BOOL declareColor4U(const LLString& name, const LLColor4U &initial_val, const LLString& comment, BOOL persist = TRUE); BOOL declareColor4(const LLString& name, const LLColor4 &initial_val, const LLString& comment, BOOL persist = TRUE); BOOL declareColor3(const LLString& name, const LLColor3 &initial_val, const LLString& comment, BOOL persist = TRUE); - BOOL declareLLSD(const LLString& name, const LLSD &initial_val, const LLString& comment, BOOL persist = TRUE); LLString findString(const LLString& name); @@ -181,7 +237,7 @@ public: S32 getS32(const LLString& name); F32 getF32(const LLString& name); U32 getU32(const LLString& name); - LLSD getLLSD(const LLString& name); + LLSD getValue(const LLString& name); // Note: If an LLColor4U control exists, it will cast it to the correct @@ -202,21 +258,19 @@ public: void setColor4U(const LLString& name, const LLColor4U &val); void setColor4(const LLString& name, const LLColor4 &val); void setColor3(const LLString& name, const LLColor3 &val); - void setLLSD(const LLString& name, const LLSD& val); void setValue(const LLString& name, const LLSD& val); - - + BOOL controlExists(const LLString& name); // Returns number of controls loaded, 0 if failed // If require_declaration is false, will auto-declare controls it finds // as the given type. - U32 loadFromFileLegacy(const LLString& filename, BOOL require_declaration = TRUE, eControlType declare_as = TYPE_STRING); - U32 saveToFile(const LLString& filename, BOOL nondefault_only); - U32 loadFromFile(const LLString& filename, BOOL require_declaration = TRUE, eControlType declare_as = TYPE_STRING); + U32 loadFromFileLegacy(const LLString& filename, BOOL require_declaration = TRUE, eControlType declare_as = TYPE_STRING); + U32 loadFromFile(const LLString& filename, BOOL require_declaration = TRUE, eControlType declare_as = TYPE_STRING); + U32 saveToFile(const LLString& filename, BOOL skip_if_default); + void applyOverrides(const std::map& overrides); void resetToDefaults(); - // Ignorable Warnings // Add a config variable to be reset on resetWarnings() diff --git a/indra/newview/app_settings/cmd_line.xml b/indra/newview/app_settings/cmd_line.xml deleted file mode 100644 index 01c590c1f3..0000000000 --- a/indra/newview/app_settings/cmd_line.xml +++ /dev/null @@ -1,323 +0,0 @@ - - - - help - - desc - display this help message - - short - h - - - port - - count - 1 - map-to - UserConnectionPort - - - drop - - count - 1 - map-to - PacketDropPercentage - - - inbw - - count - 1 - map-to - InBandwidth - - - outbw - - count - 1 - map-to - OutBandwidth - - - grid - - desc - Specify the name of the grid, local, or an IP address to connect to. - count - 1 - map-to - GridChoice - - - loginuri - - desc - login server and CGI script to use - count - 1 - compose - true - map-to - LoginURI - - - helperuri - - desc - helper web CGI prefix to use - count - 1 - map-to - HelperURI - - - debugviews - - map-to - DebugViews - - - skin - - desc - ui/branding skin folder to use - count - 1 - map-to - SkinFolder - - - autologin - - desc - log in as last saved user - map-to - AutoLogin - - - quitafter - - count - 1 - map-to - QuitAfterSeconds - - - rotate - - map-to - RotateRight - - - noaudio - - map-to - NoAudio - - - nosound - - map-to - NoAudio - - - noprobe - - map-to - NoHardwareProbe - - - noquicktime - - map-to - NoQuickTime - - - nopreload - - map-to - NoPreload - - - purge - - desc - Delete files in the cache. - map-to - PurgeCacheOnNextStartup - - - noinvlib - - desc - Do not request the inventory library. - map-to - NoInventoryLibrary - - - logfile - - count - 1 - map-to - UserLogFile - - - setdefault - - desc - - "specify the value of a particular\n - configuration variable which can be\n - overridden by settings.xml\n" - - count - 2 - - - - set - - desc - - "specify the value of a particular\n - configuration variable that\n - overrides all other settings\n" - - count - 2 - - - - settings - - desc - Specify the filename of a configuration file. - count - 1 - - - - login - - desc - 3 tokens: first, last and password - count - 3 - map-to - UserLoginInfo - - - god - - desc - Log in a god if you have god access. - map-to - ConnectAsGod - - - console - - count - 1 - map-to - ShowConsoleWindow - - - safe - - desc - Reset preferences, run in safe mode. - map-to - SafeMode - - - multiple - - desc - Allow multple viewers. - count - 1 - map-to - AllowMultipleViewers - - - novoice - - desc - Disable voice. - map-to - CmdLineDisableVoice - - - url - - desc - Startup location - count - 1 - last_option - true - - - - slurl - - desc - Startup SLurl - count - 1 - positional - true - last_option - true - - - - ignorepixeldepth - - desc - Ignore pixel depth settings. - map-to - IgnorePixelDepth - - - cooperative - - desc - Yield some idle time to local host. - count - 1 - map-to - YieldTime - - - no-verify-ssl-cert - - map-to - NoVerifySSLCert - - - channel - - count - 1 - map-to - VersionChannelName - - - loginpage - - desc - Login authentication page to use. - count - 1 - map-to - LoginPage - - - - diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml deleted file mode 100644 index 012bc9ec10..0000000000 --- a/indra/newview/app_settings/settings.xml +++ /dev/null @@ -1,9604 +0,0 @@ - - - AdvanceSnapshot - - Comment - Display advanced parameter settings in snaphot interface - Persist - 1 - Type - Boolean - Value - 0 - - AFKTimeout - - Comment - Time before automatically setting AFK (away from keyboard) mode (seconds) - Persist - 1 - Type - F32 - Value - 300 - - AgentChatColor - - Comment - Color of chat messages from other residents - Persist - 1 - Type - Color4 - Value - - 1 - 1 - 1 - 1 - - - AllowIdleAFK - - Comment - Automatically set AFK (away from keyboard) mode when idle - Persist - 1 - Type - Boolean - Value - 1 - - AllowMultipleViewers - - Comment - Allow multiple viewers. - Persist - 1 - Type - Boolean - Value - 1 - - AnimateTextures - - Comment - Enable texture animation (debug) - Persist - 1 - Type - Boolean - Value - 1 - - AnimationDebug - - Comment - Show active animations in a bubble above avatars head - Persist - 1 - Type - Boolean - Value - 0 - - AppearanceCameraMovement - - Comment - When entering appearance editing mode, camera zooms in on currently selected portion of avatar - Persist - 1 - Type - Boolean - Value - 1 - - ApplyColorImmediately - - Comment - Preview selections in color picker immediately - Persist - 1 - Type - Boolean - Value - 1 - - ApplyTextureImmediately - - Comment - Preview selections in texture picker immediately - Persist - 1 - Type - Boolean - Value - 1 - - ArrowKeysMoveAvatar - - Comment - While cursor is in chat entry box, arrow keys still control your avatar - Persist - 1 - Type - Boolean - Value - 1 - - AskedAboutCrashReports - - Comment - Turns off dialog asking if you want to enable crash reporting - Persist - 1 - Type - Boolean - Value - 0 - - AsyncKeyboard - - Comment - Improves responsiveness to keyboard input when at low framerates - Persist - 1 - Type - Boolean - Value - 1 - - AuctionShowFence - - Comment - When auctioning land, include parcel boundary marker in snapshot - Persist - 1 - Type - Boolean - Value - 1 - - AudioLevelAmbient - - Comment - Audio level of environment sounds - Persist - 1 - Type - F32 - Value - 0.5 - - AudioLevelDistance - - Comment - Scale factor for audio engine (multiple of world scale, 2.0 = audio falls off twice as fast) - Persist - 1 - Type - F32 - Value - 1 - - AudioLevelDoppler - - Comment - Scale of doppler effect on moving audio sources (1.0 = normal, <1.0 = diminished doppler effect, >1.0 = enhanced doppler effect) - Persist - 1 - Type - F32 - Value - 1 - - AudioLevelMaster - - Comment - Master audio level, or overall volume - Persist - 1 - Type - F32 - Value - 1 - - AudioLevelMedia - - Comment - Audio level of Quicktime movies - Persist - 1 - Type - F32 - Value - 1 - - AudioLevelMic - - Comment - Audio level of microphone input - Persist - 1 - Type - F32 - Value - 1 - - AudioLevelMusic - - Comment - Audio level of streaming music - Persist - 1 - Type - F32 - Value - 1 - - AudioLevelRolloff - - Comment - Controls the distance-based dropoff of audio volume (fraction or multiple of default audio rolloff) - Persist - 1 - Type - F32 - Value - 1 - - AudioLevelSFX - - Comment - Audio level of in-world sound effects - Persist - 1 - Type - F32 - Value - 1 - - AudioLevelUI - - Comment - Audio level of UI sound effects - Persist - 1 - Type - F32 - Value - 0.5 - - AudioLevelVoice - - Comment - Audio level of voice chat - Persist - 1 - Type - F32 - Value - 0.5 - - AudioStreamingMusic - - Comment - Enable streaming audio - Persist - 1 - Type - Boolean - Value - 0 - - AudioStreamingVideo - - Comment - Enable streaming video - Persist - 1 - Type - Boolean - Value - 0 - - AutoAcceptNewInventory - - Comment - Automatically accept new notecards/textures/landmarks - Persist - 1 - Type - Boolean - Value - 0 - - AutoLoadWebProfiles - - Comment - Automatically load ALL profile webpages without asking first. - Persist - 1 - Type - Boolean - Value - 0 - - AutoLogin - - Comment - Login automatically using last username/password combination - Persist - 1 - Type - Boolean - Value - 0 - - AutoMimeDiscovery - - Comment - Enable viewer mime type discovery of media URLs - Persist - 1 - Type - Boolean - Value - 0 - - AutoPilotLocksCamera - - Comment - Keep camera position locked when avatar walks to selected position - Persist - 1 - Type - Boolean - Value - 0 - - AutoSnapshot - - Comment - Update snapshot when camera stops moving, or any parameter changes - Persist - 1 - Type - Boolean - Value - 0 - - AutomaticFly - - Comment - Fly by holding jump key or using "Fly" command (FALSE = fly by using "Fly" command only) - Persist - 1 - Type - Boolean - Value - 1 - - AvatarBacklight - - Comment - Add rim lighting to avatar rendering to approximate shininess of skin - Persist - 1 - Type - Boolean - Value - 1 - - AvatarCompositeLimit - - Comment - Maximum number of avatars to display appearance changes on the fly - Persist - 1 - Type - S32 - Value - 5 - - AvatarPickerSortOrder - - Comment - Specifies sort key for textures in avatar picker (+0 = name, +1 = date, +2 = folders always by name, +4 = system folders to top) - Persist - 1 - Type - U32 - Value - 2 - - AvatarSex - - Comment - - Persist - 0 - Type - U32 - Value - 0 - - BackgroundChatColor - - Comment - Color of chat bubble background - Persist - 1 - Type - Color4 - Value - - 0 - 0 - 0 - 1 - - - BackgroundYieldTime - - Comment - Amount of time to yield every frame to other applications when SL is not the foreground window (milliseconds) - Persist - 1 - Type - S32 - Value - 40 - - BackwardBtnRect - - Comment - - Persist - 0 - Type - Rect - Value - - 45 - 29 - 66 - 4 - - - BasicHelpRect - - Comment - Rectangle for help window - Persist - 1 - Type - Rect - Value - - 0 - 404 - 467 - 0 - - - BeaconAlwaysOn - - Comment - Beacons / highlighting always on - Persist - 1 - Type - Boolean - Value - 0 - - BrowserHomePage - - Comment - [NOT USED] - Persist - 1 - Type - String - Value - http://www.secondlife.com - - BrowserProxyAddress - - Comment - Address for the Web Proxy] - Persist - 1 - Type - String - Value - - - BrowserProxyEnabled - - Comment - Use Web Proxy - Persist - 1 - Type - Boolean - Value - 0 - - BrowserProxyExclusions - - Comment - [NOT USED] - Persist - 1 - Type - String - Value - - - BrowserProxyPort - - Comment - Port for Web Proxy - Persist - 1 - Type - S32 - Value - 3128 - - BrowserProxySocks45 - - Comment - [NOT USED] - Persist - 1 - Type - S32 - Value - 5 - - BuildBtnState - - Comment - - Persist - 0 - Type - Boolean - Value - 0 - - ButtonFlashCount - - Comment - Number of flashes after which flashing buttons stay lit up - Persist - 1 - Type - S32 - Value - 3 - - ButtonFlashRate - - Comment - Frequency at which buttons flash (hz) - Persist - 1 - Type - F32 - Value - 2 - - ButtonHPad - - Comment - Default horizontal spacing between buttons (pixels) - Persist - 1 - Type - S32 - Value - 10 - - ButtonHeight - - Comment - Default height for normal buttons (pixels) - Persist - 1 - Type - S32 - Value - 20 - - ButtonHeightSmall - - Comment - Default height for small buttons (pixels) - Persist - 1 - Type - S32 - Value - 16 - - ButtonVPad - - Comment - Default vertical spacing between buttons (pixels) - Persist - 1 - Type - S32 - Value - 1 - - CacheLocation - - Comment - Controls the location of the local disk cache - Persist - 1 - Type - String - Value - - - CacheSize - - Comment - Controls amount of hard drive space reserved for local file caching in MB - Persist - 1 - Type - U32 - Value - 500 - - CacheValidateCounter - - Comment - Used to distribute cache validation - Persist - 1 - Type - U32 - Value - 0 - - CameraOffset - - Comment - Render with camera offset from view frustum (rendering debug) - Persist - 1 - Type - Boolean - Value - 0 - - CameraOffsetBuild - - Comment - Default camera position relative to focus point when entering build mode - Persist - 1 - Type - Vector3 - Value - - -6 - 0 - 6 - - - CameraOffsetDefault - - Comment - Default camera offset from avatar - Persist - 1 - Type - Vector3 - Value - - -3 - 0 - 0.75 - - - CameraPositionSmoothing - - Comment - Smooths camera position over time - Persist - 1 - Type - F32 - Value - 1.0 - - CameraPosOnLogout - - Comment - Camera position when last logged out (global coordinates) - Persist - 1 - Type - Vector3D - Value - - 0 - 0 - 0 - - - CameraMouseWheelZoom - - Comment - Camera zooms in and out with mousewheel - Persist - 1 - Type - Boolean - Value - 1 - - ChatBarStealsFocus - - Comment - Whenever keyboard focus is removed from the UI, and the chat bar is visible, the chat bar takes focus - Persist - 1 - Type - Boolean - Value - 1 - - ChatBubbleOpacity - - Comment - Opacity of chat bubble background (0.0 = completely transparent, 1.0 = completely opaque) - Persist - 1 - Type - F32 - Value - 0.5 - - ChatFontSize - - Comment - Size of chat text in chat console (0 = small, 1 = big) - Persist - 1 - Type - S32 - Value - 1 - - ChatFullWidth - - Comment - Chat console takes up full width of SL window - Persist - 1 - Type - Boolean - Value - 1 - - ChatHistoryTornOff - - Comment - Show chat history window separately from Communicate window. - Persist - 1 - Type - Boolean - Value - 0 - - ChatOnlineNotification - - Comment - Provide notifications for when friend log on and off of SL - Persist - 1 - Type - Boolean - Value - 1 - - ChatPersistTime - - Comment - Time for which chat stays visible in console (seconds) - Persist - 1 - Type - F32 - Value - 15 - - ChatShowTimestamps - - Comment - Show timestamps in chat - Persist - 1 - Type - Boolean - Value - 1 - - ChatVisible - - Comment - Chat bar is visible - Persist - 1 - Type - Boolean - Value - 1 - - ChatterboxRect - - Comment - Rectangle for chatterbox window - Persist - 1 - Type - Rect - Value - - 0 - 400 - 350 - 0 - - - CheesyBeacon - - Comment - Enable cheesy beacon effects - Persist - 1 - Type - Boolean - Value - 0 - - ClientSettingsFile - - Comment - Persisted client settings file name (per install). - Persist - 0 - Type - String - Value - - - CloseChatOnReturn - - Comment - Close chat after hitting return - Persist - 1 - Type - Boolean - Value - 0 - - CloseSnapshotOnKeep - - Comment - Close snapshot window after saving snapshot - Persist - 1 - Type - Boolean - Value - 1 - - ClothingBtnState - - Comment - - Persist - 0 - Type - Boolean - Value - 0 - - CmdLineDisableVoice - - Comment - Disable Voice. - Persist - 1 - Type - Boolean - Value - 0 - - ColorPaletteEntry01 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 0 - 0 - 0 - 1 - - - ColorPaletteEntry02 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 0.5 - 0.5 - 0.5 - 1 - - - ColorPaletteEntry03 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 0.5 - 0 - 0 - 1 - - - ColorPaletteEntry04 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 0.5 - 0.5 - 0 - 1 - - - ColorPaletteEntry05 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 0 - 0.5 - 0 - 1 - - - ColorPaletteEntry06 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 0 - 0.5 - 0.5 - 1 - - - ColorPaletteEntry07 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 0 - 0 - 0.5 - 1 - - - ColorPaletteEntry08 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 0.5 - 0 - 0.5 - 1 - - - ColorPaletteEntry09 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 0.5 - 0.5 - 0 - 1 - - - ColorPaletteEntry10 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 0 - 0.25 - 0.25 - 1 - - - ColorPaletteEntry11 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 0 - 0.5 - 1 - 1 - - - ColorPaletteEntry12 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 0 - 0.25 - 0.5 - 1 - - - ColorPaletteEntry13 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 0.5 - 0 - 1 - 1 - - - ColorPaletteEntry14 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 0.5 - 0.25 - 0 - 1 - - - ColorPaletteEntry15 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 1 - 1 - 1 - 1 - - - ColorPaletteEntry16 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 1 - 1 - 1 - 1 - - - ColorPaletteEntry17 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 1 - 1 - 1 - 1 - - - ColorPaletteEntry18 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 0.75 - 0.75 - 0.75 - 1 - - - ColorPaletteEntry19 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 1 - 0 - 0 - 1 - - - ColorPaletteEntry20 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 1 - 1 - 0 - 1 - - - ColorPaletteEntry21 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 0 - 1 - 0 - 1 - - - ColorPaletteEntry22 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 0 - 1 - 1 - 1 - - - ColorPaletteEntry23 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 0 - 0 - 1 - 1 - - - ColorPaletteEntry24 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 1 - 0 - 1 - 1 - - - ColorPaletteEntry25 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 1 - 1 - 0.5 - 1 - - - ColorPaletteEntry26 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 0 - 1 - 0.5 - 1 - - - ColorPaletteEntry27 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 0.5 - 1 - 1 - 1 - - - ColorPaletteEntry28 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 0.5 - 0.5 - 1 - 1 - - - ColorPaletteEntry29 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 1 - 0 - 0.5 - 1 - - - ColorPaletteEntry30 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 1 - 0.5 - 0 - 1 - - - ColorPaletteEntry31 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 1 - 1 - 1 - 1 - - - ColorPaletteEntry32 - - Comment - Color picker palette entry - Persist - 1 - Type - Color4 - Value - - 1 - 1 - 1 - 1 - - - ColumnHeaderDropDownDelay - - Comment - Time in seconds of mouse click before column header shows sort options list - Persist - 1 - Type - F32 - Value - 0.300000011920928955078125 - - CompileOutputRect - - Comment - Rectangle for script Recompile Everything output window - Persist - 1 - Type - Rect - Value - - 0 - 400 - 300 - 0 - - - CompressSnapshotsToDisk - - Comment - Compress snapshots saved to disk (Using JPEG 2000) - Persist - 1 - Type - Boolean - Value - 0 - - ConnectAsGod - - Comment - Log in a god if you have god access. - Persist - 1 - Type - Boolean - Value - 0 - - ConnectionPort - - Comment - Custom connection port number - Persist - 1 - Type - U32 - Value - 13000 - - ConnectionPortEnabled - - Comment - Use the custom connection port? - Persist - 1 - Type - Boolean - Value - 0 - - ConsoleBackgroundOpacity - - Comment - Opacity of chat console (0.0 = completely transparent, 1.0 = completely opaque) - Persist - 1 - Type - F32 - Value - 0.4000000059604644775390625 - - ConsoleBufferSize - - Comment - Size of chat console history (lines of chat) - Persist - 1 - Type - S32 - Value - 40 - - ConsoleMaxLines - - Comment - Max number of lines of chat text visible in console. - Persist - 1 - Type - S32 - Value - 40 - - ContactsTornOff - - Comment - Show contacts window separately from Communicate window. - Persist - 1 - Type - Boolean - Value - 0 - - CookiesEnabled - - Comment - Accept cookies from Web sites? - Persist - 1 - Type - Boolean - Value - 1 - - CrashLogBehavior - - Comment - Controls behavior when viewer (0 = ask before sending crash report, 1 = always send crash report, 2 = never send crash report) - Persist - 0 - Type - S32 - Value - 1 - - CreateToolCopyCenters - - Comment - - Persist - 0 - Type - Boolean - Value - 1 - - CreateToolCopyRotates - - Comment - - Persist - 0 - Type - Boolean - Value - 0 - - CreateToolCopySelection - - Comment - - Persist - 0 - Type - Boolean - Value - 0 - - CreateToolKeepSelected - - Comment - After using create tool, keep the create tool active - Persist - 1 - Type - Boolean - Value - 0 - - CustomServer - - Comment - Specifies IP address or hostname of grid to which you connect - Persist - 1 - Type - String - Value - - - DebugBeaconLineWidth - - Comment - Size of lines for Debug Beacons - Persist - 1 - Type - S32 - Value - 1 - - DebugInventoryFilters - - Comment - Turn on debugging display for inventory filtering - Persist - 1 - Type - Boolean - Value - 0 - - DebugPermissions - - Comment - Log permissions for selected inventory items - Persist - 1 - Type - Boolean - Value - 0 - - DebugShowColor - - Comment - Show color under cursor - Persist - 1 - Type - Boolean - Value - 0 - - DebugShowRenderInfo - - Comment - Show depth buffer contents - Persist - 1 - Type - Boolean - Value - 0 - - DebugShowTime - - Comment - Show depth buffer contents - Persist - 1 - Type - Boolean - Value - 0 - - DebugViews - - Comment - Display debugging info for views. - Persist - 1 - Type - Boolean - Value - 0 - - DebugWindowProc - - Comment - Log windows messages - Persist - 1 - Type - Boolean - Value - 0 - - DefaultObjectTexture - - Comment - Texture used as 'Default' in texture picker. (UUID texture reference) - Persist - 1 - Type - String - Value - 89556747-24cb-43ed-920b-47caed15465f - - DisableCameraConstraints - - Comment - Disable the normal bounds put on the camera by avatar position - Persist - 1 - Type - Boolean - Value - 0 - - DisableRendering - - Comment - Disable GL rendering and GUI (load testing) - Persist - 1 - Type - Boolean - Value - 0 - - DisableVerticalSync - - Comment - Update frames as fast as possible (FALSE = update frames between display scans) - Persist - 1 - Type - Boolean - Value - 1 - - DisplayAvatarAgentTarget - - Comment - Show avatar positioning locators (animation debug) - Persist - 1 - Type - Boolean - Value - 0 - - DisplayChat - - Comment - Display Latest Chat message on LCD - Persist - 1 - Type - Boolean - Value - 1 - - DisplayDebug - - Comment - Display Network Information on LCD - Persist - 1 - Type - Boolean - Value - 1 - - DisplayDebugConsole - - Comment - Display Console Debug Information on LCD - Persist - 1 - Type - Boolean - Value - 1 - - DisplayIM - - Comment - Display Latest IM message on LCD - Persist - 1 - Type - Boolean - Value - 1 - - DisplayLinden - - Comment - Display Account Information on LCD - Persist - 1 - Type - Boolean - Value - 1 - - DisplayRegion - - Comment - Display Location information on LCD - Persist - 1 - Type - Boolean - Value - 1 - - DisplayTimecode - - Comment - Display timecode on screen - Persist - 1 - Type - Boolean - Value - 0 - - Disregard128DefaultDrawDistance - - Comment - Whether to use the auto default to 128 draw distance - Persist - 1 - Type - Boolean - Value - 1 - - Disregard96DefaultDrawDistance - - Comment - Whether to use the auto default to 96 draw distance - Persist - 1 - Type - Boolean - Value - 1 - - DoubleClickAutoPilot - - Comment - Enable double-click auto pilot - Persist - 1 - Type - Boolean - Value - 0 - - DragAndDropToolTipDelay - - Comment - Seconds before displaying tooltip when performing drag and drop operation - Persist - 1 - Type - F32 - Value - 0.1000000014901161193847656 - - DropShadowButton - - Comment - Drop shadow width for buttons (pixels) - Persist - 1 - Type - S32 - Value - 2 - - DropShadowFloater - - Comment - Drop shadow width for floaters (pixels) - Persist - 1 - Type - S32 - Value - 5 - - DropShadowSlider - - Comment - Drop shadow width for sliders (pixels) - Persist - 1 - Type - S32 - Value - 3 - - DropShadowTooltip - - Comment - Drop shadow width for tooltips (pixels) - Persist - 1 - Type - S32 - Value - 4 - - DynamicCameraStrength - - Comment - Amount camera lags behind avatar motion (0 = none, 30 = avatar velocity) - Persist - 1 - Type - F32 - Value - 2 - - EditCameraMovement - - Comment - When entering build mode, camera moves up above avatar - Persist - 1 - Type - Boolean - Value - 0 - - EditLinkedParts - - Comment - Select individual parts of linked objects - Persist - 0 - Type - Boolean - Value - 0 - - EffectColor - - Comment - Particle effects color - Persist - 1 - Type - Color4 - Value - - 1 - 1 - 1 - 1 - - - EnablePushToTalk - - Comment - Must hold down a key or moouse button when talking into your microphone - Persist - 1 - Type - Boolean - Value - 1 - - EnableVoiceChat - - Comment - Enable talking to other residents with a microphone - Persist - 1 - Type - Boolean - Value - 1 - - EnergyFromTop - - Comment - - Persist - 0 - Type - S32 - Value - 20 - - EnergyHeight - - Comment - - Persist - 0 - Type - S32 - Value - 40 - - EnergyWidth - - Comment - - Persist - 0 - Type - S32 - Value - 175 - - FilterItemsPerFrame - - Comment - Maximum number of inventory items to match against search filter every frame (lower to increase framerate while searching, higher to improve search speed) - Persist - 1 - Type - S32 - Value - 500 - - FindLandArea - - Comment - Enables filtering of land search results by area - Persist - 1 - Type - Boolean - Value - 0 - - FindLandPrice - - Comment - Enables filtering of land search results by price - Persist - 1 - Type - Boolean - Value - 1 - - FindLandType - - Comment - Controls which type of land you are searching for in Find Land interface ("All", "Auction", "For Sale") - Persist - 1 - Type - String - Value - All - - FindPeopleOnline - - Comment - Limits people search to only users who are logged on - Persist - 1 - Type - Boolean - Value - 1 - - FindPlacesPictures - - Comment - Display only results of find places that have pictures - Persist - 1 - Type - Boolean - Value - 1 - - FirstLoginThisInstall - - Comment - Specifies that you have not successfully logged in since you installed the latest update - Persist - 1 - Type - Boolean - Value - 1 - - FirstName - - Comment - Login first name - Persist - 1 - Type - String - Value - - - FirstPersonAvatarVisible - - Comment - Display avatar and attachments below neck while in mouselook - Persist - 1 - Type - Boolean - Value - 0 - - FirstPersonBtnState - - Comment - - Persist - 0 - Type - Boolean - Value - 0 - - FirstRunThisInstall - - Comment - Specifies that you have not run the viewer since you installed the latest update - Persist - 1 - Type - Boolean - Value - 1 - - FixedWeather - - Comment - Weather effects do not change over time - Persist - 1 - Type - Boolean - Value - 0 - - FloaterAboutRect - - Comment - Rectangle for About window - Persist - 1 - Type - Rect - Value - - 0 - 440 - 470 - 0 - - - FloaterActiveSpeakersRect - - Comment - Rectangle for active speakers window - Persist - 1 - Type - Rect - Value - - 0 - 300 - 250 - 0 - - - FloaterAudioVolumeRect - - Comment - Rectangle for Audio Volume window - Persist - 1 - Type - Rect - Value - - 0 - 440 - 470 - 0 - - - FloaterBuildOptionsRect - - Comment - Rectangle for build options window. - Persist - 1 - Type - Rect - Value - - 0 - 0 - 0 - 0 - - - FloaterBumpRect - - Comment - Rectangle for Bumps/Hits window - Persist - 1 - Type - Rect - Value - - 0 - 180 - 400 - 0 - - - FloaterBuyContentsRect - - Comment - Rectangle for Buy Contents window - Persist - 1 - Type - Rect - Value - - 0 - 250 - 300 - 0 - - - FloaterBuyRect - - Comment - Rectangle for buy window - Persist - 1 - Type - Rect - Value - - 0 - 250 - 300 - 0 - - - FloaterCameraRect2 - - Comment - Rectangle for camera control window - Persist - 1 - Type - Rect - Value - - 166 - 128 - 342 - 64 - - - FloaterChatRect - - Comment - Rectangle for chat history - Persist - 1 - Type - Rect - Value - - 0 - 172 - 500 - 0 - - - FloaterClothingRect - - Comment - Rectangle for clothing window - Persist - 1 - Type - Rect - Value - - 0 - 480 - 320 - 0 - - - FloaterContactsRect - - Comment - Rectangle for chat history - Persist - 1 - Type - Rect - Value - - 0 - 390 - 395 - 0 - - - FloaterCustomizeAppearanceRect - - Comment - Rectangle for avatar customization window - Persist - 1 - Type - Rect - Value - - 0 - 540 - 494 - 0 - - - FloaterFindRect2 - - Comment - Rectangle for Find window - Persist - 1 - Type - Rect - Value - - 0 - 570 - 780 - 0 - - - FloaterFriendsRect - - Comment - Rectangle for friends window - Persist - 1 - Type - Rect - Value - - 0 - 400 - 250 - 0 - - - FloaterGestureRect2 - - Comment - Rectangle for gestures window - Persist - 1 - Type - Rect - Value - - 0 - 465 - 350 - 0 - - - FloaterHtmlRect - - Comment - Rectangle for HTML window - Persist - 1 - Type - Rect - Value - - 100 - 460 - 370 - 100 - - - FloaterHUDRect - - Comment - Rectangle for HUD Floater window - Persist - 1 - Type - Rect - Value - - 0 - 282 - 342 - 0 - - - FloaterIMRect - - Comment - Rectangle for IM window - Persist - 1 - Type - Rect - Value - - 0 - 160 - 500 - 0 - - - FloaterInspectRect - - Comment - Rectangle for Object Inspect window - Persist - 1 - Type - Rect - Value - - 0 - 400 - 400 - 0 - - - FloaterInventoryRect - - Comment - Rectangle for inventory window - Persist - 1 - Type - Rect - Value - - 0 - 400 - 300 - 0 - - - FloaterJoystickRect - - Comment - Rectangle for joystick controls window. - Persist - 1 - Type - Rect - Value - - 0 - 0 - 0 - 0 - - - FloaterLagMeter - - Comment - Rectangle for lag meter - Persist - 1 - Type - Rect - Value - - 0 - 142 - 350 - 0 - - - FloaterLandRect5 - - Comment - Rectangle for About Land window - Persist - 1 - Type - Rect - Value - - 0 - 370 - 460 - 0 - - - FloaterLandmarkRect - - Comment - Rectangle for landmark picker - Persist - 1 - Type - Rect - Value - - 0 - 290 - 310 - 0 - - - FloaterMediaRect - - Comment - Rectangle for media browser window - Persist - 1 - Type - Rect - Value - - 0 - 400 - 400 - 0 - - - FloaterMiniMapRect - - Comment - Rectangle for world map - Persist - 1 - Type - Rect - Value - - 0 - 225 - 200 - 0 - - - FloaterMoveRect2 - - Comment - Rectangle for avatar control window - Persist - 1 - Type - Rect - Value - - 0 - 58 - 135 - 0 - - - FloaterMuteRect3 - - Comment - Rectangle for mute window - Persist - 1 - Type - Rect - Value - - 0 - 300 - 300 - 0 - - - FloaterOpenObjectRect - - Comment - Rectangle for Open Object window - Persist - 1 - Type - Rect - Value - - 0 - 350 - 300 - 0 - - - FloaterPayRectB - - Comment - Rectangle for pay window - Persist - 1 - Type - Rect - Value - - 0 - 150 - 400 - 0 - - - FloaterRegionInfo - - Comment - Rectangle for region info window - Persist - 1 - Type - Rect - Value - - 0 - 512 - 480 - 0 - - - FloaterScriptDebugRect - - Comment - Rectangle for Script Error/Debug window - Persist - 1 - Type - Rect - Value - - 0 - 130 - 450 - 0 - - - FloaterSnapshotRect - - Comment - Rectangle for snapshot window - Persist - 1 - Type - Rect - Value - - 0 - 200 - 200 - 400 - - - FloaterViewBottom - - Comment - [DO NOT MODIFY] Controls layout of floating windows within SL window - Persist - 1 - Type - S32 - Value - -1 - - FloaterWorldMapRect2 - - Comment - Rectangle for world map window - Persist - 1 - Type - Rect - Value - - 0 - 0 - 0 - 0 - - - FlyBtnState - - Comment - - Persist - 0 - Type - Boolean - Value - 0 - - FlycamAbsolute - - Comment - Treat Flycam values as absolute positions (not deltas). - Persist - 1 - Type - Boolean - Value - 0 - - FlycamAutoLeveling - - Comment - Keep Flycam level. - Persist - 1 - Type - Boolean - Value - 1 - - FlycamAxis0 - - Comment - Flycam hardware axis mapping for internal axis 0 ([0, 5]). - Persist - 1 - Type - S32 - Value - 0 - - FlycamAxis1 - - Comment - Flycam hardware axis mapping for internal axis 1 ([0, 5]). - Persist - 1 - Type - S32 - Value - 1 - - FlycamAxis2 - - Comment - Flycam hardware axis mapping for internal axis 2 ([0, 5]). - Persist - 1 - Type - S32 - Value - 2 - - FlycamAxis3 - - Comment - Flycam hardware axis mapping for internal axis 3 ([0, 5]). - Persist - 1 - Type - S32 - Value - 3 - - FlycamAxis4 - - Comment - Flycam hardware axis mapping for internal axis 4 ([0, 5]). - Persist - 1 - Type - S32 - Value - 4 - - FlycamAxis5 - - Comment - Flycam hardware axis mapping for internal axis 5 ([0, 5]). - Persist - 1 - Type - S32 - Value - 5 - - FlycamAxis6 - - Comment - Flycam hardware axis mapping for internal axis 6 ([0, 5]). - Persist - 1 - Type - S32 - Value - -1 - - FlycamAxisDeadZone0 - - Comment - Flycam axis 0 dead zone. - Persist - 1 - Type - F32 - Value - 0.1000000014901161193847656 - - FlycamAxisDeadZone1 - - Comment - Flycam axis 1 dead zone. - Persist - 1 - Type - F32 - Value - 0.1000000014901161193847656 - - FlycamAxisDeadZone2 - - Comment - Flycam axis 2 dead zone. - Persist - 1 - Type - F32 - Value - 0.1000000014901161193847656 - - FlycamAxisDeadZone3 - - Comment - Flycam axis 3 dead zone. - Persist - 1 - Type - F32 - Value - 0.1000000014901161193847656 - - FlycamAxisDeadZone4 - - Comment - Flycam axis 4 dead zone. - Persist - 1 - Type - F32 - Value - 0.1000000014901161193847656 - - FlycamAxisDeadZone5 - - Comment - Flycam axis 5 dead zone. - Persist - 1 - Type - F32 - Value - 0.1000000014901161193847656 - - FlycamAxisDeadZone6 - - Comment - Flycam axis 6 dead zone. - Persist - 1 - Type - F32 - Value - 0.1000000014901161193847656 - - FlycamAxisScale0 - - Comment - Flycam axis 0 scaler. - Persist - 1 - Type - F32 - Value - 1 - - FlycamAxisScale1 - - Comment - Flycam axis 1 scaler. - Persist - 1 - Type - F32 - Value - 1 - - FlycamAxisScale2 - - Comment - Flycam axis 2 scaler. - Persist - 1 - Type - F32 - Value - 1 - - FlycamAxisScale3 - - Comment - Flycam axis 3 scaler. - Persist - 1 - Type - F32 - Value - 1 - - FlycamAxisScale4 - - Comment - Flycam axis 4 scaler. - Persist - 1 - Type - F32 - Value - 1 - - FlycamAxisScale5 - - Comment - Flycam axis 5 scaler. - Persist - 1 - Type - F32 - Value - 1 - - FlycamAxisScale6 - - Comment - Flycam axis 6 scaler. - Persist - 1 - Type - F32 - Value - 1 - - FlycamFeathering - - Comment - Flycam feathering (less is softer) - Persist - 1 - Type - F32 - Value - 16 - - FlycamZoomDirect - - Comment - Map flycam zoom axis directly to camera zoom. - Persist - 1 - Type - Boolean - Value - 0 - - FlyingAtExit - - Comment - Was flying when last logged out, so fly when logging in - Persist - 1 - Type - Boolean - Value - 0 - - FocusOffsetDefault - - Comment - Default focus point offset relative to avatar (x-axis is forward) - Persist - 1 - Type - Vector3 - Value - - 1 - 0 - 1 - - - FocusPosOnLogout - - Comment - Camera focus point when last logged out (global coordinates) - Persist - 1 - Type - Vector3D - Value - - 0 - 0 - 0 - - - FolderAutoOpenDelay - - Comment - Seconds before automatically expanding the folder under the mouse when performing inventory drag and drop - Persist - 1 - Type - F32 - Value - 0.75 - - FolderLoadingMessageWaitTime - - Comment - Seconds to wait before showing the LOADING... text in folder views - Persist - 1 - Type - F32 - Value - 0.5 - - FontMonospace - - Comment - Name of monospace font (Truetype file name) - Persist - 1 - Type - String - Value - profontwindows.ttf - - FontSansSerif - - Comment - Name of san-serif font (Truetype file name) - Persist - 1 - Type - String - Value - MtBkLfRg.ttf - - FontSansSerifBold - - Comment - Name of bold font (Truetype file name) - Persist - 1 - Type - String - Value - MtBdLfRg.ttf - - FontSansSerifFallback - - Comment - Name of san-serif font (Truetype file name) - Persist - 1 - Type - String - Value - ???????? Pro W3.otf;???????? ProN W3.otf;AppleGothic.dfont;AppleGothic.ttf;????.ttf - - FontSansSerifFallbackScale - - Comment - Scale of fallback font relative to huge font (fraction of huge font size) - Persist - 1 - Type - F32 - Value - 1 - - FontScreenDPI - - Comment - Font resolution, higher is bigger (pixels per inch) - Persist - 1 - Type - F32 - Value - 96 - - FontSizeHuge - - Comment - Size of huge font (points, or 1/72 of an inch) - Persist - 1 - Type - F32 - Value - 16 - - FontSizeLarge - - Comment - Size of large font (points, or 1/72 of an inch) - Persist - 1 - Type - F32 - Value - 12 - - FontSizeMedium - - Comment - Size of medium font (points, or 1/72 of an inch) - Persist - 1 - Type - F32 - Value - 10 - - FontSizeMonospace - - Comment - Size of monospaced font (points, or 1/72 of an inch) - Persist - 1 - Type - F32 - Value - 9 - - FontSizeSmall - - Comment - Size of small font (points, or 1/72 of an inch) - Persist - 1 - Type - F32 - Value - 9 - - ForceShowGrid - - Comment - Always show grid dropdown on login screen - Persist - 1 - Type - Boolean - Value - 0 - - ForwardBtnRect - - Comment - - Persist - 0 - Type - Rect - Value - - 45 - 54 - 66 - 29 - - - FreezeTime - - Comment - - Persist - 0 - Type - Boolean - Value - 0 - - FullScreen - - Comment - Run SL in fullscreen mode - Persist - 1 - Type - Boolean - Value - 0 - - FullScreenAspectRatio - - Comment - Aspect ratio of fullscreen display (width / height) - Persist - 1 - Type - F32 - Value - 1.33329999446868896484375 - - FullScreenAutoDetectAspectRatio - - Comment - Automatically detect proper aspect ratio for fullscreen display - Persist - 1 - Type - Boolean - Value - 1 - - FullScreenHeight - - Comment - Fullscreen resolution in height - Persist - 1 - Type - S32 - Value - 768 - - FullScreenWidth - - Comment - Fullscreen resolution in width - Persist - 1 - Type - S32 - Value - 1024 - - GridChoice - - Comment - The user's grid choice or ip address. - Persist - 1 - Type - String - Value - - - GridCrossSections - - Comment - Highlight cross sections of prims with grid manipulation plane. - Persist - 1 - Type - Boolean - Value - 0 - - GridDrawSize - - Comment - Visible extent of 2D snap grid (meters) - Persist - 1 - Type - F32 - Value - 12 - - GridMode - - Comment - Snap grid reference frame (0 = world, 1 = local, 2 = reference object) - Persist - 1 - Type - S32 - Value - 0 - - GridOpacity - - Comment - Grid line opacity (0.0 = completely transparent, 1.0 = completely opaque) - Persist - 1 - Type - F32 - Value - 0.699999988079071044921875 - - GridResolution - - Comment - Size of single grid step (meters) - Persist - 1 - Type - F32 - Value - 0.5 - - GridSubUnit - - Comment - Display fractional grid steps, relative to grid size - Persist - 1 - Type - Boolean - Value - 0 - - GridSubdivision - - Comment - Maximum number of times to divide single snap grid unit when GridSubUnit is true - Persist - 1 - Type - S32 - Value - 32 - - GroupNotifyBoxHeight - - Comment - Height of group notice messages - Persist - 1 - Type - S32 - Value - 260 - - GroupNotifyBoxWidth - - Comment - Width of group notice messages - Persist - 1 - Type - S32 - Value - 400 - - HTMLLinkColor - - Comment - Color of hyperlinks - Persist - 1 - Type - Color4 - Value - - 0.60000002384185791015625 - 0.60000002384185791015625 - 1 - 1 - - - HelpHomeURL - - Comment - URL of initial help page - Persist - 1 - Type - String - Value - help/index.html - - HelpLastVisitedURL - - Comment - URL of last help page, will be shown next time help is accessed - Persist - 1 - Type - String - Value - help/index.html - - HelperURI - - Comment - helper web CGI prefix to use - Persist - 1 - Type - String - Value - - - HighResSnapshot - - Comment - Double resolution of snapshot from current window resolution - Persist - 1 - Type - Boolean - Value - 0 - - HtmlFindRect - - Comment - Rectangle for HTML find window - Persist - 1 - Type - Rect - Value - - 16 - 650 - 600 - 128 - - - HtmlHelpLastPage - - Comment - Last URL visited via help system - Persist - 1 - Type - String - Value - - - HtmlHelpRect - - Comment - Rectangle for HTML help window - Persist - 1 - Type - Rect - Value - - 16 - 650 - 600 - 128 - - - HtmlReleaseMessage - - Comment - Rectangle for HTML Release Message Floater window - Persist - 1 - Type - Rect - Value - - 46 - 520 - 400 - 128 - - - IMInChatHistory - - Comment - Copy IM into chat history - Persist - 1 - Type - Boolean - Value - 0 - - IMShowTimestamps - - Comment - Show timestamps in IM - Persist - 1 - Type - Boolean - Value - 1 - - IgnorePixelDepth - - Comment - Ignore pixel depth settings. - Persist - 1 - Type - Boolean - Value - 0 - - ImagePipelineUseHTTP - - Comment - If TRUE use HTTP GET to fetch textures from the server - Persist - 1 - Type - Boolean - Value - 0 - - InBandwidth - - Comment - Incoming bandwidth throttle (bps) - Persist - 1 - Type - F32 - Value - 0 - - InventoryAutoOpenDelay - - Comment - Seconds before automatically opening inventory when mouse is over inventory button when performing inventory drag and drop - Persist - 1 - Type - F32 - Value - 1 - - InventorySortOrder - - Comment - Specifies sort key for inventory items (+0 = name, +1 = date, +2 = folders always by name, +4 = system folders to top) - Persist - 1 - Type - U32 - Value - 7 - - InvertMouse - - Comment - When in mouselook, moving mouse up looks down and vice verse (FALSE = moving up looks up) - Persist - 1 - Type - Boolean - Value - 0 - - KeepAspectForSnapshot - - Comment - Use full window when taking snapshot, regardless of requested image size - Persist - 1 - Type - Boolean - Value - 1 - - LCDDestination - - Comment - Which LCD to use - Persist - 1 - Type - S32 - Value - 0 - - LSLHelpRect - - Comment - Rectangle for LSL help window - Persist - 1 - Type - Rect - Value - - 0 - 400 - 400 - 0 - - - LSLHelpURL - - Comment - URL that points to LSL help files, with [LSL_STRING] corresponding to the referenced LSL function or keyword - Persist - 1 - Type - String - Value - https://wiki.secondlife.com/wiki/[LSL_STRING] - - LagMeterShrunk - - Comment - Last large/small state for lag meter - Persist - 1 - Type - Boolean - Value - 0 - - Language - - Comment - Language specifier (for XUI) - Persist - 1 - Type - String - Value - default - - LastFeatureVersion - - Comment - [DO NOT MODIFY] Version number for tracking hardware changes - Persist - 1 - Type - S32 - Value - 0 - - LastFindPanel - - Comment - Controls which find operation appears by default when clicking "Find" button - Persist - 1 - Type - String - Value - find_all_panel - - LastName - - Comment - Login last name - Persist - 1 - Type - String - Value - - - LastPrefTab - - Comment - Last selected tab in preferences window - Persist - 1 - Type - S32 - Value - 0 - - LastRunVersion - - Comment - Version number of last instance of the viewer that you ran - Persist - 1 - Type - String - Value - 0.0.0 - - LastSnapshotHeight - - Comment - The height of the last snapshot, in px - Persist - 1 - Type - S32 - Value - 768 - - LastSnapshotType - - Comment - Select this as next type of snapshot to take (0 = postcard, 1 = texture, 2 = local image) - Persist - 1 - Type - S32 - Value - 0 - - LastSnapshotWidth - - Comment - The width of the last snapshot, in px - Persist - 1 - Type - S32 - Value - 1024 - - LeftClickShowMenu - - Comment - Left click opens pie menu (FALSE = left click touches or grabs object) - Persist - 1 - Type - Boolean - Value - 0 - - LimitDragDistance - - Comment - Limit translation of object via translate tool - Persist - 1 - Type - Boolean - Value - 1 - - LimitSelectDistance - - Comment - Disallow selection of objects beyond max select distance - Persist - 1 - Type - Boolean - Value - 1 - - LocalCacheVersion - - Comment - Version number of cache - Persist - 1 - Type - S32 - Value - 0 - - LogMessages - - Comment - Log network traffic - Persist - 1 - Type - Boolean - Value - 0 - - LoginAsGod - - Comment - Attempt to login with god powers (Linden accounts only) - Persist - 1 - Type - Boolean - Value - 0 - - LoginLastLocation - - Comment - Login at same location you last logged out - Persist - 1 - Type - Boolean - Value - 1 - - LoginPage - - Comment - Login authentication page. - Persist - 1 - Type - String - Value - - - LoginURI - - Comment - login server and CGI prefix to use - Persist - 1 - Type - String - Value - - - LosslessJ2CUpload - - Comment - Use lossless compression for small image uploads - Persist - 1 - Type - Boolean - Value - 0 - - MapOverlayIndex - - Comment - Currently selected world map type - Persist - 1 - Type - S32 - Value - 0 - - MapScale - - Comment - World map zoom level (pixels per region) - Persist - 1 - Type - F32 - Value - 128 - - MapShowClassifieds - - Comment - Show locations associated with classified ads on world map - Persist - 1 - Type - Boolean - Value - 1 - - MapShowEvents - - Comment - Show events on world map - Persist - 1 - Type - Boolean - Value - 1 - - MapShowInfohubs - - Comment - Show infohubs on the world map - Persist - 1 - Type - Boolean - Value - 1 - - MapShowLandForSale - - Comment - Show land for sale on world map - Persist - 1 - Type - Boolean - Value - 0 - - MapShowPeople - - Comment - Show other users on world map - Persist - 1 - Type - Boolean - Value - 1 - - MapShowPopular - - Comment - Show popular places on world map - Persist - 1 - Type - Boolean - Value - 1 - - MapShowTelehubs - - Comment - Show telehubs on world map - Persist - 1 - Type - Boolean - Value - 1 - - Marker - - Comment - [NOT USED] - Persist - 1 - Type - String - Value - - - MaxDragDistance - - Comment - Maximum allowed translation distance in a single operation of translate tool (meters from start point) - Persist - 1 - Type - F32 - Value - 48 - - MaxSelectDistance - - Comment - Maximum allowed selection distance (meters from avatar) - Persist - 1 - Type - F32 - Value - 64 - - MeanCollisionBump - - Comment - You have experienced an abuse of being bumped by an object or avatar - Persist - 1 - Type - Boolean - Value - 0 - - MeanCollisionPhysical - - Comment - You have experienced an abuse from a physical object - Persist - 1 - Type - Boolean - Value - 0 - - MeanCollisionPushObject - - Comment - You have experienced an abuse of being pushed by a scripted object - Persist - 1 - Type - Boolean - Value - 0 - - MeanCollisionScripted - - Comment - You have experienced an abuse from a scripted object - Persist - 1 - Type - Boolean - Value - 0 - - MeanCollisionSelected - - Comment - You have experienced an abuse of being pushed via a selected object - Persist - 1 - Type - Boolean - Value - 0 - - MenuAccessKeyTime - - Comment - Time (seconds) in which the menu key must be tapped to move focus to the menu bar - Persist - 1 - Type - F32 - Value - 0.25 - - MenuBarHeight - - Comment - - Persist - 0 - Type - S32 - Value - 18 - - MenuBarWidth - - Comment - - Persist - 0 - Type - S32 - Value - 410 - - MiniMapRotate - - Comment - Rotate miniature world map to avatar direction - Persist - 1 - Type - Boolean - Value - 1 - - MiniMapScale - - Comment - Miniature world map zoom levle (pixels per region) - Persist - 1 - Type - F32 - Value - 128 - - MouseSensitivity - - Comment - Controls responsiveness of mouse when in mouselook mode (fraction or multiple of default mouse sensitivity) - Persist - 1 - Type - F32 - Value - 3 - - MouseSmooth - - Comment - Smooths out motion of mouse when in mouselook mode. - Persist - 1 - Type - Boolean - Value - 0 - - MouseSun - - Comment - - Persist - 0 - Type - Boolean - Value - 0 - - MouselookBtnState - - Comment - - Persist - 0 - Type - Boolean - Value - 0 - - MoveDownBtnRect - - Comment - - Persist - 0 - Type - Rect - Value - - 91 - 29 - 116 - 4 - - - MoveUpBtnRect - - Comment - - Persist - 0 - Type - Rect - Value - - 91 - 54 - 116 - 29 - - - MuteAmbient - - Comment - Ambient sound effects, such as wind noise, play at 0 volume - Persist - 1 - Type - Boolean - Value - 0 - - MuteAudio - - Comment - All audio plays at 0 volume (streaming audio still takes up bandwidth, for example) - Persist - 1 - Type - Boolean - Value - 0 - - MuteMedia - - Comment - Media plays at 0 volume (streaming audio still takes up bandwidth) - Persist - 1 - Type - Boolean - Value - 0 - - MuteMusic - - Comment - Music plays at 0 volume (streaming audio still takes up bandwidth) - Persist - 1 - Type - Boolean - Value - 0 - - MuteSounds - - Comment - Sound effects play at 0 volume - Persist - 1 - Type - Boolean - Value - 0 - - MuteUI - - Comment - UI sound effects play at 0 volume - Persist - 1 - Type - Boolean - Value - 0 - - MuteVoice - - Comment - Voice plays at 0 volume (streaming audio still takes up bandwidth) - Persist - 1 - Type - Boolean - Value - 0 - - MuteWhenMinimized - - Comment - Mute audio when SL window is minimized - Persist - 1 - Type - Boolean - Value - 1 - - NewCacheLocation - - Comment - Change the location of the local disk cache to this - Persist - 1 - Type - String - Value - - - NextLoginLocation - - Comment - Location to log into by default. - Persist - 1 - Type - String - Value - - - NoAudio - - Comment - Disable audio playback. - Persist - 1 - Type - Boolean - Value - 0 - - NoHardwareProbe - - Comment - Disable hardware probe. - Persist - 1 - Type - Boolean - Value - 0 - - NoInventoryLibrary - - Comment - Do not request inventory library. - Persist - 1 - Type - Boolean - Value - 0 - - NoPreload - - Comment - Disable sound and image preload. - Persist - 1 - Type - Boolean - Value - 0 - - NoQuickTime - - Comment - Disable quicktime playback. - Persist - 1 - Type - Boolean - Value - 0 - - NoVerifySSLCert - - Comment - Do not verify SSL peers. - Persist - 1 - Type - Boolean - Value - 0 - - NotecardEditorRect - - Comment - Rectangle for notecard editor - Persist - 1 - Type - Rect - Value - - 0 - 400 - 400 - 0 - - - NotifyBoxHeight - - Comment - Height of notification messages - Persist - 1 - Type - S32 - Value - 200 - - NotifyBoxWidth - - Comment - Width of notification messages - Persist - 1 - Type - S32 - Value - 350 - - NotifyMoneyChange - - Comment - Pop up notifications for all L$ transactions - Persist - 1 - Type - Boolean - Value - 1 - - NotifyTipDuration - - Comment - Length of time that notification tips stay on screen (seconds) - Persist - 1 - Type - F32 - Value - 4 - - NumSessions - - Comment - Number of successful logins to Second Life - Persist - 1 - Type - S32 - Value - 0 - - NumpadControl - - Comment - How numpad keys control your avatar. 0 = Like the normal arrow keys, 1 = Numpad moves avatar when numlock is off, 2 = Numpad moves avatar regardless of numlock (use this if you have no numlock) - Persist - 1 - Type - S32 - Value - 0 - - ObjectChatColor - - Comment - Color of chat messages from objects - Persist - 1 - Type - Color4 - Value - - 0.699999988079071044921875 - 0.89999997615814208984375 - 0.699999988079071044921875 - 1 - - - OpenDebugStatAdvanced - - Comment - Expand advanced performance stats display - Persist - 1 - Type - Boolean - Value - 0 - - OpenDebugStatBasic - - Comment - Expand basic performance stats display - Persist - 1 - Type - Boolean - Value - 1 - - OpenDebugStatNet - - Comment - Expand network stats display - Persist - 1 - Type - Boolean - Value - 1 - - OpenDebugStatRender - - Comment - Expand render stats display - Persist - 1 - Type - Boolean - Value - 1 - - OpenDebugStatSim - - Comment - Expand simulator performance stats display - Persist - 1 - Type - Boolean - Value - 1 - - OutBandwidth - - Comment - Outgoing bandwidth throttle (bps) - Persist - 1 - Type - F32 - Value - 0 - - OverdrivenColor - - Comment - Color of various indicators when resident is speaking too loud. - Persist - 1 - Type - Color4 - Value - - 1 - 0 - 0 - 1 - - - OverlayTitle - - Comment - Controls watermark text message displayed on screen when "ShowOverlayTitle" is enabled (one word, underscores become spaces) - Persist - 1 - Type - String - Value - Set_via_OverlayTitle_in_settings.xml - - PTTCurrentlyEnabled - - Comment - - Persist - 0 - Type - Boolean - Value - 1 - - PacketDropPercentage - - Comment - Percentage of packets dropped by the client. - Persist - 1 - Type - F32 - Value - 0 - - PermissionsCautionEnabled - - Comment - When enabled, changes the handling of script permission requests to help avoid accidental granting of certain permissions, such as the debit permission - Persist - 0 - Type - Boolean - Value - 1 - - PermissionsCautionNotifyBoxHeight - - Comment - Height of caution-style notification messages - Persist - 0 - Type - S32 - Value - 344 - - PermissionsManagerRect - - Comment - Rectangle for permissions manager window - Persist - 1 - Type - Rect - Value - - 0 - 85 - 300 - 0 - - - PickerContextOpacity - - Comment - Controls overall opacity of context frustrum connecting color and texture pickers with their swatches - Persist - 1 - Type - F32 - Value - 0.3499999940395355224609375 - - PieMenuLineWidth - - Comment - Width of lines in pie menu display (pixels) - Persist - 1 - Type - F32 - Value - 2.5 - - PinTalkViewOpen - - Comment - Stay in IM after hitting return - Persist - 1 - Type - Boolean - Value - 1 - - PingInterpolate - - Comment - Extrapolate object position along velocity vector based on ping delay - Persist - 1 - Type - Boolean - Value - 0 - - PitchFromMousePosition - - Comment - Vertical range over which avatar head tracks mouse position (degrees of head rotation from top of window to bottom) - Persist - 1 - Type - F32 - Value - 90 - - PlayTypingAnim - - Comment - Your avatar plays the typing animation whenever you type in the chat bar - Persist - 1 - Type - Boolean - Value - 1 - - PrecachingDelay - - Comment - Delay when logging in to load world before showing it (seconds) - Persist - 1 - Type - F32 - Value - 6 - - PreviewAnimRect - - Comment - Rectangle for animation preview window - Persist - 1 - Type - Rect - Value - - 0 - 85 - 300 - 0 - - - PreviewClassifiedRect - - Comment - Rectangle for URL preview window - Persist - 1 - Type - Rect - Value - - 0 - 530 - 420 - 0 - - - PreviewEventRect - - Comment - Rectangle for Event preview window - Persist - 1 - Type - Rect - Value - - 0 - 530 - 420 - 0 - - - PreviewLandmarkRect - - Comment - Rectangle for landmark preview window - Persist - 1 - Type - Rect - Value - - 0 - 90 - 300 - 0 - - - PreviewObjectRect - - Comment - Rectangle for object preview window - Persist - 1 - Type - Rect - Value - - 0 - 85 - 300 - 0 - - - PreviewScriptRect - - Comment - Rectangle for script preview window - Persist - 1 - Type - Rect - Value - - 0 - 550 - 500 - 0 - - - PreviewSoundRect - - Comment - Rectangle for sound preview window - Persist - 1 - Type - Rect - Value - - 0 - 85 - 300 - 0 - - - PreviewTextureRect - - Comment - Rectangle for texture preview window - Persist - 1 - Type - Rect - Value - - 0 - 400 - 400 - 0 - - - PreviewURLRect - - Comment - Rectangle for URL preview window - Persist - 1 - Type - Rect - Value - - 0 - 90 - 300 - 0 - - - PreviewWearableRect - - Comment - Rectangle for wearable preview window - Persist - 1 - Type - Rect - Value - - 0 - 85 - 300 - 0 - - - ProbeHardwareOnStartup - - Comment - Query current hardware configuration on application startup - Persist - 1 - Type - Boolean - Value - 1 - - PropertiesRect - - Comment - Rectangle for inventory item properties window - Persist - 1 - Type - Rect - Value - - 0 - 320 - 350 - 0 - - - PurgeCacheOnNextStartup - - Comment - Clear local file cache next time viewer is run - Persist - 1 - Type - Boolean - Value - 0 - - PurgeCacheOnStartup - - Comment - Clear local file cache every time viewer is run - Persist - 1 - Type - Boolean - Value - 0 - - PushToTalkButton - - Comment - Which button or keyboard key is used for push-to-talk - Persist - 1 - Type - String - Value - MiddleMouse - - PushToTalkToggle - - Comment - Should the push-to-talk button behave as a toggle - Persist - 1 - Type - Boolean - Value - 0 - - QAMode - - Comment - Enable Testing Features. - Persist - 1 - Type - Boolean - Value - 0 - - QuietSnapshotsToDisk - - Comment - Take snapshots to disk without playing animation or sound - Persist - 1 - Type - Boolean - Value - 0 - - QuitAfterSeconds - - Comment - The duration allowed before quitting. - Persist - 1 - Type - F32 - Value - 0 - - RadioLandBrushAction - - Comment - Last selected land modification operation (0 = flatten, 1 = raise, 2 = lower, 3 = smooth, 4 = roughen, 5 = revert) - Persist - 1 - Type - S32 - Value - 0 - - RadioLandBrushSize - - Comment - Size of land modification brush (0 = small, 1 = medium, 2 = large) - Persist - 1 - Type - S32 - Value - 0 - - RecentItemsSortOrder - - Comment - Specifies sort key for recent inventory items (+0 = name, +1 = date, +2 = folders always by name, +4 = system folders to top) - Persist - 1 - Type - U32 - Value - 1 - - RectangleSelectInclusive - - Comment - Select objects that have at least one vertex inside selection rectangle - Persist - 1 - Type - Boolean - Value - 1 - - RegionTextureSize - - Comment - Terrain texture dimensions (power of 2) - Persist - 1 - Type - U32 - Value - 256 - - RememberPassword - - Comment - Keep password (in encrypted form) for next login - Persist - 1 - Type - Boolean - Value - 1 - - RenderAnisotropic - - Comment - Render textures using anisotropic filtering - Persist - 1 - Type - Boolean - Value - 0 - - RenderAppleUseMultGL - - Comment - Whether we want to use multi-threaded OpenGL on Apple hardware (requires restart of SL). - Persist - 1 - Type - Boolean - Value - 0 - - RenderAvatarCloth - - Comment - Controls if avatars use wavy cloth - Persist - 1 - Type - Boolean - Value - 1 - - RenderAvatarLODFactor - - Comment - Controls level of detail of avatars (multiplier for current screen area when calculated level of detail) - Persist - 1 - Type - F32 - Value - 0.5 - - RenderAvatarMaxVisible - - Comment - Maximum number of avatars to display at any one time - Persist - 1 - Type - S32 - Value - 35 - - RenderAvatarVP - - Comment - Use vertex programs to perform hardware skinning of avatar - Persist - 1 - Type - Boolean - Value - 1 - - RenderBumpmapMinDistanceSquared - - Comment - Maximum distance at which to render bumpmapped primitives (distance in meters, squared) - Persist - 1 - Type - F32 - Value - 100 - - RenderCubeMap - - Comment - Whether we can render the cube map or not - Persist - 1 - Type - Boolean - Value - 1 - - RenderCustomSettings - - Comment - Do you want to set the graphics settings yourself - Persist - 1 - Type - Boolean - Value - 0 - - RenderDebugTextureBind - - Comment - Enable texture bind performance test. - Persist - 1 - Type - Boolean - Value - 0 - - RenderDynamicLOD - - Comment - Dynamically adjust level of detail. - Persist - 1 - Type - Boolean - Value - 1 - - RenderDynamicReflections - - Comment - Generate a dynamic cube map for reflections (objects reflect their environment, experimental). - Persist - 1 - Type - Boolean - Value - 0 - - RenderFarClip - - Comment - Distance of far clip plane from camera (meters) - Persist - 1 - Type - F32 - Value - 256 - - RenderFastUI - - Comment - [NOT USED] - Persist - 1 - Type - Boolean - Value - 0 - - RenderFlexTimeFactor - - Comment - Controls level of detail of flexible objects (multiplier for amount of time spent processing flex objects) - Persist - 1 - Type - F32 - Value - 1 - - RenderFogRatio - - Comment - Distance from camera where fog reaches maximum density (fraction or multiple of far clip distance) - Persist - 1 - Type - F32 - Value - 4.0 - - RenderGamma - - Comment - Sets gamma exponent for renderer - Persist - 1 - Type - F32 - Value - 0 - - RenderGammaFull - - Comment - Use fully controllable gamma correction, instead of faster, hard-coded gamma correction of 2. - Persist - 1 - Type - Boolean - Value - 1 - - RenderGlow - - Comment - Render bloom post effect. - Persist - 1 - Type - Boolean - Value - 1 - - RenderGlowIterations - - Comment - Number of times to iterate the glow (higher = wider and smoother but slower) - Persist - 1 - Type - S32 - Value - 2 - - RenderGlowLumWeights - - Comment - Weights for each color channel to be used in calculating luminance (should add up to 1.0) - Persist - 1 - Type - Vector3 - Value - - 0.299 - 0.587 - 0.114 - - - RenderGlowMaxExtractAlpha - - Comment - Max glow alpha value for brightness extraction to auto-glow. - Persist - 1 - Type - F32 - Value - 0.065 - - RenderGlowMinLuminance - - Comment - Min luminance intensity necessary to consider an object bright enough to automatically glow. (Gets clamped to 0 - 1.0 range) - Persist - 1 - Type - F32 - Value - 1.0 - - RenderGlowResolutionPow - - Comment - Glow map resolution power of two. - Persist - 1 - Type - S32 - Value - 9 - - RenderGlowStrength - - Comment - Additive strength of glow. - Persist - 1 - Type - F32 - Value - 0.35 - - RenderGlowWarmthAmount - - Comment - Amount of warmth extraction to use (versus luminance extraction). 0 = lum, 1.0 = warmth - Persist - 1 - Type - F32 - Value - 0 - - RenderGlowWarmthWeights - - Comment - Weight of each color channel used before finding the max warmth - Persist - 1 - Type - Vector3 - Value - - 1.0 - 0.5 - 0.7 - - - RenderGlowWidth - - Comment - Glow sample size (higher = wider and softer but eventually more pixelated) - Persist - 1 - Type - F32 - Value - 1.3 - - RenderHUDInSnapshot - - Comment - Display HUD attachments in snapshot - Persist - 1 - Type - Boolean - Value - 0 - - RenderHiddenSelections - - Comment - Show selection lines on objects that are behind other objects - Persist - 1 - Type - Boolean - Value - 1 - - RenderHideGroupTitle - - Comment - Don't show my group title in my name label - Persist - 1 - Type - Boolean - Value - 0 - - RenderHideGroupTitleAll - - Comment - Show group titles in name labels - Persist - 1 - Type - Boolean - Value - 0 - - RenderInitError - - Comment - Error occured while initializing GL - Persist - 1 - Type - Boolean - Value - 0 - - RenderLightRadius - - Comment - Render the radius of selected lights - Persist - 1 - Type - Boolean - Value - 0 - - RenderLightingDetail - - Comment - Amount of detail for lighting objects/avatars/terrain (0=sun/moon only, 1=enable local lights) - Persist - 1 - Type - S32 - Value - 1 - - RenderMaxPartCount - - Comment - Maximum number of particles to display on screen - Persist - 1 - Type - S32 - Value - 4096 - - RenderMaxVBOSize - - Comment - Maximum size of a vertex buffer (in KB). - Persist - 1 - Type - S32 - Value - 32 - - RenderName - - Comment - Controls display of names above avatars (0 = never, 1 = fade, 2 = always) - Persist - 1 - Type - S32 - Value - 2 - - RenderNameFadeDuration - - Comment - Time interval over which to fade avatar names (seconds) - Persist - 1 - Type - F32 - Value - 1 - - RenderNameHideSelf - - Comment - Don't display own name above avatar - Persist - 1 - Type - Boolean - Value - 0 - - RenderNameShowTime - - Comment - Fade avatar names after specified time (seconds) - Persist - 1 - Type - F32 - Value - 10 - - RenderObjectBump - - Comment - Show bumpmapping on primitives - Persist - 1 - Type - Boolean - Value - 1 - - RenderQualityPerformance - - Comment - Which graphics settings you've chosen - Persist - 1 - Type - U32 - Value - 1 - - RenderReflectionDetail - - Comment - Detail of reflection render pass. - Persist - 1 - Type - S32 - Value - 2 - - RenderReflectionRes - - Comment - Reflection map resolution. - Persist - 1 - Type - S32 - Value - 64 - - RenderResolutionDivisor - - Comment - Divisor for rendering 3D scene at reduced resolution. - Persist - 1 - Type - U32 - Value - 1 - - RenderShaderLODThreshold - - Comment - Fraction of draw distance defining the switch to a different shader LOD - Persist - 1 - Type - F32 - Value - 1.0 - - RenderSunDynamicRange - - Comment - Defines what percent brighter the sun is than local point lights (1.0 = 100% brighter. Value should not be less than 0. ). - Persist - 1 - Type - F32 - Value - 1.0 - - RenderTerrainDetail - - Comment - Detail applied to terrain texturing (0 = none, 1 or 2 = full) - Persist - 1 - Type - S32 - Value - 2 - - RenderTerrainLODFactor - - Comment - Controls level of detail of terrain (multiplier for current screen area when calculated level of detail) - Persist - 1 - Type - F32 - Value - 1.0 - - RenderTerrainScale - - Comment - Terrain detail texture scale - Persist - 1 - Type - F32 - Value - 12 - - RenderTreeLODFactor - - Comment - Controls level of detail of vegetation (multiplier for current screen area when calculated level of detail) - Persist - 1 - Type - F32 - Value - 0.5 - - RenderUIInSnapshot - - Comment - Display user interface in snapshot - Persist - 1 - Type - Boolean - Value - 0 - - RenderUseCleverUI - - Comment - Turns on the \"clever\" UI rendering optimization. It's a known performace gain (and enabled by default) on apple. - Persist - 1 - Type - Boolean - Value - 0 - - RenderUseFarClip - - Comment - If false, frustum culling will ignore far clip plane. - Persist - 1 - Type - Boolean - Value - 1 - - RenderUseFBO - - Comment - Whether we want to use GL_EXT_framebuffer_objects. - Persist - 1 - Type - Boolean - Value - 0 - - RenderUseImpostors - - Comment - Whether we want to use impostors for far away avatars. - Persist - 1 - Type - Boolean - Value - 1 - - RenderUseShaderLOD - - Comment - Whether we want to have different shaders for LOD - Persist - 1 - Type - Boolean - Value - 1 - - RenderUseShaderNearParticles - - Comment - Whether we want to use shaders on near particles - Persist - 1 - Type - Boolean - Value - 0 - - RenderShaderParticleThreshold - - Comment - Fraction of draw distance to not use shader on particles - Persist - 1 - Type - F32 - Value - 0.25 - - RenderVBOEnable - - Comment - Use GL Vertex Buffer Objects - Persist - 1 - Type - Boolean - Value - 1 - - RenderVolumeLODFactor - - Comment - Controls level of detail of primitives (multiplier for current screen area when calculated level of detail) - Persist - 1 - Type - F32 - Value - 1 - - RenderWater - - Comment - Display water - Persist - 1 - Type - Boolean - Value - 1 - - RenderWaterMipNormal - - Comment - Use mip maps for water normal map. - Persist - 1 - Type - Boolean - Value - 1 - - RenderWaterReflections - - Comment - Reflect the environment in the water. - Persist - 1 - Type - Boolean - Value - 0 - - RenderWaterRefResolution - - Comment - Water planar reflection resolution. - Persist - 1 - Type - S32 - Value - 512 - - RotateRight - - Comment - Make the agent rotate to its right. - Persist - 1 - Type - Boolean - Value - 0 - - RotationStep - - Comment - All rotations via rotation tool are constrained to multiples of this unit (degrees) - Persist - 1 - Type - F32 - Value - 1 - - RunBtnState - - Comment - - Persist - 0 - Type - Boolean - Value - 0 - - RunMultipleThreads - - Comment - If TRUE keep background threads active during render - Persist - 1 - Type - Boolean - Value - 0 - - SafeMode - - Comment - Reset preferences, run in safe mode. - Persist - 1 - Type - Boolean - Value - 0 - - ScaleShowAxes - - Comment - Show indicator of selected scale axis when scaling - Persist - 1 - Type - Boolean - Value - 0 - - ScaleStretchTextures - - Comment - Stretch textures along with object when scaling - Persist - 1 - Type - Boolean - Value - 1 - - ScaleUniform - - Comment - Scale selected objects evenly about center of selection - Persist - 1 - Type - Boolean - Value - 0 - - ScriptErrorColor - - Comment - Color of script error messages - Persist - 1 - Type - Color4 - Value - - 0.819999992847442626953125 - 0.819999992847442626953125 - 0.9900000095367431640625 - 1 - - - ScriptErrorsAsChat - - Comment - Display script errors and warning in chat history - Persist - 1 - Type - Boolean - Value - 0 - - ScriptHelpFollowsCursor - - Comment - Scripting help window updates contents based on script editor contents under text cursor - Persist - 1 - Type - Boolean - Value - 0 - - SearchURLDefault - - Comment - URL to load for empty searches - Persist - 1 - Type - String - Value - http://secondlife.com/app/search/index.php? - - SearchURLQuery - - Comment - URL to use for searches - Persist - 1 - Type - String - Value - http://secondlife.com/app/search/search_proxy.php?q=[QUERY]&s=[COLLECTION]& - - SearchURLSuffix2 - - Comment - Parameters added to end of search queries - Persist - 1 - Type - String - Value - lang=[LANG]&m=[MATURE]&t=[TEEN]&region=[REGION]&x=[X]&y=[Y]&z=[Z]&session=[SESSION] - - SelectMovableOnly - - Comment - Select only objects you can move - Persist - 1 - Type - Boolean - Value - 0 - - SelectOwnedOnly - - Comment - Select only objects you own - Persist - 1 - Type - Boolean - Value - 0 - - SelectionHighlightAlpha - - Comment - Opacity of selection highlight (0.0 = completely transparent, 1.0 = completely opaque) - Persist - 1 - Type - F32 - Value - 0.4000000059604644775390625 - - SelectionHighlightAlphaTest - - Comment - Alpha value below which pixels are displayed on selection highlight line (0.0 = show all pixels, 1.0 = show now pixels) - Persist - 1 - Type - F32 - Value - 0.1000000014901161193847656 - - SelectionHighlightThickness - - Comment - Thickness of selection highlight line (fraction of view distance) - Persist - 1 - Type - F32 - Value - 0.009999999776482582092285156 - - SelectionHighlightUAnim - - Comment - Rate at which texture animates along U direction in selection highlight line (fraction of texture per second) - Persist - 1 - Type - F32 - Value - 0 - - SelectionHighlightUScale - - Comment - Scale of texture display on selection highlight line (fraction of texture size) - Persist - 1 - Type - F32 - Value - 0.1000000014901161193847656 - - SelectionHighlightVAnim - - Comment - Rate at which texture animates along V direction in selection highlight line (fraction of texture per second) - Persist - 1 - Type - F32 - Value - 0.5 - - SelectionHighlightVScale - - Comment - Scale of texture display on selection highlight line (fraction of texture size) - Persist - 1 - Type - F32 - Value - 1 - - ServerChoice - - Comment - [DO NOT MODIFY] Controls which grid you connect to - Persist - 1 - Type - S32 - Value - 0 - - ShowAllObjectHoverTip - - Comment - Show descriptive tooltip when mouse hovers over non-interactive and interactive objects. - Persist - 1 - Type - Boolean - Value - 0 - - ShowAxes - - Comment - Render coordinate frame at your position - Persist - 1 - Type - Boolean - Value - 0 - - ShowCameraControls - - Comment - Display camera controls on login - Persist - 1 - Type - Boolean - Value - 0 - - ShowChatHistory - - Comment - - Persist - 0 - Type - Boolean - Value - 0 - - ShowCommunicate - - Comment - - Persist - 0 - Type - Boolean - Value - 0 - - ShowConsoleWindow - - Comment - Show log in separate OS window - Persist - 1 - Type - Boolean - Value - 0 - - ShowCrosshairs - - Comment - Display crosshairs when in mouselook mode - Persist - 1 - Type - Boolean - Value - 1 - - ShowDebugConsole - - Comment - Show log in SL window - Persist - 1 - Type - Boolean - Value - 0 - - ShowDebugStats - - Comment - Show performance stats display - Persist - 1 - Type - Boolean - Value - 0 - - ShowDepthBuffer - - Comment - Show depth buffer contents - Persist - 1 - Type - Boolean - Value - 0 - - ShowDirectory - - Comment - - Persist - 0 - Type - Boolean - Value - 0 - - ShowEmptyFoldersWhenSearching - - Comment - Shows folders that do not have any visible contents when applying a filter to inventory - Persist - 1 - Type - Boolean - Value - 0 - - ShowHoverTips - - Comment - Show descriptive tooltip when mouse hovers over items in world - Persist - 1 - Type - Boolean - Value - 1 - - ShowInventory - - Comment - Open inventory window on login - Persist - 1 - Type - Boolean - Value - 0 - - ShowLandHoverTip - - Comment - Show descriptive tooltip when mouse hovers over land - Persist - 1 - Type - Boolean - Value - 0 - - ShowLeaders - - Comment - - Persist - 0 - Type - Boolean - Value - 0 - - ShowMatureClassifieds - - Comment - Display results of find classifieds that are flagged as mature - Persist - 1 - Type - Boolean - Value - 0 - - ShowMatureEvents - - Comment - Display results of find events that are flagged as mature - Persist - 1 - Type - Boolean - Value - 0 - - ShowMatureFindAll - - Comment - Display results of find all that are in mature sims - Persist - 1 - Type - Boolean - Value - 0 - - ShowMatureGroups - - Comment - Display results of find groups that are in flagged as mature - Persist - 1 - Type - Boolean - Value - 1 - - ShowMatureSims - - Comment - Display results of find places or find popular that are in mature sims - Persist - 1 - Type - Boolean - Value - 0 - - ShowMiniMap - - Comment - Display mini map on login - Persist - 1 - Type - Boolean - Value - 1 - - ShowMovementControls - - Comment - Display movement controls on login - Persist - 1 - Type - Boolean - Value - 1 - - ShowNearClip - - Comment - - Persist - 0 - Type - Boolean - Value - 0 - - ShowNewInventory - - Comment - Automatically views new notecards/textures/landmarks - Persist - 1 - Type - Boolean - Value - 1 - - ShowObjectUpdates - - Comment - Show when update messages are received for individual objects - Persist - 1 - Type - Boolean - Value - 0 - - ShowOverlayTitle - - Comment - Prints watermark text message on screen - Persist - 1 - Type - Boolean - Value - 0 - - ShowParcelOwners - - Comment - - Persist - 0 - Type - Boolean - Value - 0 - - ShowPermissions - - Comment - - Persist - 0 - Type - Boolean - Value - 0 - - ShowPropertyLines - - Comment - Show line overlay demarking property boundaries - Persist - 1 - Type - Boolean - Value - 0 - - ShowSearchBar - - Comment - Show the Search Bar in the Status Overlay - Persist - 1 - Type - Boolean - Value - 1 - - ShowSelectionBeam - - Comment - Show selection particle beam when selecting or interacting with objects. - Persist - 1 - Type - Boolean - Value - 1 - - ShowStartLocation - - Comment - Display starting location menu on login screen - Persist - 1 - Type - Boolean - Value - 0 - - ShowTangentBasis - - Comment - Render normal and binormal (debugging bump mapping) - Persist - 1 - Type - Boolean - Value - 0 - - ShowToolBar - - Comment - Show toolbar at bottom of screen - Persist - 1 - Type - Boolean - Value - 1 - - ShowTools - - Comment - - Persist - 0 - Type - Boolean - Value - 0 - - ShowVoiceChannelPopup - - Comment - Controls visibility of the current voice channel popup above the voice tab - Persist - 1 - Type - Boolean - Value - 0 - - ShowVolumeSettingsPopup - - Comment - Show individual volume slider for voice, sound effects, etc - Persist - 1 - Type - Boolean - Value - 0 - - ShowWorldMap - - Comment - Display world map on login - Persist - 1 - Type - Boolean - Value - 0 - - ShowXUINames - - Comment - Display XUI Names as Tooltips - Persist - 1 - Type - Boolean - Value - 0 - - SitBtnState - - Comment - - Persist - 0 - Type - Boolean - Value - 0 - - SkinFolder - - Comment - The skin folder to use. - Persist - 1 - Type - String - Value - - - SkyAmbientScale - - Comment - Controls strength of ambient, or non-directional light from the sun and moon (fraction or multiple of default ambient level) - Persist - 1 - Type - F32 - Value - 0.300000011920928955078125 - - SkyNightColorShift - - Comment - Controls moonlight color (base color applied to moon as light source) - Persist - 1 - Type - Color3 - Value - - 0.699999988079071044921875 - 0.699999988079071044921875 - 1 - - - SkyOverrideSimSunPosition - - Comment - - Persist - 0 - Type - Boolean - Value - 0 - - SkySunDefaultPosition - - Comment - Default position of sun in sky (direction in world coordinates) - Persist - 1 - Type - Vector3 - Value - - 1 - 0 - 0.1000000014901161193847656 - - - SkyUseClassicClouds - - Comment - Whether to use the old Second Life particle clouds or not - Persist - 1 - Type - Boolean - Value - 1 - - SlideLeftBtnRect - - Comment - - Persist - 0 - Type - Rect - Value - - 20 - 54 - 45 - 29 - - - SlideRightBtnRect - - Comment - - Persist - 0 - Type - Rect - Value - - 66 - 54 - 91 - 29 - - - SmallAvatarNames - - Comment - Display avatar name text in smaller font - Persist - 1 - Type - Boolean - Value - 1 - - SnapEnabled - - Comment - Enable snapping to grid - Persist - 1 - Type - Boolean - Value - 1 - - SnapMargin - - Comment - Controls maximum distance between windows before they auto-snap together (pixels) - Persist - 1 - Type - S32 - Value - 10 - - SnapToMouseCursor - - Comment - When snapping to grid, center object on nearest grid point to mouse cursor - Persist - 1 - Type - Boolean - Value - 0 - - SnapshotLocalLastResolution - - Comment - Take next local snapshot at this resolution - Persist - 1 - Type - S32 - Value - 0 - - SnapshotPostcardLastResolution - - Comment - Take next postcard snapshot at this resolution - Persist - 1 - Type - S32 - Value - 0 - - SnapshotQuality - - Comment - Quality setting of postcard JPEGs (0 = worst, 100 = best) - Persist - 1 - Type - S32 - Value - 75 - - SnapshotTextureLastResolution - - Comment - Take next texture snapshot at this resolution - Persist - 1 - Type - S32 - Value - 0 - - SpeakingColor - - Comment - Color of various indicators when resident is speaking on a voice channel. - Persist - 1 - Type - Color4 - Value - - 0 - 1 - 0 - 1 - - - SpeedTest - - Comment - Performance testing mode, no network - Persist - 1 - Type - Boolean - Value - 0 - - StatsAutoRun - - Comment - Play back autopilot - Persist - 1 - Type - Boolean - Value - 0 - - StatsFile - - Comment - Filename for stats logging output - Persist - 1 - Type - String - Value - fs.txt - - StatsNumRuns - - Comment - Loop autopilot playback this number of times - Persist - 1 - Type - S32 - Value - -1 - - StatsPilotFile - - Comment - Filename for stats logging autopilot path - Persist - 1 - Type - String - Value - pilot.txt - - StatsQuitAfterRuns - - Comment - Quit application after this number of autopilot playback runs - Persist - 1 - Type - Boolean - Value - 0 - - StatsSessionTrackFrameStats - - Comment - Track rendering and network statistics - Persist - 1 - Type - Boolean - Value - 0 - - StatsSummaryFile - - Comment - Filename for stats logging summary - Persist - 1 - Type - String - Value - fss.txt - - StatusBarHeight - - Comment - Height of menu/status bar at top of screen (pixels) - Persist - 1 - Type - S32 - Value - 26 - - StatusBarPad - - Comment - Spacing between popup buttons at bottom of screen (Stand up, Release Controls) - Persist - 1 - Type - S32 - Value - 10 - - SystemChatColor - - Comment - Color of chat messages from SL System - Persist - 1 - Type - Color4 - Value - - 0.800000011920928955078125 - 1 - 1 - 1 - - - SystemLanguage - - Comment - Language indicated by system settings (for XUI) - Persist - 1 - Type - String - Value - en-us - - TabToTextFieldsOnly - - Comment - TAB key takes you to next text entry field, instead of next widget - Persist - 1 - Type - Boolean - Value - 0 - - TerrainColorHeightRange - - Comment - Altitude range over which a given terrain texture has effect (meters) - Persist - 1 - Type - F32 - Value - 60 - - TerrainColorStartHeight - - Comment - Starting altitude for terrain texturing (meters) - Persist - 1 - Type - F32 - Value - 20 - - TextureMemory - - Comment - Amount of memory to use for textures in MB (0 = autodetect) - Persist - 1 - Type - S32 - Value - 0 - - TexturePickerRect - - Comment - Rectangle for texture picker - Persist - 1 - Type - Rect - Value - - 0 - 290 - 350 - 0 - - - TexturePickerShowFolders - - Comment - Show folders with no texures in texture picker - Persist - 1 - Type - Boolean - Value - 1 - - TexturePickerSortOrder - - Comment - Specifies sort key for textures in texture picker (+0 = name, +1 = date, +2 = folders always by name, +4 = system folders to top) - Persist - 1 - Type - U32 - Value - 2 - - ThirdPersonBtnState - - Comment - - Persist - 0 - Type - Boolean - Value - 1 - - ThrottleBandwidthKBPS - - Comment - Maximum allowable downstream bandwidth (kilo bits per second) - Persist - 1 - Type - F32 - Value - 500 - - ToolHelpRect - - Comment - - Persist - 0 - Type - Rect - Value - - 8 - 178 - 75 - 162 - - - ToolTipDelay - - Comment - Seconds before displaying tooltip when mouse stops over UI element - Persist - 1 - Type - F32 - Value - 0.699999988079071044921875 - - ToolboxAutoMove - - Comment - [NOT USED] - Persist - 1 - Type - Boolean - Value - 0 - - ToolboxRect - - Comment - Rectangle for tools window - Persist - 1 - Type - Rect - Value - - 0 - 100 - 100 - 100 - - - ToolboxShowMore - - Comment - Whether to show additional build tool controls - Persist - 1 - Type - Boolean - Value - 1 - - TrackFocusObject - - Comment - Camera tracks last object zoomed on - Persist - 1 - Type - Boolean - Value - 1 - - TurnLeftBtnRect - - Comment - - Persist - 0 - Type - Rect - Value - - 20 - 29 - 45 - 4 - - - TurnRightBtnRect - - Comment - - Persist - 0 - Type - Rect - Value - - 66 - 29 - 91 - 4 - - - TypeAheadTimeout - - Comment - Time delay before clearing type-ahead buffer in lists (seconds) - Persist - 1 - Type - F32 - Value - 1.5 - - UIAutoScale - - Comment - Keep UI scale consistent across different resolutions - Persist - 1 - Type - Boolean - Value - 1 - - UIFloaterTestBool - - Comment - Example saved setting for the test floater - Persist - 1 - Type - Boolean - Value - 0 - - UIImgBtnCloseActiveUUID - - Comment - - Persist - 0 - Type - String - Value - 47a8c844-cd2a-4b1a-be01-df8b1612fe5d - - UIImgBtnCloseInactiveUUID - - Comment - - Persist - 0 - Type - String - Value - 779e4fa3-9b13-f74a-fba9-3886fe9c86ba - - UIImgBtnClosePressedUUID - - Comment - - Persist - 0 - Type - String - Value - e5821134-23c0-4bd0-af06-7fa95b9fb01a - - UIImgBtnForwardInUUID - - Comment - - Persist - 0 - Type - String - Value - 54197a61-f5d1-4c29-95d2-c071d08849cb - - UIImgBtnForwardOutUUID - - Comment - - Persist - 0 - Type - String - Value - a0eb4021-1b20-4a53-892d-8faa9265a6f5 - - UIImgBtnJumpLeftInUUID - - Comment - - Persist - 0 - Type - String - Value - 9cad3e6d-2d6d-107d-f8ab-5ba272b5bfe1 - - UIImgBtnJumpLeftOutUUID - - Comment - - Persist - 0 - Type - String - Value - 3c18c87e-5f50-14e2-e744-f44734aa365f - - UIImgBtnJumpRightInUUID - - Comment - - Persist - 0 - Type - String - Value - 7dabc040-ec13-2309-ddf7-4f161f6de2f4 - - UIImgBtnJumpRightOutUUID - - Comment - - Persist - 0 - Type - String - Value - ff9a71eb-7414-4cf8-866e-a701deb7c3cf - - UIImgBtnLeftInUUID - - Comment - - Persist - 0 - Type - String - Value - 95463c78-aaa6-464d-892d-3a805b6bb7bf - - UIImgBtnLeftOutUUID - - Comment - - Persist - 0 - Type - String - Value - 13a93910-6b44-45eb-ad3a-4d1324c59bac - - UIImgBtnMinimizeActiveUUID - - Comment - - Persist - 0 - Type - String - Value - 34c9398d-bb78-4643-9633-46a2fa3e9637 - - UIImgBtnMinimizeInactiveUUID - - Comment - - Persist - 0 - Type - String - Value - 6e72abba-1378-437f-bf7a-f0c15f3e99a3 - - UIImgBtnMinimizePressedUUID - - Comment - - Persist - 0 - Type - String - Value - 39801651-26cb-4926-af57-7af9352c273c - - UIImgBtnMoveDownInUUID - - Comment - - Persist - 0 - Type - String - Value - b92a70b9-c841-4c94-b4b3-cee9eb460d48 - - UIImgBtnMoveDownOutUUID - - Comment - - Persist - 0 - Type - String - Value - b5abc9fa-9e62-4e03-bc33-82c4c1b6b689 - - UIImgBtnMoveUpInUUID - - Comment - - Persist - 0 - Type - String - Value - 49b4b357-e430-4b56-b9e0-05b8759c3c82 - - UIImgBtnMoveUpOutUUID - - Comment - - Persist - 0 - Type - String - Value - f887146d-829f-4e39-9211-cf872b78f97c - - UIImgBtnPanDownInUUID - - Comment - - Persist - 0 - Type - String - Value - e5821134-23c0-4bd0-af06-7fa95b9fb01a - - UIImgBtnPanDownOutUUID - - Comment - - Persist - 0 - Type - String - Value - 47a8c844-cd2a-4b1a-be01-df8b1612fe5d - - UIImgBtnPanLeftInUUID - - Comment - - Persist - 0 - Type - String - Value - e5821134-23c0-4bd0-af06-7fa95b9fb01a - - UIImgBtnPanLeftOutUUID - - Comment - - Persist - 0 - Type - String - Value - 47a8c844-cd2a-4b1a-be01-df8b1612fe5d - - UIImgBtnPanRightInUUID - - Comment - - Persist - 0 - Type - String - Value - e5821134-23c0-4bd0-af06-7fa95b9fb01a - - UIImgBtnPanRightOutUUID - - Comment - - Persist - 0 - Type - String - Value - 47a8c844-cd2a-4b1a-be01-df8b1612fe5d - - UIImgBtnPanUpInUUID - - Comment - - Persist - 0 - Type - String - Value - e5821134-23c0-4bd0-af06-7fa95b9fb01a - - UIImgBtnPanUpOutUUID - - Comment - - Persist - 0 - Type - String - Value - 47a8c844-cd2a-4b1a-be01-df8b1612fe5d - - UIImgBtnRestoreActiveUUID - - Comment - - Persist - 0 - Type - String - Value - 111b39de-8928-4690-b7b2-e17d5c960277 - - UIImgBtnRestoreInactiveUUID - - Comment - - Persist - 0 - Type - String - Value - 0eafa471-70af-4882-b8c1-40a310929744 - - UIImgBtnRestorePressedUUID - - Comment - - Persist - 0 - Type - String - Value - 90a0ed5c-2e7b-4845-9958-a64a1b30f312 - - UIImgBtnRightInUUID - - Comment - - Persist - 0 - Type - String - Value - 5e616d0d-4335-476f-9977-560bccd009da - - UIImgBtnRightOutUUID - - Comment - - Persist - 0 - Type - String - Value - 5a44fd04-f52b-4c30-8b00-4a31e27614bd - - UIImgBtnScrollDownInUUID - - Comment - - Persist - 0 - Type - String - Value - d2421bab-2eaf-4863-b8f6-5e4c52519247 - - UIImgBtnScrollDownOutUUID - - Comment - - Persist - 0 - Type - String - Value - b4ecdecf-5c8d-44e7-b882-17a77e88ed55 - - UIImgBtnScrollLeftInUUID - - Comment - - Persist - 0 - Type - String - Value - ea137a32-6718-4d05-9c22-7d570d27b2cd - - UIImgBtnScrollLeftOutUUID - - Comment - - Persist - 0 - Type - String - Value - 43773e8d-49aa-48e0-80f3-a04715f4677a - - UIImgBtnScrollRightInUUID - - Comment - - Persist - 0 - Type - String - Value - b749de64-e903-4c3c-ac0b-25fb6fa39cb5 - - UIImgBtnScrollRightOutUUID - - Comment - - Persist - 0 - Type - String - Value - 3d700d19-e708-465d-87f2-46c8c0ee7938 - - UIImgBtnScrollUpInUUID - - Comment - - Persist - 0 - Type - String - Value - a93abdf3-27b5-4e22-a8fa-c48216cd2e3a - - UIImgBtnScrollUpOutUUID - - Comment - - Persist - 0 - Type - String - Value - dad084d7-9a46-452a-b0ff-4b9f1cefdde9 - - UIImgBtnSlideLeftInUUID - - Comment - - Persist - 0 - Type - String - Value - 724996f5-b956-46f6-9844-4fcfce1d5e83 - - UIImgBtnSlideLeftOutUUID - - Comment - - Persist - 0 - Type - String - Value - 82476321-0374-4c26-9567-521535ab4cd7 - - UIImgBtnSlideRightInUUID - - Comment - - Persist - 0 - Type - String - Value - 7eeb57d2-3f37-454d-a729-8b217b8be443 - - UIImgBtnSlideRightOutUUID - - Comment - - Persist - 0 - Type - String - Value - 1fbe4e60-0607-44d1-a50a-032eff56ae75 - - UIImgBtnSpinDownInUUID - - Comment - - Persist - 0 - Type - String - Value - a985ac71-052f-48e6-9c33-d931c813ac92 - - UIImgBtnSpinDownOutUUID - - Comment - - Persist - 0 - Type - String - Value - b6d240dd-5602-426f-b606-bbb49a30726d - - UIImgBtnSpinUpInUUID - - Comment - - Persist - 0 - Type - String - Value - c8450082-96a0-4319-8090-d3ff900b4954 - - UIImgBtnSpinUpOutUUID - - Comment - - Persist - 0 - Type - String - Value - 56576e6e-6710-4e66-89f9-471b59122794 - - UIImgBtnTabBottomInUUID - - Comment - - Persist - 0 - Type - String - Value - c001d8fd-a869-4b6f-86a1-fdcb106df9c7 - - UIImgBtnTabBottomOutUUID - - Comment - - Persist - 0 - Type - String - Value - bf0a8779-689b-48c3-bb9a-6af546366ef4 - - UIImgBtnTabBottomPartialInUUID - - Comment - - Persist - 0 - Type - String - Value - eb0b0904-8c91-4f24-b500-1180b91140de - - UIImgBtnTabBottomPartialOutUUID - - Comment - - Persist - 0 - Type - String - Value - 8dca716c-b29c-403a-9886-91c028357d6e - - UIImgBtnTabTopInUUID - - Comment - - Persist - 0 - Type - String - Value - 16d032e8-817b-4368-8a4e-b7b947ae3889 - - UIImgBtnTabTopOutUUID - - Comment - - Persist - 0 - Type - String - Value - 1ed83f57-41cf-4052-a3b4-2e8bb78d8191 - - UIImgBtnTabTopPartialInUUID - - Comment - - Persist - 0 - Type - String - Value - 7c6c6c26-0e25-4438-89bd-30d8b8e9d704 - - UIImgBtnTabTopPartialOutUUID - - Comment - - Persist - 0 - Type - String - Value - 932ad585-0e45-4a57-aa23-4cf81beeb7b0 - - UIImgBtnTearOffActiveUUID - - Comment - - Persist - 0 - Type - String - Value - 74e1a96f-4833-a24d-a1bb-1bce1468b0e7 - - UIImgBtnTearOffInactiveUUID - - Comment - - Persist - 0 - Type - String - Value - 74e1a96f-4833-a24d-a1bb-1bce1468b0e7 - - UIImgBtnTearOffPressedUUID - - Comment - - Persist - 0 - Type - String - Value - d2524c13-4ba6-af7c-e305-8ac6cc18d86a - - UIImgCheckboxActiveSelectedUUID - - Comment - - Persist - 0 - Type - String - Value - cf4a2ed7-1533-4686-9dde-df9a37ddca55 - - UIImgCheckboxActiveUUID - - Comment - - Persist - 0 - Type - String - Value - 05bb64ee-96fd-4243-b74e-f40a41bc53ba - - UIImgCheckboxInactiveSelectedUUID - - Comment - - Persist - 0 - Type - String - Value - c817c642-9abd-4236-9287-ae0513fe7d2b - - UIImgCheckboxInactiveUUID - - Comment - - Persist - 0 - Type - String - Value - 7d94cb59-32a2-49bf-a516-9e5a2045f9d9 - - UIImgCreateSelectedUUID - - Comment - - Persist - 0 - Type - String - Value - 0098b015-3daf-4cfe-a72f-915369ea97c2 - - UIImgCreateUUID - - Comment - - Persist - 0 - Type - String - Value - 7a0b1bdb-b5d9-4df5-bac2-ba230da93b5b - - UIImgCrosshairsUUID - - Comment - Image to use for crosshair display (UUID texture reference) - Persist - 1 - Type - String - Value - 6e1a3980-bf2d-4274-8970-91e60d85fb52 - - UIImgDefaultEyesUUID - - Comment - - Persist - 0 - Type - String - Value - 6522e74d-1660-4e7f-b601-6f48c1659a77 - - UIImgDefaultGlovesUUID - - Comment - - Persist - 0 - Type - String - Value - 5748decc-f629-461c-9a36-a35a221fe21f - - UIImgDefaultHairUUID - - Comment - - Persist - 0 - Type - String - Value - 7ca39b4c-bd19-4699-aff7-f93fd03d3e7b - - UIImgDefaultJacketUUID - - Comment - - Persist - 0 - Type - String - Value - 5748decc-f629-461c-9a36-a35a221fe21f - - UIImgDefaultPantsUUID - - Comment - - Persist - 0 - Type - String - Value - 5748decc-f629-461c-9a36-a35a221fe21f - - UIImgDefaultShirtUUID - - Comment - - Persist - 0 - Type - String - Value - 5748decc-f629-461c-9a36-a35a221fe21f - - UIImgDefaultShoesUUID - - Comment - - Persist - 0 - Type - String - Value - 5748decc-f629-461c-9a36-a35a221fe21f - - UIImgDefaultSkirtUUID - - Comment - - Persist - 0 - Type - String - Value - 5748decc-f629-461c-9a36-a35a221fe21f - - UIImgDefaultSocksUUID - - Comment - - Persist - 0 - Type - String - Value - 5748decc-f629-461c-9a36-a35a221fe21f - - UIImgDefaultUnderwearUUID - - Comment - - Persist - 0 - Type - String - Value - 5748decc-f629-461c-9a36-a35a221fe21f - - UIImgDirectionArrowUUID - - Comment - - Persist - 0 - Type - String - Value - 586383e8-4d9b-4fba-9196-2b5938e79c2c - - UIImgFaceSelectedUUID - - Comment - - Persist - 0 - Type - String - Value - b4870163-6208-42a9-9801-93133bf9a6cd - - UIImgFaceUUID - - Comment - - Persist - 0 - Type - String - Value - ce15fd63-b0b6-463c-a37d-ea6393208b3e - - UIImgFocusSelectedUUID - - Comment - - Persist - 0 - Type - String - Value - ab6a730e-ddfd-4982-9a32-c6de3de6d31d - - UIImgFocusUUID - - Comment - - Persist - 0 - Type - String - Value - 57bc39d1-288c-4519-aea6-6d1786a5c274 - - UIImgGrabSelectedUUID - - Comment - - Persist - 0 - Type - String - Value - c1e21504-f136-451d-b8e9-929037812f1d - - UIImgGrabUUID - - Comment - - Persist - 0 - Type - String - Value - c63f124c-6340-4fbf-b59e-0869a44adb64 - - UIImgMoveSelectedUUID - - Comment - - Persist - 0 - Type - String - Value - 46f17c7b-8381-48c3-b628-6a406e060dd6 - - UIImgMoveUUID - - Comment - - Persist - 0 - Type - String - Value - 2fa5dc06-bcdd-4e09-a426-f9f262d4fa65 - - UIImgRadioActiveSelectedUUID - - Comment - - Persist - 0 - Type - String - Value - 52f09e07-5816-4052-953c-94c6c10479b7 - - UIImgRadioActiveUUID - - Comment - - Persist - 0 - Type - String - Value - 7a1ba9b8-1047-4d1e-9cfc-bc478c80b63f - - UIImgRadioInactiveSelectedUUID - - Comment - - Persist - 0 - Type - String - Value - 1975db39-aa29-4251-aea0-409ac09d414d - - UIImgRadioInactiveUUID - - Comment - - Persist - 0 - Type - String - Value - 90688481-67ff-4af0-be69-4aa084bcad1e - - UIImgResizeBottomRightUUID - - Comment - - Persist - 0 - Type - String - Value - e3690e25-9690-4f6c-a745-e7dcd885285a - - UIImgRotateSelectedUUID - - Comment - - Persist - 0 - Type - String - Value - cdfb7fde-0d13-418a-9d89-2bd91019fc95 - - UIImgRotateUUID - - Comment - - Persist - 0 - Type - String - Value - c34b1eaa-aae3-4351-b082-e26c0b636779 - - UIImgScaleSelectedUUID - - Comment - - Persist - 0 - Type - String - Value - 55aa57ef-508a-47f7-8867-85d21c5a810d - - UIImgScaleUUID - - Comment - - Persist - 0 - Type - String - Value - 88a90fef-b448-4883-9344-ecf378a60433 - - UIImgWhiteUUID - - Comment - - Persist - 0 - Type - String - Value - 5748decc-f629-461c-9a36-a35a221fe21f - - UIScaleFactor - - Comment - Size of UI relative to default layout on 1024x768 screen - Persist - 1 - Type - F32 - Value - 1 - - UISndAlert - - Comment - Sound file for alerts (uuid for sound asset) - Persist - 1 - Type - String - Value - ed124764-705d-d497-167a-182cd9fa2e6c - - UISndBadKeystroke - - Comment - Sound file for invalid keystroke (uuid for sound asset) - Persist - 1 - Type - String - Value - 2ca849ba-2885-4bc3-90ef-d4987a5b983a - - UISndClick - - Comment - Sound file for mouse click (uuid for sound asset) - Persist - 1 - Type - String - Value - 4c8c3c77-de8d-bde2-b9b8-32635e0fd4a6 - - UISndClickRelease - - Comment - Sound file for mouse button release (uuid for sound asset) - Persist - 1 - Type - String - Value - 4c8c3c77-de8d-bde2-b9b8-32635e0fd4a6 - - UISndDebugSpamToggle - - Comment - Log UI sound effects as they are played - Persist - 1 - Type - Boolean - Value - 0 - - UISndHealthReductionF - - Comment - Sound file for female pain (uuid for sound asset) - Persist - 1 - Type - String - Value - 219c5d93-6c09-31c5-fb3f-c5fe7495c115 - - UISndHealthReductionM - - Comment - Sound file for male pain (uuid for sound asset) - Persist - 1 - Type - String - Value - e057c244-5768-1056-c37e-1537454eeb62 - - UISndHealthReductionThreshold - - Comment - Amount of health reduction required to trigger "pain" sound - Persist - 1 - Type - F32 - Value - 10 - - UISndInvalidOp - - Comment - Sound file for invalid operations (uuid for sound asset) - Persist - 1 - Type - String - Value - 4174f859-0d3d-c517-c424-72923dc21f65 - - UISndMoneyChangeDown - - Comment - Sound file for L$ balance increase (uuid for sound asset) - Persist - 1 - Type - String - Value - 104974e3-dfda-428b-99ee-b0d4e748d3a3 - - UISndMoneyChangeThreshold - - Comment - Amount of change in L$ balance required to trigger "money" sound - Persist - 1 - Type - F32 - Value - 50 - - UISndMoneyChangeUp - - Comment - Sound file for L$ balance decrease(uuid for sound asset) - Persist - 1 - Type - String - Value - 77a018af-098e-c037-51a6-178f05877c6f - - UISndNewIncomingIMSession - - Comment - Sound file for new instant message session(uuid for sound asset) - Persist - 1 - Type - String - Value - 67cc2844-00f3-2b3c-b991-6418d01e1bb7 - - UISndObjectCreate - - Comment - Sound file for object creation (uuid for sound asset) - Persist - 1 - Type - String - Value - f4a0660f-5446-dea2-80b7-6482a082803c - - UISndObjectDelete - - Comment - Sound file for object deletion (uuid for sound asset) - Persist - 1 - Type - String - Value - 0cb7b00a-4c10-6948-84de-a93c09af2ba9 - - UISndObjectRezIn - - Comment - Sound file for rezzing objects (uuid for sound asset) - Persist - 1 - Type - String - Value - 3c8fc726-1fd6-862d-fa01-16c5b2568db6 - - UISndObjectRezOut - - Comment - Sound file for derezzing objects (uuid for sound asset) - Persist - 1 - Type - String - Value - 00000000-0000-0000-0000-000000000000 - - UISndPieMenuAppear - - Comment - Sound file for opening pie menu (uuid for sound asset) - Persist - 1 - Type - String - Value - 8eaed61f-92ff-6485-de83-4dcc938a478e - - UISndPieMenuHide - - Comment - Sound file for closing pie menu (uuid for sound asset) - Persist - 1 - Type - String - Value - 00000000-0000-0000-0000-000000000000 - - UISndPieMenuSliceHighlight0 - - Comment - Sound file for selecting pie menu item 0 (uuid for sound asset) - Persist - 1 - Type - String - Value - d9f73cf8-17b4-6f7a-1565-7951226c305d - - UISndPieMenuSliceHighlight1 - - Comment - Sound file for selecting pie menu item 1 (uuid for sound asset) - Persist - 1 - Type - String - Value - f6ba9816-dcaf-f755-7b67-51b31b6233e5 - - UISndPieMenuSliceHighlight2 - - Comment - Sound file for selecting pie menu item 2 (uuid for sound asset) - Persist - 1 - Type - String - Value - 7aff2265-d05b-8b72-63c7-dbf96dc2f21f - - UISndPieMenuSliceHighlight3 - - Comment - Sound file for selecting pie menu item 3 (uuid for sound asset) - Persist - 1 - Type - String - Value - 09b2184e-8601-44e2-afbb-ce37434b8ba1 - - UISndPieMenuSliceHighlight4 - - Comment - Sound file for selecting pie menu item 4 (uuid for sound asset) - Persist - 1 - Type - String - Value - bbe4c7fc-7044-b05e-7b89-36924a67593c - - UISndPieMenuSliceHighlight5 - - Comment - Sound file for selecting pie menu item 5 (uuid for sound asset) - Persist - 1 - Type - String - Value - d166039b-b4f5-c2ec-4911-c85c727b016c - - UISndPieMenuSliceHighlight6 - - Comment - Sound file for selecting pie menu item 6 (uuid for sound asset) - Persist - 1 - Type - String - Value - 242af82b-43c2-9a3b-e108-3b0c7e384981 - - UISndPieMenuSliceHighlight7 - - Comment - Sound file for selecting pie menu item 7 (uuid for sound asset) - Persist - 1 - Type - String - Value - c1f334fb-a5be-8fe7-22b3-29631c21cf0b - - UISndSnapshot - - Comment - Sound file for taking a snapshot (uuid for sound asset) - Persist - 1 - Type - String - Value - 3d09f582-3851-c0e0-f5ba-277ac5c73fb4 - - UISndStartIM - - Comment - Sound file for starting a new IM session (uuid for sound asset) - Persist - 1 - Type - String - Value - c825dfbc-9827-7e02-6507-3713d18916c1 - - UISndTeleportOut - - Comment - Sound file for teleporting (uuid for sound asset) - Persist - 1 - Type - String - Value - d7a9a565-a013-2a69-797d-5332baa1a947 - - UISndTyping - - Comment - Sound file for starting to type a chat message (uuid for sound asset) - Persist - 1 - Type - String - Value - 5e191c7b-8996-9ced-a177-b2ac32bfea06 - - UISndWindowClose - - Comment - Sound file for closing a window (uuid for sound asset) - Persist - 1 - Type - String - Value - 2c346eda-b60c-ab33-1119-b8941916a499 - - UISndWindowOpen - - Comment - Sound file for opening a window (uuid for sound asset) - Persist - 1 - Type - String - Value - c80260ba-41fd-8a46-768a-6bf236360e3a - - UseAltKeyForMenus - - Comment - Access menus via keyboard by tapping Alt - Persist - 1 - Type - Boolean - Value - 0 - - UseChatBubbles - - Comment - Show chat above avatars head in chat bubbles - Persist - 1 - Type - Boolean - Value - 0 - - UseDebugLogin - - Comment - Provides extra control over which grid to connect to - Persist - 1 - Type - Boolean - Value - 0 - - UseDebugMenus - - Comment - Turns on "Debug" menu - Persist - 1 - Type - Boolean - Value - 0 - - UseDefaultColorPicker - - Comment - Use color picker supplied by operating system - Persist - 1 - Type - Boolean - Value - 0 - - UseEnergy - - Comment - - Persist - 0 - Type - Boolean - Value - 1 - - UseExternalBrowser - - Comment - Use default browser when opening web pages instead of in-world browser. - Persist - 1 - Type - Boolean - Value - 0 - - UseFreezeFrame - - Comment - Freeze time when taking snapshots. - Persist - 1 - Type - Boolean - Value - 0 - - UseOcclusion - - Comment - Enable object culling based on occlusion (coverage) by other objects - Persist - 1 - Type - Boolean - Value - 1 - - UseWebPagesOnPrims - - Comment - [NOT USED] - Persist - 1 - Type - Boolean - Value - 0 - - UserConnectionPort - - Comment - Port that this client transmits on. - Persist - 1 - Type - U32 - Value - 0 - - UserLogFile - - Comment - User specified log file name. - Persist - 1 - Type - String - Value - - - UserLoginInfo - - Comment - Users loging data. - Persist - 1 - Type - LLSD - Value - - - UserSettingsFile - - Comment - Persisted client settings file name (per user). - Persist - 0 - Type - String - Value - - - VFSOldSize - - Comment - [DO NOT MODIFY] Controls resizing of local file cache - Persist - 1 - Type - U32 - Value - 0 - - VFSSalt - - Comment - [DO NOT MODIFY] Controls local file caching behavior - Persist - 1 - Type - U32 - Value - 1 - - VectorizeEnable - - Comment - Enable general vector operations and data alignment. - Persist - 1 - Type - Boolean - Value - 0 - - VectorizePerfTest - - Comment - Test SSE/vectorization performance and choose fastest version. - Persist - 1 - Type - Boolean - Value - 1 - - VectorizeProcessor - - Comment - 0=Compiler Default, 1=SSE, 2=SSE2, autodetected - Persist - 0 - Type - U32 - Value - 0 - - VectorizeSkin - - Comment - Enable vector operations for avatar skinning. - Persist - 1 - Type - Boolean - Value - 1 - - VelocityInterpolate - - Comment - Extrapolate object motion from last packet based on received velocity - Persist - 1 - Type - Boolean - Value - 1 - - VerboseLogs - - Comment - Display source file and line number for each log item for debugging purposes - Persist - 1 - Type - Boolean - Value - 0 - - VersionChannelName - - Comment - Versioning Channel Name. - Persist - 1 - Type - String - Value - Second Life Release - - VertexShaderEnable - - Comment - Enable/disable all GLSL shaders (debug) - Persist - 1 - Type - Boolean - Value - 0 - - VivoxDebugLevel - - Comment - Logging level to use when launching the vivox daemon - Persist - 1 - Type - String - Value - -1 - - VivoxDebugServerName - - Comment - Hostname of the vivox account server to use for voice when not connected to Agni. - Persist - 1 - Type - String - Value - bhd.vivox.com - - VoiceCallsFriendsOnly - - Comment - Only accept voice calls from residents on your friends list - Persist - 1 - Type - Boolean - Value - 0 - - VoiceEarLocation - - Comment - Location of the virtual ear for voice - Persist - 1 - Type - S32 - Value - 0 - - VoiceHost - - Comment - Client SLVoice host to connect to - Persist - 1 - Type - String - Value - 127.0.0.1 - - VoiceImageLevel0 - - Comment - Texture UUID for voice image level 0 - Persist - 1 - Type - String - Value - 041ee5a0-cb6a-9ac5-6e49-41e9320507d5 - - VoiceImageLevel1 - - Comment - Texture UUID for voice image level 1 - Persist - 1 - Type - String - Value - 29de489d-0491-fb00-7dab-f9e686d31e83 - - VoiceImageLevel2 - - Comment - Texture UUID for voice image level 2 - Persist - 1 - Type - String - Value - 29de489d-0491-fb00-7dab-f9e686d31e83 - - VoiceImageLevel3 - - Comment - Texture UUID for voice image level 3 - Persist - 1 - Type - String - Value - 29de489d-0491-fb00-7dab-f9e686d31e83 - - VoiceImageLevel4 - - Comment - Texture UUID for voice image level 4 - Persist - 1 - Type - String - Value - 29de489d-0491-fb00-7dab-f9e686d31e83 - - VoiceImageLevel5 - - Comment - Texture UUID for voice image level 5 - Persist - 1 - Type - String - Value - 29de489d-0491-fb00-7dab-f9e686d31e83 - - VoiceImageLevel6 - - Comment - Texture UUID for voice image level 6 - Persist - 1 - Type - String - Value - 29de489d-0491-fb00-7dab-f9e686d31e83 - - VoiceInputAudioDevice - - Comment - Audio input device to use for voice - Persist - 1 - Type - String - Value - Default - - VoiceOutputAudioDevice - - Comment - Audio output device to use for voice - Persist - 1 - Type - String - Value - Default - - VoicePort - - Comment - Client SLVoice port to connect to - Persist - 1 - Type - U32 - Value - 44124 - - WarnAboutBadPCI - - Comment - Enables AboutBadPCI warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - WarnAboutDirectX9 - - Comment - Enables AboutDirectX9 warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - WarnAboutOldGraphicsDriver - - Comment - Enables AboutOldGraphicsDriver warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - WarnAboutPCIGraphics - - Comment - Enables AboutPCIGraphics warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - WarnBrowserLaunch - - Comment - Enables BrowserLaunch warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - WarnDeedObject - - Comment - Enables DeedObject warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - WarnFirstAppearance - - Comment - Enables FirstAppearance warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - WarnFirstAttach - - Comment - Enables FirstAttach warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - WarnFirstBalanceDecrease - - Comment - Enables FirstBalanceDecrease warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - WarnFirstBalanceIncrease - - Comment - Enables FirstBalanceIncrease warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - WarnFirstBuild - - Comment - Enables FirstBuild warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - WarnFirstDebugMenus - - Comment - Enables FirstDebugMenus warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - WarnFirstFlexible - - Comment - Enables FirstFlexible warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - WarnFirstGoTo - - Comment - Enables FirstGoTo warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - WarnFirstInventory - - Comment - Enables FirstInventory warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - WarnFirstLeftClickNoHit - - Comment - Enables FirstLeftClickNoHit warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - WarnFirstMap - - Comment - Enables FirstMap warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - WarnFirstOverrideKeys - - Comment - Enables FirstOverrideKeys warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - WarnFirstSandbox - - Comment - Enables FirstSandbox warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - WarnFirstSculptedPrim - - Comment - Enables FirstSculptedPrim warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - WarnFirstSit - - Comment - Enables FirstSit warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - WarnFirstStreamingMusic - - Comment - Enables FirstStreamingMusic warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - WarnFirstStreamingVideo - - Comment - Enables FirstStreamingVideo warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - WarnFirstTeleport - - Comment - Enables FirstTeleport warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - WarnFirstVoice - - Comment - Enables FirstVoice warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - WarnNewClassified - - Comment - Enables NewClassified warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - WarnQuickTimeInstalled - - Comment - Enables QuickTimeInstalled warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - WarnReturnToOwner - - Comment - Enables ReturnToOwner warning dialog - Persist - 1 - Type - Boolean - Value - 1 - - WindLightUseAtmosShaders - - Comment - Whether to enable or disable WindLight atmospheric shaders. - Persist - 1 - Type - Boolean - Value - 1 - - WindowHeight - - Comment - SL viewer window height - Persist - 1 - Type - S32 - Value - 700 - - WindowMaximized - - Comment - SL viewer window maximized on login - Persist - 1 - Type - Boolean - Value - 1 - - WindowWidth - - Comment - SL viewer window width - Persist - 1 - Type - S32 - Value - 1000 - - WindowX - - Comment - X coordinate of lower left corner of SL viewer window, relative to primary display (pixels) - Persist - 1 - Type - S32 - Value - 10 - - WindowY - - Comment - Y coordinate of lower left corner of SL viewer window, relative to primary display (pixels) - Persist - 1 - Type - S32 - Value - 10 - - WLSkyDetail - - Comment - Controls vertex detail on the WindLight sky. Lower numbers will give better performance and uglier skies. - Persist - 1 - Type - U32 - Value - 64 - - XferThrottle - - Comment - Maximum allowable downstream bandwidth for asset transfers (bits per second) - Persist - 1 - Type - F32 - Value - 150000 - - YawFromMousePosition - - Comment - Horizontal range over which avatar head tracks mouse position (degrees of head rotation from left of window to right) - Persist - 1 - Type - F32 - Value - 90 - - YieldTime - - Comment - Yield some time to the local host. - Persist - 1 - Type - S32 - Value - -1 - - ZoomTime - - Comment - Time of transition between different camera modes (seconds) - Persist - 1 - Type - F32 - Value - 0.4000000059604644775390625 - - llOwnerSayChatColor - - Comment - Color of chat messages from objects only visible to the owner - Persist - 1 - Type - Color4 - Value - - 0.9900000095367431640625 - 0.9900000095367431640625 - 0.689999997615814208984375 - 1 - - - ParcelMediaAutoPlayEnable - - Comment - Auto play parcel media when available - Persist - 1 - Type - Boolean - Value - 0 - - particlesbeacon - - Comment - Beacon / Highlight particle generators - Persist - 1 - Type - Boolean - Value - 0 - - physicalbeacon - - Comment - Beacon / Highlight physical objects - Persist - 1 - Type - Boolean - Value - 1 - - renderbeacons - - Comment - Beacon / Highlight particle generators - Persist - 1 - Type - Boolean - Value - 0 - - renderhighlights - - Comment - Beacon / Highlight scripted objects with touch function - Persist - 1 - Type - Boolean - Value - 1 - - scriptsbeacon - - Comment - Beacon / Highlight scripted objects - Persist - 1 - Type - Boolean - Value - 0 - - scripttouchbeacon - - Comment - Beacon / Highlight scripted objects with touch function - Persist - 1 - Type - Boolean - Value - 1 - - soundsbeacon - - Comment - Beacon / Highlight sound generators - Persist - 1 - Type - Boolean - Value - 0 - - SkyEditPresets - - Comment - Whether to be able to edit the sky defaults or not - Persist - 1 - Type - Boolean - Value - 0 - - WaterGLFogDepthFloor - - Comment - Controls how dark water gl fog can get - Persist - 1 - Type - F32 - Value - 0.25 - - WaterGLFogDepthScale - - Comment - Controls how quickly gl fog gets dark under water - Persist - 1 - Type - F32 - Value - 50.0 - - WaterGLFogDensityScale - - Comment - Maps shader water fog density to gl fog density - Persist - 1 - Type - F32 - Value - 0.02 - - EnableRippleWater - - Comment - Whether to use ripple water shader or not - Persist - 1 - Type - Boolean - Value - 1 - - WaterEditPresets - - Comment - Whether to be able to edit the water defaults or not - Persist - 1 - Type - Boolean - Value - 0 - - FloaterEnvRect - - Comment - Rectangle for Environment Editor - Persist - 1 - Type - Rect - Value - - 50 - 150 - 650 - 0 - - - FloaterAdvancedSkyRect - - Comment - Rectangle for Advanced Sky Editor - Persist - 1 - Type - Rect - Value - - 50 - 220 - 450 - 0 - - - FloaterDayCycleRect - - Comment - Rectangle for Day Cycle Editor - Persist - 1 - Type - Rect - Value - - 50 - 450 - 300 - 0 - - - FloaterAdvancedWaterRect - - Comment - Rectangle for Advanced Water Editor - Persist - 1 - Type - Rect - Value - - 50 - 220 - 450 - 0 - - - AlertedUnsupportedHardware - - Comment - Toggle that lets us tell the user he's on old hardware only once - Persist - 1 - Type - Boolean - Value - 0 - - RenderFastAlpha - - Comment - Use lossy alpha rendering optimization (opaque/nonexistent small alpha faces). - Persist - 1 - Type - Boolean - Value - 1 - - - diff --git a/indra/newview/app_settings/settings_crash_behavior.xml b/indra/newview/app_settings/settings_crash_behavior.xml deleted file mode 100644 index cc7f5ac88b..0000000000 --- a/indra/newview/app_settings/settings_crash_behavior.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - CrashSubmitBehavior - - Comment - Controls behavior when viewer crashes (0 = ask before sending crash report, 1 = always send crash report, 2 = never send crash report) - Persist - 1 - Type - S32 - Value - 0 - - - diff --git a/indra/newview/app_settings/settings_files.xml b/indra/newview/app_settings/settings_files.xml deleted file mode 100644 index 997bb0c33c..0000000000 --- a/indra/newview/app_settings/settings_files.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - Files - - Comment - List of settings files to load. Key is the identifier, value is the filename - Persist - 0 - Type - LLSD - Value - - Global - settings.xml - PerAccount - settings_per_account.xml - CrashSettings - settings_crash_behavior.xml - - - - diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml deleted file mode 100644 index 90c7b11637..0000000000 --- a/indra/newview/app_settings/settings_per_account.xml +++ /dev/null @@ -1,114 +0,0 @@ - - - BusyModeResponse - - Comment - Auto response to instant messages while in busy mode. - Persist - 1 - Type - String - Value - The Resident you messaged is in 'busy mode' which means they have requested not to be disturbed. Your message will still be shown in their IM panel for later viewing. - - IMLogTimestamp - - Comment - Log Timestamp of Instant Messages - Persist - 1 - Type - Boolean - Value - 1 - - InstantMessageLogPath - - Comment - Path to your log files. - Persist - 1 - Type - String - Value - - - LastLogoff - - Comment - Last logoff - Persist - 1 - Type - U32 - Value - 0 - - LogChat - - Comment - Log Chat - Persist - 1 - Type - Boolean - Value - 0 - - LogChatIM - - Comment - Log Incoming Instant Messages with Chat - Persist - 1 - Type - Boolean - Value - 0 - - LogChatTimestamp - - Comment - Log Timestamp of Chat - Persist - 1 - Type - Boolean - Value - 0 - - LogInstantMessages - - Comment - Log Instant Messages - Persist - 1 - Type - Boolean - Value - 1 - - LogShowHistory - - Comment - Log Show History - Persist - 1 - Type - Boolean - Value - 1 - - LogTimestampDate - - Comment - Include Date with Timestamp - Persist - 1 - Type - Boolean - Value - 1 - - - diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 2fe23c9a51..420f0811ff 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -917,19 +917,19 @@ Function .onInit ; generate language ID that will be used as a command line arg StrCmp $LANGUAGE "1042" 0 +3 - StrCpy $LANGFLAGS " --set SystemLanguage ko" + StrCpy $LANGFLAGS " -set SystemLanguage ko" Goto EndOfFunc StrCmp $LANGUAGE "1041" 0 +3 - StrCpy $LANGFLAGS " --set SystemLanguage ja" + StrCpy $LANGFLAGS " -set SystemLanguage ja" Goto EndOfFunc StrCmp $LANGUAGE "1031" 0 +3 - StrCpy $LANGFLAGS " --set SystemLanguage de" + StrCpy $LANGFLAGS " -set SystemLanguage de" Goto EndOfFunc StrCmp $LANGUAGE "1033" 0 +3 - StrCpy $LANGFLAGS " --set SystemLanguage en-us" + StrCpy $LANGFLAGS " -set SystemLanguage en-us" Goto EndOfFunc EndOfFunc: diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 4dab653d19..ac92ee8525 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -273,7 +273,8 @@ void LLAgentFriendObserver::changed(U32 mask) // LLAgent() //----------------------------------------------------------------------------- LLAgent::LLAgent() -: mDrawDistance( DEFAULT_FAR_PLANE ), +: mViewerPort(NET_USE_OS_ASSIGNED_PORT), + mDrawDistance( DEFAULT_FAR_PLANE ), mDoubleTapRunTimer(), mDoubleTapRunMode(DOUBLETAP_NONE), @@ -454,6 +455,8 @@ void LLAgent::init() mTrackFocusObject = gSavedSettings.getBOOL("TrackFocusObject"); // LLDebugVarMessageBox::show("Camera Lag", &CAMERA_FOCUS_HALF_LIFE, 0.5f, 0.01f); + gSavedSettings.getControl("RenderHideGroupTitle")->addListener(&mHideGroupTitleListener); + gSavedSettings.getControl("EffectColor")->addListener(&mEffectColorListener); mEffectColor = gSavedSettings.getColor4("EffectColor"); @@ -7463,6 +7466,19 @@ void LLAgent::userRemoveAllAttachments( void* userdata ) gMessageSystem->sendReliable( gAgent.getRegionHost() ); } +bool LLAgent::LLHideGroupTitleListener::handleEvent(LLPointer event, const LLSD &userdata) +{ + gAgent.setHideGroupTitle(event->getValue()); + return true; + +} + +bool LLAgent::LLEffectColorListener::handleEvent(LLPointer event, const LLSD &userdata) +{ + gAgent.setEffectColor(LLColor4(event->getValue())); + return true; +} + void LLAgent::observeFriends() { if(!mFriendObserver) diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 50830a75f0..469d2e4fe0 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -36,7 +36,6 @@ #include "indra_constants.h" #include "llmath.h" -#include "llcontrol.h" #include "llcoordframe.h" #include "llevent.h" #include "llagentconstants.h" @@ -226,8 +225,8 @@ public: // update internal datastructures and update the server with the // new contribution level. Returns true if the group id was found // and contribution could be set. - BOOL setGroupContribution(const LLUUID& group_id, S32 contribution); - BOOL setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOOL list_in_profile); + BOOL setGroupContribution(const LLUUID& group_id, S32 contribution); + BOOL setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOOL list_in_profile); void setHideGroupTitle(BOOL hide) { mHideGroupTitle = hide; } // @@ -687,6 +686,7 @@ protected: BOOL notify = TRUE); public: // TODO: Make these private! + U32 mViewerPort; // Port this agent transmits on. LLUUID mSecureSessionID; // secure token for this login session F32 mDrawDistance; @@ -932,6 +932,21 @@ private: LLPointer mCB; }; + //control listeners + class LLHideGroupTitleListener: public LLSimpleListener + { + public: + bool handleEvent(LLPointer event, const LLSD &userdata); + }; + + class LLEffectColorListener: public LLSimpleListener + { + public: + bool handleEvent(LLPointer event, const LLSD &userdata); + }; + + LLHideGroupTitleListener mHideGroupTitleListener; + LLEffectColorListener mEffectColorListener; LLFriendObserver* mFriendObserver; }; diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index ffa2a82646..8c7af9ebf7 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -62,13 +62,10 @@ #include "llmutelist.h" #include "llurldispatcher.h" #include "llurlhistory.h" -#include "llfirstuse.h" #include "llweb.h" #include "llsecondlifeurls.h" -#include - #if LL_WINDOWS #include "llwindebug.h" #endif @@ -156,7 +153,10 @@ #include "llinventoryview.h" -#include "llcommandlineparser.h" +// *FIX: Remove these once the command line params thing is figured out. +// Yuck! +static int gTempArgC = 0; +static char** gTempArgV; // *FIX: These extern globals should be cleaned up. // The globals either represent state/config/resource-storage of either @@ -169,6 +169,7 @@ //---------------------------------------------------------------------------- // llviewernetwork.h #include "llviewernetwork.h" +// extern EGridInfo gGridChoice; ////// Windows-specific includes to the bottom - nasty defines in these pollute the preprocessor @@ -215,8 +216,14 @@ extern BOOL gPeriodicSlowFrame; //////////////////////////////////////////////////////////// // All from the last globals push... +bool gVerifySSLCert = true; BOOL gHandleKeysAsync = FALSE; +BOOL gProbeHardware = TRUE; // Use DirectX 9 to probe for hardware + +S32 gYieldMS = 0; // set in parse_args, used in mainLoop +BOOL gYieldTime = FALSE; + const F32 DEFAULT_AFK_TIMEOUT = 5.f * 60.f; // time with no input before user flagged as Away From Keyboard F32 gSimLastTime; // Used in LLAppViewer::init and send_stats() @@ -227,10 +234,21 @@ LLString gDisabledMessage; // Set in LLAppViewer::initConfiguration used in idle BOOL gHideLinks = FALSE; // Set in LLAppViewer::initConfiguration, used externally BOOL gAllowIdleAFK = TRUE; +F32 gAFKTimeout = DEFAULT_AFK_TIMEOUT; BOOL gShowObjectUpdates = FALSE; +BOOL gLogMessages = FALSE; +std::string gChannelName = LL_CHANNEL; +BOOL gUseAudio = TRUE; BOOL gUseQuickTime = TRUE; +LLString gCmdLineFirstName; +LLString gCmdLineLastName; +LLString gCmdLinePassword; + +BOOL gAutoLogin = FALSE; const char* DEFAULT_SETTINGS_FILE = "settings.xml"; +BOOL gRequestInventoryLibrary = TRUE; +BOOL gGodConnect = FALSE; BOOL gAcceptTOS = FALSE; BOOL gAcceptCriticalMessage = FALSE; @@ -261,6 +279,7 @@ F32 gLogoutMaxTime = LOGOUT_REQUEST_TIME; LLUUID gInventoryLibraryOwner; LLUUID gInventoryLibraryRoot; +BOOL gDisableVoice = FALSE; BOOL gDisconnected = FALSE; // Map scale in pixels per region @@ -272,11 +291,17 @@ LLFrameTimer gRestoreGLTimer; BOOL gRestoreGL = FALSE; BOOL gUseWireframe = FALSE; +F32 gMouseSensitivity = 3.f; +BOOL gInvertMouse = FALSE; + // VFS globals - see llappviewer.h LLVFS* gStaticVFS = NULL; LLMemoryInfo gSysMemory; +bool gPreloadImages = true; +bool gPreloadSounds = true; + LLString gLastVersionChannel; LLVector3 gWindVec(3.0, 3.0, 0.0); @@ -286,14 +311,34 @@ U32 gPacketsIn = 0; BOOL gPrintMessagesThisFrame = FALSE; +BOOL gUseConsole = TRUE; + BOOL gRandomizeFramerate = FALSE; BOOL gPeriodicSlowFrame = FALSE; +BOOL gQAMode = FALSE; BOOL gLLErrorActivated = FALSE; + //////////////////////////////////////////////////////////// // Internal globals... that should be removed. +static F32 gQuitAfterSeconds = 0.f; +static BOOL gRotateRight = FALSE; +static BOOL gIgnorePixelDepth = FALSE; + +// Allow multiple viewers in ReleaseForDownload +#if LL_RELEASE_FOR_DOWNLOAD +static BOOL gMultipleViewersOK = FALSE; +#else +static BOOL gMultipleViewersOK = TRUE; +#endif + +static std::map gCommandLineSettings; +static std::map gCommandLineForcedSettings; + static LLString gArgs; +static LLString gOldSettingsFileName; +static const char* LEGACY_DEFAULT_SETTINGS_FILE = "settings.ini"; const char* MARKER_FILE_NAME = "SecondLife.exec_marker"; const char* ERROR_MARKER_FILE_NAME = "SecondLife.error_marker"; const char* LLERROR_MARKER_FILE_NAME = "SecondLife.llerror_marker"; @@ -315,10 +360,52 @@ std::string gLoginPage; std::vector gLoginURIs; static std::string gHelperURI; +static const char USAGE[] = "\n" +"usage:\tviewer [options]\n" +"options:\n" +" -login log in as a user\n" +" -autologin log in as last saved user\n" +" -loginpage login authentication page to use\n" +" -loginuri login server and CGI script to use\n" +" -helperuri helper web CGI prefix to use\n" +" -settings specify the filename of a\n" +" configuration file\n" +" default is settings.xml\n" +" -setdefault specify the value of a particular\n" +" configuration variable which can be\n" +" overridden by settings.xml\n" +" -set specify the value of a particular\n" +" configuration variable that\n" +" overrides all other settings\n" +#if !LL_RELEASE_FOR_DOWNLOAD +" -sim specify the simulator ip address\n" +#endif +" -god log in as god if you have god access\n" +" -purge delete files in cache\n" +" -safe reset preferences, run in safe mode\n" +" -noutc logs in local time, not UTC\n" +" -nothread run vfs in single thread\n" +" -noinvlib Do not request inventory library\n" +" -multiple allow multiple viewers\n" +" -nomultiple block multiple viewers\n" +" -novoice disable voice\n" +" -ignorepixeldepth ignore pixel depth settings\n" +" -cooperative [ms] yield some idle time to local host\n" +" -skin ui/branding skin folder to use\n" +#if LL_WINDOWS +" -noprobe disable hardware probe\n" +#endif +" -noquicktime disable QuickTime movies, speeds startup\n" +" -nopreload don't preload UI images or sounds, speeds startup\n" +// these seem to be unused +//" -noenv turn off environmental effects\n" +//" -proxy specify the proxy ip address\n" +"\n"; + void idle_afk_check() { // check idle timers - if (gAllowIdleAFK && (gAwayTriggerTimer.getElapsedTimeF32() > gSavedSettings.getF32("AFKTimeout"))) + if (gAllowIdleAFK && (gAwayTriggerTimer.getElapsedTimeF32() > gAFKTimeout)) { gAgent.setAFK(); } @@ -357,7 +444,7 @@ void request_initial_instant_messages() // Use these strictly for things that are constructed at startup, // or for things that are performance critical. JC -static void settings_to_globals() +static void saved_settings_to_globals() { LLBUTTON_H_PAD = gSavedSettings.getS32("ButtonHPad"); LLBUTTON_V_PAD = gSavedSettings.getS32("ButtonVPad"); @@ -395,15 +482,15 @@ static void settings_to_globals() gDebugWindowProc = gSavedSettings.getBOOL("DebugWindowProc"); gAllowIdleAFK = gSavedSettings.getBOOL("AllowIdleAFK"); + gAFKTimeout = gSavedSettings.getF32("AFKTimeout"); + gMouseSensitivity = gSavedSettings.getF32("MouseSensitivity"); + gInvertMouse = gSavedSettings.getBOOL("InvertMouse"); gShowObjectUpdates = gSavedSettings.getBOOL("ShowObjectUpdates"); gMapScale = gSavedSettings.getF32("MapScale"); gMiniMapScale = gSavedSettings.getF32("MiniMapScale"); gHandleKeysAsync = gSavedSettings.getBOOL("AsyncKeyboard"); LLHoverView::sShowHoverTips = gSavedSettings.getBOOL("ShowHoverTips"); -} -static void settings_modify() -{ LLRenderTarget::sUseFBO = gSavedSettings.getBOOL("RenderUseFBO"); LLVOAvatar::sUseImpostors = gSavedSettings.getBOOL("RenderUseImpostors"); LLVOSurfacePatch::sLODFactor = gSavedSettings.getF32("RenderTerrainLODFactor"); @@ -445,74 +532,367 @@ static void settings_modify() // propagate push to talk preference to current status gSavedSettings.setBOOL("PTTCurrentlyEnabled", gSavedSettings.getBOOL("EnablePushToTalk")); + + settings_setup_listeners(); + + // gAgent.init() also loads from saved settings. } -void initGridChoice() +int parse_args(int argc, char **argv) { - LLString gridChoice = gSavedSettings.getString("GridChoice"); - if(!gridChoice.empty()) + // Sometimes IP addresses passed in on the command line have leading + // or trailing white space. Use LLString to clean that up. + LLString ip_string; + S32 j; + + for (j = 1; j < argc; j++) + { // Used to show first chunk of each argument passed in the // window title. - { - // find the grid choice from the user setting. - int gridIndex = GRID_INFO_NONE; - for(;gridIndex < GRID_INFO_OTHER; ++gridIndex ) - { - if(0 == LLString::compareInsensitive(gGridInfo[gridIndex].mLabel, gridChoice.c_str())) - { - gGridChoice = (EGridInfo)gridIndex; - - if(GRID_INFO_LOCAL == gGridChoice) - { - gGridName = LOOPBACK_ADDRESS_STRING; - break; - } - else - { - gGridName = gGridInfo[gGridChoice].mName; - break; - } - } - } - - if(GRID_INFO_OTHER == gridIndex) - { - // *FIX:MEP Can and should we validate that this is an IP address? - gGridChoice = (EGridInfo)gridIndex; - gGridName = llformat("%s", gSavedSettings.getString("GridChoice").c_str()); - - } - } + gArgs += argv[j]; + gArgs += " "; + LLString argument = argv[j]; + if ((!strcmp(argv[j], "-port")) && (++j < argc)) + { + sscanf(argv[j], "%u", &(gAgent.mViewerPort)); + } + else if ((!strcmp(argv[j], "-drop")) && (++j < argc)) + { + sscanf(argv[j], "%f", &gPacketDropPercentage); + } + else if ((!strcmp(argv[j], "-inbw")) && (++j < argc)) + { + sscanf(argv[j], "%f", &gInBandwidth); + } + else if ((!strcmp(argv[j], "-outbw")) && (++j < argc)) + { + sscanf(argv[j], "%f", &gOutBandwidth); + } + else if (!strcmp(argv[j], "--aditi")) + { + gGridChoice = GRID_INFO_ADITI; + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[gGridChoice].mName); // Flawfinder: ignore + } + else if (!strcmp(argv[j], "--agni")) + { + gGridChoice = GRID_INFO_AGNI; + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[gGridChoice].mName); // Flawfinder: ignore + } + else if (!strcmp(argv[j], "--aruna")) + { + gGridChoice = GRID_INFO_ARUNA; + sprintf(gGridName,"%s", gGridInfo[gGridChoice].mName); + } + else if (!strcmp(argv[j], "--durga")) + { + gGridChoice = GRID_INFO_DURGA; + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[gGridChoice].mName); // Flawfinder: ignore + } + else if (!strcmp(argv[j], "--ganga")) + { + gGridChoice = GRID_INFO_GANGA; + sprintf(gGridName,"%s", gGridInfo[gGridChoice].mName); + } + else if (!strcmp(argv[j], "--mitra")) + { + gGridChoice = GRID_INFO_MITRA; + sprintf(gGridName,"%s", gGridInfo[gGridChoice].mName); + } + else if (!strcmp(argv[j], "--mohini")) + { + gGridChoice = GRID_INFO_MOHINI; + sprintf(gGridName,"%s", gGridInfo[gGridChoice].mName); + } + else if (!strcmp(argv[j], "--nandi")) + { + gGridChoice = GRID_INFO_NANDI; + sprintf(gGridName,"%s", gGridInfo[gGridChoice].mName); + } + else if (!strcmp(argv[j], "--radha")) + { + gGridChoice = GRID_INFO_RADHA; + sprintf(gGridName,"%s", gGridInfo[gGridChoice].mName); + } + else if (!strcmp(argv[j], "--ravi")) + { + gGridChoice = GRID_INFO_RAVI; + sprintf(gGridName,"%s", gGridInfo[gGridChoice].mName); + } + else if (!strcmp(argv[j], "--siva")) + { + gGridChoice = GRID_INFO_SIVA; + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[gGridChoice].mName); // Flawfinder: ignore + } + else if (!strcmp(argv[j], "--shakti")) + { + gGridChoice = GRID_INFO_SHAKTI; + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[gGridChoice].mName); // Flawfinder: ignore + } + else if (!strcmp(argv[j], "--soma")) + { + gGridChoice = GRID_INFO_SOMA; + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[gGridChoice].mName); // Flawfinder: ignore + } + else if (!strcmp(argv[j], "--uma")) + { + gGridChoice = GRID_INFO_UMA; + sprintf(gGridName,"%s", gGridInfo[gGridChoice].mName); + } + else if (!strcmp(argv[j], "--vaak")) + { + gGridChoice = GRID_INFO_VAAK; + sprintf(gGridName,"%s", gGridInfo[gGridChoice].mName); + } + else if (!strcmp(argv[j], "--yami")) + { + gGridChoice = GRID_INFO_YAMI; + sprintf(gGridName,"%s", gGridInfo[gGridChoice].mName); + } + else if (!strcmp(argv[j], "-loginpage") && (++j < argc)) + { + LLAppViewer::instance()->setLoginPage(utf8str_trim(argv[j])); + } + else if (!strcmp(argv[j], "-loginuri") && (++j < argc)) + { + LLAppViewer::instance()->addLoginURI(utf8str_trim(argv[j])); + } + else if (!strcmp(argv[j], "-helperuri") && (++j < argc)) + { + LLAppViewer::instance()->setHelperURI(utf8str_trim(argv[j])); + } + else if (!strcmp(argv[j], "-debugviews")) + { + LLView::sDebugRects = TRUE; + } + else if (!strcmp(argv[j], "-skin") && (++j < argc)) + { + std::string folder(argv[j]); + gDirUtilp->setSkinFolder(folder); + } + else if (!strcmp(argv[j], "-autologin") || !strcmp(argv[j], "--autologin")) // keep --autologin for compatibility + { + gAutoLogin = TRUE; + } + else if (!strcmp(argv[j], "-quitafter") && (++j < argc)) + { + gQuitAfterSeconds = (F32)atof(argv[j]); + } + else if (!strcmp(argv[j], "-rotate")) + { + gRotateRight = TRUE; + } +// else if (!strcmp(argv[j], "-noenv")) +// { + //turn OFF environmental effects for slow machines/video cards +// gRequestParaboloidMap = FALSE; +// } + else if (!strcmp(argv[j], "-noaudio")) + { + gUseAudio = FALSE; + } + else if (!strcmp(argv[j], "-nosound")) // tends to be popular cmdline on Linux. + { + gUseAudio = FALSE; + } + else if (!strcmp(argv[j], "-noprobe")) + { + gProbeHardware = FALSE; + } + else if (!strcmp(argv[j], "-noquicktime")) + { + // Developers can log in faster if they don't load all the + // quicktime dlls. + gUseQuickTime = false; + } + else if (!strcmp(argv[j], "-nopreload")) + { + // Developers can log in faster if they don't decode sounds + // or images on startup, ~5 seconds faster. + gPreloadSounds = false; + gPreloadImages = false; + } + else if (!strcmp(argv[j], "-purge")) + { + LLAppViewer::instance()->purgeCache(); + } + else if(!strcmp(argv[j], "-noinvlib")) + { + gRequestInventoryLibrary = FALSE; + } + else if (!strcmp(argv[j], "-log")) + { + gLogMessages = TRUE; + continue; + } + else if (!strcmp(argv[j], "-logfile") && (++j < argc)) + { + // *NOTE: This buffer size is hard coded into scanf() below. + char logfile[256]; // Flawfinder: ignore + sscanf(argv[j], "%255s", logfile); // Flawfinder: ignore + llinfos << "Setting log file to " << logfile << llendl; + LLFile::remove(logfile); + LLError::logToFile(logfile); + } + else if (!strcmp(argv[j], "-settings") && (++j < argc)) + { + gSettingsFileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, argv[j]); + } + else if (!strcmp(argv[j], "-setdefault") && (j + 2 < argc)) + { + std::string control_name; + std::string control_value; + + j++; + if (argv[j]) control_name = std::string(argv[j]); -#if !LL_RELEASE_FOR_DOWNLOAD - if (gGridChoice == GRID_INFO_NONE) - { - // Development version: load last server choice by default (overridden by cmd line args) - S32 server = gSavedSettings.getS32("ServerChoice"); - if (server != 0) - gGridChoice = (EGridInfo)llclamp(server, 0, (S32)GRID_INFO_COUNT - 1); - if (server == GRID_INFO_OTHER) + j++; + if (argv[j]) control_value = std::string(argv[j]); + + // grab control name and value + if (!control_name.empty()) + { + gCommandLineSettings[control_name] = control_value; + } + } + else if (!strcmp(argv[j], "-set") && (j + 2 < argc)) { - LLString custom_server = gSavedSettings.getString("CustomServer"); - if (custom_server.empty()) + std::string control_name; + std::string control_value; + + j++; + if (argv[j]) control_name = std::string(argv[j]); + + j++; + if (argv[j]) control_value = std::string(argv[j]); + + // grab control name and value + if (!control_name.empty()) { - gGridName = "none"; + gCommandLineForcedSettings[control_name] = control_value; + } + } + else if (!strcmp(argv[j], "-login")) + { + if (j + 3 < argc) + { + j++; + gCmdLineFirstName = argv[j]; + j++; + gCmdLineLastName = argv[j]; + j++; + gCmdLinePassword = argv[j]; } else { - gGridName = custom_server.c_str(); + // only works if -login is last parameter on command line + llerrs << "Not enough parameters to -login. Did you mean -loginuri?" << llendl; } } - gSavedSettings.setString("GridChoice", gGridInfo[gGridChoice].mName); - } + else if (!strcmp(argv[j], "-god")) + { + gGodConnect = TRUE; + } + else if (!strcmp(argv[j], "-noconsole")) + { + gUseConsole = FALSE; + } + else if (!strcmp(argv[j], "-safe")) + { + llinfos << "Setting viewer feature table to run in safe mode, resetting prefs" << llendl; + gFeatureManagerp->setSafe(TRUE); + } + else if (!strcmp(argv[j], "-multiple")) + { + gMultipleViewersOK = TRUE; + } + else if (!strcmp(argv[j], "-nomultiple")) + { + gMultipleViewersOK = FALSE; + } + else if (!strcmp(argv[j], "-novoice")) + { + gDisableVoice = TRUE; + } + else if (!strcmp(argv[j], "-nothread")) + { + LLVFile::ALLOW_ASYNC = FALSE; + llinfos << "Running VFS in nothread mode" << llendl; + } + // some programs don't respect the command line options in protocol handlers (I'm looking at you, Opera) + // so this allows us to parse the URL straight off the command line without a "-url" paramater + else if (LLURLDispatcher::isSLURL(argv[j]) + || !strcmp(argv[j], "-url") && (++j < argc)) + { + std::string slurl = argv[j]; + if (LLURLDispatcher::isSLURLCommand(slurl)) + { + LLStartUp::sSLURLCommand = slurl; + } + else + { + LLURLSimString::setString(slurl); + } + // *NOTE: After setting the url, bail. What can happen is + // that someone can use IE (or potentially other browsers) + // and do the rough equivalent of command injection and + // steal passwords. Phoenix. SL-55321 + return 0; + } + else if (!strcmp(argv[j], "-ignorepixeldepth")) + { + gIgnorePixelDepth = TRUE; + } + else if (!strcmp(argv[j], "-cooperative")) + { + S32 ms_to_yield = 0; + if(++j < argc) + { + S32 rv = sscanf(argv[j], "%d", &ms_to_yield); + if(0 == rv) + { + --j; + } + } + else + { + --j; + } + gYieldMS = ms_to_yield; + gYieldTime = TRUE; + } + else if (!strcmp(argv[j], "-no-verify-ssl-cert")) + { + gVerifySSLCert = false; + } + else if ( (!strcmp(argv[j], "--channel") || !strcmp(argv[j], "-channel")) && (++j < argc)) + { + gChannelName = argv[j]; + } +#if LL_DARWIN + else if (!strncmp(argv[j], "-psn_", 5)) + { + // this is the Finder passing the process session number + // we ignore this + } #endif + else if(!strncmp(argv[j], "-qa", 3)) + { + gQAMode = TRUE; + } + else + { - if (gGridChoice == GRID_INFO_NONE) - { - gGridChoice = GridDefaultChoice; - gSavedSettings.setString("GridChoice", gGridInfo[gGridChoice].mName); + // DBC - Mac OS X passes some stuff by default on the command line (e.g. psn). + // Second Life URLs are passed this way as well? + llwarns << "Possible unknown keyword " << argv[j] << llendl; + + // print usage information + llinfos << USAGE << llendl; + // return 1; + } } + return 0; } bool send_url_to_other_instance(const std::string& url) @@ -558,12 +938,11 @@ LLAppViewer::LLAppViewer() : mReportedCrash(false), mNumSessions(0), mPurgeCache(false), - mPurgeOnExit(false), - mSecondInstance(false), + mPurgeOnExit(false), + mSecondInstance(false), mSavedFinalSnapshot(false), - mQuitRequested(false), - mLogoutRequestSent(false), - mYieldTime(-1) + mQuitRequested(false), + mLogoutRequestSent(false) { if(NULL != sInstance) { @@ -579,6 +958,13 @@ LLAppViewer::~LLAppViewer() removeMarkerFile(); } +bool LLAppViewer::tempStoreCommandOptions(int argc, char** argv) +{ + gTempArgC = argc; + gTempArgV = argv; + return true; +} + bool LLAppViewer::init() { // *NOTE:Mani - LLCurl::initClass is not thread safe. @@ -587,6 +973,7 @@ bool LLAppViewer::init() initThreads(); + initEarlyConfiguration(); // // Start of the application @@ -606,24 +993,61 @@ bool LLAppViewer::init() // // OK to write stuff to logs now, we've now crash reported if necessary // - if (!initConfiguration()) - return false; - writeSystemInfo(); + // Set up some defaults... + gSettingsFileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, DEFAULT_SETTINGS_FILE); + gOldSettingsFileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, LEGACY_DEFAULT_SETTINGS_FILE); - // Build a string representing the current version number. - gCurrentVersion = llformat("%s %d.%d.%d.%d", - gSavedSettings.getString("VersionChannelName").c_str(), - LL_VERSION_MAJOR, - LL_VERSION_MINOR, - LL_VERSION_PATCH, - LL_VERSION_BUILD ); + if (!initConfiguration()) + return false; ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// // *FIX: The following code isn't grouped into functions yet. + + // + // Write system information into the debug log (CPU, OS, etc.) + // + writeSystemInfo(); + + // Build a string representing the current version number. + gCurrentVersion = llformat("%s %d.%d.%d.%d", gChannelName.c_str(), LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VERSION_BUILD ); + + // + // Merge with the command line overrides + gSavedSettings.applyOverrides(gCommandLineSettings); + + // Need to do this before calling parseAlerts + gUICtrlFactory = new LLViewerUICtrlFactory(); + + // Pre-load alerts.xml to define the warnings settings (always loads from skins/xui/en-us/) + // Do this *before* loading the settings file + LLAlertDialog::parseAlerts("alerts.xml", &gSavedSettings, TRUE); + + // Overwrite default settings with user settings + llinfos << "Loading configuration file " << gSettingsFileName << llendl; + if (0 == gSavedSettings.loadFromFile(gSettingsFileName)) + { + llinfos << "Failed to load settings from " << gSettingsFileName << llendl; + llinfos << "Loading legacy settings from " << gOldSettingsFileName << llendl; + gSavedSettings.loadFromFileLegacy(gOldSettingsFileName); + } + + // need to do this here - need to have initialized global settings first + LLString nextLoginLocation = gSavedSettings.getString( "NextLoginLocation" ); + if ( nextLoginLocation.length() ) + { + LLURLSimString::setString( nextLoginLocation.c_str() ); + }; + + // Merge with the command line overrides + gSavedSettings.applyOverrides(gCommandLineForcedSettings); + + gLastRunVersion = gSavedSettings.getString("LastRunVersion"); + + fixup_settings(); // Get the single value from the crash settings file, if it exists std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); @@ -663,25 +1087,56 @@ bool LLAppViewer::init() { LLError::setPrintLocation(true); } + +#if !LL_RELEASE_FOR_DOWNLOAD + if (gGridChoice == GRID_INFO_NONE) + { + // Development version: load last server choice by default (overridden by cmd line args) + + S32 server = gSavedSettings.getS32("ServerChoice"); + if (server != 0) + gGridChoice = (EGridInfo)llclamp(server, 0, (S32)GRID_INFO_COUNT - 1); + if (server == GRID_INFO_OTHER) + { + LLString custom_server = gSavedSettings.getString("CustomServer"); + if (custom_server.empty()) + { + snprintf(gGridName, MAX_STRING, "none"); /* Flawfinder: ignore */ + } + else + { + snprintf(gGridName, MAX_STRING, "%s", custom_server.c_str()); /* Flawfinder: ignore */ + } + } + } +#endif + + if (gGridChoice == GRID_INFO_NONE) + { + gGridChoice = GridDefaultChoice; + } // Load art UUID information, don't require these strings to be declared in code. LLString viewer_art_filename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"viewerart.xml"); llinfos << "Loading art table from " << viewer_art_filename << llendl; - gViewerArt.loadFromFileLegacy(viewer_art_filename.c_str(), FALSE); + gViewerArt.loadFromFile(viewer_art_filename.c_str(), FALSE); LLString textures_filename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, "textures", "textures.xml"); llinfos << "Loading art table from " << textures_filename << llendl; - gViewerArt.loadFromFileLegacy(textures_filename.c_str(), FALSE); + gViewerArt.loadFromFile(textures_filename.c_str(), FALSE); LLString colors_base_filename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "colors_base.xml"); llinfos << "Loading base colors from " << colors_base_filename << llendl; - gColors.loadFromFileLegacy(colors_base_filename.c_str(), FALSE, TYPE_COL4U); + gColors.loadFromFile(colors_base_filename.c_str(), FALSE, TYPE_COL4U); // Load overrides from user colors file LLString user_colors_filename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "colors.xml"); llinfos << "Loading user colors from " << user_colors_filename << llendl; - if (gColors.loadFromFileLegacy(user_colors_filename.c_str(), FALSE, TYPE_COL4U) == 0) + if (gColors.loadFromFile(user_colors_filename.c_str(), FALSE, TYPE_COL4U) == 0) { - llinfos << "Cannot load user colors from " << user_colors_filename << llendl; + llinfos << "Failed to load user colors from " << user_colors_filename << llendl; + LLString user_legacy_colors_filename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "colors.ini"); + llinfos << "Loading legacy colors from " << user_legacy_colors_filename << llendl; + gColors.loadFromFileLegacy(user_legacy_colors_filename.c_str(), FALSE, TYPE_COL4U); } // Widget construction depends on LLUI being initialized @@ -704,18 +1159,16 @@ bool LLAppViewer::init() LLAgent::parseTeleportMessages("teleport_strings.xml"); - LLViewerJointMesh::updateVectorize(); - // load MIME type -> media impl mappings LLMIMETypes::parseMIMETypes( "mime_types.xml" ); + mCrashBehavior = gCrashSettings.getS32(CRASH_BEHAVIOR_SETTING); + + LLVectorPerformanceOptions::initClass(); + + // Move certain saved settings into global variables for speed + saved_settings_to_globals(); - // Copy settings to globals. *TODO: Remove or move to appropriage class initializers - settings_to_globals(); - // Setup settings listeners - settings_setup_listeners(); - // Modify settings based on system configuration and compile options - settings_modify(); // Find partition serial number (Windows) or hardware serial (Mac) mSerialNumber = generateSerialNumber(); @@ -980,9 +1433,9 @@ bool LLAppViewer::mainLoop() bool run_multiple_threads = gSavedSettings.getBOOL("RunMultipleThreads"); // yield some time to the os based on command line option - if(mYieldTime >= 0) + if(gYieldTime) { - ms_sleep(mYieldTime); + ms_sleep(gYieldMS); } // yield cooperatively when not running as foreground window @@ -1254,11 +1707,11 @@ bool LLAppViewer::cleanup() // Must do this after all panels have been deleted because panels that have persistent rects // save their rects on delete. - gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), TRUE); - - // UserSettingsFile 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("UserSettingsFile"), TRUE); + gSavedSettings.saveToFile(gSettingsFileName, TRUE); + if (!gPerAccountSettingsFileName.empty()) + { + gSavedPerAccountSettings.saveToFile(gPerAccountSettingsFileName, TRUE); + } llinfos << "Saved settings" << llendflush; std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); @@ -1353,10 +1806,10 @@ bool LLAppViewer::cleanup() end_messaging_system(); - // *NOTE:Mani - The following call is not thread safe. - LLCurl::cleanupClass(); + // *NOTE:Mani - The following call is not thread safe. + LLCurl::cleanupClass(); - // If we're exiting to launch an URL, do that here so the screen + // If we're exiting to launch an URL, do that here so the screen // is at the right resolution before we launch IE. if (!gLaunchFileOnQuit.empty()) { @@ -1377,6 +1830,106 @@ bool LLAppViewer::cleanup() return true; } +bool LLAppViewer::initEarlyConfiguration() +{ + // *FIX: globals - This method sets a bunch of globals early in the init process. + int argc = gTempArgC; + char** argv = gTempArgV; + + // HACK! We REALLY want to know what grid they were trying to connect to if they + // crashed hard. + // So we walk through the command line args ONLY looking for the + // userserver arguments first. And we don't do ANYTHING but set + // the gGridName (which gets passed to the crash reporter). + // We're assuming that they're trying to log into the same grid as last + // time, which seems fairly reasonable. + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[GridDefaultChoice].mName); // Flawfinder: ignore + S32 j; + for (j = 1; j < argc; j++) + { + if (!strcmp(argv[j], "--aditi")) + { + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[GRID_INFO_ADITI].mName); // Flawfinder: ignore + } + else if (!strcmp(argv[j], "--agni")) + { + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[GRID_INFO_AGNI].mName); // Flawfinder: ignore + } + else if (!strcmp(argv[j], "--siva")) + { + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[GRID_INFO_SIVA].mName); // Flawfinder: ignore + } + else if (!strcmp(argv[j], "--shakti")) + { + sprintf(gGridName,"%s", gGridInfo[GRID_INFO_SHAKTI].mName); + } + else if (!strcmp(argv[j], "--durga")) + { + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[GRID_INFO_DURGA].mName); // Flawfinder: ignore + } + else if (!strcmp(argv[j], "--soma")) + { + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[GRID_INFO_SOMA].mName); // Flawfinder: ignore + } + else if (!strcmp(argv[j], "--ganga")) + { + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[GRID_INFO_GANGA].mName); // Flawfinder: ignore + } + else if (!strcmp(argv[j], "--vaak")) + { + sprintf(gGridName,"%s", gGridInfo[GRID_INFO_VAAK].mName); + } + else if (!strcmp(argv[j], "--uma")) + { + sprintf(gGridName,"%s", gGridInfo[GRID_INFO_UMA].mName); + } + else if (!strcmp(argv[j], "--mohini")) + { + sprintf(gGridName,"%s", gGridInfo[GRID_INFO_MOHINI].mName); + } + else if (!strcmp(argv[j], "--yami")) + { + sprintf(gGridName,"%s", gGridInfo[GRID_INFO_YAMI].mName); + } + else if (!strcmp(argv[j], "--nandi")) + { + sprintf(gGridName,"%s", gGridInfo[GRID_INFO_NANDI].mName); + } + else if (!strcmp(argv[j], "--mitra")) + { + sprintf(gGridName,"%s", gGridInfo[GRID_INFO_MITRA].mName); + } + else if (!strcmp(argv[j], "--radha")) + { + sprintf(gGridName,"%s", gGridInfo[GRID_INFO_RADHA].mName); + } + else if (!strcmp(argv[j], "--ravi")) + { + sprintf(gGridName,"%s", gGridInfo[GRID_INFO_RAVI].mName); + } + else if (!strcmp(argv[j], "--aruna")) + { + sprintf(gGridName,"%s", gGridInfo[GRID_INFO_ARUNA].mName); + } + else if (!strcmp(argv[j], "-multiple")) + { + // Hack to detect -multiple so we can disable the marker file check (which will always fail) + gMultipleViewersOK = TRUE; + } + else if (!strcmp(argv[j], "-novoice")) + { + // May need to know this early also + gDisableVoice = TRUE; + } + else if (!strcmp(argv[j], "-url") && (++j < argc)) + { + LLURLSimString::setString(argv[j]); + } + } + + return true; +} + bool LLAppViewer::initThreads() { #if MEM_TRACK_MEM @@ -1437,275 +1990,14 @@ bool LLAppViewer::initLogging() return true; } -void LLAppViewer::loadSettingsFromDirectory(ELLPath path_index) -{ - for(LLSD::map_iterator itr = mSettingsFileList.beginMap(); itr != mSettingsFileList.endMap(); ++itr) - { - LLString settings_name = (*itr).first; - LLString settings_file = mSettingsFileList[settings_name].asString(); - LLString full_settings_path = gDirUtilp->getExpandedFilename(path_index, settings_file); - if(gSettings.find(settings_name) == gSettings.end()) - { - llwarns << "Cannot load " << settings_file << " - No matching settings group for name " << settings_name << llendl; - continue; - } - if(!gSettings[settings_name]->loadFromFile(gDirUtilp->getExpandedFilename(path_index, settings_file))) - { - llwarns << "Cannot load " << full_settings_path << " - No settings found." << llendl; - } - else - { - llinfos << "Loaded settings file " << full_settings_path << llendl; - } - } -} - bool LLAppViewer::initConfiguration() { - //Set up internal pointers - gSettings["Global"] = &gSavedSettings; - gSettings["PerAccount"] = &gSavedPerAccountSettings; - gSettings["CrashSettings"] = &gCrashSettings; - - //Load settings files list - std::string settings_file_list = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "settings_files.xml"); - LLControlGroup settings_control; - llinfos << "Loading settings file list" << settings_file_list << llendl; - if (0 == settings_control.loadFromFile(settings_file_list)) - { - llerrs << "Cannot load default configuration file " << settings_file_list << llendl; - } - - mSettingsFileList = settings_control.getLLSD("Files"); - - //Order of loading - // - App Settings (Defaults) - // - user_settings (Client Overrides) - // - user directory (user specific overrides, happens in llstartup) - loadSettingsFromDirectory(LL_PATH_APP_SETTINGS); - - //Fix settings that require compiled information - gSavedSettings.setString("ClientSettingsFile", - gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, DEFAULT_SETTINGS_FILE)); - gSavedSettings.setString("VersionChannelName", LL_CHANNEL); - #ifndef LL_RELEASE_FOR_DOWNLOAD - gSavedSettings.setBOOL("ShowConsoleWindow", TRUE); - #endif - - // These are warnings that appear on the first experience of that condition. - // They are already set in the settings_default.xml file, but still need to be added to LLFirstUse - // for disable/reset ability - LLFirstUse::addConfigVariable("FirstBalanceIncrease"); - LLFirstUse::addConfigVariable("FirstBalanceDecrease"); - LLFirstUse::addConfigVariable("FirstSit"); - LLFirstUse::addConfigVariable("FirstMap"); - LLFirstUse::addConfigVariable("FirstGoTo"); - LLFirstUse::addConfigVariable("FirstBuild"); - LLFirstUse::addConfigVariable("FirstLeftClickNoHit"); - LLFirstUse::addConfigVariable("FirstTeleport"); - LLFirstUse::addConfigVariable("FirstOverrideKeys"); - LLFirstUse::addConfigVariable("FirstAttach"); - LLFirstUse::addConfigVariable("FirstAppearance"); - LLFirstUse::addConfigVariable("FirstInventory"); - LLFirstUse::addConfigVariable("FirstSandbox"); - LLFirstUse::addConfigVariable("FirstFlexible"); - LLFirstUse::addConfigVariable("FirstDebugMenus"); - LLFirstUse::addConfigVariable("FirstStreamingMusic"); - LLFirstUse::addConfigVariable("FirstStreamingVideo"); - LLFirstUse::addConfigVariable("FirstSculptedPrim"); - LLFirstUse::addConfigVariable("FirstVoice"); - LLFirstUse::addConfigVariable("FirstMedia"); - - ////// - // *FIX:Mani - Find a way to remove the gUICtrlFactory and - // LLAlertDialog::parseAlerts dependecies on the being loaded - // *before* the user settings. Having to do this init here - // seems odd. - - // Need to do this before calling parseAlerts - gUICtrlFactory = new LLViewerUICtrlFactory(); - - // Pre-load alerts.xml to define the warnings settings (always loads from skins/xui/en-us/) - // Do this *before* loading the settings file - LLAlertDialog::parseAlerts("alerts.xml", &gSavedSettings, TRUE); - - // Overwrite default user settings with user settings - loadSettingsFromDirectory(LL_PATH_USER_SETTINGS); - - // Parse command line settings. - LLControlGroupCLP clp; - std::string cmd_line_config = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, - "cmd_line.xml"); - clp.configure(cmd_line_config, &gSavedSettings); - - if(!initParseCommandLine(clp)) + // Ye olde parse_args()... + if(!doConfigFromCommandLine()) { - llwarns - << "Error parsing command line options. Command Line options ignored." - << llendl; - - llinfos << "Command line usage:\n" << clp << llendl; - } - - // If the user has specified a alternate settings file name. - // Load it now. - if(clp.hasOption("settings")) - { - std::string user_settings_filename = clp.getOption("settings")[0]; - std::string full_settings_path = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, - user_settings_filename); - - llinfos << "Loading command line specified settings file: " << full_settings_path << llendl; - - if(!gSavedSettings.loadFromFile(full_settings_path)) - { - llwarns << "File not found: " << full_settings_path << llendl; - } - - gSavedSettings.setString("ClientSettingsFile", full_settings_path); - } - - // Apply the command line params to the settings system. - // Anyway the following call to notify depends upon the settings being init'd. - clp.notify(); - - // Start up the debugging console before handling other options. - if (gSavedSettings.getBOOL("ShowConsoleWindow")) - { - initConsole(); - } - - if(clp.hasOption("help")) - { - llinfos << "Command line usage:\n" << clp << llendl; return false; } - - ////////////////////////// - // Apply settings... - if(clp.hasOption("setdefault")) - { - //const LLCommandLineParser::token_vector_t& setdefault = clp.getOption("setdefault"); - //if(0x1 & setdefault.size()) - //{ - // llwarns << "Invalid '--setdefault' parameter count." << llendl; - //} - //else - //{ - // LLCommandLineParser::token_vector_t::const_iterator itr = setdefault.begin(); - // for(; itr != setdefault.end(); ++itr) - // { - // const std::string& name = *itr; - // const std::string& value = *(++itr); - // LLControlVariable* c = gSettings["global"]->getControl(name); - // if(c) - // { - // c->setDefault(value); - // } - // else - // { - // llwarns << "'--setdefault' specified with unknown setting: '" - // << name << "'." << llendl; - // } - // } - //} - } - - if(clp.hasOption("set")) - { - const LLCommandLineParser::token_vector_t& set_values = clp.getOption("set"); - if(0x1 & set_values.size()) - { - llwarns << "Invalid '--set' parameter count." << llendl; - } - else - { - LLCommandLineParser::token_vector_t::const_iterator itr = set_values.begin(); - for(; itr != set_values.end(); ++itr) - { - const std::string& name = *itr; - const std::string& value = *(++itr); - LLControlVariable* c = gSettings["Global"]->getControl(name); - if(c) - { - c->setValue(value, false); - } - else - { - llwarns << "'--set' specified with unknown setting: '" - << name << "'." << llendl; - } - } - } - } - - initGridChoice(); - - // Handle slurl use. NOTE: Don't let SL-55321 reappear. - - // *FIX: This init code should be made more robust to prevent - // the issue SL-55321 from returning. One thought is to allow - // only select options to be set from command line when a slurl - // is specified. More work on the settings system is needed to - // achieve this. For now... - - // *NOTE:Mani The command line parser parses tokens and is - // setup to bail after parsing the '--url' option or the - // first option specified without a '--option' flag (or - // any other option that uses the 'last_option' setting - - // see LLControlGroupCLP::configure()) - - // What can happen is that someone can use IE (or potentially - // other browsers) and do the rough equivalent of command - // injection and steal passwords. Phoenix. SL-55321 - if(clp.hasOption("url")) - { - std::string slurl = clp.getOption("url")[0]; - if (LLURLDispatcher::isSLURLCommand(slurl)) - { - LLStartUp::sSLURLCommand = slurl; - } - else - { - LLURLSimString::setString(slurl); - } - } - else if(clp.hasOption("slurl")) - { - std::string slurl = clp.getOption("slurl")[0]; - if(LLURLDispatcher::isSLURL(slurl)) - { - if (LLURLDispatcher::isSLURLCommand(slurl)) - { - LLStartUp::sSLURLCommand = slurl; - } - else - { - LLURLSimString::setString(slurl); - } - } - } - - const LLControlVariable* loginuri = gSavedSettings.getControl("LoginURI"); - if(loginuri && LLString::null != loginuri->getValue().asString()) - { - addLoginURI(loginuri->getValue().asString()); - } - - const LLControlVariable* helperuri = gSavedSettings.getControl("HelperURI"); - if(helperuri && LLString::null != helperuri->getValue().asString()) - { - setHelperURI(helperuri->getValue().asString()); - } - - const LLControlVariable* skinfolder = gSavedSettings.getControl("SkinFolder"); - if(skinfolder && LLString::null != skinfolder->getValue().asString()) - { - gDirUtilp->setSkinFolder(skinfolder->getValue().asString()); - } - - mYieldTime = gSavedSettings.getS32("YieldTime"); - + // XUI:translate gSecondLife = "Second Life"; @@ -1776,6 +2068,19 @@ bool LLAppViewer::initConfiguration() gStartTime = totalTime(); + //////////////////////////////////////// + // + // Process ini files + // + + // declare all possible setting variables + declare_settings(); + +#if !LL_RELEASE_FOR_DOWNLOAD +// only write the defaults for non-release builds! + gSavedSettings.saveToFile(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,"settings_default.xml").c_str(), FALSE); +#endif + // // Set the name of the window // @@ -1788,7 +2093,7 @@ bool LLAppViewer::initConfiguration() #endif LLString::truncate(gWindowTitle, 255); - if (!gSavedSettings.getBOOL("AllowMultipleViewers")) + if (!gMultipleViewersOK) { // // Check for another instance of the app running @@ -1914,12 +2219,12 @@ bool LLAppViewer::initConfiguration() if (mSecondInstance) { - gSavedSettings.setBOOL("CmdLineDisableVoice", TRUE); + gDisableVoice = TRUE; /* Don't start another instance if using -multiple //RN: if we received a URL, hand it off to the existing instance - if (LLURLSimString::parse()) - { - LLURLSimString::send_to_other_instance(); + if (LLURLSimString::parse()) + { + LLURLSimString::send_to_other_instance(); return 1; } */ @@ -1928,15 +2233,95 @@ bool LLAppViewer::initConfiguration() initMarkerFile(); } - // need to do this here - need to have initialized global settings first - LLString nextLoginLocation = gSavedSettings.getString( "NextLoginLocation" ); - if ( nextLoginLocation.length() ) + return true; // Config was successful. +} + +bool LLAppViewer::doConfigFromCommandLine() +{ + // *FIX: This is what parse args used to do, minus the arg reading part. + // Now the arg parsing is handled by LLApp::parseCommandOptions() and this + // method need only interpret settings. Perhaps some day interested parties + // can ask an app about a setting rather than have the app set + // a gazzillion globals. + + ///////////////////////////////////////// + // + // Process command line arguments + // + S32 args_result = 0; + +#if LL_DARWIN { - LLURLSimString::setString( nextLoginLocation.c_str() ); - }; + // On the Mac, read in arguments.txt (if it exists) and process it for additional arguments. + LLString args; + if(_read_file_into_string(args, "arguments.txt")) /* Flawfinder: ignore*/ + { + // The arguments file exists. + // It should consist of command line arguments separated by newlines. + // Split it into individual arguments and build a fake argv[] to pass to parse_args. + std::vector arglist; + + arglist.push_back("newview"); + + llinfos << "Reading additional command line arguments from arguments.txt..." << llendl; + + typedef boost::tokenizer > tokenizer; + boost::escaped_list_separator sep("\\", "\r\n ", "\"'"); + tokenizer tokens(args, sep); + tokenizer::iterator token_iter; - gLastRunVersion = gSavedSettings.getString("LastRunVersion"); - return true; // Config was successful. + for(token_iter = tokens.begin(); token_iter != tokens.end(); ++token_iter) + { + llinfos << "argument: '" << (token_iter->c_str()) << "'" << llendl; + + arglist.push_back(*token_iter); + } + + char **fakeargv = new char*[arglist.size()]; + int i; + for(i=0; i < arglist.size(); i++) + fakeargv[i] = const_cast(arglist[i].c_str()); + + args_result = parse_args(arglist.size(), fakeargv); + delete[] fakeargv; + } + + // Get the user's preferred language string based on the Mac OS localization mechanism. + // To add a new localization: + // go to the "Resources" section of the project + // get info on "language.txt" + // in the "General" tab, click the "Add Localization" button + // create a new localization for the language you're adding + // set the contents of the new localization of the file to the string corresponding to our localization + // (i.e. "en-us", "ja", etc. Use the existing ones as a guide.) + CFURLRef url = CFBundleCopyResourceURL(CFBundleGetMainBundle(), CFSTR("language"), CFSTR("txt"), NULL); + char path[MAX_PATH]; + if(CFURLGetFileSystemRepresentation(url, false, (UInt8 *)path, sizeof(path))) + { + LLString lang; + if(_read_file_into_string(lang, path)) /* Flawfinder: ignore*/ + { + gCommandLineForcedSettings["SystemLanguage"] = lang; + } + } + CFRelease(url); + } +#endif + + int argc = gTempArgC; + char** argv = gTempArgV; + + // + // Parse the command line arguments + // + args_result |= parse_args(argc, argv); + if (args_result) + { + removeMarkerFile(); + return false; + } + + return true; } bool LLAppViewer::initWindow() @@ -1955,11 +2340,10 @@ bool LLAppViewer::initWindow() window_title_str[sizeof(window_title_str) - 1] = '\0'; // always start windowed - BOOL ignorePixelDepth = gSavedSettings.getBOOL("IgnorePixelDepth"); gViewerWindow = new LLViewerWindow(window_title_str, "Second Life", gSavedSettings.getS32("WindowX"), gSavedSettings.getS32("WindowY"), gSavedSettings.getS32("WindowWidth"), gSavedSettings.getS32("WindowHeight"), - FALSE, ignorePixelDepth); + FALSE, gIgnorePixelDepth); if (gSavedSettings.getBOOL("FullScreen")) { @@ -1981,14 +2365,14 @@ bool LLAppViewer::initWindow() // Set this flag in case we crash while initializing GL gSavedSettings.setBOOL("RenderInitError", TRUE); - gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); + gSavedSettings.saveToFile( gSettingsFileName, TRUE ); gPipeline.init(); stop_glerror(); gViewerWindow->initGLDefaults(); gSavedSettings.setBOOL("RenderInitError", FALSE); - gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); + gSavedSettings.saveToFile( gSettingsFileName, TRUE ); } LLUI::sWindow = gViewerWindow->getWindow(); @@ -1996,6 +2380,11 @@ bool LLAppViewer::initWindow() LLAlertDialog::parseAlerts("alerts.xml"); LLNotifyBox::parseNotify("notify.xml"); + // *TODO - remove this when merging into release + // DON'T Clean up the feature manager lookup table - settings are needed + // for setting the graphics level. + //gFeatureManagerp->cleanupFeatureTables(); + // Show watch cursor gViewerWindow->setCursor(UI_CURSOR_WAIT); @@ -2085,7 +2474,7 @@ void LLAppViewer::writeSystemInfo() { gDebugInfo["SLLog"] = LLError::logFileName(); - gDebugInfo["ClientInfo"]["Name"] = gSavedSettings.getString("VersionChannelName"); + gDebugInfo["ClientInfo"]["Name"] = gChannelName; gDebugInfo["ClientInfo"]["MajorVersion"] = LL_VERSION_MAJOR; gDebugInfo["ClientInfo"]["MinorVersion"] = LL_VERSION_MINOR; gDebugInfo["ClientInfo"]["PatchVersion"] = LL_VERSION_PATCH; @@ -2136,7 +2525,7 @@ void LLAppViewer::handleViewerCrash() } pApp->mReportedCrash = TRUE; - gDebugInfo["SettingsFilename"] = gSavedSettings.getString("ClientSettingsFile"); + gDebugInfo["SettingsFilename"] = gSettingsFileName; gDebugInfo["CAFilename"] = gDirUtilp->getCAFile(); gDebugInfo["ViewerExePath"] = gDirUtilp->getExecutablePathAndName().c_str(); gDebugInfo["CurrentPath"] = gDirUtilp->getCurPath().c_str(); @@ -2277,11 +2666,7 @@ void LLAppViewer::initMarkerFile() ll_apr_file_remove(error_marker_file); //Freeze case checks - if(anotherInstanceRunning()) - { - return; - } - + if(anotherInstanceRunning()) return; fMarker = ll_apr_file_open(mMarkerFileName, LL_APR_RB); if (fMarker != NULL) { @@ -2487,7 +2872,7 @@ bool LLAppViewer::initCache() char static_vfs_index_file[LL_MAX_PATH]; // Flawfinder: ignore char static_vfs_data_file[LL_MAX_PATH]; // Flawfinder: ignore - if (gSavedSettings.getBOOL("AllowMultipleViewers")) + if (gMultipleViewersOK) { // don't mess with renaming the VFS in this case new_salt = old_salt; @@ -2686,6 +3071,17 @@ void LLAppViewer::setHelperURI(const std::string& uri) gHelperURI = uri; } +void LLAppViewer::setLoginPage(const std::string& login_page) +{ + gLoginPage = login_page; +} + +const std::string& LLAppViewer::getLoginPage() +{ + return gLoginPage; +} + + // Callback from a dialog indicating user was logged out. void finish_disconnect(S32 option, void* userdata) { @@ -2854,6 +3250,8 @@ void LLAppViewer::idle() // Update frame timers static LLTimer idle_timer; + LLControlBase::updateAllListeners(); + LLFrameTimer::updateFrameTime(); LLEventTimer::updateClass(); LLCriticalDamp::updateInterpolants(); @@ -2874,10 +3272,9 @@ void LLAppViewer::idle() // Smoothly weight toward current frame gFPSClamped = (frame_rate_clamped + (4.f * gFPSClamped)) / 5.f; - F32 qas = gSavedSettings.getF32("QuitAfterSeconds"); - if (qas > 0.f) + if (gQuitAfterSeconds > 0.f) { - if (gRenderStartTime.getElapsedTimeF32() > qas) + if (gRenderStartTime.getElapsedTimeF32() > gQuitAfterSeconds) { LLAppViewer::instance()->forceQuit(); } @@ -2916,7 +3313,7 @@ void LLAppViewer::idle() // Update simulator agent state // - if (gSavedSettings.getBOOL("RotateRight")) + if (gRotateRight) { gAgent.moveYaw(-1.f); } @@ -3124,6 +3521,7 @@ void LLAppViewer::idle() // // Update weather effects // + if (!gNoRender) { gWorldp->updateClouds(gFrameDTClamped); diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 40a69f7868..9518636f87 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -36,21 +36,15 @@ class LLTextureCache; class LLWorkerThread; class LLTextureFetch; -class LLCommandLineParser; - class LLAppViewer : public LLApp { public: LLAppViewer(); virtual ~LLAppViewer(); - /** - * @brief Access to the LLAppViewer singleton. - * - * The LLAppViewer singleton is created in main()/WinMain(). - * So don't use it in pre-entry (static initialization) code. - */ - static LLAppViewer* instance() {return sInstance; } + // *NOTE:Mani - Don't use this! + // Having + static LLAppViewer* instance() {return sInstance; } // // Main application logic @@ -70,6 +64,10 @@ public: bool quitRequested() { return mQuitRequested; } bool logoutRequestSent() { return mLogoutRequestSent; } + // *FIX: This is meant to stay only until the command line issues are hashed out with repect to LLApp::parseCommandLine + // This version stores the argc and argv for later usage, make sure the params passed in last as long as this class. + bool tempStoreCommandOptions(int argc, char** argv); + void closeDebug(); const LLOSInfo& getOSInfo() const { return mSysOSInfo; } @@ -89,6 +87,9 @@ public: const std::string& getSerialNumber() { return mSerialNumber; } + // *FIX:Mani purgeCache was made public for parse_args(). + // If that beast is gone, make it private. + void purgeCache(); // Clear the local cache. bool getPurgeCache() const { return mPurgeCache; } const LLString& getSecondLifeTitle() const; // The Second Life title. @@ -100,6 +101,8 @@ public: const std::vector& getLoginURIs() const; const std::string& getHelperURI() const; void resetURIs() const; + void setLoginPage(const std::string& login_page); + const std::string& getLoginPage(); void forceDisconnect(const LLString& msg); // Force disconnection, with a message to the user. void badNetworkHandler(); // Cause a crash state due to bad network packet. @@ -122,26 +125,23 @@ public: virtual void forceErrorInifiniteLoop(); virtual void forceErrorSoftwareException(); - void loadSettingsFromDirectory(ELLPath path_index); protected: virtual bool initWindow(); // Initialize the viewer's window. virtual bool initLogging(); // Initialize log files, logging system, return false on failure. - virtual void initConsole() {}; // Initialize OS level debugging console. virtual bool initHardwareTest() { return true; } // A false result indicates the app should quit. - - virtual bool initParseCommandLine(LLCommandLineParser& clp) - { return true; } // Allow platforms to specify the command line args. virtual std::string generateSerialNumber() = 0; // Platforms specific classes generate this. private: + bool initEarlyConfiguration(); // Initialize setting needed by crash reporting. bool initThreads(); // Initialize viewer threads, return false on failure. bool initConfiguration(); // Initialize settings from the command line/config file. bool initCache(); // Initialize local client cache. - void purgeCache(); // Clear the local cache. + + bool doConfigFromCommandLine(); // calls parse args. void cleanupSavedSettings(); // Sets some config data to current or default values during cleanup. void removeCacheFiles(const char *filemask); // Deletes cached files the match the given wildcard. @@ -186,8 +186,6 @@ private: bool mQuitRequested; // User wants to quit, may have modified documents open. bool mLogoutRequestSent; // Disconnect message sent to simulator, no longer safe to send messages to the sim. - S32 mYieldTime; - LLSD mSettingsFileList; }; // consts from viewer.h @@ -198,16 +196,31 @@ const S32 AGENT_UPDATES_PER_SECOND = 10; // // "// llstartup" indicates that llstartup is the only client for this global. +extern bool gVerifySSLCert; // parse_args setting used by llxmlrpctransaction.cpp extern BOOL gHandleKeysAsync; // gSavedSettings used by llviewerdisplay.cpp & llviewermenu.cpp +extern BOOL gProbeHardware; extern LLString gDisabledMessage; // llstartup extern BOOL gHideLinks; // used by llpanellogin, lllfloaterbuycurrency, llstartup extern LLSD gDebugInfo; extern BOOL gAllowIdleAFK; +extern F32 gAFKTimeout; extern BOOL gShowObjectUpdates; +extern BOOL gLogMessages; // llstartup +extern std::string gChannelName; +extern BOOL gUseAudio; // llstartup + +extern LLString gCmdLineFirstName; // llstartup +extern LLString gCmdLineLastName; +extern LLString gCmdLinePassword; + +extern BOOL gAutoLogin; // llstartup extern const char* DEFAULT_SETTINGS_FILE; // llstartup +extern BOOL gRequestInventoryLibrary; // llstartup +extern BOOL gGodConnect; // llstartup + extern BOOL gAcceptTOS; extern BOOL gAcceptCriticalMessage; @@ -252,6 +265,7 @@ extern LLUUID gInventoryLibraryOwner; extern LLUUID gInventoryLibraryRoot; extern BOOL gDisconnected; +extern BOOL gDisableVoice; // Map scale in pixels per region extern F32 gMapScale; @@ -261,6 +275,9 @@ extern LLFrameTimer gRestoreGLTimer; extern BOOL gRestoreGL; extern BOOL gUseWireframe; +extern F32 gMouseSensitivity; +extern BOOL gInvertMouse; + // VFS globals - gVFS is for general use // gStaticVFS is read-only and is shipped w/ the viewer // it has pre-cache data like the UI .TGAs @@ -268,6 +285,9 @@ extern LLVFS *gStaticVFS; extern LLMemoryInfo gSysMemory; +extern bool gPreloadImages; +extern bool gPreloadSounds; + extern LLString gLastVersionChannel; extern LLVector3 gWindVec; @@ -278,7 +298,10 @@ extern BOOL gPrintMessagesThisFrame; extern LLUUID gSunTextureID; extern LLUUID gMoonTextureID; +extern BOOL gUseConsole; + extern BOOL gRandomizeFramerate; extern BOOL gPeriodicSlowFrame; +extern BOOL gQAMode; #endif // LL_LLAPPVIEWER_H diff --git a/indra/newview/llappviewerlinux.cpp b/indra/newview/llappviewerlinux.cpp index c36dd2955e..1993fd0a76 100644 --- a/indra/newview/llappviewerlinux.cpp +++ b/indra/newview/llappviewerlinux.cpp @@ -31,11 +31,9 @@ #include "llviewerprecompiledheaders.h" +#include "llmemtype.h" #include "llappviewerlinux.h" -#include "llcommandlineparser.h" - -#include "llmemtype.h" #include "llviewernetwork.h" #include "llmd5.h" @@ -56,12 +54,6 @@ # include #endif -namespace -{ - int gArgC = 0; - char **gArgV = NULL; -} - int main( int argc, char **argv ) { LLMemType mt1(LLMemType::MTYPE_STARTUP); @@ -70,14 +62,18 @@ int main( int argc, char **argv ) asm ("ta\t6"); // NOTE: Make sure memory alignment is enforced on SPARC #endif - gArgC = argc; - gArgV = argv; - LLAppViewer* viewer_app_ptr = new LLAppViewerLinux(); viewer_app_ptr->setErrorHandler(LLAppViewer::handleViewerCrash); - bool ok = viewer_app_ptr->init(); + bool ok = viewer_app_ptr->tempStoreCommandOptions(argc, argv); + if(!ok) + { + llwarns << "Unable to parse command line." << llendl; + return -1; + } + + ok = viewer_app_ptr->init(); if(!ok) { llwarns << "Application init failed." << llendl; @@ -325,7 +321,7 @@ void LLAppViewerLinux::handleCrashReporting() {(char*)cmd.c_str(), ask_dialog, (char*)"-user", - (char*)gGridName.c_str(), + (char*)gGridName, (char*)"-name", (char*)LLAppViewer::instance()->getSecondLifeTitle().c_str(), NULL}; @@ -407,12 +403,6 @@ bool LLAppViewerLinux::initLogging() return LLAppViewer::initLogging(); } -bool LLAppViewerLinux::initParseCommandLine(LLCommandLineParser& clp) -{ - clp.parseCommandLine(gArgC, gArgV); - return true; -} - std::string LLAppViewerLinux::generateSerialNumber() { char serial_md5[MD5HEX_STR_SIZE]; diff --git a/indra/newview/llappviewerlinux.h b/indra/newview/llappviewerlinux.h index ce91b6b8b6..f38a64a8cd 100644 --- a/indra/newview/llappviewerlinux.h +++ b/indra/newview/llappviewerlinux.h @@ -36,8 +36,6 @@ #include "llappviewer.h" #endif -class LLCommandLineParser; - class LLAppViewerLinux : public LLAppViewer { public: @@ -56,7 +54,6 @@ protected: virtual void handleCrashReporting(); virtual bool initLogging(); - virtual bool initParseCommandLine(LLCommandLineParser& clp); }; #endif // LL_LLAPPVIEWERLINUX_H diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index ba3f28911f..2d7091a075 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -36,8 +36,6 @@ #endif #include "llappviewermacosx.h" -#include "llcommandlineparser.h" - #include "llmemtype.h" #include "llviewernetwork.h" @@ -47,13 +45,6 @@ #include "llurldispatcher.h" #include -namespace -{ - // The command line args stored. - // They are not used immediately by the app. - int gArgC; - char** gArgV; -} int main( int argc, char **argv ) { @@ -70,11 +61,14 @@ int main( int argc, char **argv ) viewer_app_ptr->setErrorHandler(LLAppViewer::handleViewerCrash); - // Store off the command line args for use later. - gArgC = argc; - gArgV = argv; - - bool ok = viewer_app_ptr->init(); + bool ok = viewer_app_ptr->tempStoreCommandOptions(argc, argv); + if(!ok) + { + llwarns << "Unable to parse command line." << llendl; + return -1; + } + + ok = viewer_app_ptr->init(); if(!ok) { llwarns << "Application init failed." << llendl; @@ -114,27 +108,6 @@ bool LLAppViewerMacOSX::init() return LLAppViewer::init(); } -bool LLAppViewerMacOSX::initParseCommandLine(LLCommandLineParser& clp) -{ - // First parse the command line, not often used on the mac. - clp.parseCommandLine(gArgC, gArgV); - - // Now read in the args from arguments txt. - // Succesive calls to clp.parse... will NOT override earlier - // options. - const char* filename = "arguments.txt"; - llifstream ifs(filename, llifstream::binary); - if (!ifs.is_open()) - { - llwarns << "Unable to open file" << filename << llendl; - return false; - } - - - clp.parseCommandLineFile(ifs); - return true; -} - void LLAppViewerMacOSX::handleCrashReporting() { // Macintosh diff --git a/indra/newview/llappviewermacosx.h b/indra/newview/llappviewermacosx.h index cc4a7f5eb5..2c61e5a01c 100644 --- a/indra/newview/llappviewermacosx.h +++ b/indra/newview/llappviewermacosx.h @@ -51,7 +51,6 @@ public: protected: virtual void handleCrashReporting(); std::string generateSerialNumber(); - virtual bool initParseCommandLine(LLCommandLineParser& clp); }; #endif // LL_LLAPPVIEWERMACOSX_H diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index fb726e7c97..09bcf6f7cc 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -55,13 +55,41 @@ #include "llviewernetwork.h" #include "llmd5.h" -#include "llcommandlineparser.h" +void fill_args(int& argc, char** argv, const S32 max_args, LPSTR cmd_line) +{ + char *token = NULL; + if( cmd_line[0] == '\"' ) + { + // Exe name is enclosed in quotes + token = strtok( cmd_line, "\"" ); + argv[argc++] = token; + token = strtok( NULL, " \t," ); + } + else + { + // Exe name is not enclosed in quotes + token = strtok( cmd_line, " \t," ); + } + while( (token != NULL) && (argc < max_args) ) + { + argv[argc++] = token; + /* Get next token: */ + if (*(token + strlen(token) + 1) == '\"') /* Flawfinder: ignore*/ + { + token = strtok( NULL, "\""); + } + else + { + token = strtok( NULL, " \t," ); + } + } +} + +// *NOTE:Mani - this code is stolen from LLApp, where its never actually used. LONG WINAPI viewer_windows_exception_handler(struct _EXCEPTION_POINTERS *exception_infop) { - // *NOTE:Mani - this code is stolen from LLApp, where its never actually used. - - // Translate the signals/exceptions into cross-platform stuff + // Translate the signals/exceptions into cross-platform stuff // Windows implementation llinfos << "Entering Windows Exception Handler..." << llendl; @@ -116,7 +144,21 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, // *FIX: global gIconResource = MAKEINTRESOURCE(IDI_LL_ICON); - LLAppViewerWin32* viewer_app_ptr = new LLAppViewerWin32(lpCmdLine); + // In Win32, we need to generate argc and argv ourselves... + // Note: GetCommandLine() returns a potentially return a LPTSTR + // which can resolve to a LPWSTR (unicode string). + // (That's why it's different from lpCmdLine which is a LPSTR.) + // We don't currently do unicode, so call the non-unicode version + // directly. + LPSTR cmd_line_including_exe_name = GetCommandLineA(); + + const S32 MAX_ARGS = 100; + int argc = 0; + char* argv[MAX_ARGS]; /* Flawfinder: ignore */ + + fill_args(argc, argv, MAX_ARGS, cmd_line_including_exe_name); + + LLAppViewerWin32* viewer_app_ptr = new LLAppViewerWin32(); // *FIX:Mani This method is poorly named, since the exception // is now handled by LLApp. @@ -138,6 +180,13 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, viewer_app_ptr->setErrorHandler(LLAppViewer::handleViewerCrash); + ok = viewer_app_ptr->tempStoreCommandOptions(argc, argv); + if(!ok) + { + llwarns << "Unable to parse command line." << llendl; + return -1; + } + ok = viewer_app_ptr->init(); if(!ok) { @@ -259,8 +308,7 @@ void create_console() setvbuf( stderr, NULL, _IONBF, 0 ); } -LLAppViewerWin32::LLAppViewerWin32(const char* cmd_line) : - mCmdLine(cmd_line) +LLAppViewerWin32::LLAppViewerWin32() { } @@ -291,11 +339,15 @@ bool LLAppViewerWin32::cleanup() return result; } -void LLAppViewerWin32::initConsole() +bool LLAppViewerWin32::initWindow() { - // pop up debug console - create_console(); - return LLAppViewer::initConsole(); + // pop up debug console if necessary + if (gUseConsole && gSavedSettings.getBOOL("ShowConsoleWindow")) + { + create_console(); + } + + return LLAppViewer::initWindow(); } void write_debug_dx(const char* str) @@ -316,7 +368,7 @@ bool LLAppViewerWin32::initHardwareTest() // Do driver verification and initialization based on DirectX // hardware polling and driver versions // - if (FALSE == gSavedSettings.getBOOL("NoHardwareProbe")) + if (gProbeHardware) { BOOL vram_only = !gSavedSettings.getBOOL("ProbeHardwareOnStartup"); @@ -379,11 +431,6 @@ bool LLAppViewerWin32::initHardwareTest() return true; } -bool LLAppViewerWin32::initParseCommandLine(LLCommandLineParser& clp) -{ - return clp.parseCommandLineString(mCmdLine); -} - void LLAppViewerWin32::handleCrashReporting() { // Windows only behaivor. Spawn win crash reporter. @@ -439,4 +486,4 @@ std::string LLAppViewerWin32::generateSerialNumber() llwarns << "GetVolumeInformation failed" << llendl; } return serial_md5; -} +} \ No newline at end of file diff --git a/indra/newview/llappviewerwin32.h b/indra/newview/llappviewerwin32.h index 66653c48f5..23e7337618 100644 --- a/indra/newview/llappviewerwin32.h +++ b/indra/newview/llappviewerwin32.h @@ -39,7 +39,7 @@ class LLAppViewerWin32 : public LLAppViewer { public: - LLAppViewerWin32(const char* cmd_line); + LLAppViewerWin32(); virtual ~LLAppViewerWin32(); // @@ -49,18 +49,15 @@ public: virtual bool cleanup(); protected: - virtual void initConsole(); // Initialize OS level debugging console. + virtual bool initWindow(); // Initialize the viewer's window. virtual bool initHardwareTest(); // Win32 uses DX9 to test hardware. - virtual bool initParseCommandLine(LLCommandLineParser& clp); - - virtual void handleCrashReporting(); + virtual void handleCrashReporting(); std::string generateSerialNumber(); private: void disableWinErrorReporting(); - std::string mCmdLine; }; #endif // LL_LLAPPVIEWERWIN32_H diff --git a/indra/newview/llcommandlineparser.cpp b/indra/newview/llcommandlineparser.cpp deleted file mode 100644 index 2f99ca1247..0000000000 --- a/indra/newview/llcommandlineparser.cpp +++ /dev/null @@ -1,535 +0,0 @@ -/** - * @file llcommandlineparser.cpp - * @brief The LLCommandLineParser class definitions - * - * $LicenseInfo:firstyear=2007&license=viewergpl$ - * - * Copyright (c) 2007, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" -#include "llcommandlineparser.h" - -// *NOTE: The boost::lexical_cast generates -// the warning C4701(local used with out assignment) in VC7.1. -// Disable the warning for the boost includes. -#if _MSC_VER -# pragma warning(push) -# pragma warning( disable : 4701 ) -#else -// NOTE: For the other platforms? -#endif - -#include -#include -#include - -#if _MSC_VER -# pragma warning(pop) -#endif - -#include "llsdserialize.h" -#include -#include - -#include "llcontrol.h" - -namespace po = boost::program_options; - -// *NTOE:MEP - Currently the boost object reside in file scope. -// This has a couple of negatives, they are always around and -// there can be only one instance of each. -// The plus is that the boost-ly-ness of this implementation is -// hidden from the rest of the world. -// Its importatnt to realize that multiple LLCommandLineParser objects -// will all have this single repository of option escs and parsed options. -// This could be good or bad, and probably won't matter for most use cases. -namespace -{ - po::options_description gOptionsDesc; - po::positional_options_description gPositionalOptions; - po::variables_map gVariableMap; - - const LLCommandLineParser::token_vector_t gEmptyValue; - - void read_file_into_string(std::string& str, const std::basic_istream < char >& file) - { - std::ostringstream oss; - oss << file.rdbuf(); - str = oss.str(); - } - - bool gPastLastOption = false; -} - -class LLCLPError : public std::logic_error { -public: - LLCLPError(const std::string& what) : std::logic_error(what) {} -}; - -class LLCLPLastOption : public std::logic_error { -public: - LLCLPLastOption(const std::string& what) : std::logic_error(what) {} -}; - -class LLCLPValue : public po::value_semantic_codecvt_helper -{ - unsigned mMinTokens; - unsigned mMaxTokens; - bool mIsComposing; - typedef boost::function1 notify_callback_t; - notify_callback_t mNotifyCallback; - bool mLastOption; - -public: - LLCLPValue() : - mMinTokens(0), - mMaxTokens(0), - mIsComposing(false), - mLastOption(false) - {} - - virtual ~LLCLPValue() {}; - - void setMinTokens(unsigned c) - { - mMinTokens = c; - } - - void setMaxTokens(unsigned c) - { - mMaxTokens = c; - } - - void setComposing(bool c) - { - mIsComposing = c; - } - - void setLastOption(bool c) - { - mLastOption = c; - } - - void setNotifyCallback(notify_callback_t f) - { - mNotifyCallback = f; - } - - // Overrides to support the value_semantic interface. - virtual std::string name() const - { - const std::string arg("arg"); - const std::string args("args"); - return (max_tokens() > 1) ? args : arg; - } - - virtual unsigned min_tokens() const - { - return mMinTokens; - } - - virtual unsigned max_tokens() const - { - return mMaxTokens; - } - - virtual bool is_composing() const - { - return mIsComposing; - } - - virtual bool apply_default(boost::any& value_store) const - { - return false; // No defaults. - } - - virtual void notify(const boost::any& value_store) const - { - const LLCommandLineParser::token_vector_t* value = - boost::any_cast(&value_store); - if(mNotifyCallback) - { - mNotifyCallback(*value); - } - - } - -protected: - void xparse(boost::any& value_store, - const std::vector& new_tokens) const - { - if(gPastLastOption) - { - throw(LLCLPLastOption("Don't parse no more!")); - } - - // Error checks. Needed? - if (!value_store.empty() && !is_composing()) - { - throw(LLCLPError("Non composing value with multiple occurences.")); - } - if (new_tokens.size() < min_tokens() || new_tokens.size() > max_tokens()) - { - throw(LLCLPError("Illegal number of tokens specified.")); - } - - if(value_store.empty()) - { - value_store = boost::any(LLCommandLineParser::token_vector_t()); - } - LLCommandLineParser::token_vector_t* tv = - boost::any_cast(&value_store); - - for(unsigned i = 0; i < new_tokens.size() && i < mMaxTokens; ++i) - { - tv->push_back(new_tokens[i]); - } - - if(mLastOption) - { - gPastLastOption = true; - } - } -}; - -//---------------------------------------------------------------------------- -// LLCommandLineParser defintions -//---------------------------------------------------------------------------- -void LLCommandLineParser::addOptionDesc(const LLString& option_name, - boost::function1 notify_callback, - unsigned int token_count, - const LLString& description, - const LLString& short_name, - bool composing, - bool positional, - bool last_option) -{ - // Compose the name for boost::po. - // It takes the format "long_name, short name" - const LLString comma(","); - LLString boost_option_name = option_name; - if(short_name != LLString::null) - { - boost_option_name += comma; - boost_option_name += short_name; - } - - LLCLPValue* value_desc = new LLCLPValue(); - value_desc->setMinTokens(token_count); - value_desc->setMaxTokens(token_count); - value_desc->setComposing(composing); - value_desc->setLastOption(last_option); - - boost::shared_ptr d( - new po::option_description(boost_option_name.c_str(), - value_desc, - description.c_str())); - - if(!notify_callback.empty()) - { - value_desc->setNotifyCallback(notify_callback); - } - - gOptionsDesc.add(d); - - if(positional) - { - gPositionalOptions.add(boost_option_name.c_str(), token_count); - } -} - -bool parseAndStoreResults(po::command_line_parser& clp) -{ - try - { - clp.options(gOptionsDesc); - clp.positional(gPositionalOptions); - clp.style(po::command_line_style::default_style - | po::command_line_style::allow_long_disguise); - po::basic_parsed_options opts = clp.run(); - po::store(opts, gVariableMap); - } - catch(po::error& e) - { - llwarns << "Caught Error:" << e.what() << llendl; - return false; - } - catch(LLCLPError& e) - { - llwarns << "Caught Error:" << e.what() << llendl; - return false; - } - catch(LLCLPLastOption&) - { - // Continue without parsing. - llwarns << "Found tokens past last option. Ignoring." << llendl; - - // boost::po will have stored a mal-formed option. - // All such options will be removed below. - for(po::variables_map::iterator i = gVariableMap.begin(); i != gVariableMap.end();) - { - po::variables_map::iterator tempI = i++; - if(tempI->second.empty()) - { - gVariableMap.erase(tempI); - } - } - } - return true; -} - -bool LLCommandLineParser::parseCommandLine(int argc, char **argv) -{ - po::command_line_parser clp(argc, argv); - return parseAndStoreResults(clp); -} - -bool LLCommandLineParser::parseCommandLineString(const std::string& str) -{ - // Split the string content into tokens - boost::escaped_list_separator sep("\\", "\r\n ", "\"'"); - boost::tokenizer< boost::escaped_list_separator > tok(str, sep); - std::vector tokens; - // std::copy(tok.begin(), tok.end(), std::back_inserter(tokens)); - for(boost::tokenizer< boost::escaped_list_separator >::iterator i = tok.begin(); - i != tok.end(); - ++i) - { - if(0 != i->size()) - { - tokens.push_back(*i); - } - } - - po::command_line_parser clp(tokens); - return parseAndStoreResults(clp); - -} - -bool LLCommandLineParser::parseCommandLineFile(const std::basic_istream < char >& file) -{ - std::string args; - read_file_into_string(args, file); - - return parseCommandLineString(args); -} - -void LLCommandLineParser::notify() -{ - po::notify(gVariableMap); -} - -void LLCommandLineParser::printOptions() const -{ - for(po::variables_map::iterator i = gVariableMap.begin(); i != gVariableMap.end(); ++i) - { - std::string name = i->first; - token_vector_t values = i->second.as(); - std::ostringstream oss; - oss << name << ": "; - for(token_vector_t::iterator t_itr = values.begin(); t_itr != values.end(); ++t_itr) - { - oss << t_itr->c_str() << " "; - } - llinfos << oss.str() << llendl; - } -} - -std::ostream& LLCommandLineParser::printOptionsDesc(std::ostream& os) const -{ - return os << gOptionsDesc; -} - -bool LLCommandLineParser::hasOption(const std::string& name) const -{ - return gVariableMap.count(name) > 0; -} - -const LLCommandLineParser::token_vector_t& LLCommandLineParser::getOption(const std::string& name) const -{ - if(hasOption(name)) - { - return gVariableMap[name].as(); - } - - return gEmptyValue; -} - -//---------------------------------------------------------------------------- -// LLControlGroupCLP defintions -//---------------------------------------------------------------------------- -void setControlValueCB(const LLCommandLineParser::token_vector_t& value, - const LLString& opt_name, - LLControlGroup* ctrlGroup) -{ - if(value.size() > 1) - { - llwarns << "Ignoring extra tokens mapped to the setting: " << opt_name << "." << llendl; - } - - // *FIX: Do sematic conversion here. - // LLSD (ImplString) Is no good for doing string to type conversion for... - // booleans - // compound types - // ?... - - LLControlVariable* ctrl = ctrlGroup->getControl(opt_name); - if(NULL != ctrl) - { - switch(ctrl->type()) - { - case TYPE_BOOLEAN: - if(value.size() > 1) - { - llwarns << "Ignoring extra tokens." << llendl; - } - - if(value.size() > 0) - { - // There's a token. check the string for true/false/1/0 etc. - BOOL result = false; - BOOL gotSet = LLString::convertToBOOL(value[0], result); - if(gotSet) - { - ctrl->setValue(LLSD(result), false); - } - } - else - { - ctrl->setValue(LLSD(true), false); - } - break; - - default: - { - // For the default types, let llsd do the conversion. - if(value.size() > 1) - { - // Assume its an array... - LLSD llsdArray; - for(unsigned int i = 0; i < value.size(); ++i) - { - LLSD llsdValue; - llsdValue.assign(LLSD::String(value[i])); - llsdArray.set(i, llsdValue); - } - - ctrl->setValue(llsdArray, false); - } - else if(value.size() > 0) - { - LLSD llsdValue; - llsdValue.assign(LLSD::String(value[0])); - ctrl->setValue(llsdValue, false); - } - } - break; - } - } - else - { - llwarns << "Command Line option mapping '" - << opt_name - << "' not found! Ignoring." - << llendl; - } -} - -void LLControlGroupCLP::configure(const LLString& config_filename, LLControlGroup* controlGroup) -{ - // This method reads the llsd based config file, and uses it to set - // members of a control group. - LLSD clpConfigLLSD; - - llifstream input_stream; - input_stream.open(config_filename.c_str(), std::ios::in | std::ios::binary); - - if(input_stream.is_open()) - { - LLSDSerialize::fromXML(clpConfigLLSD, input_stream); - for(LLSD::map_iterator option_itr = clpConfigLLSD.beginMap(); - option_itr != clpConfigLLSD.endMap(); - ++option_itr) - { - LLSD::String long_name = option_itr->first; - LLSD option_params = option_itr->second; - - LLString desc("n/a"); - if(option_params.has("desc")) - { - desc = option_params["desc"].asString(); - } - - LLString short_name = LLString::null; - if(option_params.has("short")) - { - short_name = option_params["short"].asString(); - } - - unsigned int token_count = 0; - if(option_params.has("count")) - { - token_count = option_params["count"].asInteger(); - } - - bool composing = false; - if(option_params.has("compose")) - { - composing = option_params["compose"].asBoolean(); - } - - bool positional = false; - if(option_params.has("positional")) - { - positional = option_params["positional"].asBoolean(); - } - - bool last_option = false; - if(option_params.has("last_option")) - { - last_option = option_params["last_option"].asBoolean(); - } - - boost::function1 callback; - if(option_params.has("map-to") && (NULL != controlGroup)) - { - LLString controlName = option_params["map-to"].asString(); - callback = boost::bind(setControlValueCB, _1, - controlName, controlGroup); - } - - this->addOptionDesc( - long_name, - callback, - token_count, - desc, - short_name, - composing, - positional, - last_option); - } - } -} diff --git a/indra/newview/llcommandlineparser.h b/indra/newview/llcommandlineparser.h deleted file mode 100644 index 6cc40ee8b4..0000000000 --- a/indra/newview/llcommandlineparser.h +++ /dev/null @@ -1,131 +0,0 @@ -/** - * @file llcommandlineparser.h - * @brief LLCommandLineParser class declaration - * - * $LicenseInfo:firstyear=2007&license=viewergpl$ - * - * Copyright (c) 2007, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ -*/ - -#ifndef LL_LLCOMMANDLINEPARSER_H -#define LL_LLCOMMANDLINEPARSER_H - -#include - -/** - * @class LLCommandLineParser - * @brief Handle defining and parsing the command line. - */ -class LLCommandLineParser -{ -public: - typedef std::vector< std::string > token_vector_t; - - /** - * @brief Add a value-less option to the command line description. - * @param option_name The long name of the cmd-line option. - * @param description The text description of the option usage. - */ - void addOptionDesc( - const LLString& option_name, - boost::function1 notify_callback = 0, - unsigned int num_tokens = 0, - const LLString& description = LLString::null, - const LLString& short_name = LLString::null, - bool composing = false, - bool positional = false, - bool last_option = false); - - - /** - * @brief Parse the command line given by argc/argv. - */ - bool parseCommandLine(int argc, char **argv); - - /** - * @brief Parse the command line contained by the given file. - */ - bool parseCommandLineString(const std::string& str); - - /** - * @brief Parse the command line contained by the given file. - */ - bool parseCommandLineFile(const std::basic_istream< char >& file); - - /** - * @brief Call callbacks associated with option descriptions. - * - * Use this to handle the results of parsing. - */ - void notify(); - - /** @brief Print a description of the configured options. - * - * Use this to print a description of options to the - * given ostream. Useful for displaying usage info. - */ - std::ostream& printOptionsDesc(std::ostream& os) const; - - /** @brief Manual option setting accessors. - * - * Use these to retrieve get the values set for an option. - * getOption will return an empty value if the option isn't - * set. - */ - bool hasOption(const std::string& name) const; - const token_vector_t& getOption(const std::string& name) const; - - void printOptions() const; -}; - -inline std::ostream& operator<<(std::ostream& out, const LLCommandLineParser& clp) -{ - return clp.printOptionsDesc(out); -} - -class LLControlGroup; - -/** - * @class LLControlGroupCLP - * @brief Uses the CLP to configure an LLControlGroup - * - * - */ -class LLControlGroupCLP : public LLCommandLineParser -{ -public: - /** - * @brief Configure the command line parser according the given config file. - * - * @param config_filename The name of the XML based LLSD config file. - * @param clp A reference to the command line parser object to configure. - * - * *FIX:Mani Specify config file format. - */ - void configure(const LLString& config_filename, - LLControlGroup* controlGroup); -}; - -#endif // LL_LLCOMMANDLINEPARSER_H diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index e6fcfb6d40..bf7d48f911 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -483,7 +483,7 @@ void LLFeatureManager::applyFeatures(bool skipFeatures) } // get the control setting - LLControlVariable* ctrl = gSavedSettings.getControl(mIt->first); + LLControlBase* ctrl = gSavedSettings.getControl(mIt->first); if(ctrl == NULL) { llwarns << "AHHH! Control setting " << mIt->first << " does not exist!" << llendl; diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp index b00450eec6..97ebc02ba1 100644 --- a/indra/newview/llfirstuse.cpp +++ b/indra/newview/llfirstuse.cpp @@ -49,8 +49,7 @@ std::set LLFirstUse::sConfigVariables; // static void LLFirstUse::addConfigVariable(const LLString& var) { - //Don't add the warning, now that we're storing the default in the settings_default.xml file - //gSavedSettings.addWarning(var); + gSavedSettings.addWarning(var); sConfigVariables.insert(var); } @@ -257,15 +256,13 @@ void LLFirstUse::useSculptedPrim() // static void LLFirstUse::useVoice() { - if (!gSavedSettings.getBOOL("CmdLineDisableVoice")) - { - if (gSavedSettings.getWarning("FirstVoice")) - { - gSavedSettings.setWarning("FirstVoice", FALSE); - - LLFloaterVoiceWizard::showInstance(); - } - } + if (gDisableVoice) return; + if (gSavedSettings.getWarning("FirstVoice")) + { + gSavedSettings.setWarning("FirstVoice", FALSE); + + LLFloaterVoiceWizard::showInstance(); + } } // static diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 3a1fc6146a..4edf6f3652 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -84,7 +84,7 @@ LLFloaterAbout::LLFloaterAbout() + llformat(" %d.%d.%d (%d) %s %s (%s)", LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VIEWER_BUILD, __DATE__, __TIME__, - gSavedSettings.getString("VersionChannelName").c_str()); + gChannelName.c_str()); support.append(version); support.append("\n\n"); diff --git a/indra/newview/llfloatergroups.cpp b/indra/newview/llfloatergroups.cpp index 7a0f01e5a6..4573ca75d2 100644 --- a/indra/newview/llfloatergroups.cpp +++ b/indra/newview/llfloatergroups.cpp @@ -173,7 +173,8 @@ bool LLPanelGroups::handleEvent(LLPointer event, const LLSD& userdata) reset(); return true; } - return false; + + return LLView::handleEvent(event, userdata); } // Default constructor diff --git a/indra/newview/llfloatergroups.h b/indra/newview/llfloatergroups.h index 6d99f34085..a1740861d5 100644 --- a/indra/newview/llfloatergroups.h +++ b/indra/newview/llfloatergroups.h @@ -83,7 +83,7 @@ protected: static instance_map_t sInstances; }; -class LLPanelGroups : public LLPanel, public LLSimpleListener +class LLPanelGroups : public LLPanel { public: LLPanelGroups(); diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 345561f551..584d7479e4 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -446,7 +446,7 @@ void LLFloaterPreference::onBtnOK( void* userdata ) fp->apply(); fp->close(false); - gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); + gSavedSettings.saveToFile( gSettingsFileName, TRUE ); std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); // save all settings, even if equals defaults diff --git a/indra/newview/llfloatersettingsdebug.cpp b/indra/newview/llfloatersettingsdebug.cpp deleted file mode 100644 index 7975bd95ef..0000000000 --- a/indra/newview/llfloatersettingsdebug.cpp +++ /dev/null @@ -1,490 +0,0 @@ -/** - * @file llfloatersettingsdebug.cpp - * @brief floater for debugging internal viewer settings - * - * $LicenseInfo:firstyear=2001&license=viewergpl$ - * - * Copyright (c) 2001-2007, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" -#include "llfloatersettingsdebug.h" -#include "llfloater.h" -#include "llvieweruictrlfactory.h" -#include "llfirstuse.h" -#include "llcombobox.h" -#include "llspinctrl.h" -#include "llcolorswatch.h" -#include "llviewercontrol.h" - -LLFloaterSettingsDebug* LLFloaterSettingsDebug::sInstance = NULL; - -LLFloaterSettingsDebug::LLFloaterSettingsDebug() : LLFloater("Configuration Editor") -{ -} - -LLFloaterSettingsDebug::~LLFloaterSettingsDebug() -{ - sInstance = NULL; -} - -BOOL LLFloaterSettingsDebug::postBuild() -{ - LLComboBox* settings_combo = LLUICtrlFactory::getComboBoxByName(this, "settings_combo"); - - struct f : public LLControlGroup::ApplyFunctor - { - LLComboBox* combo; - f(LLComboBox* c) : combo(c) {} - virtual void apply(const LLString& name, LLControlVariable* control) - { - combo->add(name, (void*)control); - } - } func(settings_combo); - - gSavedSettings.applyToAll(&func); - gSavedPerAccountSettings.applyToAll(&func); - gColors.applyToAll(&func); - - settings_combo->sortByName(); - settings_combo->setCommitCallback(onSettingSelect); - settings_combo->setCallbackUserData(this); - settings_combo->updateSelection(); - - childSetCommitCallback("val_spinner_1", onCommitSettings); - childSetUserData("val_spinner_1", this); - childSetCommitCallback("val_spinner_2", onCommitSettings); - childSetUserData("val_spinner_2", this); - childSetCommitCallback("val_spinner_3", onCommitSettings); - childSetUserData("val_spinner_3", this); - childSetCommitCallback("val_spinner_4", onCommitSettings); - childSetUserData("val_spinner_4", this); - childSetCommitCallback("val_text", onCommitSettings); - childSetUserData("val_text", this); - childSetCommitCallback("boolean_combo", onCommitSettings); - childSetUserData("boolean_combo", this); - childSetCommitCallback("color_swatch", onCommitSettings); - childSetUserData("color_swatch", this); - childSetAction("default_btn", onClickDefault, this); - mComment = getChild("comment_text"); - return TRUE; -} - -void LLFloaterSettingsDebug::draw() -{ - LLComboBox* settings_combo = getChild("settings_combo"); - LLControlVariable* controlp = (LLControlVariable*)settings_combo->getCurrentUserdata(); - updateControl(controlp); - - LLFloater::draw(); -} - -//static -void LLFloaterSettingsDebug::show(void*) -{ - if (sInstance == NULL) - { - sInstance = new LLFloaterSettingsDebug(); - - gUICtrlFactory->buildFloater(sInstance, "floater_settings_debug.xml"); - } - - sInstance->open(); /* Flawfinder: ignore */ -} - -//static -void LLFloaterSettingsDebug::onSettingSelect(LLUICtrl* ctrl, void* user_data) -{ - LLFloaterSettingsDebug* floaterp = (LLFloaterSettingsDebug*)user_data; - LLComboBox* combo_box = (LLComboBox*)ctrl; - LLControlVariable* controlp = (LLControlVariable*)combo_box->getCurrentUserdata(); - - floaterp->updateControl(controlp); -} - -//static -void LLFloaterSettingsDebug::onCommitSettings(LLUICtrl* ctrl, void* user_data) -{ - LLFloaterSettingsDebug* floaterp = (LLFloaterSettingsDebug*)user_data; - - LLComboBox* settings_combo = floaterp->getChild("settings_combo"); - LLControlVariable* controlp = (LLControlVariable*)settings_combo->getCurrentUserdata(); - - LLVector3 vector; - LLVector3d vectord; - LLRect rect; - LLColor4 col4; - LLColor3 col3; - LLColor4U col4U; - LLColor4 color_with_alpha; - - switch(controlp->type()) - { - case TYPE_U32: - controlp->set(floaterp->childGetValue("val_spinner_1")); - break; - case TYPE_S32: - controlp->set(floaterp->childGetValue("val_spinner_1")); - break; - case TYPE_F32: - controlp->set(LLSD(floaterp->childGetValue("val_spinner_1").asReal())); - break; - case TYPE_BOOLEAN: - controlp->set(floaterp->childGetValue("boolean_combo")); - break; - case TYPE_STRING: - controlp->set(LLSD(floaterp->childGetValue("val_text").asString())); - break; - case TYPE_VEC3: - vector.mV[VX] = (F32)floaterp->childGetValue("val_spinner_1").asReal(); - vector.mV[VY] = (F32)floaterp->childGetValue("val_spinner_2").asReal(); - vector.mV[VZ] = (F32)floaterp->childGetValue("val_spinner_3").asReal(); - controlp->set(vector.getValue()); - break; - case TYPE_VEC3D: - vectord.mdV[VX] = floaterp->childGetValue("val_spinner_1").asReal(); - vectord.mdV[VY] = floaterp->childGetValue("val_spinner_2").asReal(); - vectord.mdV[VZ] = floaterp->childGetValue("val_spinner_3").asReal(); - controlp->set(vectord.getValue()); - break; - case TYPE_RECT: - rect.mLeft = floaterp->childGetValue("val_spinner_1").asInteger(); - rect.mRight = floaterp->childGetValue("val_spinner_2").asInteger(); - rect.mBottom = floaterp->childGetValue("val_spinner_3").asInteger(); - rect.mTop = floaterp->childGetValue("val_spinner_4").asInteger(); - controlp->set(rect.getValue()); - break; - case TYPE_COL4: - col3.setValue(floaterp->childGetValue("color_swatch")); - col4 = LLColor4(col3, (F32)floaterp->childGetValue("val_spinner_4").asReal()); - controlp->set(col4.getValue()); - break; - case TYPE_COL3: - controlp->set(floaterp->childGetValue("color_swatch")); - //col3.mV[VRED] = (F32)floaterp->childGetValue("val_spinner_1").asC(); - //col3.mV[VGREEN] = (F32)floaterp->childGetValue("val_spinner_2").asReal(); - //col3.mV[VBLUE] = (F32)floaterp->childGetValue("val_spinner_3").asReal(); - //controlp->set(col3.getValue()); - break; - case TYPE_COL4U: - col3.setValue(floaterp->childGetValue("color_swatch")); - col4U.setVecScaleClamp(col3); - col4U.mV[VALPHA] = floaterp->childGetValue("val_spinner_4").asInteger(); - controlp->set(col4U.getValue()); - break; - default: - break; - } -} - -// static -void LLFloaterSettingsDebug::onClickDefault(void* user_data) -{ - LLFloaterSettingsDebug* floaterp = (LLFloaterSettingsDebug*)user_data; - LLComboBox* settings_combo = floaterp->getChild("settings_combo"); - LLControlVariable* controlp = (LLControlVariable*)settings_combo->getCurrentUserdata(); - - if (controlp) - { - controlp->resetToDefault(); - floaterp->updateControl(controlp); - } -} - -// we've switched controls, or doing per-frame update, so update spinners, etc. -void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp) -{ - LLSpinCtrl* spinner1 = LLUICtrlFactory::getSpinnerByName(this, "val_spinner_1"); - LLSpinCtrl* spinner2 = LLUICtrlFactory::getSpinnerByName(this, "val_spinner_2"); - LLSpinCtrl* spinner3 = LLUICtrlFactory::getSpinnerByName(this, "val_spinner_3"); - LLSpinCtrl* spinner4 = LLUICtrlFactory::getSpinnerByName(this, "val_spinner_4"); - LLColorSwatchCtrl* color_swatch = getChild("color_swatch"); - - if (!spinner1 || !spinner2 || !spinner3 || !spinner4 || !color_swatch) - { - llwarns << "Could not find all desired controls by name" - << llendl; - return; - } - - spinner1->setVisible(FALSE); - spinner2->setVisible(FALSE); - spinner3->setVisible(FALSE); - spinner4->setVisible(FALSE); - color_swatch->setVisible(FALSE); - childSetVisible("val_text", FALSE); - childSetVisible("boolean_combo", FALSE); - mComment->setText(LLString::null); - - if (controlp) - { - eControlType type = controlp->type(); - mComment->setText(controlp->getComment()); - spinner1->setMaxValue(F32_MAX); - spinner2->setMaxValue(F32_MAX); - spinner3->setMaxValue(F32_MAX); - spinner4->setMaxValue(F32_MAX); - spinner1->setMinValue(-F32_MAX); - spinner2->setMinValue(-F32_MAX); - spinner3->setMinValue(-F32_MAX); - spinner4->setMinValue(-F32_MAX); - if (!spinner1->hasFocus()) - { - spinner1->setIncrement(0.1f); - } - if (!spinner2->hasFocus()) - { - spinner2->setIncrement(0.1f); - } - if (!spinner3->hasFocus()) - { - spinner3->setIncrement(0.1f); - } - if (!spinner4->hasFocus()) - { - spinner4->setIncrement(0.1f); - } - - LLSD sd = controlp->get(); - switch(type) - { - case TYPE_U32: - spinner1->setVisible(TRUE); - spinner1->setLabel(LLString("value")); // Debug, don't translate - if (!spinner1->hasFocus()) - { - spinner1->setValue(sd); - spinner1->setMinValue((F32)U32_MIN); - spinner1->setMaxValue((F32)U32_MAX); - spinner1->setIncrement(1.f); - spinner1->setPrecision(0); - } - break; - case TYPE_S32: - spinner1->setVisible(TRUE); - spinner1->setLabel(LLString("value")); // Debug, don't translate - if (!spinner1->hasFocus()) - { - spinner1->setValue(sd); - spinner1->setMinValue((F32)S32_MIN); - spinner1->setMaxValue((F32)S32_MAX); - spinner1->setIncrement(1.f); - spinner1->setPrecision(0); - } - break; - case TYPE_F32: - spinner1->setVisible(TRUE); - spinner1->setLabel(LLString("value")); // Debug, don't translate - if (!spinner1->hasFocus()) - { - spinner1->setPrecision(3); - spinner1->setValue(sd); - } - break; - case TYPE_BOOLEAN: - childSetVisible("boolean_combo", TRUE); - - if (!childHasFocus("boolean_combo")) - { - if (sd.asBoolean()) - { - childSetValue("boolean_combo", LLSD("true")); - } - else - { - childSetValue("boolean_combo", LLSD("")); - } - } - break; - case TYPE_STRING: - childSetVisible("val_text", TRUE); - if (!childHasFocus("val_text")) - { - childSetValue("val_text", sd); - } - break; - case TYPE_VEC3: - { - LLVector3 v; - v.setValue(sd); - spinner1->setVisible(TRUE); - spinner1->setLabel(LLString("X")); - spinner2->setVisible(TRUE); - spinner2->setLabel(LLString("Y")); - spinner3->setVisible(TRUE); - spinner3->setLabel(LLString("Z")); - if (!spinner1->hasFocus()) - { - spinner1->setPrecision(3); - spinner1->setValue(v[VX]); - } - if (!spinner2->hasFocus()) - { - spinner2->setPrecision(3); - spinner2->setValue(v[VY]); - } - if (!spinner3->hasFocus()) - { - spinner3->setPrecision(3); - spinner3->setValue(v[VZ]); - } - break; - } - case TYPE_VEC3D: - { - LLVector3d v; - v.setValue(sd); - spinner1->setVisible(TRUE); - spinner1->setLabel(LLString("X")); - spinner2->setVisible(TRUE); - spinner2->setLabel(LLString("Y")); - spinner3->setVisible(TRUE); - spinner3->setLabel(LLString("Z")); - if (!spinner1->hasFocus()) - { - spinner1->setPrecision(3); - spinner1->setValue(v[VX]); - } - if (!spinner2->hasFocus()) - { - spinner2->setPrecision(3); - spinner2->setValue(v[VY]); - } - if (!spinner3->hasFocus()) - { - spinner3->setPrecision(3); - spinner3->setValue(v[VZ]); - } - break; - } - case TYPE_RECT: - { - LLRect r; - r.setValue(sd); - spinner1->setVisible(TRUE); - spinner1->setLabel(LLString("Left")); - spinner2->setVisible(TRUE); - spinner2->setLabel(LLString("Right")); - spinner3->setVisible(TRUE); - spinner3->setLabel(LLString("Bottom")); - spinner4->setVisible(TRUE); - spinner4->setLabel(LLString("Top")); - if (!spinner1->hasFocus()) - { - spinner1->setPrecision(0); - spinner1->setValue(r.mLeft); - } - if (!spinner2->hasFocus()) - { - spinner2->setPrecision(0); - spinner2->setValue(r.mRight); - } - if (!spinner3->hasFocus()) - { - spinner3->setPrecision(0); - spinner3->setValue(r.mBottom); - } - if (!spinner4->hasFocus()) - { - spinner4->setPrecision(0); - spinner4->setValue(r.mTop); - } - - spinner1->setMinValue((F32)S32_MIN); - spinner1->setMaxValue((F32)S32_MAX); - spinner1->setIncrement(1.f); - - spinner2->setMinValue((F32)S32_MIN); - spinner2->setMaxValue((F32)S32_MAX); - spinner2->setIncrement(1.f); - - spinner3->setMinValue((F32)S32_MIN); - spinner3->setMaxValue((F32)S32_MAX); - spinner3->setIncrement(1.f); - - spinner4->setMinValue((F32)S32_MIN); - spinner4->setMaxValue((F32)S32_MAX); - spinner4->setIncrement(1.f); - break; - } - case TYPE_COL4: - { - LLColor4 clr; - clr.setValue(sd); - color_swatch->setVisible(TRUE); - // only set if changed so color picker doesn't update - if(clr != LLColor4(color_swatch->getValue())) - { - color_swatch->set(LLColor4(sd), TRUE, FALSE); - } - spinner4->setVisible(TRUE); - spinner4->setLabel(LLString("Alpha")); - if (!spinner4->hasFocus()) - { - spinner4->setPrecision(3); - spinner4->setMinValue(0.0); - spinner4->setMaxValue(1.f); - spinner4->setValue(clr.mV[VALPHA]); - } - break; - } - case TYPE_COL3: - { - LLColor3 clr; - clr.setValue(sd); - color_swatch->setVisible(TRUE); - color_swatch->setValue(sd); - break; - } - case TYPE_COL4U: - { - LLColor4U clr; - clr.setValue(sd); - color_swatch->setVisible(TRUE); - if(LLColor4(clr) != LLColor4(color_swatch->getValue())) - { - color_swatch->set(LLColor4(clr), TRUE, FALSE); - } - spinner4->setVisible(TRUE); - spinner4->setLabel(LLString("Alpha")); - if(!spinner4->hasFocus()) - { - spinner4->setPrecision(0); - spinner4->setValue(clr.mV[VALPHA]); - } - - spinner4->setMinValue(0); - spinner4->setMaxValue(255); - spinner4->setIncrement(1.f); - - break; - } - default: - mComment->setText(LLString("unknown")); - break; - } - } - -} diff --git a/indra/newview/llfloatersettingsdebug.h b/indra/newview/llfloatersettingsdebug.h deleted file mode 100644 index 389a474467..0000000000 --- a/indra/newview/llfloatersettingsdebug.h +++ /dev/null @@ -1,61 +0,0 @@ -/** - * @file llfloatersettingsdebug.h - * @brief floater for debugging internal viewer settings - * - * $LicenseInfo:firstyear=2001&license=viewergpl$ - * - * Copyright (c) 2001-2007, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#ifndef LLFLOATERDEBUGSETTINGS_H -#define LLFLOATERDEBUGSETTINGS_H - -#include "llcontrol.h" -#include "llfloater.h" -#include "lltexteditor.h" - -class LLFloaterSettingsDebug : public LLFloater -{ -public: - LLFloaterSettingsDebug(); - virtual ~LLFloaterSettingsDebug(); - - virtual BOOL postBuild(); - virtual void draw(); - - void updateControl(LLControlVariable* control); - - static void show(void*); - static void onSettingSelect(LLUICtrl* ctrl, void* user_data); - static void onCommitSettings(LLUICtrl* ctrl, void* user_data); - static void onClickDefault(void* user_data); - -protected: - static LLFloaterSettingsDebug* sInstance; - LLTextEditor* mComment; -}; - -#endif //LLFLOATERDEBUGSETTINGS_H - diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index e24b5251e0..7ceb40499f 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -163,6 +163,8 @@ LLNetMap::LLNetMap( mPopupMenuHandle = menu->getHandle(); sInstance = this; + + gSavedSettings.getControl("MiniMapRotate")->addListener(&mNetMapListener); } LLNetMap::~LLNetMap() @@ -826,3 +828,9 @@ void LLNetMap::handleZoomLevel(void* which) break; } } + +bool LLRotateNetMapListener::handleEvent(LLPointer event, const LLSD& user_data) +{ + LLNetMap::setRotateMap(event->getValue().asBoolean()); + return true; +} diff --git a/indra/newview/llnetmap.h b/indra/newview/llnetmap.h index dc696238ea..d375413d1d 100644 --- a/indra/newview/llnetmap.h +++ b/indra/newview/llnetmap.h @@ -45,6 +45,12 @@ class LLCoordGL; class LLTextBox; class LLMenuGL; +class LLRotateNetMapListener : public LLSimpleListener +{ +public: + bool handleEvent(LLPointer, const LLSD& user_data); +}; + class LLNetMap : public LLUICtrl { public: @@ -111,6 +117,8 @@ public: LLTextBox* mTextBoxNorthWest; LLTextBox* mTextBoxSouthWest; + LLRotateNetMapListener mNetMapListener; + static BOOL sRotateMap; static LLNetMap* sInstance; }; diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index b6e8c1a7f3..1e933706e1 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -206,7 +206,7 @@ void LLLoginHandler::parse(const LLSD& queryMap) if (LLAppViewer::instance()->getLoginURIs().size() == 0) { - gGridName = gGridInfo[gGridChoice].mName; /* Flawfinder: ignore */ + snprintf(gGridName, MAX_STRING, "%s", gGridInfo[gGridChoice].mName); /* Flawfinder: ignore */ LLAppViewer::instance()->resetURIs(); } @@ -429,7 +429,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, LLTextBox* channel_text = LLUICtrlFactory::getTextBoxByName(this, "channel_text"); if (channel_text) { - channel_text->setText(gSavedSettings.getString("VersionChannelName")); + channel_text->setText(gChannelName); channel_text->setClickedCallback(onClickVersion); channel_text->setCallbackUserData(this); } @@ -471,7 +471,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, // kick off a request to grab the url manually gResponsePtr = LLIamHereLogin::build( this ); - std::string login_page = gSavedSettings.getString("LoginPage"); + std::string login_page = LLAppViewer::instance()->getLoginPage(); if (login_page.empty()) { login_page = getString( "real_url" ); @@ -927,7 +927,7 @@ void LLPanelLogin::loadLoginPage() std::ostringstream oStr; - std::string login_page = gSavedSettings.getString("LoginPage"); + std::string login_page = LLAppViewer::instance()->getLoginPage(); if (login_page.empty()) { login_page = sInstance->getString( "real_url" ); @@ -984,24 +984,24 @@ void LLPanelLogin::loadLoginPage() } LLString firstname, lastname; - - if(gSavedSettings.getLLSD("UserLoginInfo").size() == 3) - { - LLSD cmd_line_login = gSavedSettings.getLLSD("UserLoginInfo"); - firstname = cmd_line_login[0].asString(); - lastname = cmd_line_login[1].asString(); - password = cmd_line_login[2].asString(); - } - - if (firstname.empty()) + + if (gCmdLineFirstName.empty()) { firstname = gSavedSettings.getString("FirstName"); } + else + { + firstname = gCmdLineFirstName; + } - if (lastname.empty()) + if (gCmdLineLastName.empty()) { lastname = gSavedSettings.getString("LastName"); } + else + { + lastname = gCmdLineLastName; + } LLString version = llformat("%d.%d.%d (%d)", LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VIEWER_BUILD); @@ -1020,9 +1020,9 @@ void LLPanelLogin::loadLoginPage() curl_free(curl_version); - if (!password.empty()) + if (!gCmdLinePassword.empty()) { - oStr << "&password=" << password; + oStr << "&password=" << gCmdLinePassword; } else if (!(password = load_password_from_disk()).empty()) { diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index f2475d84d9..d2bc8f4100 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -447,7 +447,7 @@ BOOL idle_startup() { fclose(found_template); - U32 port = gSavedSettings.getU32("UserConnectionPort"); + U32 port = gAgent.mViewerPort; if ((NET_USE_OS_ASSIGNED_PORT == port) && // if nothing specified on command line (-port) (gSavedSettings.getBOOL("ConnectionPortEnabled"))) @@ -497,7 +497,7 @@ BOOL idle_startup() invalid_message_callback, NULL); - if (gSavedSettings.getBOOL("LogMessages")) + if (gSavedSettings.getBOOL("LogMessages") || gLogMessages) { llinfos << "Message logging activated!" << llendl; msg->startLogging(); @@ -516,23 +516,18 @@ BOOL idle_startup() } gAssetStorage = new LLViewerAssetStorage(msg, gXferManager, gVFS); - - F32 dropPercent = gSavedSettings.getF32("PacketDropPercentage"); - msg->mPacketRing.setDropPercentage(dropPercent); - - F32 inBandwidth = gSavedSettings.getF32("InBandwidth"); - F32 outBandwidth = gSavedSettings.getF32("OutBandwidth"); - if (inBandwidth != 0.f) + msg->mPacketRing.setDropPercentage(gPacketDropPercentage); + if (gInBandwidth != 0.f) { - llinfos << "Setting packetring incoming bandwidth to " << inBandwidth << llendl; + llinfos << "Setting packetring incoming bandwidth to " << gInBandwidth << llendl; msg->mPacketRing.setUseInThrottle(TRUE); - msg->mPacketRing.setInBandwidth(inBandwidth); + msg->mPacketRing.setInBandwidth(gInBandwidth); } - if (outBandwidth != 0.f) + if (gOutBandwidth != 0.f) { - llinfos << "Setting packetring outgoing bandwidth to " << outBandwidth << llendl; + llinfos << "Setting packetring outgoing bandwidth to " << gOutBandwidth << llendl; msg->mPacketRing.setUseOutThrottle(TRUE); - msg->mPacketRing.setOutBandwidth(outBandwidth); + msg->mPacketRing.setOutBandwidth(gOutBandwidth); } } @@ -546,7 +541,7 @@ BOOL idle_startup() // or audio cues in connection UI. //------------------------------------------------- - if (FALSE == gSavedSettings.getBOOL("NoAudio")) + if (gUseAudio) { #if LL_FMOD gAudiop = (LLAudioEngine *) new LLAudioEngine_FMOD(); @@ -591,13 +586,14 @@ BOOL idle_startup() show_connect_box = FALSE; } - else if(gSavedSettings.getLLSD("UserLoginInfo").size() == 3) - { - LLSD cmd_line_login = gSavedSettings.getLLSD("UserLoginInfo"); - firstname = cmd_line_login[0].asString(); - lastname = cmd_line_login[1].asString(); + else if( !gCmdLineFirstName.empty() + && !gCmdLineLastName.empty() + && !gCmdLinePassword.empty()) + { + firstname = gCmdLineFirstName; + lastname = gCmdLineLastName; - LLMD5 pass((unsigned char*)cmd_line_login[2].asString().c_str()); + LLMD5 pass((unsigned char*)gCmdLinePassword.c_str()); char md5pass[33]; /* Flawfinder: ignore */ pass.hex_digest(md5pass); password = md5pass; @@ -608,9 +604,9 @@ BOOL idle_startup() #else show_connect_box = FALSE; #endif - gSavedSettings.setBOOL("AutoLogin", TRUE); - } - else if (gSavedSettings.getBOOL("AutoLogin")) + gAutoLogin = TRUE; + } + else if (gAutoLogin || gSavedSettings.getBOOL("AutoLogin")) { firstname = gSavedSettings.getString("FirstName"); lastname = gSavedSettings.getString("LastName"); @@ -785,14 +781,19 @@ BOOL idle_startup() // create necessary directories // *FIX: these mkdir's should error check gDirUtilp->setLindenUserDir(firstname.c_str(), lastname.c_str()); - LLFile::mkdir(gDirUtilp->getLindenUserDir().c_str()); - // Set UserSettingsFile to the default value. - gSavedSettings.setString("UserSettingsFile", - gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, DEFAULT_SETTINGS_FILE)); - // Overwrite default user settings with user settings - LLAppViewer::instance()->loadSettingsFromDirectory(LL_PATH_PER_SL_ACCOUNT); + LLFile::mkdir(gDirUtilp->getLindenUserDir().c_str()); + + // the mute list is loaded in the llmutelist class. + + gSavedSettings.loadFromFile(gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT,"overrides.xml")); + + // handle the per account settings setup + gPerAccountSettingsFileName = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, DEFAULT_SETTINGS_FILE); + + // per account settings. Set defaults here if not found. If we get a bunch of these, eventually move to a function. + gSavedPerAccountSettings.loadFromFile(gPerAccountSettingsFileName); // Need to set the LastLogoff time here if we don't have one. LastLogoff is used for "Recent Items" calculation // and startup time is close enough if we don't have a real value. @@ -827,7 +828,7 @@ BOOL idle_startup() gSavedSettings.setS32("ServerChoice", gGridChoice); if (gGridChoice == GRID_INFO_OTHER) { - gGridName = server_label;/* Flawfinder: ignore */ + snprintf(gGridName, MAX_STRING, "%s", server_label.c_str());/* Flawfinder: ignore */ } if ( user_picked_server ) @@ -931,7 +932,7 @@ BOOL idle_startup() //requested_options.push_back("inventory-meat"); //requested_options.push_back("inventory-skel-targets"); #if (!defined LL_MINIMIAL_REQUESTED_OPTIONS) - if(FALSE == gSavedSettings.getBOOL("NoInventoryLibrary")) + if(gRequestInventoryLibrary) { requested_options.push_back("inventory-lib-root"); requested_options.push_back("inventory-lib-owner"); @@ -951,7 +952,7 @@ BOOL idle_startup() requested_options.push_back("tutorial_setting"); requested_options.push_back("login-flags"); requested_options.push_back("global-textures"); - if(gSavedSettings.getBOOL("ConnectAsGod")) + if(gGodConnect) { gSavedSettings.setBOOL("UseDebugMenus", TRUE); requested_options.push_back("god-connect"); @@ -1239,6 +1240,7 @@ BOOL idle_startup() << (sAuthUriNum + 1) << ". "; auth_desc = s.str(); LLStartUp::setStartupState( STATE_LOGIN_AUTHENTICATE ); + sAuthUriNum++; return do_normal_idle; } break; @@ -1488,7 +1490,7 @@ BOOL idle_startup() args["[ERROR_MESSAGE]"] = emsg.str(); gViewerWindow->alertXml("ErrorMessage", args, login_alert_done); reset_login(); - gSavedSettings.setBOOL("AutoLogin", FALSE); + gAutoLogin = FALSE; show_connect_box = TRUE; } @@ -1508,7 +1510,7 @@ BOOL idle_startup() args["[ERROR_MESSAGE]"] = emsg.str(); gViewerWindow->alertXml("ErrorMessage", args, login_alert_done); reset_login(); - gSavedSettings.setBOOL("AutoLogin", FALSE); + gAutoLogin = FALSE; show_connect_box = TRUE; // Don't save an incorrect password to disk. save_password_to_disk(NULL); @@ -1532,7 +1534,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); + gSavedSettings.saveToFile(gSettingsFileName, TRUE); // // Initialize classes w/graphics stuff. @@ -2099,7 +2101,7 @@ BOOL idle_startup() gSavedSettings.setString( "NextLoginLocation", "" ); // and make sure it's saved - gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile") , TRUE ); + gSavedSettings.saveToFile( gSettingsFileName, TRUE ); }; if (!gNoRender) @@ -2391,7 +2393,7 @@ void login_show() if( GRID_INFO_OTHER == gGridChoice ) { - LLPanelLogin::addServer( gGridName.c_str(), GRID_INFO_OTHER ); + LLPanelLogin::addServer( gGridName, GRID_INFO_OTHER ); } else { @@ -2439,7 +2441,7 @@ void login_callback(S32 option, void *userdata) { // turn off the setting and write out to disk gSavedSettings.setBOOL("RememberPassword", FALSE); - gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile") , TRUE ); + gSavedSettings.saveToFile(gSettingsFileName, TRUE); // stomp the saved password on disk save_password_to_disk(NULL); @@ -2633,7 +2635,7 @@ void login_alert_status(S32 option, void* user_data) 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); + gSavedSettings.saveToFile(gSettingsFileName, TRUE); std::ostringstream message; @@ -2733,7 +2735,7 @@ void update_dialog_callback(S32 option, void *userdata) // *TODO change userserver to be grid on both viewer and sim, since // userserver no longer exists. query_map["userserver"] = gGridName; - query_map["channel"] = gSavedSettings.getString("VersionChannelName"); + query_map["channel"] = gChannelName; // *TODO constantize this guy LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); diff --git a/indra/newview/lltoolgun.cpp b/indra/newview/lltoolgun.cpp index 9c8bb97343..ffa921125a 100644 --- a/indra/newview/lltoolgun.cpp +++ b/indra/newview/lltoolgun.cpp @@ -80,10 +80,14 @@ BOOL LLToolGun::handleHover(S32 x, S32 y, MASK mask) { if( gAgent.cameraMouselook() ) { - const F32 NOMINAL_MOUSE_SENSITIVITY = 0.0025f; + #if 1 //LL_WINDOWS || LL_DARWIN + const F32 NOMINAL_MOUSE_SENSITIVITY = 0.0025f; + #else + const F32 NOMINAL_MOUSE_SENSITIVITY = 0.025f; + #endif - F32 mouse_sensitivity = gSavedSettings.getF32("MouseSensitivity"); - mouse_sensitivity = clamp_rescale(mouse_sensitivity, 0.f, 15.f, 0.5f, 2.75f) * NOMINAL_MOUSE_SENSITIVITY; + + F32 mouse_sensitivity = clamp_rescale(gMouseSensitivity, 0.f, 15.f, 0.5f, 2.75f) * NOMINAL_MOUSE_SENSITIVITY; // ...move the view with the mouse @@ -94,7 +98,7 @@ BOOL LLToolGun::handleHover(S32 x, S32 y, MASK mask) if (dx != 0 || dy != 0) { // ...actually moved off center - if (gSavedSettings.getBOOL("InvertMouse")) + if (gInvertMouse) { gAgent.pitch(mouse_sensitivity * -dy); } diff --git a/indra/newview/llvectorperfoptions.cpp b/indra/newview/llvectorperfoptions.cpp index 34c10a4f72..ca8ae2e886 100644 --- a/indra/newview/llvectorperfoptions.cpp +++ b/indra/newview/llvectorperfoptions.cpp @@ -31,4 +31,101 @@ #include "llviewerprecompiledheaders.h" -// Deprecated - moved into llviewerjointmesh +#include "llvectorperfoptions.h" +#include "llviewerjointmesh.h" +#include "llviewercontrol.h" + +// Initially, we test the performance of the vectorization code, then +// turn it off if it ends up being slower. JC +BOOL gVectorizePerfTest = TRUE; +BOOL gVectorizeEnable = FALSE; +U32 gVectorizeProcessor = 0; +BOOL gVectorizeSkin = FALSE; + +void update_vector_performances(void) +{ + char *vp; + + switch(gVectorizeProcessor) + { + case 2: vp = "SSE2"; break; // *TODO: replace the magic #s + case 1: vp = "SSE"; break; + default: vp = "COMPILER DEFAULT"; break; + } + llinfos << "Vectorization : " << ( gVectorizeEnable ? "ENABLED" : "DISABLED" ) << llendl ; + llinfos << "Vector Processor : " << vp << llendl ; + llinfos << "Vectorized Skinning : " << ( gVectorizeSkin ? "ENABLED" : "DISABLED" ) << llendl ; + + if(gVectorizeEnable && gVectorizeSkin) + { + switch(gVectorizeProcessor) + { + case 2: + LLViewerJointMesh::sUpdateGeometryFunc = &LLViewerJointMesh::updateGeometrySSE2; + break; + case 1: + LLViewerJointMesh::sUpdateGeometryFunc = &LLViewerJointMesh::updateGeometrySSE; + break; + default: + LLViewerJointMesh::sUpdateGeometryFunc = &LLViewerJointMesh::updateGeometryVectorized; + break; + } + } + else + { + LLViewerJointMesh::sUpdateGeometryFunc = &LLViewerJointMesh::updateGeometryOriginal; + } +} + + +class LLVectorizationEnableListener: public LLSimpleListener +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + gVectorizeEnable = event->getValue().asBoolean(); + update_vector_performances(); + return true; + } +}; +static LLVectorizationEnableListener vectorization_enable_listener; + +class LLVectorizeSkinListener: public LLSimpleListener +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + gVectorizeSkin = event->getValue().asBoolean(); + update_vector_performances(); + return true; + } +}; +static LLVectorizeSkinListener vectorize_skin_listener; + +class LLVectorProcessorListener: public LLSimpleListener +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + gVectorizeProcessor = event->getValue().asInteger(); + update_vector_performances(); + return true; + } +}; +static LLVectorProcessorListener vector_processor_listener; + +void LLVectorPerformanceOptions::initClass() +{ + gVectorizePerfTest = gSavedSettings.getBOOL("VectorizePerfTest"); + gVectorizeEnable = gSavedSettings.getBOOL("VectorizeEnable"); + gVectorizeProcessor = gSavedSettings.getU32("VectorizeProcessor"); + gVectorizeSkin = gSavedSettings.getBOOL("VectorizeSkin"); + update_vector_performances(); + + // these are currently static in this file, so they can't move to settings_setup_listeners + gSavedSettings.getControl("VectorizeEnable")->addListener(&vectorization_enable_listener); + gSavedSettings.getControl("VectorizeProcessor")->addListener(&vector_processor_listener); + gSavedSettings.getControl("VectorizeSkin")->addListener(&vectorize_skin_listener); +} + +void LLVectorPerformanceOptions::cleanupClass() +{ +} + diff --git a/indra/newview/llvectorperfoptions.h b/indra/newview/llvectorperfoptions.h index e2a0a37e33..dac4d1f86c 100644 --- a/indra/newview/llvectorperfoptions.h +++ b/indra/newview/llvectorperfoptions.h @@ -32,6 +32,10 @@ #ifndef LL_VECTORPERFOPTIONS_H #define LL_VECTORPERFOPTIONS_H -// Deprecated - moved into llviewerjointmesh +namespace LLVectorPerformanceOptions +{ + void initClass(); // Run after configuration files are read. + void cleanupClass(); +}; #endif diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index fd85ac1bc1..affce91b79 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -65,7 +65,7 @@ void init_audio() BOOL mute_audio = gSavedSettings.getBOOL("MuteAudio"); - if (!mute_audio && FALSE == gSavedSettings.getBOOL("NoPreload")) + if (!mute_audio && gPreloadSounds) { gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndAlert"))); gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndBadKeystroke"))); diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 7733ef5ae1..9c81f89e99 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -36,47 +36,26 @@ #include "indra_constants.h" -// For Listeners -#include "audioengine.h" -#include "llagent.h" -#include "llconsole.h" -#include "lldrawpoolterrain.h" -#include "llflexibleobject.h" -#include "llfeaturemanager.h" -#include "llglslshader.h" -#include "llnetmap.h" -#include "llpanelgeneral.h" -#include "llpanelinput.h" -#include "llsky.h" -#include "llvieweraudio.h" -#include "llviewerimagelist.h" -#include "llviewerthrottle.h" -#include "llviewerwindow.h" -#include "llvoavatar.h" -#include "llvoiceclient.h" -#include "llvosky.h" -#include "llvotree.h" -#include "llvovolume.h" -#include "llworld.h" -#include "pipeline.h" -#include "llviewerjoystick.h" -#include "llviewerparcelmgr.h" -#include "llparcel.h" -#include "llnotify.h" -#include "llkeyboard.h" -#include "llerrorcontrol.h" -#include "llversionviewer.h" -#include "llappviewer.h" -#include "llvosurfacepatch.h" -#include "llvowlsky.h" -#include "llglimmediate.h" +#include "v3math.h" +#include "v3dmath.h" +#include "llrect.h" +#include "v4color.h" +#include "v4coloru.h" +#include "v3color.h" + +#include "llfloater.h" +#include "llvieweruictrlfactory.h" +#include "llfirstuse.h" +#include "llcombobox.h" +#include "llspinctrl.h" +#include "llcolorswatch.h" #ifdef TOGGLE_HACKED_GODLIKE_VIEWER BOOL gHackGodmode = FALSE; #endif +LLFloaterSettingsDebug* LLFloaterSettingsDebug::sInstance = NULL; -std::map gSettings; LLControlGroup gSavedSettings; // saved at end of session LLControlGroup gSavedPerAccountSettings; // saved at end of session LLControlGroup gViewerArt; // read-only @@ -86,440 +65,461 @@ LLControlGroup gCrashSettings; // saved at end of session LLString gLastRunVersion; LLString gCurrentVersion; -extern BOOL gResizeScreenTexture; +LLString gSettingsFileName; +LLString gPerAccountSettingsFileName; -//////////////////////////////////////////////////////////////////////////// -// Listeners - -static bool handleRenderAvatarMouselookChanged(const LLSD& newvalue) -{ - LLVOAvatar::sVisibleInFirstPerson = newvalue.asBoolean(); - return true; -} - -static bool handleRenderFarClipChanged(const LLSD& newvalue) +LLFloaterSettingsDebug::LLFloaterSettingsDebug() : LLFloater("Configuration Editor") { - F32 draw_distance = (F32) newvalue.asReal(); - gAgent.mDrawDistance = draw_distance; - if (gWorldPointer) - { - gWorldPointer->setLandFarClip(draw_distance); - } - return true; } -static bool handleTerrainDetailChanged(const LLSD& newvalue) +LLFloaterSettingsDebug::~LLFloaterSettingsDebug() { - LLDrawPoolTerrain::sDetailMode = newvalue.asInteger(); - return true; + sInstance = NULL; } - -static bool handleSetShaderChanged(const LLSD& newvalue) +BOOL LLFloaterSettingsDebug::postBuild() { - LLShaderMgr::setShaders(); - return true; -} + LLComboBox* settings_combo = LLUICtrlFactory::getComboBoxByName(this, "settings_combo"); -static bool handleReleaseGLBufferChanged(const LLSD& newvalue) -{ - if (gPipeline.isInit()) + LLControlGroup::ctrl_name_table_t::iterator name_it; + for(name_it = gSavedSettings.mNameTable.begin(); name_it != gSavedSettings.mNameTable.end(); ++name_it) { - gPipeline.releaseGLBuffers(); - gPipeline.createGLBuffers(); + settings_combo->add(name_it->first, (void*)name_it->second); } - return true; -} - -static bool handleVolumeLODChanged(const LLSD& newvalue) -{ - LLVOVolume::sLODFactor = (F32) newvalue.asReal(); - LLVOVolume::sDistanceFactor = 1.f-LLVOVolume::sLODFactor * 0.1f; - return true; -} - -static bool handleAvatarLODChanged(const LLSD& newvalue) -{ - LLVOAvatar::sLODFactor = (F32) newvalue.asReal(); - return true; -} - -static bool handleTerrainLODChanged(const LLSD& newvalue) -{ - LLVOSurfacePatch::sLODFactor = (F32)newvalue.asReal(); - //sqaure lod factor to get exponential range of [0,4] and keep - //a value of 1 in the middle of the detail slider for consistency - //with other detail sliders (see panel_preferences_graphics1.xml) - LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; - return true; -} - -static bool handleTreeLODChanged(const LLSD& newvalue) -{ - LLVOTree::sTreeFactor = (F32) newvalue.asReal(); - return true; -} - -static bool handleFlexLODChanged(const LLSD& newvalue) -{ - LLVolumeImplFlexible::sUpdateFactor = (F32) newvalue.asReal(); - return true; -} - -static bool handleGammaChanged(const LLSD& newvalue) -{ - F32 gamma = (F32) newvalue.asReal(); - if (gamma == 0.0f) + for(name_it = gSavedPerAccountSettings.mNameTable.begin(); name_it != gSavedPerAccountSettings.mNameTable.end(); ++name_it) { - gamma = 1.0f; // restore normal gamma + settings_combo->add(name_it->first, (void*)name_it->second); } - if (gViewerWindow && gViewerWindow->getWindow() && gamma != gViewerWindow->getWindow()->getGamma()) + for(name_it = gColors.mNameTable.begin(); name_it != gColors.mNameTable.end(); ++name_it) { - // Only save it if it's changed - if (!gViewerWindow->getWindow()->setGamma(gamma)) - { - llwarns << "setGamma failed!" << llendl; - } + settings_combo->add(name_it->first, (void*)name_it->second); } + settings_combo->sortByName(); + settings_combo->setCommitCallback(onSettingSelect); + settings_combo->setCallbackUserData(this); + settings_combo->updateSelection(); + + childSetCommitCallback("val_spinner_1", onCommitSettings); + childSetUserData("val_spinner_1", this); + childSetCommitCallback("val_spinner_2", onCommitSettings); + childSetUserData("val_spinner_2", this); + childSetCommitCallback("val_spinner_3", onCommitSettings); + childSetUserData("val_spinner_3", this); + childSetCommitCallback("val_spinner_4", onCommitSettings); + childSetUserData("val_spinner_4", this); + childSetCommitCallback("val_text", onCommitSettings); + childSetUserData("val_text", this); + childSetCommitCallback("boolean_combo", onCommitSettings); + childSetUserData("boolean_combo", this); + childSetCommitCallback("color_swatch", onCommitSettings); + childSetUserData("color_swatch", this); + childSetAction("default_btn", onClickDefault, this); + mComment = getChild("comment_text"); + return TRUE; +} + +void LLFloaterSettingsDebug::draw() +{ + LLComboBox* settings_combo = getChild("settings_combo"); + LLControlBase* controlp = (LLControlBase*)settings_combo->getCurrentUserdata(); + updateControl(controlp); + + LLFloater::draw(); +} + +//static +void LLFloaterSettingsDebug::show(void*) +{ + if (sInstance == NULL) + { + sInstance = new LLFloaterSettingsDebug(); - return true; -} - -const F32 MAX_USER_FOG_RATIO = 10.f; -const F32 MIN_USER_FOG_RATIO = 0.5f; - -static bool handleFogRatioChanged(const LLSD& newvalue) -{ - F32 fog_ratio = llmax(MIN_USER_FOG_RATIO, llmin((F32) newvalue.asReal(), MAX_USER_FOG_RATIO)); - gSky.setFogRatio(fog_ratio); - return true; -} - -static bool handleMaxPartCountChanged(const LLSD& newvalue) -{ - LLViewerPartSim::setMaxPartCount(newvalue.asInteger()); - return true; -} - -const S32 MAX_USER_COMPOSITE_LIMIT = 100; -const S32 MIN_USER_COMPOSITE_LIMIT = 0; + gUICtrlFactory->buildFloater(sInstance, "floater_settings_debug.xml"); + } -static bool handleCompositeLimitChanged(const LLSD& newvalue) -{ - S32 composite_limit = llmax(MIN_USER_COMPOSITE_LIMIT, llmin((S32)newvalue.asInteger(), MAX_USER_COMPOSITE_LIMIT)); - LLVOAvatar::sMaxOtherAvatarsToComposite = composite_limit; - return true; + sInstance->open(); /* Flawfinder: ignore */ +} + +//static +void LLFloaterSettingsDebug::onSettingSelect(LLUICtrl* ctrl, void* user_data) +{ + LLFloaterSettingsDebug* floaterp = (LLFloaterSettingsDebug*)user_data; + LLComboBox* combo_box = (LLComboBox*)ctrl; + LLControlBase* controlp = (LLControlBase*)combo_box->getCurrentUserdata(); + + floaterp->updateControl(controlp); +} + +//static +void LLFloaterSettingsDebug::onCommitSettings(LLUICtrl* ctrl, void* user_data) +{ + LLFloaterSettingsDebug* floaterp = (LLFloaterSettingsDebug*)user_data; + + LLComboBox* settings_combo = floaterp->getChild("settings_combo"); + LLControlBase* controlp = (LLControlBase*)settings_combo->getCurrentUserdata(); + + LLVector3 vector; + LLVector3d vectord; + LLRect rect; + LLColor4 col4; + LLColor3 col3; + LLColor4U col4U; + LLColor4 color_with_alpha; + + switch(controlp->type()) + { + case TYPE_U32: + controlp->set(floaterp->childGetValue("val_spinner_1")); + break; + case TYPE_S32: + controlp->set(floaterp->childGetValue("val_spinner_1")); + break; + case TYPE_F32: + controlp->set(LLSD(floaterp->childGetValue("val_spinner_1").asReal())); + break; + case TYPE_BOOLEAN: + controlp->set(floaterp->childGetValue("boolean_combo")); + break; + case TYPE_STRING: + controlp->set(LLSD(floaterp->childGetValue("val_text").asString())); + break; + case TYPE_VEC3: + vector.mV[VX] = (F32)floaterp->childGetValue("val_spinner_1").asReal(); + vector.mV[VY] = (F32)floaterp->childGetValue("val_spinner_2").asReal(); + vector.mV[VZ] = (F32)floaterp->childGetValue("val_spinner_3").asReal(); + controlp->set(vector.getValue()); + break; + case TYPE_VEC3D: + vectord.mdV[VX] = floaterp->childGetValue("val_spinner_1").asReal(); + vectord.mdV[VY] = floaterp->childGetValue("val_spinner_2").asReal(); + vectord.mdV[VZ] = floaterp->childGetValue("val_spinner_3").asReal(); + controlp->set(vectord.getValue()); + break; + case TYPE_RECT: + rect.mLeft = floaterp->childGetValue("val_spinner_1").asInteger(); + rect.mRight = floaterp->childGetValue("val_spinner_2").asInteger(); + rect.mBottom = floaterp->childGetValue("val_spinner_3").asInteger(); + rect.mTop = floaterp->childGetValue("val_spinner_4").asInteger(); + controlp->set(rect.getValue()); + break; + case TYPE_COL4: + col3.setValue(floaterp->childGetValue("color_swatch")); + col4 = LLColor4(col3, (F32)floaterp->childGetValue("val_spinner_4").asReal()); + controlp->set(col4.getValue()); + break; + case TYPE_COL3: + controlp->set(floaterp->childGetValue("color_swatch")); + //col3.mV[VRED] = (F32)floaterp->childGetValue("val_spinner_1").asC(); + //col3.mV[VGREEN] = (F32)floaterp->childGetValue("val_spinner_2").asReal(); + //col3.mV[VBLUE] = (F32)floaterp->childGetValue("val_spinner_3").asReal(); + //controlp->set(col3.getValue()); + break; + case TYPE_COL4U: + col3.setValue(floaterp->childGetValue("color_swatch")); + col4U.setVecScaleClamp(col3); + col4U.mV[VALPHA] = floaterp->childGetValue("val_spinner_4").asInteger(); + controlp->set(col4U.getValue()); + break; + default: + break; + } } -static bool handleVideoMemoryChanged(const LLSD& newvalue) +// static +void LLFloaterSettingsDebug::onClickDefault(void* user_data) { - gImageList.updateMaxResidentTexMem(newvalue.asInteger()); - return true; -} + LLFloaterSettingsDebug* floaterp = (LLFloaterSettingsDebug*)user_data; + LLComboBox* settings_combo = floaterp->getChild("settings_combo"); + LLControlBase* controlp = (LLControlBase*)settings_combo->getCurrentUserdata(); -static bool handleBandwidthChanged(const LLSD& newvalue) -{ - gViewerThrottle.setMaxBandwidth((F32) newvalue.asReal()); - return true; -} - -static bool handleChatFontSizeChanged(const LLSD& newvalue) -{ - if(gConsole) + if (controlp) { - gConsole->setFontSize(newvalue.asInteger()); + controlp->resetToDefault(); + floaterp->updateControl(controlp); } - return true; } -static bool handleChatPersistTimeChanged(const LLSD& newvalue) +// we've switched controls, or doing per-frame update, so update spinners, etc. +void LLFloaterSettingsDebug::updateControl(LLControlBase* controlp) { - if(gConsole) - { - gConsole->setLinePersistTime((F32) newvalue.asReal()); - } - return true; -} + LLSpinCtrl* spinner1 = LLUICtrlFactory::getSpinnerByName(this, "val_spinner_1"); + LLSpinCtrl* spinner2 = LLUICtrlFactory::getSpinnerByName(this, "val_spinner_2"); + LLSpinCtrl* spinner3 = LLUICtrlFactory::getSpinnerByName(this, "val_spinner_3"); + LLSpinCtrl* spinner4 = LLUICtrlFactory::getSpinnerByName(this, "val_spinner_4"); + LLColorSwatchCtrl* color_swatch = getChild("color_swatch"); -static bool handleConsoleMaxLinesChanged(const LLSD& newvalue) -{ - if(gConsole) + if (!spinner1 || !spinner2 || !spinner3 || !spinner4 || !color_swatch) { - gConsole->setMaxLines(newvalue.asInteger()); + llwarns << "Could not find all desired controls by name" + << llendl; + return; } - return true; -} -static void handleAudioVolumeChanged(const LLSD& newvalue) -{ - audio_update_volume(true); -} - -static bool handleJoystickChanged(const LLSD& newvalue) -{ - LLViewerJoystick::updateCamera(TRUE); - return true; -} + spinner1->setVisible(FALSE); + spinner2->setVisible(FALSE); + spinner3->setVisible(FALSE); + spinner4->setVisible(FALSE); + color_swatch->setVisible(FALSE); + childSetVisible("val_text", FALSE); + mComment->setText(LLString::null); -static bool handleAudioStreamMusicChanged(const LLSD& newvalue) -{ - if (gAudiop) + if (controlp) { - if ( newvalue.asBoolean() ) + eControlType type = controlp->type(); + mComment->setText(controlp->getComment()); + spinner1->setMaxValue(F32_MAX); + spinner2->setMaxValue(F32_MAX); + spinner3->setMaxValue(F32_MAX); + spinner4->setMaxValue(F32_MAX); + spinner1->setMinValue(-F32_MAX); + spinner2->setMinValue(-F32_MAX); + spinner3->setMinValue(-F32_MAX); + spinner4->setMinValue(-F32_MAX); + if (!spinner1->hasFocus()) { - if (gParcelMgr - && gParcelMgr->getAgentParcel() - && !gParcelMgr->getAgentParcel()->getMusicURL().empty()) - { - // if stream is already playing, don't call this - // otherwise music will briefly stop - if ( ! gAudiop->isInternetStreamPlaying() ) - { - gAudiop->startInternetStream(gParcelMgr->getAgentParcel()->getMusicURL().c_str()); - } - } + spinner1->setIncrement(0.1f); } - else + if (!spinner2->hasFocus()) { - gAudiop->stopInternetStream(); + spinner2->setIncrement(0.1f); + } + if (!spinner3->hasFocus()) + { + spinner3->setIncrement(0.1f); + } + if (!spinner4->hasFocus()) + { + spinner4->setIncrement(0.1f); } - } - return true; -} - -static bool handleUseOcclusionChanged(const LLSD& newvalue) -{ - LLPipeline::sUseOcclusion = (newvalue.asBoolean() && gGLManager.mHasOcclusionQuery - && gFeatureManagerp->isFeatureAvailable("UseOcclusion") && !gUseWireframe) ? 2 : 0; - return true; -} - -static bool handleNumpadControlChanged(const LLSD& newvalue) -{ - if (gKeyboard) - { - gKeyboard->setNumpadDistinct(static_cast(newvalue.asInteger())); - } - return true; -} - -static bool handleRenderUseVBOChanged(const LLSD& newvalue) -{ - if (gPipeline.isInit()) - { - gPipeline.setUseVBO(newvalue.asBoolean()); - } - return true; -} - -static bool handleWLSkyDetailChanged(const LLSD&) -{ - if (gSky.mVOWLSkyp.notNull()) - { - gSky.mVOWLSkyp->updateGeometry(gSky.mVOWLSkyp->mDrawable); - } - return true; -} - -static bool handleRenderLightingDetailChanged(const LLSD& newvalue) -{ - if (gPipeline.isInit()) - { - gPipeline.setLightingDetail(newvalue.asInteger()); - } - return true; -} - -static bool handleResetVertexBuffersChanged(const LLSD&) -{ - if (gPipeline.isInit()) - { - gPipeline.resetVertexBuffers(); - } - return true; -} - -static bool handleRenderDynamicLODChanged(const LLSD& newvalue) -{ - LLPipeline::sDynamicLOD = newvalue.asBoolean(); - return true; -} - -static bool handleRenderUseFBOChanged(const LLSD& newvalue) -{ - LLRenderTarget::sUseFBO = newvalue.asBoolean(); - if (gPipeline.isInit()) - { - gPipeline.releaseGLBuffers(); - gPipeline.createGLBuffers(); - } - return true; -} - -static bool handleRenderUseImpostorsChanged(const LLSD& newvalue) -{ - LLVOAvatar::sUseImpostors = newvalue.asBoolean(); - return true; -} - -static bool handleRenderUseCleverUIChanged(const LLSD& newvalue) -{ - gGL.setClever(newvalue.asBoolean()); - return true; -} - -static bool handleRenderResolutionDivisorChanged(const LLSD&) -{ - gResizeScreenTexture = TRUE; - return true; -} - -static bool handleDebugViewsChanged(const LLSD& newvalue) -{ - LLView::sDebugRects = newvalue.asBoolean(); - return true; -} - -static bool handleLogFileChanged(const LLSD& newvalue) -{ - std::string log_filename = newvalue.asString(); - LLFile::remove(log_filename.c_str()); - LLError::logToFile(log_filename); - return true; -} - -bool handleHideGroupTitleChanged(const LLSD& newvalue) -{ - gAgent.setHideGroupTitle(newvalue); - return true; -} -bool handleEffectColorChanged(const LLSD& newvalue) -{ - gAgent.setEffectColor(LLColor4(newvalue)); - return true; -} + LLSD sd = controlp->get(); + switch(type) + { + case TYPE_U32: + spinner1->setVisible(TRUE); + spinner1->setLabel(LLString("value")); // Debug, don't translate + childSetVisible("boolean_combo", FALSE); + if (!spinner1->hasFocus()) + { + spinner1->setValue(sd); + spinner1->setMinValue((F32)U32_MIN); + spinner1->setMaxValue((F32)U32_MAX); + spinner1->setIncrement(1.f); + spinner1->setPrecision(0); + } + break; + case TYPE_S32: + spinner1->setVisible(TRUE); + spinner1->setLabel(LLString("value")); // Debug, don't translate + childSetVisible("boolean_combo", FALSE); + if (!spinner1->hasFocus()) + { + spinner1->setValue(sd); + spinner1->setMinValue((F32)S32_MIN); + spinner1->setMaxValue((F32)S32_MAX); + spinner1->setIncrement(1.f); + spinner1->setPrecision(0); + } + break; + case TYPE_F32: + spinner1->setVisible(TRUE); + spinner1->setLabel(LLString("value")); // Debug, don't translate + childSetVisible("boolean_combo", FALSE); + if (!spinner1->hasFocus()) + { + spinner1->setPrecision(3); + spinner1->setValue(sd); + } + break; + case TYPE_BOOLEAN: + childSetVisible("boolean_combo", TRUE); + + if (!childHasFocus("boolean_combo")) + { + if (sd.asBoolean()) + { + childSetValue("boolean_combo", LLSD("true")); + } + else + { + childSetValue("boolean_combo", LLSD("")); + } + } + break; + case TYPE_STRING: + childSetVisible("val_text", TRUE); + childSetVisible("boolean_combo", FALSE); + if (!childHasFocus("val_text")) + { + childSetValue("val_text", sd); + } + break; + case TYPE_VEC3: + { + childSetVisible("boolean_combo", FALSE); + LLVector3 v; + v.setValue(sd); + spinner1->setVisible(TRUE); + spinner1->setLabel(LLString("X")); + spinner2->setVisible(TRUE); + spinner2->setLabel(LLString("Y")); + spinner3->setVisible(TRUE); + spinner3->setLabel(LLString("Z")); + if (!spinner1->hasFocus()) + { + spinner1->setPrecision(3); + spinner1->setValue(v[VX]); + } + if (!spinner2->hasFocus()) + { + spinner2->setPrecision(3); + spinner2->setValue(v[VY]); + } + if (!spinner3->hasFocus()) + { + spinner3->setPrecision(3); + spinner3->setValue(v[VZ]); + } + break; + } + case TYPE_VEC3D: + { + childSetVisible("boolean_combo", FALSE); + LLVector3d v; + v.setValue(sd); + spinner1->setVisible(TRUE); + spinner1->setLabel(LLString("X")); + spinner2->setVisible(TRUE); + spinner2->setLabel(LLString("Y")); + spinner3->setVisible(TRUE); + spinner3->setLabel(LLString("Z")); + if (!spinner1->hasFocus()) + { + spinner1->setPrecision(3); + spinner1->setValue(v[VX]); + } + if (!spinner2->hasFocus()) + { + spinner2->setPrecision(3); + spinner2->setValue(v[VY]); + } + if (!spinner3->hasFocus()) + { + spinner3->setPrecision(3); + spinner3->setValue(v[VZ]); + } + break; + } + case TYPE_RECT: + { + childSetVisible("boolean_combo", FALSE); + LLRect r; + r.setValue(sd); + spinner1->setVisible(TRUE); + spinner1->setLabel(LLString("Left")); + spinner2->setVisible(TRUE); + spinner2->setLabel(LLString("Right")); + spinner3->setVisible(TRUE); + spinner3->setLabel(LLString("Bottom")); + spinner4->setVisible(TRUE); + spinner4->setLabel(LLString("Top")); + if (!spinner1->hasFocus()) + { + spinner1->setPrecision(0); + spinner1->setValue(r.mLeft); + } + if (!spinner2->hasFocus()) + { + spinner2->setPrecision(0); + spinner2->setValue(r.mRight); + } + if (!spinner3->hasFocus()) + { + spinner3->setPrecision(0); + spinner3->setValue(r.mBottom); + } + if (!spinner4->hasFocus()) + { + spinner4->setPrecision(0); + spinner4->setValue(r.mTop); + } -bool handleRotateNetMapChanged(const LLSD& newvalue) -{ - LLNetMap::setRotateMap(newvalue.asBoolean()); - return true; -} + spinner1->setMinValue((F32)S32_MIN); + spinner1->setMaxValue((F32)S32_MAX); + spinner1->setIncrement(1.f); + + spinner2->setMinValue((F32)S32_MIN); + spinner2->setMaxValue((F32)S32_MAX); + spinner2->setIncrement(1.f); + + spinner3->setMinValue((F32)S32_MIN); + spinner3->setMaxValue((F32)S32_MAX); + spinner3->setIncrement(1.f); + + spinner4->setMinValue((F32)S32_MIN); + spinner4->setMaxValue((F32)S32_MAX); + spinner4->setIncrement(1.f); + break; + } + case TYPE_COL4: + { + childSetVisible("boolean_combo", FALSE); + LLColor4 clr; + clr.setValue(sd); + color_swatch->setVisible(TRUE); + // only set if changed so color picker doesn't update + if(clr != LLColor4(color_swatch->getValue())) + { + color_swatch->set(LLColor4(sd), TRUE, FALSE); + } + spinner4->setVisible(TRUE); + spinner4->setLabel(LLString("Alpha")); + if (!spinner4->hasFocus()) + { + spinner4->setPrecision(3); + spinner4->setMinValue(0.0); + spinner4->setMaxValue(1.f); + spinner4->setValue(clr.mV[VALPHA]); + } + break; + } + case TYPE_COL3: + { + childSetVisible("boolean_combo", FALSE); + LLColor3 clr; + clr.setValue(sd); + color_swatch->setVisible(TRUE); + color_swatch->setValue(sd); + break; + } + case TYPE_COL4U: + { + childSetVisible("boolean_combo", FALSE); + LLColor4U clr; + clr.setValue(sd); + color_swatch->setVisible(TRUE); + if(LLColor4(clr) != LLColor4(color_swatch->getValue())) + { + color_swatch->set(LLColor4(clr), TRUE, FALSE); + } + spinner4->setVisible(TRUE); + spinner4->setLabel(LLString("Alpha")); + if(!spinner4->hasFocus()) + { + spinner4->setPrecision(0); + spinner4->setValue(clr.mV[VALPHA]); + } -bool handleVectorizeChanged(const LLSD& newvalue) -{ - LLViewerJointMesh::updateVectorize(); - return true; -} + spinner4->setMinValue(0); + spinner4->setMaxValue(255); + spinner4->setIncrement(1.f); -bool handleVoiceClientPrefsChanged(const LLSD& newvalue) -{ - if(gVoiceClient) - { - // Note: Ignore the specific event value, look up the ones we want - - gVoiceClient->setVoiceEnabled(gSavedSettings.getBOOL("EnableVoiceChat")); - gVoiceClient->setUsePTT(gSavedSettings.getBOOL("PTTCurrentlyEnabled")); - std::string keyString = gSavedSettings.getString("PushToTalkButton"); - gVoiceClient->setPTTKey(keyString); - gVoiceClient->setPTTIsToggle(gSavedSettings.getBOOL("PushToTalkToggle")); - gVoiceClient->setEarLocation(gSavedSettings.getS32("VoiceEarLocation")); - std::string serverName = gSavedSettings.getString("VivoxDebugServerName"); - gVoiceClient->setVivoxDebugServerName(serverName); - - std::string inputDevice = gSavedSettings.getString("VoiceInputAudioDevice"); - gVoiceClient->setCaptureDevice(inputDevice); - std::string outputDevice = gSavedSettings.getString("VoiceOutputAudioDevice"); - gVoiceClient->setRenderDevice(outputDevice); + break; + } + default: + mComment->setText(LLString("unknown")); + break; + } } - return true; -} - -//////////////////////////////////////////////////////////////////////////// -void settings_setup_listeners() -{ - gSavedSettings.getControl("FirstPersonAvatarVisible")->getSignal()->connect(boost::bind(&handleRenderAvatarMouselookChanged, _1)); - gSavedSettings.getControl("RenderFarClip")->getSignal()->connect(boost::bind(&handleRenderFarClipChanged, _1)); - gSavedSettings.getControl("RenderTerrainDetail")->getSignal()->connect(boost::bind(&handleTerrainDetailChanged, _1)); - gSavedSettings.getControl("RenderAvatarVP")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1)); - gSavedSettings.getControl("VertexShaderEnable")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1)); - gSavedSettings.getControl("RenderDynamicReflections")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1)); - gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _1)); - gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1)); - gSavedSettings.getControl("EnableRippleWater")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1)); - gSavedSettings.getControl("RenderGlowResolutionPow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _1)); - gSavedSettings.getControl("RenderAvatarCloth")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1)); - gSavedSettings.getControl("WindLightUseAtmosShaders")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1)); - gSavedSettings.getControl("RenderGammaFull")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1)); - gSavedSettings.getControl("RenderVolumeLODFactor")->getSignal()->connect(boost::bind(&handleVolumeLODChanged, _1)); - gSavedSettings.getControl("RenderAvatarLODFactor")->getSignal()->connect(boost::bind(&handleAvatarLODChanged, _1)); - gSavedSettings.getControl("RenderTerrainLODFactor")->getSignal()->connect(boost::bind(&handleTerrainLODChanged, _1)); - gSavedSettings.getControl("RenderTreeLODFactor")->getSignal()->connect(boost::bind(&handleTreeLODChanged, _1)); - gSavedSettings.getControl("RenderFlexTimeFactor")->getSignal()->connect(boost::bind(&handleFlexLODChanged, _1)); - gSavedSettings.getControl("ThrottleBandwidthKBPS")->getSignal()->connect(boost::bind(&handleBandwidthChanged, _1)); - gSavedSettings.getControl("RenderGamma")->getSignal()->connect(boost::bind(&handleGammaChanged, _1)); - gSavedSettings.getControl("RenderFogRatio")->getSignal()->connect(boost::bind(&handleFogRatioChanged, _1)); - gSavedSettings.getControl("RenderMaxPartCount")->getSignal()->connect(boost::bind(&handleMaxPartCountChanged, _1)); - gSavedSettings.getControl("RenderDynamicLOD")->getSignal()->connect(boost::bind(&handleRenderDynamicLODChanged, _1)); - gSavedSettings.getControl("RenderDebugTextureBind")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1)); - gSavedSettings.getControl("RenderFastAlpha")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1)); - gSavedSettings.getControl("RenderObjectBump")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1)); - gSavedSettings.getControl("RenderMaxVBOSize")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1)); - gSavedSettings.getControl("RenderUseFBO")->getSignal()->connect(boost::bind(&handleRenderUseFBOChanged, _1)); - gSavedSettings.getControl("RenderUseImpostors")->getSignal()->connect(boost::bind(&handleRenderUseImpostorsChanged, _1)); - gSavedSettings.getControl("RenderUseCleverUI")->getSignal()->connect(boost::bind(&handleRenderUseCleverUIChanged, _1)); - gSavedSettings.getControl("RenderResolutionDivisor")->getSignal()->connect(boost::bind(&handleRenderResolutionDivisorChanged, _1)); - gSavedSettings.getControl("AvatarCompositeLimit")->getSignal()->connect(boost::bind(&handleCompositeLimitChanged, _1)); - gSavedSettings.getControl("TextureMemory")->getSignal()->connect(boost::bind(&handleVideoMemoryChanged, _1)); - gSavedSettings.getControl("ChatFontSize")->getSignal()->connect(boost::bind(&handleChatFontSizeChanged, _1)); - gSavedSettings.getControl("ChatPersistTime")->getSignal()->connect(boost::bind(&handleChatPersistTimeChanged, _1)); - gSavedSettings.getControl("ConsoleMaxLines")->getSignal()->connect(boost::bind(&handleConsoleMaxLinesChanged, _1)); - gSavedSettings.getControl("UseOcclusion")->getSignal()->connect(boost::bind(&handleUseOcclusionChanged, _1)); - gSavedSettings.getControl("AudioLevelMaster")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("AudioLevelSFX")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("AudioLevelUI")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("AudioLevelAmbient")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("AudioLevelMusic")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("AudioLevelMedia")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("AudioLevelVoice")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("AudioLevelDistance")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("AudioLevelDoppler")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("AudioLevelRolloff")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("AudioStreamingMusic")->getSignal()->connect(boost::bind(&handleAudioStreamMusicChanged, _1)); - gSavedSettings.getControl("MuteAudio")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("MuteMusic")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("MuteMedia")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("MuteVoice")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("MuteAmbient")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("MuteUI")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _1)); - gSavedSettings.getControl("RenderVBOEnable")->getSignal()->connect(boost::bind(&handleRenderUseVBOChanged, _1)); - gSavedSettings.getControl("WLSkyDetail")->getSignal()->connect(boost::bind(&handleWLSkyDetailChanged, _1)); - gSavedSettings.getControl("RenderLightingDetail")->getSignal()->connect(boost::bind(&handleRenderLightingDetailChanged, _1)); - gSavedSettings.getControl("NumpadControl")->getSignal()->connect(boost::bind(&handleNumpadControlChanged, _1)); - gSavedSettings.getControl("FlycamAxis0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("FlycamAxis1")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("FlycamAxis2")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("FlycamAxis3")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("FlycamAxis4")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("FlycamAxis5")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("FlycamAxis6")->getSignal()->connect(boost::bind(&handleJoystickChanged, _1)); - gSavedSettings.getControl("DebugViews")->getSignal()->connect(boost::bind(&handleDebugViewsChanged, _1)); - gSavedSettings.getControl("UserLogFile")->getSignal()->connect(boost::bind(&handleLogFileChanged, _1)); - gSavedSettings.getControl("RenderHideGroupTitle")->getSignal()->connect(boost::bind(handleHideGroupTitleChanged, _1)); - gSavedSettings.getControl("EffectColor")->getSignal()->connect(boost::bind(handleEffectColorChanged, _1)); - gSavedSettings.getControl("MiniMapRotate")->getSignal()->connect(boost::bind(handleRotateNetMapChanged, _1)); - gSavedSettings.getControl("VectorizePerfTest")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _1)); - gSavedSettings.getControl("VectorizeEnable")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _1)); - gSavedSettings.getControl("VectorizeProcessor")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _1)); - gSavedSettings.getControl("VectorizeSkin")->getSignal()->connect(boost::bind(&handleVectorizeChanged, _1)); - gSavedSettings.getControl("EnableVoiceChat")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); - gSavedSettings.getControl("PTTCurrentlyEnabled")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); - gSavedSettings.getControl("PushToTalkButton")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); - gSavedSettings.getControl("PushToTalkToggle")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); - gSavedSettings.getControl("VoiceEarLocation")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); - gSavedSettings.getControl("VivoxDebugServerName")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); - gSavedSettings.getControl("VoiceInputAudioDevice")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); - gSavedSettings.getControl("VoiceOutputAudioDevice")->getSignal()->connect(boost::bind(&handleVoiceClientPrefsChanged, _1)); } - diff --git a/indra/newview/llviewercontrol.h b/indra/newview/llviewercontrol.h index 2727e36b53..c2a9dc9096 100644 --- a/indra/newview/llviewercontrol.h +++ b/indra/newview/llviewercontrol.h @@ -32,8 +32,9 @@ #ifndef LL_LLVIEWERCONTROL_H #define LL_LLVIEWERCONTROL_H -#include #include "llcontrol.h" +#include "llfloater.h" +#include "lltexteditor.h" // Enabled this definition to compile a 'hacked' viewer that // allows a hacked godmode to be toggled on and off. @@ -42,12 +43,33 @@ extern BOOL gHackGodmode; #endif +class LLFloaterSettingsDebug : public LLFloater +{ +public: + LLFloaterSettingsDebug(); + virtual ~LLFloaterSettingsDebug(); + + virtual BOOL postBuild(); + virtual void draw(); + + void updateControl(LLControlBase* control); + + static void show(void*); + static void onSettingSelect(LLUICtrl* ctrl, void* user_data); + static void onCommitSettings(LLUICtrl* ctrl, void* user_data); + static void onClickDefault(void* user_data); + +protected: + static LLFloaterSettingsDebug* sInstance; + LLTextEditor* mComment; +}; + // These functions found in llcontroldef.cpp *TODO: clean this up! //setting variables are declared in this function +void declare_settings(); +void fixup_settings(); void settings_setup_listeners(); -extern std::map gSettings; - // for the graphics settings void create_graphics_group(LLControlGroup& group); @@ -68,4 +90,7 @@ extern LLControlGroup gCrashSettings; extern LLString gLastRunVersion; extern LLString gCurrentVersion; +extern LLString gSettingsFileName; +extern LLString gPerAccountSettingsFileName; + #endif // LL_LLVIEWERCONTROL_H diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index fe00c25c63..2677b33af8 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -866,53 +866,13 @@ static F64 sUpdateGeometryRunAvgOn[10]; static U32 sUpdateGeometryRunCount = 0 ; static U32 sUpdateGeometryCalls = 0 ; static U32 sUpdateGeometryLastProcessor = 0 ; -static BOOL sVectorizePerfTest = FALSE; -static U32 sVectorizeProcessor = 0; - -//static void (*LLViewerJointMesh::sUpdateGeometryFunc)(LLFace* face, LLPolyMesh* mesh); -//static -void LLViewerJointMesh::updateVectorize() -{ - sVectorizePerfTest = gSavedSettings.getBOOL("VectorizePerfTest"); - sVectorizeProcessor = gSavedSettings.getU32("VectorizeProcessor"); - BOOL vectorizeEnable = gSavedSettings.getBOOL("VectorizeEnable"); - BOOL vectorizeSkin = gSavedSettings.getBOOL("VectorizeSkin"); - - std::string vp; - switch(sVectorizeProcessor) - { - case 2: vp = "SSE2"; break; // *TODO: replace the magic #s - case 1: vp = "SSE"; break; - default: vp = "COMPILER DEFAULT"; break; - } - llinfos << "Vectorization : " << ( vectorizeEnable ? "ENABLED" : "DISABLED" ) << llendl ; - llinfos << "Vector Processor : " << vp << llendl ; - llinfos << "Vectorized Skinning : " << ( vectorizeSkin ? "ENABLED" : "DISABLED" ) << llendl ; - if(vectorizeEnable && vectorizeSkin) - { - switch(sVectorizeProcessor) - { - case 2: - sUpdateGeometryFunc = &updateGeometrySSE2; - break; - case 1: - sUpdateGeometryFunc = &updateGeometrySSE; - break; - default: - sUpdateGeometryFunc = &updateGeometryVectorized; - break; - } - } - else - { - sUpdateGeometryFunc = &updateGeometryOriginal; - } -} - void LLViewerJointMesh::updateGeometry() { + extern BOOL gVectorizePerfTest; + extern U32 gVectorizeProcessor; + if (!(mValid && mMesh && mFace @@ -923,7 +883,7 @@ void LLViewerJointMesh::updateGeometry() return; } - if (!sVectorizePerfTest) + if (!gVectorizePerfTest) { // Once we've measured performance, just run the specified // code version. @@ -956,13 +916,13 @@ void LLViewerJointMesh::updateGeometry() { F64 time_since_app_start = ug_timer.getElapsedSeconds(); if(sUpdateGeometryGlobalTime == 0.0 - || sUpdateGeometryLastProcessor != sVectorizeProcessor) + || sUpdateGeometryLastProcessor != gVectorizeProcessor) { sUpdateGeometryGlobalTime = time_since_app_start; sUpdateGeometryElapsedTime = 0; sUpdateGeometryCalls = 0; sUpdateGeometryRunCount = 0; - sUpdateGeometryLastProcessor = sVectorizeProcessor; + sUpdateGeometryLastProcessor = gVectorizeProcessor; sUpdateGeometryCallPointer = false; return; } @@ -1009,7 +969,7 @@ void LLViewerJointMesh::updateGeometry() F64 perf_boost = ( sUpdateGeometryElapsedTimeOff - sUpdateGeometryElapsedTimeOn ) / sUpdateGeometryElapsedTimeOn; llinfos << "run averages (" << (F64)sUpdateGeometryRunCount << "/10) vectorize off " << a - << "% : vectorize type " << sVectorizeProcessor + << "% : vectorize type " << gVectorizeProcessor << " " << b << "% : performance boost " << perf_boost * 100.0 @@ -1023,6 +983,7 @@ void LLViewerJointMesh::updateGeometry() // We have data now on which version is faster. Switch to that // code and save the data for next run. + gVectorizePerfTest = FALSE; gSavedSettings.setBOOL("VectorizePerfTest", FALSE); if (perf_boost > 0.0) diff --git a/indra/newview/llviewerjointmesh.h b/indra/newview/llviewerjointmesh.h index 4cef1552ca..8e1ee514ff 100644 --- a/indra/newview/llviewerjointmesh.h +++ b/indra/newview/llviewerjointmesh.h @@ -149,9 +149,6 @@ public: /*virtual*/ BOOL isAnimatable() { return FALSE; } - static void updateVectorize(); // Update globals when settings variables change - -private: // Avatar vertex skinning is a significant performance issue on computers // with avatar vertex programs turned off (for example, most Macs). We // therefore have custom versions that use SIMD instructions. diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 9af072ad6f..f86d822d90 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -44,6 +44,9 @@ #include "llmediamanager.h" #include "lluuid.h" +// don't want to include llappviewer.h +extern std::string gChannelName; + // Implementation functions not exported into header file class LLViewerMediaImpl : public LLMediaObserver @@ -454,7 +457,7 @@ void LLViewerMedia::initClass() // append our magic version number string to the browser user agent id std::ostringstream codec; codec << "[Second Life "; - codec << "(" << gSavedSettings.getString("VersionChannelName") << ")"; + codec << "(" << gChannelName << ")"; codec << " - " << LL_VERSION_MAJOR << "." << LL_VERSION_MINOR << "." << LL_VERSION_PATCH << "." << LL_VERSION_BUILD; codec << "]"; init_data->setBrowserUserAgentId( codec.str() ); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index a2b9cde5d1..a384d24947 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -120,7 +120,6 @@ #include "llfloaterregioninfo.h" #include "llfloaterreporter.h" #include "llfloaterscriptdebug.h" -#include "llfloatersettingsdebug.h" #include "llfloaterenvsettings.h" #include "llfloaterstats.h" #include "llfloatertest.h" @@ -377,11 +376,6 @@ void toggle_cull_small(void *); void toggle_show_xui_names(void *); BOOL check_show_xui_names(void *); -void run_vectorize_perf_test(void *) -{ - gSavedSettings.setBOOL("VectorizePerfTest", TRUE); -} - // Debug UI void handle_web_search_demo(void*); void handle_slurl_test(void*); @@ -1097,7 +1091,7 @@ void init_client_menu(LLMenuGL* menu) &menu_check_control, (void*)"ShowConsoleWindow")); - if(gSavedSettings.getBOOL("QAMode")) + if(gQAMode) { LLMenuGL* sub = NULL; sub = new LLMenuGL("Debugging"); @@ -1177,6 +1171,7 @@ extern BOOL gDebugClicks; extern BOOL gDebugWindowProc; extern BOOL gDebugTextEditorTips; extern BOOL gDebugSelectMgr; +extern BOOL gVectorizePerfTest; void init_debug_ui_menu(LLMenuGL* menu) { @@ -1388,7 +1383,7 @@ void init_debug_rendering_menu(LLMenuGL* menu) (void*)"ShowDepthBuffer")); sub_menu->append(new LLMenuItemToggleGL("Show Select Buffer", &gDebugSelect)); - sub_menu->append(new LLMenuItemCallGL("Vectorize Perf Test", &run_vectorize_perf_test)); + sub_menu->append(new LLMenuItemToggleGL("Vectorize Perf Test", &gVectorizePerfTest)); sub_menu = new LLMenuGL("Render Tests"); @@ -4853,7 +4848,7 @@ BOOL menu_check_build_tool( void* user_data ) void handle_reload_settings(void*) { gSavedSettings.resetToDefaults(); - gSavedSettings.loadFromFile(gSavedSettings.getString("ClientSettingsFile"), TRUE); + gSavedSettings.loadFromFile(gSettingsFileName, TRUE); llinfos << "Loading colors from colors.xml" << llendl; std::string color_file = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"colors.xml"); diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp index b0ebc64b7a..6fb2957023 100644 --- a/indra/newview/llviewernetwork.cpp +++ b/indra/newview/llviewernetwork.cpp @@ -114,5 +114,10 @@ LLGridData gGridInfo[GRID_INFO_COUNT] = // Use this to figure out which domain name and login URI to use. EGridInfo gGridChoice = GRID_INFO_NONE; -LLString gGridName; /* Flawfinder: ignore */ +char gGridName[MAX_STRING]; /* Flawfinder: ignore */ + +F32 gPacketDropPercentage = 0.f; +F32 gInBandwidth = 0.f; +F32 gOutBandwidth = 0.f; + unsigned char gMACAddress[MAC_ADDRESS_BYTES]; /* Flawfinder: ignore */ diff --git a/indra/newview/llviewernetwork.h b/indra/newview/llviewernetwork.h index 4e6c874921..4de73aae7a 100644 --- a/indra/newview/llviewernetwork.h +++ b/indra/newview/llviewernetwork.h @@ -55,7 +55,7 @@ enum EGridInfo GRID_INFO_VAAK, GRID_INFO_YAMI, GRID_INFO_LOCAL, - GRID_INFO_OTHER, // IP address set via command line option + GRID_INFO_OTHER, // IP address set via -user or other command line option GRID_INFO_COUNT }; @@ -68,9 +68,12 @@ struct LLGridData const char* mHelperURI; }; +extern F32 gPacketDropPercentage; +extern F32 gInBandwidth; +extern F32 gOutBandwidth; extern EGridInfo gGridChoice; extern LLGridData gGridInfo[]; -extern LLString gGridName; /* Flawfinder: ignore */ +extern char gGridName[MAX_STRING]; /* Flawfinder: ignore */ const S32 MAC_ADDRESS_BYTES = 6; extern unsigned char gMACAddress[MAC_ADDRESS_BYTES]; /* Flawfinder: ignore */ diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index e2ea6e6ecf..69e08db2bf 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -678,6 +678,31 @@ void LLVivoxProtocolParser::processResponse(std::string tag) /////////////////////////////////////////////////////////////////////////////////////////////// +class LLVoiceClientPrefsListener: public LLSimpleListener +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + // Note: Ignore the specific event value, look up the ones we want + + gVoiceClient->setVoiceEnabled(gSavedSettings.getBOOL("EnableVoiceChat")); + gVoiceClient->setUsePTT(gSavedSettings.getBOOL("PTTCurrentlyEnabled")); + std::string keyString = gSavedSettings.getString("PushToTalkButton"); + gVoiceClient->setPTTKey(keyString); + gVoiceClient->setPTTIsToggle(gSavedSettings.getBOOL("PushToTalkToggle")); + gVoiceClient->setEarLocation(gSavedSettings.getS32("VoiceEarLocation")); + std::string serverName = gSavedSettings.getString("VivoxDebugServerName"); + gVoiceClient->setVivoxDebugServerName(serverName); + + std::string inputDevice = gSavedSettings.getString("VoiceInputAudioDevice"); + gVoiceClient->setCaptureDevice(inputDevice); + std::string outputDevice = gSavedSettings.getString("VoiceOutputAudioDevice"); + gVoiceClient->setRenderDevice(outputDevice); + + return true; + } +}; +static LLVoiceClientPrefsListener voice_prefs_listener; + class LLVoiceClientMuteListObserver : public LLMuteListObserver { /* virtual */ void onChange() { gVoiceClient->muteListChanged();} @@ -834,6 +859,16 @@ LLVoiceClient::LLVoiceClient() std::string renderDevice = gSavedSettings.getString("VoiceOutputAudioDevice"); setRenderDevice(renderDevice); + // Set up our listener to get updates on all prefs values we care about. + gSavedSettings.getControl("EnableVoiceChat")->addListener(&voice_prefs_listener); + gSavedSettings.getControl("PTTCurrentlyEnabled")->addListener(&voice_prefs_listener); + gSavedSettings.getControl("PushToTalkButton")->addListener(&voice_prefs_listener); + gSavedSettings.getControl("PushToTalkToggle")->addListener(&voice_prefs_listener); + gSavedSettings.getControl("VoiceEarLocation")->addListener(&voice_prefs_listener); + gSavedSettings.getControl("VivoxDebugServerName")->addListener(&voice_prefs_listener); + gSavedSettings.getControl("VoiceInputAudioDevice")->addListener(&voice_prefs_listener); + gSavedSettings.getControl("VoiceOutputAudioDevice")->addListener(&voice_prefs_listener); + mTuningMode = false; mTuningEnergy = 0.0f; mTuningMicVolume = 0; @@ -1246,7 +1281,7 @@ void LLVoiceClient::stateMachine() break; case stateStart: - if(gSavedSettings.getBOOL("CmdLineDisableVoice")) + if(gDisableVoice) { // Voice is locked out, we must not launch the vivox daemon. setState(stateJail); @@ -3609,7 +3644,7 @@ void LLVoiceClient::setVoiceEnabled(bool enabled) bool LLVoiceClient::voiceEnabled() { - return gSavedSettings.getBOOL("EnableVoiceChat") && !gSavedSettings.getBOOL("CmdLineDisableVoice"); + return gSavedSettings.getBOOL("EnableVoiceChat") && !gDisableVoice; } void LLVoiceClient::setUsePTT(bool usePTT) diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index fc4ede5bab..9dc92efa81 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -238,9 +238,8 @@ void LLXMLRPCTransaction::Impl::init(XMLRPC_REQUEST request, bool useGzip) // mCurlRequest->setopt(CURLOPT_VERBOSE, 1); // usefull for debugging mCurlRequest->setopt(CURLOPT_NOSIGNAL, 1); mCurlRequest->setWriteCallback(&curlDownloadCallback, (void*)this); - BOOL vefifySSLCert = !gSavedSettings.getBOOL("NoVerifySSLCert"); - mCurlRequest->setopt(CURLOPT_SSL_VERIFYPEER, vefifySSLCert); - mCurlRequest->setopt(CURLOPT_SSL_VERIFYHOST, vefifySSLCert ? 2 : 0); + mCurlRequest->setopt(CURLOPT_SSL_VERIFYPEER, gVerifySSLCert); + mCurlRequest->setopt(CURLOPT_SSL_VERIFYHOST, gVerifySSLCert? 2 : 0); // Be a little impatient about establishing connections. mCurlRequest->setopt(CURLOPT_CONNECTTIMEOUT, 40L); diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index e87fe8d8ff..b19e4e2c9c 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -115,15 +115,15 @@ class ViewerManifest(LLManifest): if not self.default_grid(): if self.default_channel(): # beta grid viewer - channel_flags = '--settings settings_beta.xml' - grid_flags = "--helperuri http://preview-%(grid)s.secondlife.com/helpers/ --loginuri https://login.%(grid)s.lindenlab.com/cgi-bin/login.cgi" % {'grid':self.args['grid']} + channel_flags = '-settings settings_beta.xml' + grid_flags = "-helperuri http://preview-%(grid)s.secondlife.com/helpers/ -loginuri https://login.%(grid)s.lindenlab.com/cgi-bin/login.cgi" % {'grid':self.args['grid']} if not self.default_channel(): # some channel on some grid - channel_flags = '--settings settings_%s.xml --channel "%s"' % (self.channel_lowerword(), self.channel()) + channel_flags = '-settings settings_%s.xml -channel "%s"' % (self.channel_lowerword(), self.channel()) elif self.login_channel(): # Report a special channel during login, but use default channel elsewhere - channel_flags = '--channel "%s"' % (self.login_channel()) + channel_flags = '-channel "%s"' % (self.login_channel()) return " ".join((channel_flags, grid_flags)).strip() -- cgit v1.2.3