diff options
author | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-06-30 01:19:14 +0300 |
---|---|---|
committer | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-06-30 01:19:14 +0300 |
commit | 3be8ae9d4274ca16ff2dbf8fa10a23f48c2e7022 (patch) | |
tree | 5ae4e3bbc45bbef1b68300921a9a770d88add182 | |
parent | 76acc754370580e7e60ac2a929e165b79c24a7c3 (diff) |
STORM-1305 WIP Edit Sky floater: removed the old sun position slider, added hour marks to the new one.
-rw-r--r-- | indra/newview/llfloatereditsky.cpp | 24 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_edit_sky_preset.xml | 167 |
2 files changed, 145 insertions, 46 deletions
diff --git a/indra/newview/llfloatereditsky.cpp b/indra/newview/llfloatereditsky.cpp index 96289be31e..0163dfbf30 100644 --- a/indra/newview/llfloatereditsky.cpp +++ b/indra/newview/llfloatereditsky.cpp @@ -172,7 +172,6 @@ void LLFloaterEditSky::initCallbacks(void) getChild<LLUICtrl>("WLAmbient")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlMoved, this, _1, ¶m_mgr.mAmbient)); // time of day - getChild<LLUICtrl>("WLSunAngle")->setCommitCallback(boost::bind(&LLFloaterEditSky::onSunMoved, this, _1, ¶m_mgr.mLightnorm)); // old slider getChild<LLUICtrl>("WLSunPos")->setCommitCallback(boost::bind(&LLFloaterEditSky::onSunMoved, this, _1, ¶m_mgr.mLightnorm)); // multi-slider getChild<LLTimeCtrl>("WLDayTime")->setCommitCallback(boost::bind(&LLFloaterEditSky::onTimeChanged, this)); // time ctrl getChild<LLUICtrl>("WLEastAngle")->setCommitCallback(boost::bind(&LLFloaterEditSky::onSunMoved, this, _1, ¶m_mgr.mLightnorm)); @@ -251,7 +250,6 @@ void LLFloaterEditSky::syncControls() setColorSwatch("WLAmbient", param_mgr->mAmbient, WL_SUN_AMBIENT_SLIDER_SCALE); F32 sun_pos = param_mgr->mCurParams.getFloat("sun_angle",err) / F_TWO_PI; - getChild<LLUICtrl>("WLSunAngle")->setValue(sun_pos); getChild<LLMultiSliderCtrl>("WLSunPos")->setCurSliderValue(sun_pos_to_time24(sun_pos), TRUE); childSetValue("WLEastAngle", param_mgr->mCurParams.getFloat("east_angle",err) / F_TWO_PI); @@ -535,36 +533,18 @@ void LLFloaterEditSky::onSunMoved(LLUICtrl* ctrl, void* userdata) { LLWLParamManager::getInstance()->mAnimator.deactivate(); - LLSliderCtrl* sun_sldr = getChild<LLSliderCtrl>("WLSunAngle"); LLMultiSliderCtrl* sun_msldr = getChild<LLMultiSliderCtrl>("WLSunPos"); LLSliderCtrl* east_sldr = getChild<LLSliderCtrl>("WLEastAngle"); LLTimeCtrl* time_ctrl = getChild<LLTimeCtrl>("WLDayTime"); - WLColorControl* color_ctrl = static_cast<WLColorControl *>(userdata); - F32 sun_pos = 0.0f; // 0..1 - F32 time24 = 0.0f; // 0..24 - if (ctrl == sun_msldr) // new slider moved - { - time24 = sun_msldr->getCurSliderValue(); - sun_pos = time24_to_sun_pos(time24); - - sun_sldr->setValue(sun_pos); // update the old slider - } - else - { - sun_pos = sun_sldr->getValueF32(); - time24 = sun_pos_to_time24(sun_pos); - - sun_msldr->setCurSliderValue(time24, TRUE); // update the new slider - } - + F32 time24 = sun_msldr->getCurSliderValue(); time_ctrl->setTime24(time24); // sync the time ctrl with the new sun position // get the two angles LLWLParamManager * param_mgr = LLWLParamManager::getInstance(); - param_mgr->mCurParams.setSunAngle(F_TWO_PI * sun_pos); + param_mgr->mCurParams.setSunAngle(F_TWO_PI * time24_to_sun_pos(time24)); param_mgr->mCurParams.setEastAngle(F_TWO_PI * east_sldr->getValueF32()); // set the sun vector diff --git a/indra/newview/skins/default/xui/en/floater_edit_sky_preset.xml b/indra/newview/skins/default/xui/en/floater_edit_sky_preset.xml index a0a66ca1cd..56233d91ee 100644 --- a/indra/newview/skins/default/xui/en/floater_edit_sky_preset.xml +++ b/indra/newview/skins/default/xui/en/floater_edit_sky_preset.xml @@ -450,30 +450,10 @@ layout="topleft" left_pad="60" name="TODText" - top="10" + top="25" width="200"> Sun/Moon Position </text> - <icon - height="20" - image_name="icon_diurnal.tga" - layout="topleft" - left_delta="14" - top_pad="10" - name="SkyDayCycle" - use_draw_context_alpha="false" - width="148" /> - <slider - control_name="WLSunAngle" - follows="left|top" - height="10" - increment="0.001" - initial_value="0.7" - layout="topleft" - left_delta="-8" - name="WLSunAngle" - top_pad="0" - width="207" /> <multi_slider can_edit_text="true" control_name="WLSunPos" @@ -490,12 +470,151 @@ show_text="false" top_pad="0" width="300" /> + + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + font="SansSerif" + height="14" + layout="topleft" + left_delta="2" + name="WL12amHash" + top_pad="6" + width="6"> + | + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + font="SansSerif" + height="14" + layout="topleft" + left_pad="66" + name="WL6amHash" + top_delta="0" + width="6"> + | + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + font="SansSerif" + height="14" + layout="topleft" + left_pad="67" + name="WL12pmHash2" + top_delta="0" + width="6"> + | + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + font="SansSerif" + height="14" + layout="topleft" + left_pad="67" + name="WL6pmHash" + top_delta="0" + width="6"> + | + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + font="SansSerif" + height="14" + layout="topleft" + left_pad="67" + name="WL12amHash2" + top_delta="0" + width="6"> + | + </text> + + + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + height="16" + layout="topleft" + left_delta="-300" + name="WL12am" + top="74" + width="55"> + 12am + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + height="16" + layout="topleft" + left_pad="20" + name="WL6am" + top_delta="0" + width="55"> + 6am + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + height="16" + layout="topleft" + left_pad="15" + name="WL12pmHash" + top_delta="0" + width="55"> + 12pm + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + height="16" + layout="topleft" + left_pad="18" + name="WL6pm" + top_delta="0" + width="55"> + 6pm + </text> + <text + type="string" + length="1" + border_visible="true" + follows="left|top|right" + height="16" + layout="topleft" + left_pad="15" + name="WL12am2" + top_delta="0" + width="55"> + 12am + </text> + <time follows="left|top" height="16" label_width="0" layout="topleft" - left_delta="80" + left_delta="-175" name="WLDayTime" top_pad="15" value="6:00 AM" @@ -508,9 +627,9 @@ font="SansSerif" height="16" layout="topleft" - left_delta="-80" + left_delta="-106" name="WLEastAngleText" - top_pad="40" + top_pad="24" width="200"> East Angle </text> |