aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-09-13 20:26:02 -0700
committerMcCabe Maxsted2009-09-13 20:26:02 -0700
commit162ac8865cb927c561283da696570dcd68490c67 (patch)
tree46fc91ae7a03fadbb03afa5d87f15f6986f044b9
parentFixed windlight toolbar presets not applying when region default (diff)
downloadmeta-impy-162ac8865cb927c561283da696570dcd68490c67.zip
meta-impy-162ac8865cb927c561283da696570dcd68490c67.tar.gz
meta-impy-162ac8865cb927c561283da696570dcd68490c67.tar.bz2
meta-impy-162ac8865cb927c561283da696570dcd68490c67.tar.xz
Added prev/next buttons for windlight presets, cleaned up some stuff
-rw-r--r--ChangeLog.txt13
-rw-r--r--linden/indra/newview/llfloaterwindlight.cpp67
-rw-r--r--linden/indra/newview/llfloaterwindlight.h3
-rw-r--r--linden/indra/newview/llwindlightremotectrl.cpp16
-rw-r--r--linden/indra/newview/llwlparammanager.cpp6
-rw-r--r--linden/indra/newview/llwlparammanager.h6
-rw-r--r--linden/indra/newview/skins/default/textures/textures.xml3
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_windlight_options.xml24
8 files changed, 104 insertions, 34 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index 0f481c6..339e1d0 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,3 +1,16 @@
12009-09-13 McCabe Maxsted <hakushakukun@gmail.com>
2
3 * Added prev/next buttons for windlight presets, cleaned up some stuff.
4
5 modified: linden/indra/newview/llfloaterwindlight.cpp
6 modified: linden/indra/newview/llfloaterwindlight.h
7 modified: linden/indra/newview/llwindlightremotectrl.cpp
8 modified: linden/indra/newview/llwlparammanager.cpp
9 modified: linden/indra/newview/llwlparammanager.h
10 modified: linden/indra/newview/skins/default/textures/textures.xml
11 modified: linden/indra/newview/skins/default/xui/en-us/floater_windlight_options.xml
12
13
12009-09-12 McCabe Maxsted <hakushakukun@gmail.com> 142009-09-12 McCabe Maxsted <hakushakukun@gmail.com>
2 15
3 * Clarified 'show in search' in profile. 16 * Clarified 'show in search' in profile.
diff --git a/linden/indra/newview/llfloaterwindlight.cpp b/linden/indra/newview/llfloaterwindlight.cpp
index 1c3db9b..914513b 100644
--- a/linden/indra/newview/llfloaterwindlight.cpp
+++ b/linden/indra/newview/llfloaterwindlight.cpp
@@ -228,6 +228,10 @@ void LLFloaterWindLight::initCallbacks(void) {
228 // Dome 228 // Dome
229 childSetCommitCallback("WLGamma", onFloatControlMoved, &param_mgr->mWLGamma); 229 childSetCommitCallback("WLGamma", onFloatControlMoved, &param_mgr->mWLGamma);
230 childSetCommitCallback("WLStarAlpha", onStarAlphaMoved, NULL); 230 childSetCommitCallback("WLStarAlpha", onStarAlphaMoved, NULL);
231
232 // next/prev buttons
233 childSetAction("next", onClickNext, this);
234 childSetAction("prev", onClickPrev, this);
231} 235}
232 236
233void LLFloaterWindLight::onClickHelp(void* data) 237void LLFloaterWindLight::onClickHelp(void* data)
@@ -318,6 +322,13 @@ void LLFloaterWindLight::syncMenu()
318 LLWLParamSet& currentParams = param_mgr->mCurParams; 322 LLWLParamSet& currentParams = param_mgr->mCurParams;
319 //std::map<std::string, LLVector4> & currentParams = param_mgr->mCurParams.mParamValues; 323 //std::map<std::string, LLVector4> & currentParams = param_mgr->mCurParams.mParamValues;
320 324
325 // Fixes LL "bug" (preset name isn't kept synchronized)
326 LLComboBox* comboBox = getChild<LLComboBox>("WLPresetsCombo");
327 if (comboBox->getSelectedItemLabel() != currentParams.mName)
328 {
329 comboBox->setSimple(currentParams.mName);
330 }
331
321 // blue horizon 332 // blue horizon
322 param_mgr->mBlueHorizon = currentParams.getVector(param_mgr->mBlueHorizon.mName, err); 333 param_mgr->mBlueHorizon = currentParams.getVector(param_mgr->mBlueHorizon.mName, err);
323 childSetValue("WLBlueHorizonR", param_mgr->mBlueHorizon.r / 2.0); 334 childSetValue("WLBlueHorizonR", param_mgr->mBlueHorizon.r / 2.0);
@@ -439,14 +450,6 @@ void LLFloaterWindLight::syncMenu()
439 childSetValue("WLGamma", param_mgr->mWLGamma.x); 450 childSetValue("WLGamma", param_mgr->mWLGamma.x);
440 451
441 childSetValue("WLStarAlpha", param_mgr->mCurParams.getStarBrightness()); 452 childSetValue("WLStarAlpha", param_mgr->mCurParams.getStarBrightness());
442
443 // Update combobox name
444 LLComboBox* comboBox = getChild<LLComboBox>("WLPresetsCombo");
445 std::string current_name = param_mgr->mCurPresetName;
446 if (!current_name.empty() && current_name != comboBox->getSelectedValue().asString())
447 {
448 comboBox->selectByValue(LLSD(current_name));
449 }
450} 453}
451 454
452 455
@@ -1001,3 +1004,51 @@ void LLFloaterWindLight::deactivateAnimator()
1001 LLWLParamManager::instance()->mAnimator.mIsRunning = false; 1004 LLWLParamManager::instance()->mAnimator.mIsRunning = false;
1002 LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; 1005 LLWLParamManager::instance()->mAnimator.mUseLindenTime = false;
1003} 1006}
1007
1008void LLFloaterWindLight::onClickNext(void* user_data)
1009{
1010 LLWLParamManager * param_mgr = LLWLParamManager::instance();
1011 LLWLParamSet& currentParams = param_mgr->mCurParams;
1012
1013 // find place of current param
1014 std::map<std::string, LLWLParamSet>::iterator mIt =
1015 param_mgr->mParamList.find(currentParams.mName);
1016
1017 // if at the end, loop
1018 std::map<std::string, LLWLParamSet>::iterator last = param_mgr->mParamList.end(); --last;
1019 if(mIt == last)
1020 {
1021 mIt = param_mgr->mParamList.begin();
1022 }
1023 else
1024 {
1025 mIt++;
1026 }
1027 param_mgr->mAnimator.mIsRunning = false;
1028 param_mgr->mAnimator.mUseLindenTime = false;
1029 param_mgr->loadPreset(mIt->first, true);
1030}
1031
1032void LLFloaterWindLight::onClickPrev(void* user_data)
1033{
1034 LLWLParamManager * param_mgr = LLWLParamManager::instance();
1035 LLWLParamSet& currentParams = param_mgr->mCurParams;
1036
1037 // find place of current param
1038 std::map<std::string, LLWLParamSet>::iterator mIt =
1039 param_mgr->mParamList.find(currentParams.mName);
1040
1041 // if at the beginning, loop
1042 if(mIt == param_mgr->mParamList.begin())
1043 {
1044 std::map<std::string, LLWLParamSet>::iterator last = param_mgr->mParamList.end(); --last;
1045 mIt = last;
1046 }
1047 else
1048 {
1049 mIt--;
1050 }
1051 param_mgr->mAnimator.mIsRunning = false;
1052 param_mgr->mAnimator.mUseLindenTime = false;
1053 param_mgr->loadPreset(mIt->first, true);
1054}
diff --git a/linden/indra/newview/llfloaterwindlight.h b/linden/indra/newview/llfloaterwindlight.h
index 3e5556b..70e76c5 100644
--- a/linden/indra/newview/llfloaterwindlight.h
+++ b/linden/indra/newview/llfloaterwindlight.h
@@ -136,6 +136,9 @@ private:
136 static LLFloaterWindLight* sWindLight; 136 static LLFloaterWindLight* sWindLight;
137 137
138 static std::set<std::string> sDefaultPresets; 138 static std::set<std::string> sDefaultPresets;
139
140 static void onClickNext(void* user_data);
141 static void onClickPrev(void* user_data);
139}; 142};
140 143
141 144
diff --git a/linden/indra/newview/llwindlightremotectrl.cpp b/linden/indra/newview/llwindlightremotectrl.cpp
index ca411c5..591b413 100644
--- a/linden/indra/newview/llwindlightremotectrl.cpp
+++ b/linden/indra/newview/llwindlightremotectrl.cpp
@@ -92,11 +92,11 @@ void LLWindlightRemoteCtrl::build()
92{ 92{
93 if (gSavedSettings.getBOOL("ShowWindlightSettingsPopup")) 93 if (gSavedSettings.getBOOL("ShowWindlightSettingsPopup"))
94 { 94 {
95 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_windlight_remote_expanded.xml"/*, &getFactoryMap()*/); 95 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_windlight_remote_expanded.xml");
96 } 96 }
97 else 97 else
98 { 98 {
99 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_windlight_remote.xml"/*, &getFactoryMap()*/); 99 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_windlight_remote.xml");
100 } 100 }
101} 101}
102 102
@@ -128,14 +128,15 @@ void LLWindlightRemoteCtrl::refreshPresets()
128 if (mPresetsCombo) 128 if (mPresetsCombo)
129 { 129 {
130 // snag current preset 130 // snag current preset
131 std::string cur_preset = LLWLParamManager::instance()->mCurPresetName;//mPresetsCombo->getValue().asString(); 131 LLWLParamManager * param_mgr = LLWLParamManager::instance();
132 LLWLParamSet& currentParams = param_mgr->mCurParams;
132 133
133 // clear in case presets names have changed 134 // clear in case presets names have changed
134 mPresetsCombo->clearRows(); 135 mPresetsCombo->clearRows();
135 136
136 std::map<std::string, LLWLParamSet>::iterator mIt = 137 std::map<std::string, LLWLParamSet>::iterator mIt =
137 LLWLParamManager::instance()->mParamList.begin(); 138 param_mgr->mParamList.begin();
138 for(; mIt != LLWLParamManager::instance()->mParamList.end(); mIt++) 139 for(; mIt != param_mgr->mParamList.end(); mIt++)
139 { 140 {
140 mPresetsCombo->add(mIt->first); 141 mPresetsCombo->add(mIt->first);
141 } 142 }
@@ -148,9 +149,10 @@ void LLWindlightRemoteCtrl::refreshPresets()
148 mPresetsCombo->addSimpleElement(getString("midnight"), ADD_BOTTOM); 149 mPresetsCombo->addSimpleElement(getString("midnight"), ADD_BOTTOM);
149 mPresetsCombo->addSimpleElement(getString("revert_region"), ADD_BOTTOM); 150 mPresetsCombo->addSimpleElement(getString("revert_region"), ADD_BOTTOM);
150 151
151 if (!cur_preset.empty()) 152 if (mPresetsCombo->getSelectedItemLabel() != currentParams.mName &&
153 !currentParams.mName.empty())
152 { 154 {
153 mPresetsCombo->selectByValue(LLSD(cur_preset)); 155 mPresetsCombo->selectByValue(LLSD(currentParams.mName));
154 } 156 }
155 else 157 else
156 { 158 {
diff --git a/linden/indra/newview/llwlparammanager.cpp b/linden/indra/newview/llwlparammanager.cpp
index ba21a96..ba3d070 100644
--- a/linden/indra/newview/llwlparammanager.cpp
+++ b/linden/indra/newview/llwlparammanager.cpp
@@ -97,10 +97,7 @@ LLWLParamManager::LLWLParamManager() :
97 97
98 // sky dome 98 // sky dome
99 mDomeOffset(0.96f), 99 mDomeOffset(0.96f),
100 mDomeRadius(15000.f), 100 mDomeRadius(15000.f)
101
102 // current name
103 mCurPresetName("")
104{ 101{
105} 102}
106 103
@@ -229,7 +226,6 @@ void LLWLParamManager::loadPreset(const std::string & name,bool propagate)
229 setParamSet(name, paramsData); 226 setParamSet(name, paramsData);
230 } 227 }
231 presetsXML.close(); 228 presetsXML.close();
232 mCurPresetName = name;
233 } 229 }
234 else 230 else
235 { 231 {
diff --git a/linden/indra/newview/llwlparammanager.h b/linden/indra/newview/llwlparammanager.h
index 4507307..355d3e3 100644
--- a/linden/indra/newview/llwlparammanager.h
+++ b/linden/indra/newview/llwlparammanager.h
@@ -261,11 +261,7 @@ public:
261 F32 mDomeRadius; 261 F32 mDomeRadius;
262 262
263 // list of all the parameters, listed by name 263 // list of all the parameters, listed by name
264 std::map<std::string, LLWLParamSet> mParamList; 264 std::map<std::string, LLWLParamSet> mParamList;
265
266 // current parameter name
267 std::string mCurPresetName;
268
269 265
270private: 266private:
271 // our parameter manager singleton instance 267 // our parameter manager singleton instance
diff --git a/linden/indra/newview/skins/default/textures/textures.xml b/linden/indra/newview/skins/default/textures/textures.xml
index 9e1d9b5..4800048 100644
--- a/linden/indra/newview/skins/default/textures/textures.xml
+++ b/linden/indra/newview/skins/default/textures/textures.xml
@@ -365,6 +365,9 @@
365 <texture name="icn_label_music.tga"/> 365 <texture name="icn_label_music.tga"/>
366 <texture name="icn_label_media.tga"/> 366 <texture name="icn_label_media.tga"/>
367 <texture name="arrow_down.tga"/> 367 <texture name="arrow_down.tga"/>
368 <texture name="arrow_up.tga"/>
369 <texture name="arrow_left.tga"/>
370 <texture name="arrow_right.tga"/>
368 <texture name="cloud-particle.j2c" use_mips="true"/> 371 <texture name="cloud-particle.j2c" use_mips="true"/>
369 372
370 <texture name="skin_thumbnail_default.png" preload="true" /> 373 <texture name="skin_thumbnail_default.png" preload="true" />
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_windlight_options.xml b/linden/indra/newview/skins/default/xui/en-us/floater_windlight_options.xml
index 906e7de..471b3e5 100644
--- a/linden/indra/newview/skins/default/xui/en-us/floater_windlight_options.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_windlight_options.xml
@@ -4,29 +4,35 @@
4 min_width="400" mouse_opaque="true" name="WindLight floater" 4 min_width="400" mouse_opaque="true" name="WindLight floater"
5 rect_control="FloaterAdvancedSkyRect" title="Advanced Sky Editor" 5 rect_control="FloaterAdvancedSkyRect" title="Advanced Sky Editor"
6 width="700"> 6 width="700">
7 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" 7 <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
8 bottom="-50" drop_shadow_visible="true" follows="left|top|right" 8 bottom="-50" drop_shadow_visible="true" follows="left|top|right"
9 font="SansSerif" h_pad="0" halign="left" height="16" 9 font="SansSerif" h_pad="0" halign="left" height="16"
10 left="10" mouse_opaque="true" name="KeyFramePresetsText" v_pad="0" 10 left="10" mouse_opaque="true" name="KeyFramePresetsText" v_pad="0"
11 width="110"> 11 width="110">
12 Sky Presets: 12 Sky Presets:
13 </text> 13 </text>
14 <combo_box allow_text_entry="false" bottom="-50" follows="left|top" height="18" 14 <combo_box allow_text_entry="false" bottom="-52" follows="left|top" height="18"
15 left_delta="110" max_chars="20" mouse_opaque="true" name="WLPresetsCombo" 15 left_delta="110" max_chars="20" mouse_opaque="true" name="WLPresetsCombo"
16 width="150" /> 16 width="150" />
17 <button bottom="-53" enabled="true" font="SansSerif" halign="center" height="20"
18 label="" label_selected="" left_delta="-25" image_overlay="arrow_left.tga"
19 mouse_opaque="true" name="prev" scale_image="true" width="20" />
20 <button bottom="-53" enabled="true" font="SansSerif" halign="center" height="20"
21 label="" label_selected="" left_delta="180" image_overlay="arrow_right.tga"
22 mouse_opaque="true" name="next" scale_image="true" width="20" />
17 <button bottom="-53" enabled="true" font="SansSerif" halign="center" height="20" 23 <button bottom="-53" enabled="true" font="SansSerif" halign="center" height="20"
18 label="New" label_selected="New" left_delta="170" 24 label="New" label_selected="New" left_delta="40"
19 mouse_opaque="true" name="WLNewPreset" scale_image="true" width="70" /> 25 mouse_opaque="true" name="WLNewPreset" scale_image="true" width="70" />
20 <button bottom_delta="0" enabled="true" font="SansSerif" halign="center" height="20" 26 <button bottom_delta="0" enabled="true" font="SansSerif" halign="center" height="20"
21 label="Save" label_selected="Save" left_delta="80" 27 label="Save" label_selected="Save" left_delta="70"
22 mouse_opaque="true" name="WLSavePreset" scale_image="true" width="70" /> 28 mouse_opaque="true" name="WLSavePreset" scale_image="true" width="70" />
23 <button bottom_delta="0" enabled="true" font="SansSerif" halign="center" height="20" 29 <button bottom_delta="0" enabled="true" font="SansSerif" halign="center" height="20"
24 label="Delete" label_selected="Delete" left_delta="80" 30 label="Delete" label_selected="Delete" left_delta="70"
25 mouse_opaque="true" name="WLDeletePreset" scale_image="true" width="70" /> 31 mouse_opaque="true" name="WLDeletePreset" scale_image="true" width="70" />
26 <button bottom_delta="0" enabled="true" font="SansSerif" halign="center" height="20" 32 <button bottom_delta="0" enabled="true" font="SansSerif" halign="center" height="20"
27 label="Day Cycle Editor" label_selected="Day Cycle Editor" 33 label="Day Cycle Editor" label_selected="Day Cycle Editor"
28 left_delta="120" mouse_opaque="true" name="WLDayCycleMenuButton" 34 left_delta="100" mouse_opaque="true" name="WLDayCycleMenuButton"
29 scale_image="true" width="120" /> 35 scale_image="true" width="125" />
30 <tab_container bottom="-220" follows="left|top" height="160" left="0" 36 <tab_container bottom="-220" follows="left|top" height="160" left="0"
31 mouse_opaque="false" name="WindLight Tabs" tab_position="top" width="700"> 37 mouse_opaque="false" name="WindLight Tabs" tab_position="top" width="700">
32 <panel border="true" bottom="-220" follows="left|top|right|bottom" height="160" 38 <panel border="true" bottom="-220" follows="left|top|right|bottom" height="160"