From 7a001186b3063c36a78b2537b81c75124e307ff7 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 9 Aug 2018 16:36:44 -0700 Subject: Adjust layout of sunmoon panel and size of ext day edit. Blank sun texture. Fix edit and transition in edit day cycle. Fix default and blank images in sky textures. --- indra/llinventory/llsettingssky.cpp | 7 +- indra/llinventory/llsettingssky.h | 1 + indra/newview/llfloatereditextdaycycle.cpp | 17 ++- indra/newview/llfloatereditextdaycycle.h | 2 + indra/newview/llpaneleditsky.cpp | 17 ++- .../default/xui/en/floater_edit_ext_day_cycle.xml | 12 +-- .../default/xui/en/panel_settings_sky_sunmoon.xml | 116 ++++++++++----------- 7 files changed, 95 insertions(+), 77 deletions(-) diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp index 4451bd753b..072dff4ce4 100644 --- a/indra/llinventory/llsettingssky.cpp +++ b/indra/llinventory/llsettingssky.cpp @@ -1095,10 +1095,15 @@ LLUUID LLSettingsSky::GetDefaultAssetId() LLUUID LLSettingsSky::GetDefaultSunTextureId() { - //return DEFAULT_SUN_ID; return LLUUID::null; } + +LLUUID LLSettingsSky::GetBlankSunTextureId() +{ + return DEFAULT_SUN_ID; +} + LLUUID LLSettingsSky::GetDefaultMoonTextureId() { return DEFAULT_MOON_ID; diff --git a/indra/llinventory/llsettingssky.h b/indra/llinventory/llsettingssky.h index 19a5656644..e2a6e6e8ae 100644 --- a/indra/llinventory/llsettingssky.h +++ b/indra/llinventory/llsettingssky.h @@ -235,6 +235,7 @@ public: static LLUUID GetDefaultAssetId(); static LLUUID GetDefaultSunTextureId(); + static LLUUID GetBlankSunTextureId(); static LLUUID GetDefaultMoonTextureId(); static LLUUID GetDefaultCloudNoiseTextureId(); static LLUUID GetDefaultBloomTextureId(); diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp index dc882141db..85bcf086e5 100644 --- a/indra/newview/llfloatereditextdaycycle.cpp +++ b/indra/newview/llfloatereditextdaycycle.cpp @@ -140,6 +140,9 @@ LLFloaterEditExtDayCycle::LLFloaterEditExtDayCycle(const LLSD &key) : mScratchSky = LLSettingsVOSky::buildDefaultSky(); mScratchWater = LLSettingsVOWater::buildDefaultWater(); + + mEditSky = mScratchSky; + mEditWater = mScratchWater; } LLFloaterEditExtDayCycle::~LLFloaterEditExtDayCycle() @@ -558,7 +561,7 @@ void LLFloaterEditExtDayCycle::onFrameSliderCallback(const LLSD &data) mTimeSlider->setCurSliderValue(sliderpos); updateTabs(); - LLEnvironment::instance().updateEnvironment(); + LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_INSTANT); } void LLFloaterEditExtDayCycle::onFrameSliderDoubleClick(S32 x, S32 y, MASK mask) @@ -908,7 +911,7 @@ void LLFloaterEditExtDayCycle::onAssetLoaded(LLUUID asset_id, LLSettingsBase::pt mEditDay = std::dynamic_pointer_cast(settings); updateEditEnvironment(); LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_EDIT, LLEnvironment::TRANSITION_INSTANT); - LLEnvironment::instance().updateEnvironment(); + LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_INSTANT); synchronizeTabs(); updateTabs(); refresh(); @@ -935,7 +938,7 @@ void LLFloaterEditExtDayCycle::loadLiveEnvironment(LLEnvironment::EnvSelection_t updateEditEnvironment(); LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_EDIT, LLEnvironment::TRANSITION_INSTANT); - LLEnvironment::instance().updateEnvironment(); + LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_INSTANT); synchronizeTabs(); updateTabs(); refresh(); @@ -960,7 +963,8 @@ void LLFloaterEditExtDayCycle::updateEditEnvironment(void) reblendSettings(); - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, mScratchSky, mScratchWater); + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, mEditSky, mEditWater); + LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_INSTANT); } void LLFloaterEditExtDayCycle::synchronizeTabs() @@ -993,6 +997,7 @@ void LLFloaterEditExtDayCycle::synchronizeTabs() { psettingW = mScratchWater; } + mEditWater = psettingW; setTabsData(tabs, psettingW, canedit); @@ -1021,11 +1026,13 @@ void LLFloaterEditExtDayCycle::synchronizeTabs() { psettingS = mScratchSky; } + mEditSky = psettingS; doCloseInventoryFloater(); setTabsData(tabs, psettingS, canedit); - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, psettingS, psettingW); + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, mEditSky, mEditWater); + LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_INSTANT); } void LLFloaterEditExtDayCycle::setTabsData(LLTabContainer * tabcontainer, const LLSettingsBase::ptr_t &settings, bool editable) diff --git a/indra/newview/llfloatereditextdaycycle.h b/indra/newview/llfloatereditextdaycycle.h index 0607d35d4a..83506ba85f 100644 --- a/indra/newview/llfloatereditextdaycycle.h +++ b/indra/newview/llfloatereditextdaycycle.h @@ -172,6 +172,8 @@ private: LLSettingsSky::ptr_t mScratchSky; LLSettingsWater::ptr_t mScratchWater; LLSettingsBase::ptr_t mCurrentEdit; + LLSettingsSky::ptr_t mEditSky; + LLSettingsWater::ptr_t mEditWater; LLFrameTimer mPlayTimer; F32 mPlayStartFrame; // an env frame diff --git a/indra/newview/llpaneleditsky.cpp b/indra/newview/llpaneleditsky.cpp index 87c0a21c42..73c92b0137 100644 --- a/indra/newview/llpaneleditsky.cpp +++ b/indra/newview/llpaneleditsky.cpp @@ -210,7 +210,9 @@ BOOL LLPanelSettingsSkyCloudTab::postBuild() getChild(FIELD_SKY_CLOUD_SCALE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudScaleChanged(); }); getChild(FIELD_SKY_CLOUD_SCROLL_XY)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudScrollChanged(); }); getChild(FIELD_SKY_CLOUD_MAP)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudMapChanged(); }); -// getChild(FIELD_SKY_CLOUD_MAP)->setDefaultImageAssetID(LLSettingsSky::DEFAULT_CLOUD_TEXTURE_ID); + getChild(FIELD_SKY_CLOUD_MAP)->setDefaultImageAssetID(LLSettingsSky::GetDefaultCloudNoiseTextureId()); + getChild(FIELD_SKY_CLOUD_MAP)->setAllowNoTexture(TRUE); + getChild(FIELD_SKY_CLOUD_MAP)->setAllowLocalTexture(FALSE); getChild(FIELD_SKY_CLOUD_DENSITY_X)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudDensityChanged(); }); getChild(FIELD_SKY_CLOUD_DENSITY_Y)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudDensityChanged(); }); @@ -332,10 +334,17 @@ BOOL LLPanelSettingsSkySunMoonTab::postBuild() getChild(FIELD_SKY_STAR_BRIGHTNESS)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onStarBrightnessChanged(); }); getChild(FIELD_SKY_SUN_ROTATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunRotationChanged(); }); getChild(FIELD_SKY_SUN_IMAGE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunImageChanged(); }); -// getChild(FIELD_SKY_SUN_IMAGE)->setDefaultImageAssetID(LLSettingsSky:: ); + getChild(FIELD_SKY_SUN_IMAGE)->setBlankImageAssetID(LLSettingsSky::GetBlankSunTextureId()); + getChild(FIELD_SKY_SUN_IMAGE)->setDefaultImageAssetID(LLSettingsSky::GetBlankSunTextureId()); + getChild(FIELD_SKY_SUN_IMAGE)->setAllowNoTexture(TRUE); + getChild(FIELD_SKY_SUN_IMAGE)->setAllowLocalTexture(FALSE); getChild(FIELD_SKY_MOON_ROTATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonRotationChanged(); }); getChild(FIELD_SKY_MOON_IMAGE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonImageChanged(); }); -// getChild(FIELD_SKY_MOON_IMAGE)->setDefaultImageAssetID(LLSettingsSky:: ); + getChild(FIELD_SKY_MOON_IMAGE)->setDefaultImageAssetID(LLSettingsSky::GetDefaultMoonTextureId()); + getChild(FIELD_SKY_MOON_IMAGE)->setBlankImageAssetID(LLSettingsSky::GetBlankSunTextureId()); + getChild(FIELD_SKY_MOON_IMAGE)->setAllowNoTexture(TRUE); + getChild(FIELD_SKY_MOON_IMAGE)->setAllowLocalTexture(FALSE); + refresh(); @@ -394,11 +403,13 @@ void LLPanelSettingsSkySunMoonTab::onGlowChanged() glow.mV[2] *= SLIDER_SCALE_GLOW_B; mSkySettings->setGlow(glow); + mSkySettings->update(); } void LLPanelSettingsSkySunMoonTab::onStarBrightnessChanged() { mSkySettings->setStarBrightness(getChild(FIELD_SKY_STAR_BRIGHTNESS)->getValue().asReal()); + mSkySettings->update(); } void LLPanelSettingsSkySunMoonTab::onSunRotationChanged() diff --git a/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml b/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml index 5e38a289c9..e3cd72c39d 100644 --- a/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml +++ b/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml @@ -7,8 +7,8 @@ title="Edit Day Cycle" width="705" height="650" - min_width="450" - min_height="85" + min_width="705" + min_height="650" can_resize="true"> @@ -455,14 +455,14 @@ + visible="false"> + visible="true"> + Sun & Stars + + + Position: + + + + Image: + + + - Sun Color: + Color: @@ -45,8 +88,8 @@ follows="left|top" height="10" layout="topleft" - left_delta="0" - top_delta="57" + left_delta="-160" + top_delta="47" width="200"> Glow Focus: @@ -61,15 +104,15 @@ min_val="0" max_val="0.5" name="glow_focus" - top_delta="20" - width="200" + top_delta="15" + width="250" can_edit_text="true"/> Glow Size: @@ -84,8 +127,8 @@ min_val="1" max_val="1.99" name="glow_size" - top_delta="20" - width="200" + top_delta="15" + width="250" can_edit_text="true"/> - - - Sun - - - Position: - - - - Image: - - -