diff options
author | Graham Linden <graham@lindenlab.com> | 2018-08-09 15:53:43 +0100 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2018-08-09 15:53:43 +0100 |
commit | fb13d9746d8aaf48e27f5eb80254abe17ce66019 (patch) | |
tree | 2d05bd3c76f0217883ed9f22897fad7f4456cf82 /indra/newview | |
parent | 126191ada56cf5daa694493a9ad5188beda11253 (diff) | |
parent | 133900d31a4f75621bad070043f5ef0125708a88 (diff) |
Merge
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llenvironment.cpp | 23 | ||||
-rw-r--r-- | indra/newview/llenvironment.h | 3 | ||||
-rw-r--r-- | indra/newview/llfloatereditextdaycycle.cpp | 20 | ||||
-rw-r--r-- | indra/newview/llfloatereditextdaycycle.h | 2 | ||||
-rw-r--r-- | indra/newview/llsettingsvo.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llwlhandlers.cpp | 7 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/widgets/sun_moon_trackball.xml | 2 |
8 files changed, 37 insertions, 24 deletions
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 8f6a94962f..b2bd20d809 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -423,13 +423,17 @@ void LLEnvironment::onLegacyRegionSettings(LLSD data) LLUUID regionId = data[0]["regionID"].asUUID(); LLSettingsDay::ptr_t regionday; - if (data[1].isUndefined()) - regionday = LLSettingsVODay::buildDefaultDayCycle(); - else + if (!data[1].isUndefined()) regionday = LLSettingsVODay::buildFromLegacyMessage(regionId, data[1], data[2], data[3]); clearEnvironment(ENV_PARCEL); - setEnvironment(ENV_REGION, regionday, LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET); + if (!regionday) + { + LL_WARNS("ENVIRONMENT") << "Unable to create day from legacy. Using default day cycle." << LL_ENDL; + setEnvironment(LLEnvironment::ENV_REGION, LLSettingsDay::GetDefaultAssetId(), LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET); + } + else + setEnvironment(ENV_REGION, regionday, LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET); updateEnvironment(); } @@ -570,12 +574,17 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, const LLSe void LLEnvironment::setEnvironment(EnvSelection_t env, const LLUUID &assetId) { - LLSettingsVOBase::getSettingsAsset(assetId, - [this, env](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { onSetEnvAssetLoaded(env, asset_id, settings, status); }); + setEnvironment(env, assetId, LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET); +} + +void LLEnvironment::setEnvironment(EnvSelection_t env, const LLUUID &assetId, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset) +{ + LLSettingsVOBase::getSettingsAsset(assetId, + [this, env, daylength, dayoffset](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { onSetEnvAssetLoaded(env, asset_id, settings, daylength, dayoffset, status); }); } -void LLEnvironment::onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status) +void LLEnvironment::onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLSettingsBase::ptr_t settings, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset, S32 status) { if (!settings || status) { diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h index 80d186c9e6..eba1b737c8 100644 --- a/indra/newview/llenvironment.h +++ b/indra/newview/llenvironment.h @@ -172,6 +172,7 @@ public: void setEnvironment(EnvSelection_t env, const LLSettingsSky::ptr_t & fixed) { setEnvironment(env, fixedEnvironment_t(fixed, LLSettingsWater::ptr_t())); } void setEnvironment(EnvSelection_t env, const LLSettingsWater::ptr_t & fixed) { setEnvironment(env, fixedEnvironment_t(LLSettingsSky::ptr_t(), fixed)); } void setEnvironment(EnvSelection_t env, const LLSettingsSky::ptr_t & fixeds, const LLSettingsWater::ptr_t & fixedw) { setEnvironment(env, fixedEnvironment_t(fixeds, fixedw)); } + void setEnvironment(EnvSelection_t env, const LLUUID &assetId, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset); void setEnvironment(EnvSelection_t env, const LLUUID &assetId); void clearEnvironment(EnvSelection_t env); @@ -368,7 +369,7 @@ private: void onAgentPositionHasChanged(const LLVector3 &localpos); - void onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status); + void onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLSettingsBase::ptr_t settings, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset, S32 status); void onUpdateParcelAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, S32 parcel_id, S32 day_length, S32 day_offset); }; diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp index cbdc026cfe..dc882141db 100644 --- a/indra/newview/llfloatereditextdaycycle.cpp +++ b/indra/newview/llfloatereditextdaycycle.cpp @@ -107,8 +107,6 @@ namespace { const std::string ACTION_APPLY_REGION("apply_region"); const F32 DAY_CYCLE_PLAY_TIME_SECONDS = 60; - - const F32 FRAME_SLOP_FACTOR = 0.0251f; } //========================================================================= @@ -407,7 +405,7 @@ void LLFloaterEditExtDayCycle::onAddTrack() { LLSettingsBase::Seconds frame(mTimeSlider->getCurSliderValue()); LLSettingsBase::ptr_t setting; - if ((mEditDay->getSettingsNearKeyframe(frame, mCurrentTrack, FRAME_SLOP_FACTOR)).second) + if ((mEditDay->getSettingsNearKeyframe(frame, mCurrentTrack, LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR)).second) { LL_WARNS("ENVIRONMENT") << "Attempt to add new frame too close to existing frame." << LL_ENDL; return; @@ -512,7 +510,7 @@ void LLFloaterEditExtDayCycle::onFrameSliderCallback(const LLSD &data) { // don't move the point/frame as long as shift is pressed and user is attempting to copy // handleKeyUp will do the move if user releases key too early. - if (!(mEditDay->getSettingsNearKeyframe(sliderpos, mCurrentTrack, FRAME_SLOP_FACTOR)).second) + if (!(mEditDay->getSettingsNearKeyframe(sliderpos, mCurrentTrack, LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR)).second) { LL_DEBUGS() << "Copying frame from " << it->second.mFrame << " to " << sliderpos << LL_ENDL; LLSettingsBase::ptr_t new_settings; @@ -584,7 +582,7 @@ void LLFloaterEditExtDayCycle::onFrameSliderMouseDown(S32 x, S32 y, MASK mask) LL_WARNS("LAPRAS") << "Selected vs mouse delta = " << (sliderval - sliderpos) << LL_ENDL; - if (fabs(sliderval - sliderpos) > FRAME_SLOP_FACTOR) + if (fabs(sliderval - sliderpos) > LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR) { mFramesSlider->resetCurSlider(); } @@ -598,12 +596,12 @@ void LLFloaterEditExtDayCycle::onFrameSliderMouseUp(S32 x, S32 y, MASK mask) LL_WARNS("LAPRAS") << " UP: X=" << x << " Y=" << y << " MASK=" << mask << " Position=" << sliderpos << LL_ENDL; mTimeSlider->setCurSliderValue(sliderpos); - selectFrame(sliderpos, FRAME_SLOP_FACTOR); + selectFrame(sliderpos, LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR); } void LLFloaterEditExtDayCycle::onTimeSliderMoved() { - selectFrame(mTimeSlider->getCurSliderValue(), FRAME_SLOP_FACTOR); + selectFrame(mTimeSlider->getCurSliderValue(), LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR); } void LLFloaterEditExtDayCycle::selectTrack(U32 track_index, bool force ) @@ -785,7 +783,7 @@ void LLFloaterEditExtDayCycle::updateSlider() mLastFrameSlider.clear(); } - selectFrame(frame_position, FRAME_SLOP_FACTOR); + selectFrame(frame_position, LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR); } void LLFloaterEditExtDayCycle::updateTimeAndLabel() @@ -979,7 +977,7 @@ void LLFloaterEditExtDayCycle::synchronizeTabs() { canedit = !mIsPlaying; // either search mEditDay or retrieve from mSliderKeyMap - LLSettingsDay::CycleTrack_t::value_type found = mEditDay->getSettingsNearKeyframe(frame, LLSettingsDay::TRACK_WATER, FRAME_SLOP_FACTOR); + LLSettingsDay::CycleTrack_t::value_type found = mEditDay->getSettingsNearKeyframe(frame, LLSettingsDay::TRACK_WATER, LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR); psettingW = std::static_pointer_cast<LLSettingsWater>(found.second); } mCurrentEdit = psettingW; @@ -1007,7 +1005,7 @@ void LLFloaterEditExtDayCycle::synchronizeTabs() { canedit = !mIsPlaying; // either search mEditDay or retrieve from mSliderKeyMap - LLSettingsDay::CycleTrack_t::value_type found = mEditDay->getSettingsNearKeyframe(frame, mCurrentTrack, FRAME_SLOP_FACTOR); + LLSettingsDay::CycleTrack_t::value_type found = mEditDay->getSettingsNearKeyframe(frame, mCurrentTrack, LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR); psettingS = std::static_pointer_cast<LLSettingsSky>(found.second); } mCurrentEdit = psettingS; @@ -1218,7 +1216,7 @@ void LLFloaterEditExtDayCycle::stopPlay() gIdleCallbacks.deleteFunction(onIdlePlay, this); mPlayTimer.stop(); F32 frame = mTimeSlider->getCurSliderValue(); - selectFrame(frame, FRAME_SLOP_FACTOR); + selectFrame(frame, LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR); getChild<LLView>("play_layout", true)->setVisible(TRUE); getChild<LLView>("pause_layout", true)->setVisible(FALSE); diff --git a/indra/newview/llfloatereditextdaycycle.h b/indra/newview/llfloatereditextdaycycle.h index f29d5b55ca..0607d35d4a 100644 --- a/indra/newview/llfloatereditextdaycycle.h +++ b/indra/newview/llfloatereditextdaycycle.h @@ -110,7 +110,7 @@ private: void setWaterTabsEnabled(BOOL enable); void setSkyTabsEnabled(BOOL enable); void updateButtons(); - void updateSlider(); //track to slider + void updateSlider(); //generate sliders from current track void updateTimeAndLabel(); void addSliderFrame(const F32 frame, LLSettingsBase::ptr_t &setting, bool update_ui = true); void removeCurrentSliderFrame(); diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index e464f3f8ef..80797ae21c 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -1025,7 +1025,8 @@ LLSettingsDay::ptr_t LLSettingsVODay::buildFromLegacyMessage(const LLUUID ®io if (dayp) { - dayp->initialize(); + // true for validation - either validate here, or when cloning for floater. + dayp->initialize(true); } return dayp; } diff --git a/indra/newview/llwlhandlers.cpp b/indra/newview/llwlhandlers.cpp index 6aa379e0de..f0453b4d6d 100644 --- a/indra/newview/llwlhandlers.cpp +++ b/indra/newview/llwlhandlers.cpp @@ -80,6 +80,9 @@ bool LLEnvironmentRequest::doRequest() { LL_INFOS("WindlightCaps") << "Skipping windlight setting request - we don't have this capability" << LL_ENDL; // region is apparently not capable of this; don't respond at all + // (there shouldn't be any regions where this is the case... but + LL_INFOS("ENVIRONMENT") << "No legacy windlight caps... just set the region to be the default day." << LL_ENDL; + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_REGION, LLSettingsDay::GetDefaultAssetId()); return false; } @@ -117,8 +120,8 @@ void LLEnvironmentRequest::environmentRequestCoro(std::string url) if (!status) { LL_WARNS("WindlightCaps") << "Got an error, not using region windlight... " << LL_ENDL; - LLEnvironment::instance().onLegacyRegionSettings(LLSD()); - + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_REGION, LLSettingsDay::GetDefaultAssetId()); + return; } result = result["content"]; 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 50212fdf80..5e38a289c9 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 @@ -240,6 +240,7 @@ height="10" increment="0.005" overlap_threshold="0.026" + loop_overlap="true" initial_value="0" layout="topleft" left="10" diff --git a/indra/newview/skins/default/xui/en/widgets/sun_moon_trackball.xml b/indra/newview/skins/default/xui/en/widgets/sun_moon_trackball.xml index 68681b8228..3a9655b317 100644 --- a/indra/newview/skins/default/xui/en/widgets/sun_moon_trackball.xml +++ b/indra/newview/skins/default/xui/en/widgets/sun_moon_trackball.xml @@ -4,7 +4,7 @@ width="150" height="150" user_resize="false" - increment_angle_mouse="0.5f" + increment_angle_mouse="1.5f" increment_angle_btn="3.0f" image_sphere="VirtualTrackball_Sphere" image_moon_back="VirtualTrackball_Moon_Back" |