diff options
Diffstat (limited to 'indra/newview')
6 files changed, 90 insertions, 6 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index aa723eb3a8..a5d3a34322 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -328,6 +328,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)  	mCommitCallbackRegistrar.add("Pref.AutoAdjustments",         boost::bind(&LLFloaterPreference::onClickAutoAdjustments, this));  	mCommitCallbackRegistrar.add("Pref.HardwareDefaults",		boost::bind(&LLFloaterPreference::setHardwareDefaults, this));  	mCommitCallbackRegistrar.add("Pref.AvatarImpostorsEnable",	boost::bind(&LLFloaterPreference::onAvatarImpostorsEnable, this)); +    mCommitCallbackRegistrar.add("Pref.UpdateIndirectMaxNonImpostors", boost::bind(&LLFloaterPreference::updateMaxNonImpostors, this));  	mCommitCallbackRegistrar.add("Pref.UpdateIndirectMaxComplexity",	boost::bind(&LLFloaterPreference::updateMaxComplexity, this));      mCommitCallbackRegistrar.add("Pref.RenderOptionUpdate",     boost::bind(&LLFloaterPreference::onRenderOptionEnable, this));  	mCommitCallbackRegistrar.add("Pref.WindowedMod",			boost::bind(&LLFloaterPreference::onCommitWindowedMode, this)); @@ -359,6 +360,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key)  	LLAvatarPropertiesProcessor::getInstance()->addObserver( gAgent.getID(), this );      mComplexityChangedSignal = gSavedSettings.getControl("RenderAvatarMaxComplexity")->getCommitSignal()->connect(boost::bind(&LLFloaterPreference::updateComplexityText, this)); +    mImpostorsChangedSignal = gSavedSettings.getControl("RenderAvatarMaxNonImpostors")->getSignal()->connect(boost::bind(&LLFloaterPreference::updateIndirectMaxNonImpostors, this, _2));  	mCommitCallbackRegistrar.add("Pref.ClearLog",				boost::bind(&LLConversationLog::onClearLog, &LLConversationLog::instance()));  	mCommitCallbackRegistrar.add("Pref.DeleteTranscripts",      boost::bind(&LLFloaterPreference::onDeleteTranscripts, this)); @@ -528,6 +530,7 @@ LLFloaterPreference::~LLFloaterPreference()  {  	LLConversationLog::instance().removeObserver(this);      mComplexityChangedSignal.disconnect(); +    mImpostorsChangedSignal.disconnect();  }  void LLFloaterPreference::draw() @@ -1283,6 +1286,9 @@ void LLAvatarComplexityControls::setIndirectMaxArc()  void LLFloaterPreference::refresh()  {  	LLPanel::refresh(); +    setMaxNonImpostorsText( +        gSavedSettings.getU32("RenderAvatarMaxNonImpostors"), +        getChild<LLTextBox>("IndirectMaxNonImpostorsText", true));      LLAvatarComplexityControls::setText(          gSavedSettings.getU32("RenderAvatarMaxComplexity"),          getChild<LLTextBox>("IndirectMaxComplexityText", true)); @@ -1561,6 +1567,44 @@ void LLAvatarComplexityControls::setRenderTimeText(F32 value, LLTextBox* text_bo      }  } +void LLFloaterPreference::updateMaxNonImpostors() +{ +    // Called when the IndirectMaxNonImpostors control changes +    // Responsible for fixing the slider label (IndirectMaxNonImpostorsText) and setting RenderAvatarMaxNonImpostors +    LLSliderCtrl* ctrl = getChild<LLSliderCtrl>("IndirectMaxNonImpostors", true); +    U32 value = ctrl->getValue().asInteger(); + +    if (0 == value || LLVOAvatar::NON_IMPOSTORS_MAX_SLIDER <= value) +    { +        value = 0; +    } +    gSavedSettings.setU32("RenderAvatarMaxNonImpostors", value); +    LLVOAvatar::updateImpostorRendering(value); // make it effective immediately +    setMaxNonImpostorsText(value, getChild<LLTextBox>("IndirectMaxNonImpostorsText")); +} + +void LLFloaterPreference::updateIndirectMaxNonImpostors(const LLSD& newvalue) +{ +    U32 value = newvalue.asInteger(); +    if ((value != 0) && (value != gSavedSettings.getU32("IndirectMaxNonImpostors"))) +    { +        gSavedSettings.setU32("IndirectMaxNonImpostors", value); +    } +    setMaxNonImpostorsText(value, getChild<LLTextBox>("IndirectMaxNonImpostorsText")); +} + +void LLFloaterPreference::setMaxNonImpostorsText(U32 value, LLTextBox* text_box) +{ +    if (0 == value) +    { +        text_box->setText(LLTrans::getString("no_limit")); +    } +    else +    { +        text_box->setText(llformat("%d", value)); +    } +} +  void LLFloaterPreference::updateMaxComplexity()  {  	// Called when the IndirectMaxComplexity control changes diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 04ac87364d..936808d58e 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -210,6 +210,9 @@ private:  	void onDeleteTranscripts();  	void onDeleteTranscriptsResponse(const LLSD& notification, const LLSD& response);  	void updateDeleteTranscriptsButton(); +    void updateMaxNonImpostors(); +    void updateIndirectMaxNonImpostors(const LLSD& newvalue); +    void setMaxNonImpostorsText(U32 value, LLTextBox* text_box);  	void updateMaxComplexity();      void updateComplexityText();  	static bool loadFromFilename(const std::string& filename, std::map<std::string, std::string> &label_map); @@ -233,6 +236,7 @@ private:  	std::unique_ptr< ll::prefs::SearchData > mSearchData;  	bool mSearchDataDirty; +    boost::signals2::connection	mImpostorsChangedSignal;      boost::signals2::connection	mComplexityChangedSignal;  	void onUpdateFilterTerm( bool force = false ); diff --git a/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp b/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp index a91f0ec060..d59113144e 100644 --- a/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp +++ b/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp @@ -52,13 +52,14 @@ LLFloaterPreferenceGraphicsAdvanced::LLFloaterPreferenceGraphicsAdvanced(const L      mCommitCallbackRegistrar.add("Pref.Cancel", boost::bind(&LLFloaterPreferenceGraphicsAdvanced::onBtnCancel, this, _2));      mCommitCallbackRegistrar.add("Pref.OK",     boost::bind(&LLFloaterPreferenceGraphicsAdvanced::onBtnOK, this, _2)); -    gSavedSettings.getControl("RenderAvatarMaxNonImpostors")->getSignal()->connect(boost::bind(&LLFloaterPreferenceGraphicsAdvanced::updateIndirectMaxNonImpostors, this, _2)); +    mImpostorsChangedSignal = gSavedSettings.getControl("RenderAvatarMaxNonImpostors")->getSignal()->connect(boost::bind(&LLFloaterPreferenceGraphicsAdvanced::updateIndirectMaxNonImpostors, this, _2));  }  LLFloaterPreferenceGraphicsAdvanced::~LLFloaterPreferenceGraphicsAdvanced()  {      mComplexityChangedSignal.disconnect();      mLODFactorChangedSignal.disconnect(); +    mImpostorsChangedSignal.disconnect();  }  BOOL LLFloaterPreferenceGraphicsAdvanced::postBuild() @@ -221,8 +222,8 @@ void LLFloaterPreferenceGraphicsAdvanced::updateIndirectMaxNonImpostors(const LL      if ((value != 0) && (value != gSavedSettings.getU32("IndirectMaxNonImpostors")))      {          gSavedSettings.setU32("IndirectMaxNonImpostors", value); -        setMaxNonImpostorsText(value, getChild<LLTextBox>("IndirectMaxNonImpostorsText"));      } +    setMaxNonImpostorsText(value, getChild<LLTextBox>("IndirectMaxNonImpostorsText"));  }  void LLFloaterPreferenceGraphicsAdvanced::setMaxNonImpostorsText(U32 value, LLTextBox* text_box) diff --git a/indra/newview/llfloaterpreferencesgraphicsadvanced.h b/indra/newview/llfloaterpreferencesgraphicsadvanced.h index 2c92f3dbf1..80e35368eb 100644 --- a/indra/newview/llfloaterpreferencesgraphicsadvanced.h +++ b/indra/newview/llfloaterpreferencesgraphicsadvanced.h @@ -60,6 +60,7 @@ protected:      void		onBtnOK(const LLSD& userdata);      void		onBtnCancel(const LLSD& userdata); +    boost::signals2::connection	mImpostorsChangedSignal;      boost::signals2::connection	mComplexityChangedSignal;      boost::signals2::connection	mLODFactorChangedSignal;  }; diff --git a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml index bc237322af..d993b1f990 100644 --- a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml +++ b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml @@ -170,7 +170,7 @@      height="16"      increment="1"      initial_value="12" -    label="Max. # of non-impostors:" +    label="Max. # animated avatars:"      label_width="185"      layout="topleft"      left="30" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index 8a9d3b755e..5d1ddc2e69 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -210,26 +210,60 @@      increment="8"      initial_value="160"      label="Draw distance:" -    label_width="90" +    label_width="187"      layout="topleft"      left="30"      min_val="64"      max_val="512"      name="DrawDistance"      top_delta="40" -    width="330" /> +    width="427" />    <text      type="string"      length="1"      follows="left|top"      height="12"      layout="topleft" -    left_delta="330" +    left_delta="427"      name="DrawDistanceMeterText2"      top_delta="0"      width="128">       m    </text> +  <slider +    control_name="IndirectMaxNonImpostors" +    name="IndirectMaxNonImpostors" +    decimal_digits="0" +    increment="1" +    initial_value="12" +    show_text="false" +    min_val="1" +    max_val="66" +    label="Maximum number of animated avatars:" +    follows="left|top" +    layout="topleft" +    height="16" +    label_width="240" +    left="30" +    top_delta="40" +    width="393"> +      <slider.commit_callback +        function="Pref.UpdateIndirectMaxNonImpostors" +        parameter="IndirectNonImpostorsText" /> +  </slider> +  <text +    type="string" +    length="1" +    follows="left|top" +    height="16" +    layout="topleft" +    top_delta="0" +    left_delta="397" +    text_readonly_color="LabelDisabledColor" +    name="IndirectMaxNonImpostorsText" +    width="65"> +      0 +  </text>    <button    height="23"  | 
