Clean up and simplify wlf panel code
This commit is contained in:
@@ -34,15 +34,11 @@
|
|||||||
#include "wlfPanel_AdvSettings.h"
|
#include "wlfPanel_AdvSettings.h"
|
||||||
|
|
||||||
#include "llbutton.h"
|
#include "llbutton.h"
|
||||||
#include "lluictrlfactory.h"
|
|
||||||
#include "llviewercontrol.h"
|
|
||||||
#include "lliconctrl.h"
|
|
||||||
#include "lloverlaybar.h"
|
|
||||||
#include "lltextbox.h"
|
|
||||||
#include "llcombobox.h"
|
|
||||||
#include "llsliderctrl.h"
|
|
||||||
#include "llcheckboxctrl.h"
|
#include "llcheckboxctrl.h"
|
||||||
#include "llstartup.h"
|
#include "llcombobox.h"
|
||||||
|
#include "llpostprocess.h"
|
||||||
|
#include "llsliderctrl.h"
|
||||||
|
#include "lluictrlfactory.h"
|
||||||
|
|
||||||
#include "llfloaterwindlight.h"
|
#include "llfloaterwindlight.h"
|
||||||
#include "llfloaterwater.h"
|
#include "llfloaterwater.h"
|
||||||
@@ -57,6 +53,10 @@
|
|||||||
#include "llwlparamset.h"
|
#include "llwlparamset.h"
|
||||||
#include "llwlparammanager.h"
|
#include "llwlparammanager.h"
|
||||||
|
|
||||||
|
// [RLVa:KB]
|
||||||
|
#include "rlvhandler.h"
|
||||||
|
// [/RLVa:KB]
|
||||||
|
|
||||||
// Hover funcs
|
// Hover funcs
|
||||||
void syncFromPreferenceSetting(LLSliderCtrl* sldrCtrl);
|
void syncFromPreferenceSetting(LLSliderCtrl* sldrCtrl);
|
||||||
void onHoverSliderMoved(const LLSD& val);
|
void onHoverSliderMoved(const LLSD& val);
|
||||||
@@ -171,10 +171,10 @@ BOOL wlfPanel_AdvSettings::postBuild()
|
|||||||
//populateDayCyclePresetsList();
|
//populateDayCyclePresetsList();
|
||||||
|
|
||||||
// next/prev buttons
|
// next/prev buttons
|
||||||
getChild<LLUICtrl>("WWnext")->setCommitCallback(boost::bind(&wlfPanel_AdvSettings::onClickWWNext, this));
|
getChild<LLUICtrl>("WWnext")->setCommitCallback(boost::bind(wlfPanel_AdvSettings::onClickArrow, mWaterPresetCombo, true));
|
||||||
getChild<LLUICtrl>("WWprev")->setCommitCallback(boost::bind(&wlfPanel_AdvSettings::onClickWWPrev, this));
|
getChild<LLUICtrl>("WWprev")->setCommitCallback(boost::bind(wlfPanel_AdvSettings::onClickArrow, mWaterPresetCombo, false));
|
||||||
getChild<LLUICtrl>("WLnext")->setCommitCallback(boost::bind(&wlfPanel_AdvSettings::onClickWLNext, this));
|
getChild<LLUICtrl>("WLnext")->setCommitCallback(boost::bind(wlfPanel_AdvSettings::onClickArrow, mSkyPresetCombo, true));
|
||||||
getChild<LLUICtrl>("WLprev")->setCommitCallback(boost::bind(&wlfPanel_AdvSettings::onClickWLPrev, this));
|
getChild<LLUICtrl>("WLprev")->setCommitCallback(boost::bind(wlfPanel_AdvSettings::onClickArrow, mSkyPresetCombo, false));
|
||||||
|
|
||||||
getChild<LLUICtrl>("EnvAdvancedSkyButton")->setCommitCallback(boost::bind(LLFloaterWindLight::show));
|
getChild<LLUICtrl>("EnvAdvancedSkyButton")->setCommitCallback(boost::bind(LLFloaterWindLight::show));
|
||||||
getChild<LLUICtrl>("EnvAdvancedWaterButton")->setCommitCallback(boost::bind(LLFloaterWater::show));
|
getChild<LLUICtrl>("EnvAdvancedWaterButton")->setCommitCallback(boost::bind(LLFloaterWater::show));
|
||||||
@@ -224,7 +224,7 @@ BOOL wlfPanel_AdvSettings::postBuild()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mHoverHeight = NULL;
|
mHoverHeight = nullptr;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -301,48 +301,13 @@ void wlfPanel_AdvSettings::onChangeWLPresetName(const LLSD& value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wlfPanel_AdvSettings::onClickWWNext()
|
void wlfPanel_AdvSettings::onClickArrow(LLComboBox* combo, bool next)
|
||||||
{
|
{
|
||||||
S32 index = mWaterPresetCombo->getCurrentIndex();
|
S32 index = combo->getCurrentIndex() + (next ? 1 : -1);
|
||||||
++index;
|
const auto too_far = next ? combo->getItemCount() : -1;
|
||||||
if (index == mWaterPresetCombo->getItemCount())
|
const auto wrap_around = next ? 0 : combo->getItemCount();
|
||||||
index = 0;
|
combo->setCurrentByIndex(index == too_far ? wrap_around : index);
|
||||||
mWaterPresetCombo->setCurrentByIndex(index);
|
combo->onCommit();
|
||||||
|
|
||||||
onChangeWWPresetName(mWaterPresetCombo->getSelectedValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
void wlfPanel_AdvSettings::onClickWWPrev()
|
|
||||||
{
|
|
||||||
S32 index = mWaterPresetCombo->getCurrentIndex();
|
|
||||||
if (index == 0)
|
|
||||||
index = mWaterPresetCombo->getItemCount();
|
|
||||||
--index;
|
|
||||||
mWaterPresetCombo->setCurrentByIndex(index);
|
|
||||||
|
|
||||||
onChangeWWPresetName(mWaterPresetCombo->getSelectedValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
void wlfPanel_AdvSettings::onClickWLNext()
|
|
||||||
{
|
|
||||||
S32 index = mSkyPresetCombo->getCurrentIndex();
|
|
||||||
++index;
|
|
||||||
if (index == mSkyPresetCombo->getItemCount())
|
|
||||||
index = 0;
|
|
||||||
mSkyPresetCombo->setCurrentByIndex(index);
|
|
||||||
|
|
||||||
onChangeWLPresetName(mSkyPresetCombo->getSelectedValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
void wlfPanel_AdvSettings::onClickWLPrev()
|
|
||||||
{
|
|
||||||
S32 index = mSkyPresetCombo->getCurrentIndex();
|
|
||||||
if (index == 0)
|
|
||||||
index = mSkyPresetCombo->getItemCount();
|
|
||||||
--index;
|
|
||||||
mSkyPresetCombo->setCurrentByIndex(index);
|
|
||||||
|
|
||||||
onChangeWLPresetName(mSkyPresetCombo->getSelectedValue());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wlfPanel_AdvSettings::onChangeDayTime(const LLSD& value)
|
void wlfPanel_AdvSettings::onChangeDayTime(const LLSD& value)
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
#include <boost/ptr_container/ptr_list.hpp>
|
#include <boost/ptr_container/ptr_list.hpp>
|
||||||
|
|
||||||
// [RLVa:KB]
|
// [RLVa:KB]
|
||||||
#include "rlvhandler.h"
|
#include "rlvdefines.h"
|
||||||
// [/RLVa:KB]
|
// [/RLVa:KB]
|
||||||
|
|
||||||
class LLComboBox;
|
class LLComboBox;
|
||||||
@@ -66,10 +66,7 @@ protected:
|
|||||||
void build();
|
void build();
|
||||||
|
|
||||||
void onUseRegionSettings(const LLSD& value);
|
void onUseRegionSettings(const LLSD& value);
|
||||||
void onClickWWNext();
|
static void onClickArrow(LLComboBox* combo, bool next);
|
||||||
void onClickWWPrev();
|
|
||||||
void onClickWLNext();
|
|
||||||
void onClickWLPrev();
|
|
||||||
void onChangeDayTime(const LLSD& value);
|
void onChangeDayTime(const LLSD& value);
|
||||||
|
|
||||||
void refreshLists(); /// update controls with user prefs
|
void refreshLists(); /// update controls with user prefs
|
||||||
|
|||||||
Reference in New Issue
Block a user