From cf0e4f79f52b4fb24769aa6e355ec8c95c6d2afc Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 27 Apr 2018 17:12:13 -0700 Subject: Adding fixed water edit dialog. --- indra/newview/llfloaterfixedenvironment.cpp | 817 ++++++++++++++++++++++++++++ 1 file changed, 817 insertions(+) create mode 100644 indra/newview/llfloaterfixedenvironment.cpp (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp new file mode 100644 index 0000000000..d5162ef622 --- /dev/null +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -0,0 +1,817 @@ +/** + * @file llfloaterfixedenvironment.cpp + * @brief Floaters to create and edit fixed settings for sky and water. + * + * $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloaterfixedenvironment.h" + +#include + +// libs +#include "llbutton.h" +#include "llnotifications.h" +#include "llnotificationsutil.h" +#include "llsliderctrl.h" +#include "lltabcontainer.h" + +// newview +#include "llpaneleditwater.h" + +#include "llsettingssky.h" +#include "llsettingswater.h" + +#include "llenvironment.h" + +namespace +{ + const std::string FIELD_SETTINGS_NAME("settings_name"); + + const std::string CONTROL_TAB_AREA("tab_settings"); + + const std::string BUTTON_NAME_LOAD("btn_load"); + const std::string BUTTON_NAME_IMPORT("btn_import"); + const std::string BUTTON_NAME_COMMIT("btn_commit"); + const std::string BUTTON_NAME_CANCEL("btn_cancel"); +} + +LLFloaterFixedEnvironment::LLFloaterFixedEnvironment(const LLSD &key) : + LLFloater(key) +{ +} + +BOOL LLFloaterFixedEnvironment::postBuild() +{ + mTab = getChild(CONTROL_TAB_AREA); + mTxtName = getChild(FIELD_SETTINGS_NAME); + + mTxtName->setCommitOnFocusLost(TRUE); + mTxtName->setCommitCallback([this](LLUICtrl *, const LLSD &) { onNameChanged(mTxtName->getValue().asString()); }); + + return TRUE; +} + +void LLFloaterFixedEnvironment::onFocusReceived() +{ + updateEditEnvironment(); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_EDIT); +} + +void LLFloaterFixedEnvironment::onFocusLost() +{ + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); +} + +void LLFloaterFixedEnvironment::refresh() +{ + mTxtName->setValue(mSettings->getName()); + + S32 count = mTab->getTabCount(); + + for (S32 idx = 0; idx < count; ++idx) + { + LLSettingsEditPanel *panel = static_cast(mTab->getPanelByIndex(idx)); + if (panel) + panel->refresh(); + } +} + +void LLFloaterFixedEnvironment::syncronizeTabs() +{ + S32 count = mTab->getTabCount(); + + for (S32 idx = 0; idx < count; ++idx) + { + LLSettingsEditPanel *panel = static_cast(mTab->getPanelByIndex(idx)); + if (panel) + panel->setSettings(mSettings); + } +} + +void LLFloaterFixedEnvironment::onNameChanged(const std::string &name) +{ + mSettings->setName(name); +} + +//========================================================================= +LLFloaterFixedEnvironmentWater::LLFloaterFixedEnvironmentWater(const LLSD &key): + LLFloaterFixedEnvironment(key) +{} + +BOOL LLFloaterFixedEnvironmentWater::postBuild() +{ + if (!LLFloaterFixedEnvironment::postBuild()) + return FALSE; + + LLPanelSettingsWater * panel; + panel = new LLPanelSettingsWaterMainTab; + panel->buildFromFile("panel_settings_water.xml"); + panel->setWater(std::static_pointer_cast(mSettings)); + mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(true)); + + // Initialize the settings, take a snapshot of the current water. + mSettings = LLEnvironment::instance().getEnvironmentFixedWater(LLEnvironment::ENV_CURRENT)->buildClone(); + + mSettings->setName("Snapshot water (new)"); + + mTxtName->setValue(mSettings->getName()); + + syncronizeTabs(); + refresh(); + return TRUE; +} + +void LLFloaterFixedEnvironmentWater::updateEditEnvironment(void) +{ + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, + std::static_pointer_cast(mSettings)); +} + +//========================================================================= + +#if 0 +// virtual +BOOL LLFloaterEditSky::postBuild() +{ + mSkyPresetNameEditor = getChild("sky_preset_name"); + mSkyPresetCombo = getChild("sky_preset_combo"); + mMakeDefaultCheckBox = getChild("make_default_cb"); + mSaveButton = getChild("save"); + mSkyAdapter = boost::make_shared(); + + LLEnvironment::instance().setSkyListChange(boost::bind(&LLFloaterEditSky::onSkyPresetListChange, this)); + + initCallbacks(); + +// // Create the sun position scrubber on the slider. +// getChild("WLSunPos")->addSlider(12.f); + + return TRUE; +} + +// virtual +void LLFloaterEditSky::onOpen(const LLSD& key) +{ + bool new_preset = isNewPreset(); + std::string param = key.asString(); + std::string floater_title = getString(std::string("title_") + param); + std::string hint = getString(std::string("hint_" + param)); + + // Update floater title. + setTitle(floater_title); + + // Update the hint at the top. + getChild("hint")->setValue(hint); + + // Hide the hint to the right of the combo if we're invoked to create a new preset. + getChildView("note")->setVisible(!new_preset); + + // Switch between the sky presets combobox and preset name input field. + mSkyPresetCombo->setVisible(!new_preset); + mSkyPresetNameEditor->setVisible(new_preset); + + reset(); +} + +// virtual +void LLFloaterEditSky::onClose(bool app_quitting) +{ + if (!app_quitting) // there's no point to change environment if we're quitting + { + LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_EDIT); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); + } +} + +// virtual +void LLFloaterEditSky::draw() +{ + syncControls(); + LLFloater::draw(); +} + +void LLFloaterEditSky::initCallbacks(void) +{ + // *TODO: warn user if a region environment update comes while we're editing a region sky preset. + + mSkyPresetNameEditor->setKeystrokeCallback(boost::bind(&LLFloaterEditSky::onSkyPresetNameEdited, this), NULL); + mSkyPresetCombo->setCommitCallback(boost::bind(&LLFloaterEditSky::onSkyPresetSelected, this)); + mSkyPresetCombo->setTextEntryCallback(boost::bind(&LLFloaterEditSky::onSkyPresetNameEdited, this)); + + mSaveButton->setCommitCallback(boost::bind(&LLFloaterEditSky::onBtnSave, this)); + getChild("cancel")->setCommitCallback(boost::bind(&LLFloaterEditSky::onBtnCancel, this)); + + // Connect to region info updates. + LLRegionInfoModel::instance().setUpdateCallback(boost::bind(&LLFloaterEditSky::onRegionInfoUpdate, this)); + + //------------------------------------------------------------------------- +// LEGACY_ATMOSPHERICS + // ambient + getChild("WLAmbient")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlMoved, this, _1, &mSkyAdapter->mAmbient)); + + // blue horizon/density + getChild("WLBlueHorizon")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlMoved, this, _1, &mSkyAdapter->mBlueHorizon)); + getChild("WLBlueDensity")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlMoved, this, _1, &mSkyAdapter->mBlueDensity)); + + // haze density, horizon, mult, and altitude + getChild("WLHazeDensity")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mHazeDensity)); + getChild("WLHazeHorizon")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mHazeHorizon)); + getChild("WLDensityMult")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mDensityMult)); + getChild("WLDistanceMult")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mDistanceMult)); + getChild("WLMaxAltitude")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mMaxAlt)); + + // sunlight + getChild("WLSunlight")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlMoved, this, _1, &mSkyAdapter->mSunlight)); + + // glow + getChild("WLGlowR")->setCommitCallback(boost::bind(&LLFloaterEditSky::onGlowRMoved, this, _1, &mSkyAdapter->mGlow)); + getChild("WLGlowB")->setCommitCallback(boost::bind(&LLFloaterEditSky::onGlowBMoved, this, _1, &mSkyAdapter->mGlow)); + + // time of day +// getChild("WLSunPos")->setCommitCallback(boost::bind(&LLFloaterEditSky::onSunMoved, this, _1, &mSkyAdapter->mLightnorm)); // multi-slider +// getChild("WLDayTime")->setCommitCallback(boost::bind(&LLFloaterEditSky::onTimeChanged, this)); // time ctrl +// getChild("WLEastAngle")->setCommitCallback(boost::bind(&LLFloaterEditSky::onSunMoved, this, _1, &mSkyAdapter->mLightnorm)); + getChild("WLSunRotation")->setCommitCallback(boost::bind(&LLFloaterEditSky::onSunRotationChanged, this)); + getChild("WLMoonRotation")->setCommitCallback(boost::bind(&LLFloaterEditSky::onMoonRotationChanged, this)); + + // Clouds + + // Cloud Color + getChild("WLCloudColor")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlMoved, this, _1, &mSkyAdapter->mCloudColor)); + + // Cloud + getChild("WLCloudX")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlRMoved, this, _1, &mSkyAdapter->mCloudMain)); + getChild("WLCloudY")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlGMoved, this, _1, &mSkyAdapter->mCloudMain)); + getChild("WLCloudDensity")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlBMoved, this, _1, &mSkyAdapter->mCloudMain)); + + // Cloud Detail + getChild("WLCloudDetailX")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlRMoved, this, _1, &mSkyAdapter->mCloudDetail)); + getChild("WLCloudDetailY")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlGMoved, this, _1, &mSkyAdapter->mCloudDetail)); + getChild("WLCloudDetailDensity")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlBMoved, this, _1, &mSkyAdapter->mCloudDetail)); + + // Cloud extras + getChild("WLCloudCoverage")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mCloudCoverage)); + getChild("WLCloudScale")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mCloudScale)); + getChild("WLCloudScrollX")->setCommitCallback(boost::bind(&LLFloaterEditSky::onCloudScrollXMoved, this, _1)); + getChild("WLCloudScrollY")->setCommitCallback(boost::bind(&LLFloaterEditSky::onCloudScrollYMoved, this, _1)); + + + // Dome + getChild("WLGamma")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mWLGamma)); + getChild("WLStarAlpha")->setCommitCallback(boost::bind(&LLFloaterEditSky::onStarAlphaMoved, this, _1)); +} + +//================================================================================================= + +void LLFloaterEditSky::syncControls() +{ + LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky(); + mEditSettings = psky; + + std::string name = psky->getName(); + + mSkyPresetNameEditor->setText(name); + mSkyPresetCombo->setValue(name); + +// LEGACY_ATMOSPHERICS + // ambient + mSkyAdapter->mAmbient.setColor3( psky->getAmbientColor() ); + setColorSwatch("WLAmbient", mSkyAdapter->mAmbient, WL_SUN_AMBIENT_SLIDER_SCALE); + + // blue horizon / density + mSkyAdapter->mBlueHorizon.setColor3( psky->getBlueHorizon() ); + setColorSwatch("WLBlueHorizon", mSkyAdapter->mBlueHorizon, WL_BLUE_HORIZON_DENSITY_SCALE); + mSkyAdapter->mBlueDensity.setColor3( psky->getBlueDensity() ); + setColorSwatch("WLBlueDensity", mSkyAdapter->mBlueDensity, WL_BLUE_HORIZON_DENSITY_SCALE); + + // haze density, horizon, mult, and altitude + mSkyAdapter->mHazeDensity = psky->getHazeDensity(); + childSetValue("WLHazeDensity", (F32) mSkyAdapter->mHazeDensity); + mSkyAdapter->mHazeHorizon = psky->getHazeHorizon(); + childSetValue("WLHazeHorizon", (F32) mSkyAdapter->mHazeHorizon); + mSkyAdapter->mDensityMult = psky->getDensityMultiplier(); + childSetValue("WLDensityMult", ((F32) mSkyAdapter->mDensityMult) * mSkyAdapter->mDensityMult.getMult()); + mSkyAdapter->mMaxAlt = psky->getMaxY(); + mSkyAdapter->mDistanceMult = psky->getDistanceMultiplier(); + childSetValue("WLDistanceMult", (F32) mSkyAdapter->mDistanceMult); + childSetValue("WLMaxAltitude", (F32) mSkyAdapter->mMaxAlt); + + // Lighting + + // sunlight + mSkyAdapter->mSunlight.setColor3( psky->getSunlightColor() ); + setColorSwatch("WLSunlight", mSkyAdapter->mSunlight, WL_SUN_AMBIENT_SLIDER_SCALE); + + // glow + mSkyAdapter->mGlow.setColor3( psky->getGlow() ); + childSetValue("WLGlowR", 2 - mSkyAdapter->mGlow.getRed() / 20.0f); + childSetValue("WLGlowB", -mSkyAdapter->mGlow.getBlue() / 5.0f); + + + +// LLSettingsSky::azimalt_t azal = psky->getSunRotationAzAl(); +// +// F32 time24 = sun_pos_to_time24(azal.second / F_TWO_PI); +// getChild("WLSunPos")->setCurSliderValue(time24, TRUE); +// getChild("WLDayTime")->setTime24(time24); +// childSetValue("WLEastAngle", azal.first / F_TWO_PI); + getChild("WLSunRotation")->setRotation(psky->getSunRotation()); + getChild("WLMoonRotation")->setRotation(psky->getMoonRotation()); + + // Clouds + + // Cloud Color + mSkyAdapter->mCloudColor.setColor3( psky->getCloudColor() ); + setColorSwatch("WLCloudColor", mSkyAdapter->mCloudColor, WL_CLOUD_SLIDER_SCALE); + + // Cloud + mSkyAdapter->mCloudMain.setColor3( psky->getCloudPosDensity1() ); + childSetValue("WLCloudX", mSkyAdapter->mCloudMain.getRed()); + childSetValue("WLCloudY", mSkyAdapter->mCloudMain.getGreen()); + childSetValue("WLCloudDensity", mSkyAdapter->mCloudMain.getBlue()); + + // Cloud Detail + mSkyAdapter->mCloudDetail.setColor3( psky->getCloudPosDensity2() ); + childSetValue("WLCloudDetailX", mSkyAdapter->mCloudDetail.getRed()); + childSetValue("WLCloudDetailY", mSkyAdapter->mCloudDetail.getGreen()); + childSetValue("WLCloudDetailDensity", mSkyAdapter->mCloudDetail.getBlue()); + + // Cloud extras + mSkyAdapter->mCloudCoverage = psky->getCloudShadow(); + mSkyAdapter->mCloudScale = psky->getCloudScale(); + childSetValue("WLCloudCoverage", (F32) mSkyAdapter->mCloudCoverage); + childSetValue("WLCloudScale", (F32) mSkyAdapter->mCloudScale); + + // cloud scrolling + LLVector2 scroll_rate = psky->getCloudScrollRate(); + + // LAPRAS: These should go away... + childDisable("WLCloudLockX"); + childDisable("WLCloudLockY"); + + // disable if locked, enable if not + childEnable("WLCloudScrollX"); + childEnable("WLCloudScrollY"); + + // *HACK cloud scrolling is off my an additive of 10 + childSetValue("WLCloudScrollX", scroll_rate[0] - 10.0f); + childSetValue("WLCloudScrollY", scroll_rate[1] - 10.0f); + + // Tweak extras + + mSkyAdapter->mWLGamma = psky->getGamma(); + childSetValue("WLGamma", (F32) mSkyAdapter->mWLGamma); + + childSetValue("WLStarAlpha", psky->getStarBrightness()); +} + +void LLFloaterEditSky::setColorSwatch(const std::string& name, const WLColorControl& from_ctrl, F32 k) +{ + // Set the value, dividing it by first. + LLColor4 color = from_ctrl.getColor4(); + getChild(name)->set(color / k); +} + +// color control callbacks +void LLFloaterEditSky::onColorControlMoved(LLUICtrl* ctrl, WLColorControl* color_ctrl) +{ + LLColorSwatchCtrl* swatch = static_cast(ctrl); + LLColor4 color_vec(swatch->get().mV); + + // Multiply RGB values by the appropriate factor. + F32 k = WL_CLOUD_SLIDER_SCALE; + if (color_ctrl->getIsSunOrAmbientColor()) + { + k = WL_SUN_AMBIENT_SLIDER_SCALE; + } + else if (color_ctrl->getIsBlueHorizonOrDensity()) + { + k = WL_BLUE_HORIZON_DENSITY_SCALE; + } + + color_vec *= k; // intensity isn't affected by the multiplication + + // Set intensity to maximum of the RGB values. + color_vec.mV[3] = color_max(color_vec); + + // Apply the new RGBI value. + color_ctrl->setColor4(color_vec); + color_ctrl->update(mEditSettings); +} + +void LLFloaterEditSky::onColorControlRMoved(LLUICtrl* ctrl, void* userdata) +{ + LLSliderCtrl* sldr_ctrl = static_cast(ctrl); + WLColorControl* color_ctrl = static_cast(userdata); + + F32 red_value = sldr_ctrl->getValueF32(); + F32 k = 1.0f; + + if (color_ctrl->getIsSunOrAmbientColor()) + { + k = WL_SUN_AMBIENT_SLIDER_SCALE; + } + if (color_ctrl->getIsBlueHorizonOrDensity()) + { + k = WL_BLUE_HORIZON_DENSITY_SCALE; + } + color_ctrl->setRed(red_value * k); + + adjustIntensity(color_ctrl, red_value, k); + color_ctrl->update(mEditSettings); +} + +void LLFloaterEditSky::onColorControlGMoved(LLUICtrl* ctrl, void* userdata) +{ + LLSliderCtrl* sldr_ctrl = static_cast(ctrl); + WLColorControl* color_ctrl = static_cast(userdata); + + F32 green_value = sldr_ctrl->getValueF32(); + F32 k = 1.0f; + + if (color_ctrl->getIsSunOrAmbientColor()) + { + k = WL_SUN_AMBIENT_SLIDER_SCALE; + } + if (color_ctrl->getIsBlueHorizonOrDensity()) + { + k = WL_BLUE_HORIZON_DENSITY_SCALE; + } + color_ctrl->setGreen(green_value * k); + + adjustIntensity(color_ctrl, green_value, k); + color_ctrl->update(mEditSettings); +} + +void LLFloaterEditSky::onColorControlBMoved(LLUICtrl* ctrl, void* userdata) +{ + LLSliderCtrl* sldr_ctrl = static_cast(ctrl); + WLColorControl* color_ctrl = static_cast(userdata); + + F32 blue_value = sldr_ctrl->getValueF32(); + F32 k = 1.0f; + + if (color_ctrl->getIsSunOrAmbientColor()) + { + k = WL_SUN_AMBIENT_SLIDER_SCALE; + } + if (color_ctrl->getIsBlueHorizonOrDensity()) + { + k = WL_BLUE_HORIZON_DENSITY_SCALE; + } + color_ctrl->setBlue(blue_value * k); + + adjustIntensity(color_ctrl, blue_value, k); + color_ctrl->update(mEditSettings); +} + +void LLFloaterEditSky::adjustIntensity(WLColorControl *ctrl, F32 val, F32 scale) +{ + if (ctrl->getHasSliderName()) + { + LLColor4 color = ctrl->getColor4(); + F32 i = color_max(color) / scale; + ctrl->setIntensity(i); + std::string name = ctrl->getSliderName(); + name.append("I"); + + childSetValue(name, i); + } +} + + +/// GLOW SPECIFIC CODE +void LLFloaterEditSky::onGlowRMoved(LLUICtrl* ctrl, void* userdata) +{ + + LLSliderCtrl* sldr_ctrl = static_cast(ctrl); + WLColorControl* color_ctrl = static_cast(userdata); + + // scaled by 20 + color_ctrl->setRed((2 - sldr_ctrl->getValueF32()) * 20); + + color_ctrl->update(mEditSettings); +} + +/// \NOTE that we want NEGATIVE (-) B +void LLFloaterEditSky::onGlowBMoved(LLUICtrl* ctrl, void* userdata) +{ + LLSliderCtrl* sldr_ctrl = static_cast(ctrl); + WLColorControl* color_ctrl = static_cast(userdata); + + /// \NOTE that we want NEGATIVE (-) B and NOT by 20 as 20 is too big + color_ctrl->setBlue(-sldr_ctrl->getValueF32() * 5); + + color_ctrl->update(mEditSettings); +} + +void LLFloaterEditSky::onFloatControlMoved(LLUICtrl* ctrl, void* userdata) +{ + LLSliderCtrl* sldr_ctrl = static_cast(ctrl); + WLFloatControl * floatControl = static_cast(userdata); + + floatControl->setValue(sldr_ctrl->getValueF32() / floatControl->getMult()); + + floatControl->update(mEditSettings); +} + + +// Lighting callbacks + +// time of day +void LLFloaterEditSky::onSunMoved(LLUICtrl* ctrl, void* userdata) +{ + LLMultiSliderCtrl* sun_msldr = getChild("WLSunPos"); + LLSliderCtrl* east_sldr = getChild("WLEastAngle"); + LLTimeCtrl* time_ctrl = getChild("WLDayTime"); + WLColorControl* color_ctrl = static_cast(userdata); + + F32 time24 = sun_msldr->getCurSliderValue(); + time_ctrl->setTime24(time24); // sync the time ctrl with the new sun position + + // get the two angles + F32 azimuth = F_TWO_PI * east_sldr->getValueF32(); + F32 altitude = F_TWO_PI * time24_to_sun_pos(time24); + mEditSettings->setSunRotation(azimuth, altitude); + mEditSettings->setMoonRotation(azimuth + F_PI, -altitude); + + LLVector4 sunnorm( mEditSettings->getSunDirection(), 1.f ); + + color_ctrl->update(mEditSettings); +} + +void LLFloaterEditSky::onTimeChanged() +{ + F32 time24 = getChild("WLDayTime")->getTime24(); + getChild("WLSunPos")->setCurSliderValue(time24, TRUE); + onSunMoved(getChild("WLSunPos"), &(mSkyAdapter->mLightnorm)); +} + +void LLFloaterEditSky::onSunRotationChanged() +{ + LLJoystickQuaternion* sun_spinner = getChild("WLSunRotation"); + LLQuaternion sunrot(sun_spinner->getRotation()); + + mEditSettings->setSunRotation(sunrot); +} + +void LLFloaterEditSky::onMoonRotationChanged() +{ + LLJoystickQuaternion* moon_spinner = getChild("WLMoonRotation"); + LLQuaternion moonrot(moon_spinner->getRotation()); + + mEditSettings->setMoonRotation(moonrot); +} + +void LLFloaterEditSky::onStarAlphaMoved(LLUICtrl* ctrl) +{ + LLSliderCtrl* sldr_ctrl = static_cast(ctrl); + + mEditSettings->setStarBrightness(sldr_ctrl->getValueF32()); +} + +// Clouds +void LLFloaterEditSky::onCloudScrollXMoved(LLUICtrl* ctrl) +{ + LLSliderCtrl* sldr_ctrl = static_cast(ctrl); + // *HACK all cloud scrolling is off by an additive of 10. + mEditSettings->setCloudScrollRateX(sldr_ctrl->getValueF32() + 10.0f); +} + +void LLFloaterEditSky::onCloudScrollYMoved(LLUICtrl* ctrl) +{ + LLSliderCtrl* sldr_ctrl = static_cast(ctrl); + + // *HACK all cloud scrolling is off by an additive of 10. + mEditSettings->setCloudScrollRateY(sldr_ctrl->getValueF32() + 10.0f); +} + +//================================================================================================= + +void LLFloaterEditSky::reset() +{ + if (isNewPreset()) + { + mSkyPresetNameEditor->setValue(LLSD()); + mSaveButton->setEnabled(FALSE); // will be enabled as soon as users enters a name + } + else + { + refreshSkyPresetsList(); + + // Disable controls until a sky preset to edit is selected. + enableEditing(false); + } +} + +bool LLFloaterEditSky::isNewPreset() const +{ + return mKey.asString() == "new"; +} + +void LLFloaterEditSky::refreshSkyPresetsList() +{ + mSkyPresetCombo->removeall(); + + LLEnvironment::list_name_id_t list = LLEnvironment::instance().getSkyList(); + + for (LLEnvironment::list_name_id_t::iterator it = list.begin(); it != list.end(); ++it) + { + mSkyPresetCombo->add((*it).first, LLSDArray((*it).first)((*it).second)); + } + + mSkyPresetCombo->setLabel(getString("combo_label")); +} + +void LLFloaterEditSky::enableEditing(bool enable) +{ + // Enable/disable the tab and their contents. + LLTabContainer* tab_container = getChild("WindLight Tabs"); + tab_container->setEnabled(enable); + for (S32 i = 0; i < tab_container->getTabCount(); ++i) + { + tab_container->enableTabButton(i, enable); + tab_container->getPanelByIndex(i)->setCtrlsEnabled(enable); + } + + // Enable/disable saving. + mSaveButton->setEnabled(enable); + mMakeDefaultCheckBox->setEnabled(enable); +} + +void LLFloaterEditSky::saveRegionSky() +{ +#if 0 + LLWLParamKey key(getSelectedSkyPreset()); + llassert(key.scope == LLEnvKey::SCOPE_REGION); + + LL_DEBUGS("Windlight") << "Saving region sky preset: " << key.name << LL_ENDL; + LLWLParamManager& wl_mgr = LLWLParamManager::instance(); + wl_mgr.mCurParams.mName = key.name; + wl_mgr.setParamSet(key, wl_mgr.mCurParams); + + // *TODO: save to cached region settings. + LL_WARNS("Windlight") << "Saving region sky is not fully implemented yet" << LL_ENDL; +#endif +} + +std::string LLFloaterEditSky::getSelectedPresetName() const +{ + std::string name; + if (mSkyPresetNameEditor->getVisible()) + { + name = mSkyPresetNameEditor->getText(); + } + else + { + LLSD combo_val = mSkyPresetCombo->getValue(); + name = combo_val[0].asString(); + } + + return name; +} + +void LLFloaterEditSky::onSkyPresetNameEdited() +{ + std::string name = mSkyPresetNameEditor->getText(); + LLSettingsWater::ptr_t psky = LLEnvironment::instance().getCurrentWater(); + + psky->setName(name); +} + +void LLFloaterEditSky::onSkyPresetSelected() +{ + std::string name; + + name = getSelectedPresetName(); + + LLSettingsSky::ptr_t psky = LLEnvironment::instance().findSkyByName(name); + + if (!psky) + { + LL_WARNS("WATEREDIT") << "Could not find water preset" << LL_ENDL; + enableEditing(false); + return; + } + + psky = psky->buildClone(); + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, psky); + mEditSettings = psky; + + syncControls(); + enableEditing(true); + +} + +bool LLFloaterEditSky::onSaveAnswer(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + + // If they choose save, do it. Otherwise, don't do anything + if (option == 0) + { + onSaveConfirmed(); + } + + return false; +} + +void LLFloaterEditSky::onSaveConfirmed() +{ + // Save currently displayed water params to the selected preset. + std::string name = mEditSettings->getName(); + + LL_DEBUGS("Windlight") << "Saving sky preset " << name << LL_ENDL; + + LLEnvironment::instance().addSky(mEditSettings); + + // Change preference if requested. + if (mMakeDefaultCheckBox->getEnabled() && mMakeDefaultCheckBox->getValue()) + { + LL_DEBUGS("Windlight") << name << " is now the new preferred sky preset" << LL_ENDL; + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, mEditSettings); + } + + closeFloater(); +} + +void LLFloaterEditSky::onBtnSave() +{ + LLEnvironment::instance().addSky(mEditSettings); + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, mEditSettings); + + closeFloater(); +} + +void LLFloaterEditSky::onBtnCancel() +{ + closeFloater(); +} + +void LLFloaterEditSky::onSkyPresetListChange() +{ + refreshSkyPresetsList(); +} + +void LLFloaterEditSky::onRegionSettingsChange() +{ +#if 0 + // If creating a new sky, don't bother. + if (isNewPreset()) + { + return; + } + + if (getSelectedSkyPreset().scope == LLEnvKey::SCOPE_REGION) // if editing a region sky + { + // reset the floater to its initial state + reset(); + + // *TODO: Notify user? + } + else // editing a local sky + { + refreshSkyPresetsList(); + } +#endif +} + +void LLFloaterEditSky::onRegionInfoUpdate() +{ +#if 0 + bool can_edit = true; + + // If we've selected a region sky preset for editing. + if (getSelectedSkyPreset().scope == LLEnvKey::SCOPE_REGION) + { + // check whether we have the access + can_edit = LLEnvManagerNew::canEditRegionSettings(); + } + + enableEditing(can_edit); +#endif +} +#endif + -- cgit v1.2.3 From 438609699b838924becee89fa9d8ec83552f3236 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 30 Apr 2018 16:37:08 -0700 Subject: New water settings dialog. --- indra/newview/llfloaterfixedenvironment.cpp | 115 +++++++++++++++++++++++++--- 1 file changed, 106 insertions(+), 9 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index d5162ef622..6c883b2534 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -36,6 +36,7 @@ #include "llnotificationsutil.h" #include "llsliderctrl.h" #include "lltabcontainer.h" +#include "llfilepicker.h" // newview #include "llpaneleditwater.h" @@ -44,6 +45,9 @@ #include "llsettingswater.h" #include "llenvironment.h" +#include "llagent.h" + +#include "llsettingsvo.h" namespace { @@ -70,22 +74,41 @@ BOOL LLFloaterFixedEnvironment::postBuild() mTxtName->setCommitOnFocusLost(TRUE); mTxtName->setCommitCallback([this](LLUICtrl *, const LLSD &) { onNameChanged(mTxtName->getValue().asString()); }); + getChild(BUTTON_NAME_LOAD)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonLoad(); }); + getChild(BUTTON_NAME_IMPORT)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonImport(); }); + getChild(BUTTON_NAME_COMMIT)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonApply(); }); + getChild(BUTTON_NAME_CANCEL)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonCancel(); }); + return TRUE; } void LLFloaterFixedEnvironment::onFocusReceived() { updateEditEnvironment(); - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_EDIT); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_EDIT, LLEnvironment::TRANSITION_FAST); } void LLFloaterFixedEnvironment::onFocusLost() { + // *TODO*: If the window receiving focus is from a select color or select image control... + // We have technically not changed out of what we are doing so don't change back to displaying + // the local environment. (unfortunately the focus manager has LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); } void LLFloaterFixedEnvironment::refresh() { + if (!mSettings) + { + // disable everything. + return; + } + + bool enableApplyAndLoad = canUseInventory(); + + getChild(BUTTON_NAME_LOAD)->setEnabled(enableApplyAndLoad); + getChild(BUTTON_NAME_COMMIT)->setEnabled(enableApplyAndLoad); + mTxtName->setValue(mSettings->getName()); S32 count = mTab->getTabCount(); @@ -115,6 +138,33 @@ void LLFloaterFixedEnvironment::onNameChanged(const std::string &name) mSettings->setName(name); } +void LLFloaterFixedEnvironment::onButtonLoad() +{ + doLoadFromInventory(); +} + +void LLFloaterFixedEnvironment::onButtonImport() +{ + doImportFromDisk(); +} + +void LLFloaterFixedEnvironment::onButtonApply() +{ + doApplyFixedSettings(); +} + +void LLFloaterFixedEnvironment::onButtonCancel() +{ + // *TODO*: If changed issue a warning? + this->closeFloater(); +} + +//------------------------------------------------------------------------- +bool LLFloaterFixedEnvironment::canUseInventory() const +{ + return !gAgent.getRegionCapability("UpdateSettingsAgentInventory").empty(); +} + //========================================================================= LLFloaterFixedEnvironmentWater::LLFloaterFixedEnvironmentWater(const LLSD &key): LLFloaterFixedEnvironment(key) @@ -131,22 +181,69 @@ BOOL LLFloaterFixedEnvironmentWater::postBuild() panel->setWater(std::static_pointer_cast(mSettings)); mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(true)); - // Initialize the settings, take a snapshot of the current water. - mSettings = LLEnvironment::instance().getEnvironmentFixedWater(LLEnvironment::ENV_CURRENT)->buildClone(); + return TRUE; +} - mSettings->setName("Snapshot water (new)"); +void LLFloaterFixedEnvironmentWater::updateEditEnvironment(void) +{ + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, + std::static_pointer_cast(mSettings)); +} - mTxtName->setValue(mSettings->getName()); +void LLFloaterFixedEnvironmentWater::onOpen(const LLSD& key) +{ + if (!mSettings) + { + // Initialize the settings, take a snapshot of the current water. + mSettings = LLEnvironment::instance().getEnvironmentFixedWater(LLEnvironment::ENV_CURRENT)->buildClone(); + mSettings->setName("Snapshot water (new)"); + // TODO: Should we grab sky and keep it around for reference? + } + + updateEditEnvironment(); syncronizeTabs(); refresh(); - return TRUE; + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_EDIT, LLEnvironment::TRANSITION_FAST); } -void LLFloaterFixedEnvironmentWater::updateEditEnvironment(void) +void LLFloaterFixedEnvironmentWater::onClose(bool app_quitting) { - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, - std::static_pointer_cast(mSettings)); + mSettings.reset(); + syncronizeTabs(); +} + +void LLFloaterFixedEnvironmentWater::doLoadFromInventory() +{ + +} + +void LLFloaterFixedEnvironmentWater::doImportFromDisk() +{ // Load a a legacy Windlight XML from disk. + + LLFilePicker& picker = LLFilePicker::instance(); + if (picker.getOpenFile(LLFilePicker::FFLOAD_XML)) + { + std::string filename = picker.getFirstFile(); + + LL_WARNS("LAPRAS") << "Selected file: " << filename << LL_ENDL; + LLSettingsWater::ptr_t legacywater = LLEnvironment::createWaterFromLegacyPreset(filename); + + if (!legacywater) + { // *TODO* Put up error dialog here. Could not create water from filename + return; + } + + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, legacywater); + this->setEditSettings(legacywater); + LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST, true); + } +} + +void LLFloaterFixedEnvironmentWater::doApplyFixedSettings() +{ + LLSettingsVOBase::createInventoryItem(mSettings); + } //========================================================================= -- cgit v1.2.3 From 03da2bc1a1c7674514c967b0e7408258dba25d77 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 2 May 2018 17:07:06 -0700 Subject: Fixed sky editing floater. --- indra/newview/llfloaterfixedenvironment.cpp | 91 +++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 6c883b2534..ec8e2c8965 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -40,6 +40,7 @@ // newview #include "llpaneleditwater.h" +#include "llpaneleditsky.h" #include "llsettingssky.h" #include "llsettingswater.h" @@ -246,6 +247,96 @@ void LLFloaterFixedEnvironmentWater::doApplyFixedSettings() } +//========================================================================= +LLFloaterFixedEnvironmentSky::LLFloaterFixedEnvironmentSky(const LLSD &key) : + LLFloaterFixedEnvironment(key) +{} + +BOOL LLFloaterFixedEnvironmentSky::postBuild() +{ + if (!LLFloaterFixedEnvironment::postBuild()) + return FALSE; + + LLPanelSettingsSky * panel; + panel = new LLPanelSettingsSkyAtmosTab; + panel->buildFromFile("panel_settings_sky_atmos.xml"); + panel->setSky(std::static_pointer_cast(mSettings)); + mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(true)); + + panel = new LLPanelSettingsSkyCloudTab; + panel->buildFromFile("panel_settings_sky_clouds.xml"); + panel->setSky(std::static_pointer_cast(mSettings)); + mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(false)); + + panel = new LLPanelSettingsSkySunMoonTab; + panel->buildFromFile("panel_settings_sky_sunmoon.xml"); + panel->setSky(std::static_pointer_cast(mSettings)); + mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(false)); + + return TRUE; +} + +void LLFloaterFixedEnvironmentSky::updateEditEnvironment(void) +{ + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, + std::static_pointer_cast(mSettings)); +} + +void LLFloaterFixedEnvironmentSky::onOpen(const LLSD& key) +{ + if (!mSettings) + { + // Initialize the settings, take a snapshot of the current water. + mSettings = LLEnvironment::instance().getEnvironmentFixedSky(LLEnvironment::ENV_CURRENT)->buildClone(); + mSettings->setName("Snapshot sky (new)"); + + // TODO: Should we grab sky and keep it around for reference? + } + + updateEditEnvironment(); + syncronizeTabs(); + refresh(); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_EDIT, LLEnvironment::TRANSITION_FAST); +} + +void LLFloaterFixedEnvironmentSky::onClose(bool app_quitting) +{ + mSettings.reset(); + syncronizeTabs(); +} + +void LLFloaterFixedEnvironmentSky::doLoadFromInventory() +{ + +} + +void LLFloaterFixedEnvironmentSky::doImportFromDisk() +{ // Load a a legacy Windlight XML from disk. + + LLFilePicker& picker = LLFilePicker::instance(); + if (picker.getOpenFile(LLFilePicker::FFLOAD_XML)) + { + std::string filename = picker.getFirstFile(); + + LL_WARNS("LAPRAS") << "Selected file: " << filename << LL_ENDL; + LLSettingsSky::ptr_t legacysky = LLEnvironment::createSkyFromLegacyPreset(filename); + + if (!legacysky) + { // *TODO* Put up error dialog here. Could not create water from filename + return; + } + + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, legacysky); + this->setEditSettings(legacysky); + LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST, true); + } +} + +void LLFloaterFixedEnvironmentSky::doApplyFixedSettings() +{ + LLSettingsVOBase::createInventoryItem(mSettings); +} + //========================================================================= #if 0 -- cgit v1.2.3 From c238fa3ac5a3f93dcbf95e3cf7a7f8b576ab751c Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 8 May 2018 16:57:14 -0700 Subject: Add save/update functionality hooks to fixed editor. --- indra/newview/llfloaterfixedenvironment.cpp | 765 ++++------------------------ 1 file changed, 85 insertions(+), 680 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index ec8e2c8965..f95e41408f 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -60,11 +60,23 @@ namespace const std::string BUTTON_NAME_IMPORT("btn_import"); const std::string BUTTON_NAME_COMMIT("btn_commit"); const std::string BUTTON_NAME_CANCEL("btn_cancel"); + + const std::string ACTION_SAVE("save_settings"); + const std::string ACTION_SAVEAS("save_as_new_settings"); + const std::string ACTION_APPLY_LOCAL("apply_local"); + const std::string ACTION_APPLY_PARCEL("apply_parcel"); + const std::string ACTION_APPLY_REGION("apply_region"); } LLFloaterFixedEnvironment::LLFloaterFixedEnvironment(const LLSD &key) : - LLFloater(key) + LLFloater(key), + mFlyoutControl(nullptr) +{ +} + +LLFloaterFixedEnvironment::~LLFloaterFixedEnvironment() { + delete mFlyoutControl; } BOOL LLFloaterFixedEnvironment::postBuild() @@ -77,9 +89,11 @@ BOOL LLFloaterFixedEnvironment::postBuild() getChild(BUTTON_NAME_LOAD)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonLoad(); }); getChild(BUTTON_NAME_IMPORT)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonImport(); }); - getChild(BUTTON_NAME_COMMIT)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonApply(); }); getChild(BUTTON_NAME_CANCEL)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonCancel(); }); + mFlyoutControl = new LLFlyoutComboBtn(this, "btn_commit", "btn_flyout", "menu_save_settings.xml"); + mFlyoutControl->setAction([this](LLUICtrl *ctrl, const LLSD &data) { onButtonApply(ctrl, data); }); + return TRUE; } @@ -107,8 +121,10 @@ void LLFloaterFixedEnvironment::refresh() bool enableApplyAndLoad = canUseInventory(); + mFlyoutControl->setMenuItemEnabled(ACTION_SAVE, enableApplyAndLoad); + mFlyoutControl->setMenuItemEnabled(ACTION_SAVEAS, enableApplyAndLoad); + getChild(BUTTON_NAME_LOAD)->setEnabled(enableApplyAndLoad); - getChild(BUTTON_NAME_COMMIT)->setEnabled(enableApplyAndLoad); mTxtName->setValue(mSettings->getName()); @@ -149,9 +165,28 @@ void LLFloaterFixedEnvironment::onButtonImport() doImportFromDisk(); } -void LLFloaterFixedEnvironment::onButtonApply() +void LLFloaterFixedEnvironment::onButtonApply(LLUICtrl *ctrl, const LLSD &data) { - doApplyFixedSettings(); + std::string ctrl_action = ctrl->getName(); + + if (ctrl_action == ACTION_SAVE) + { + doApplyCreateNewInventory(); + } + else if (ctrl_action == ACTION_SAVEAS) + { + doApplyUpdateInventory(); + } + else if ((ctrl_action == ACTION_APPLY_LOCAL) || + (ctrl_action == ACTION_APPLY_PARCEL) || + (ctrl_action == ACTION_APPLY_REGION)) + { + doApplyEnvironment(ctrl_action); + } + else + { + LL_WARNS("ENVIRONMENT") << "Unknown settings action '" << ctrl_action << "'" << LL_ENDL; + } } void LLFloaterFixedEnvironment::onButtonCancel() @@ -160,12 +195,57 @@ void LLFloaterFixedEnvironment::onButtonCancel() this->closeFloater(); } +void LLFloaterFixedEnvironment::doApplyCreateNewInventory() +{ + // This method knows what sort of settings object to create. + LLSettingsVOBase::createInventoryItem(mSettings); +} + +void LLFloaterFixedEnvironment::doApplyUpdateInventory() +{ + // todo update existing inventory object. +} + +void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) +{ + LLEnvironment::EnvSelection_t env(LLEnvironment::ENV_DEFAULT); + bool updateSimulator( where != ACTION_APPLY_LOCAL ); + + if (where == ACTION_APPLY_LOCAL) + env = LLEnvironment::ENV_LOCAL; + else if (where == ACTION_APPLY_PARCEL) + env = LLEnvironment::ENV_PARCEL; + else if (where == ACTION_APPLY_REGION) + env = LLEnvironment::ENV_REGION; + else + { + LL_WARNS("ENVIRONMENT") << "Unknown apply '" << where << "'" << LL_ENDL; + return; + } + + LLEnvironment::instance().setEnvironment(env, mSettings); + if (updateSimulator) + { + LL_WARNS("ENVIRONMENT") << "Attempting apply" << LL_ENDL; + } +} + //------------------------------------------------------------------------- bool LLFloaterFixedEnvironment::canUseInventory() const { return !gAgent.getRegionCapability("UpdateSettingsAgentInventory").empty(); } +bool LLFloaterFixedEnvironment::canApplyRegion() const +{ + return true; +} + +bool LLFloaterFixedEnvironment::canApplyParcel() const +{ + return false; +} + //========================================================================= LLFloaterFixedEnvironmentWater::LLFloaterFixedEnvironmentWater(const LLSD &key): LLFloaterFixedEnvironment(key) @@ -241,12 +321,6 @@ void LLFloaterFixedEnvironmentWater::doImportFromDisk() } } -void LLFloaterFixedEnvironmentWater::doApplyFixedSettings() -{ - LLSettingsVOBase::createInventoryItem(mSettings); - -} - //========================================================================= LLFloaterFixedEnvironmentSky::LLFloaterFixedEnvironmentSky(const LLSD &key) : LLFloaterFixedEnvironment(key) @@ -332,674 +406,5 @@ void LLFloaterFixedEnvironmentSky::doImportFromDisk() } } -void LLFloaterFixedEnvironmentSky::doApplyFixedSettings() -{ - LLSettingsVOBase::createInventoryItem(mSettings); -} - //========================================================================= -#if 0 -// virtual -BOOL LLFloaterEditSky::postBuild() -{ - mSkyPresetNameEditor = getChild("sky_preset_name"); - mSkyPresetCombo = getChild("sky_preset_combo"); - mMakeDefaultCheckBox = getChild("make_default_cb"); - mSaveButton = getChild("save"); - mSkyAdapter = boost::make_shared(); - - LLEnvironment::instance().setSkyListChange(boost::bind(&LLFloaterEditSky::onSkyPresetListChange, this)); - - initCallbacks(); - -// // Create the sun position scrubber on the slider. -// getChild("WLSunPos")->addSlider(12.f); - - return TRUE; -} - -// virtual -void LLFloaterEditSky::onOpen(const LLSD& key) -{ - bool new_preset = isNewPreset(); - std::string param = key.asString(); - std::string floater_title = getString(std::string("title_") + param); - std::string hint = getString(std::string("hint_" + param)); - - // Update floater title. - setTitle(floater_title); - - // Update the hint at the top. - getChild("hint")->setValue(hint); - - // Hide the hint to the right of the combo if we're invoked to create a new preset. - getChildView("note")->setVisible(!new_preset); - - // Switch between the sky presets combobox and preset name input field. - mSkyPresetCombo->setVisible(!new_preset); - mSkyPresetNameEditor->setVisible(new_preset); - - reset(); -} - -// virtual -void LLFloaterEditSky::onClose(bool app_quitting) -{ - if (!app_quitting) // there's no point to change environment if we're quitting - { - LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_EDIT); - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); - } -} - -// virtual -void LLFloaterEditSky::draw() -{ - syncControls(); - LLFloater::draw(); -} - -void LLFloaterEditSky::initCallbacks(void) -{ - // *TODO: warn user if a region environment update comes while we're editing a region sky preset. - - mSkyPresetNameEditor->setKeystrokeCallback(boost::bind(&LLFloaterEditSky::onSkyPresetNameEdited, this), NULL); - mSkyPresetCombo->setCommitCallback(boost::bind(&LLFloaterEditSky::onSkyPresetSelected, this)); - mSkyPresetCombo->setTextEntryCallback(boost::bind(&LLFloaterEditSky::onSkyPresetNameEdited, this)); - - mSaveButton->setCommitCallback(boost::bind(&LLFloaterEditSky::onBtnSave, this)); - getChild("cancel")->setCommitCallback(boost::bind(&LLFloaterEditSky::onBtnCancel, this)); - - // Connect to region info updates. - LLRegionInfoModel::instance().setUpdateCallback(boost::bind(&LLFloaterEditSky::onRegionInfoUpdate, this)); - - //------------------------------------------------------------------------- -// LEGACY_ATMOSPHERICS - // ambient - getChild("WLAmbient")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlMoved, this, _1, &mSkyAdapter->mAmbient)); - - // blue horizon/density - getChild("WLBlueHorizon")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlMoved, this, _1, &mSkyAdapter->mBlueHorizon)); - getChild("WLBlueDensity")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlMoved, this, _1, &mSkyAdapter->mBlueDensity)); - - // haze density, horizon, mult, and altitude - getChild("WLHazeDensity")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mHazeDensity)); - getChild("WLHazeHorizon")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mHazeHorizon)); - getChild("WLDensityMult")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mDensityMult)); - getChild("WLDistanceMult")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mDistanceMult)); - getChild("WLMaxAltitude")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mMaxAlt)); - - // sunlight - getChild("WLSunlight")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlMoved, this, _1, &mSkyAdapter->mSunlight)); - - // glow - getChild("WLGlowR")->setCommitCallback(boost::bind(&LLFloaterEditSky::onGlowRMoved, this, _1, &mSkyAdapter->mGlow)); - getChild("WLGlowB")->setCommitCallback(boost::bind(&LLFloaterEditSky::onGlowBMoved, this, _1, &mSkyAdapter->mGlow)); - - // time of day -// getChild("WLSunPos")->setCommitCallback(boost::bind(&LLFloaterEditSky::onSunMoved, this, _1, &mSkyAdapter->mLightnorm)); // multi-slider -// getChild("WLDayTime")->setCommitCallback(boost::bind(&LLFloaterEditSky::onTimeChanged, this)); // time ctrl -// getChild("WLEastAngle")->setCommitCallback(boost::bind(&LLFloaterEditSky::onSunMoved, this, _1, &mSkyAdapter->mLightnorm)); - getChild("WLSunRotation")->setCommitCallback(boost::bind(&LLFloaterEditSky::onSunRotationChanged, this)); - getChild("WLMoonRotation")->setCommitCallback(boost::bind(&LLFloaterEditSky::onMoonRotationChanged, this)); - - // Clouds - - // Cloud Color - getChild("WLCloudColor")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlMoved, this, _1, &mSkyAdapter->mCloudColor)); - - // Cloud - getChild("WLCloudX")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlRMoved, this, _1, &mSkyAdapter->mCloudMain)); - getChild("WLCloudY")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlGMoved, this, _1, &mSkyAdapter->mCloudMain)); - getChild("WLCloudDensity")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlBMoved, this, _1, &mSkyAdapter->mCloudMain)); - - // Cloud Detail - getChild("WLCloudDetailX")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlRMoved, this, _1, &mSkyAdapter->mCloudDetail)); - getChild("WLCloudDetailY")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlGMoved, this, _1, &mSkyAdapter->mCloudDetail)); - getChild("WLCloudDetailDensity")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlBMoved, this, _1, &mSkyAdapter->mCloudDetail)); - - // Cloud extras - getChild("WLCloudCoverage")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mCloudCoverage)); - getChild("WLCloudScale")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mCloudScale)); - getChild("WLCloudScrollX")->setCommitCallback(boost::bind(&LLFloaterEditSky::onCloudScrollXMoved, this, _1)); - getChild("WLCloudScrollY")->setCommitCallback(boost::bind(&LLFloaterEditSky::onCloudScrollYMoved, this, _1)); - - - // Dome - getChild("WLGamma")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mWLGamma)); - getChild("WLStarAlpha")->setCommitCallback(boost::bind(&LLFloaterEditSky::onStarAlphaMoved, this, _1)); -} - -//================================================================================================= - -void LLFloaterEditSky::syncControls() -{ - LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky(); - mEditSettings = psky; - - std::string name = psky->getName(); - - mSkyPresetNameEditor->setText(name); - mSkyPresetCombo->setValue(name); - -// LEGACY_ATMOSPHERICS - // ambient - mSkyAdapter->mAmbient.setColor3( psky->getAmbientColor() ); - setColorSwatch("WLAmbient", mSkyAdapter->mAmbient, WL_SUN_AMBIENT_SLIDER_SCALE); - - // blue horizon / density - mSkyAdapter->mBlueHorizon.setColor3( psky->getBlueHorizon() ); - setColorSwatch("WLBlueHorizon", mSkyAdapter->mBlueHorizon, WL_BLUE_HORIZON_DENSITY_SCALE); - mSkyAdapter->mBlueDensity.setColor3( psky->getBlueDensity() ); - setColorSwatch("WLBlueDensity", mSkyAdapter->mBlueDensity, WL_BLUE_HORIZON_DENSITY_SCALE); - - // haze density, horizon, mult, and altitude - mSkyAdapter->mHazeDensity = psky->getHazeDensity(); - childSetValue("WLHazeDensity", (F32) mSkyAdapter->mHazeDensity); - mSkyAdapter->mHazeHorizon = psky->getHazeHorizon(); - childSetValue("WLHazeHorizon", (F32) mSkyAdapter->mHazeHorizon); - mSkyAdapter->mDensityMult = psky->getDensityMultiplier(); - childSetValue("WLDensityMult", ((F32) mSkyAdapter->mDensityMult) * mSkyAdapter->mDensityMult.getMult()); - mSkyAdapter->mMaxAlt = psky->getMaxY(); - mSkyAdapter->mDistanceMult = psky->getDistanceMultiplier(); - childSetValue("WLDistanceMult", (F32) mSkyAdapter->mDistanceMult); - childSetValue("WLMaxAltitude", (F32) mSkyAdapter->mMaxAlt); - - // Lighting - - // sunlight - mSkyAdapter->mSunlight.setColor3( psky->getSunlightColor() ); - setColorSwatch("WLSunlight", mSkyAdapter->mSunlight, WL_SUN_AMBIENT_SLIDER_SCALE); - - // glow - mSkyAdapter->mGlow.setColor3( psky->getGlow() ); - childSetValue("WLGlowR", 2 - mSkyAdapter->mGlow.getRed() / 20.0f); - childSetValue("WLGlowB", -mSkyAdapter->mGlow.getBlue() / 5.0f); - - - -// LLSettingsSky::azimalt_t azal = psky->getSunRotationAzAl(); -// -// F32 time24 = sun_pos_to_time24(azal.second / F_TWO_PI); -// getChild("WLSunPos")->setCurSliderValue(time24, TRUE); -// getChild("WLDayTime")->setTime24(time24); -// childSetValue("WLEastAngle", azal.first / F_TWO_PI); - getChild("WLSunRotation")->setRotation(psky->getSunRotation()); - getChild("WLMoonRotation")->setRotation(psky->getMoonRotation()); - - // Clouds - - // Cloud Color - mSkyAdapter->mCloudColor.setColor3( psky->getCloudColor() ); - setColorSwatch("WLCloudColor", mSkyAdapter->mCloudColor, WL_CLOUD_SLIDER_SCALE); - - // Cloud - mSkyAdapter->mCloudMain.setColor3( psky->getCloudPosDensity1() ); - childSetValue("WLCloudX", mSkyAdapter->mCloudMain.getRed()); - childSetValue("WLCloudY", mSkyAdapter->mCloudMain.getGreen()); - childSetValue("WLCloudDensity", mSkyAdapter->mCloudMain.getBlue()); - - // Cloud Detail - mSkyAdapter->mCloudDetail.setColor3( psky->getCloudPosDensity2() ); - childSetValue("WLCloudDetailX", mSkyAdapter->mCloudDetail.getRed()); - childSetValue("WLCloudDetailY", mSkyAdapter->mCloudDetail.getGreen()); - childSetValue("WLCloudDetailDensity", mSkyAdapter->mCloudDetail.getBlue()); - - // Cloud extras - mSkyAdapter->mCloudCoverage = psky->getCloudShadow(); - mSkyAdapter->mCloudScale = psky->getCloudScale(); - childSetValue("WLCloudCoverage", (F32) mSkyAdapter->mCloudCoverage); - childSetValue("WLCloudScale", (F32) mSkyAdapter->mCloudScale); - - // cloud scrolling - LLVector2 scroll_rate = psky->getCloudScrollRate(); - - // LAPRAS: These should go away... - childDisable("WLCloudLockX"); - childDisable("WLCloudLockY"); - - // disable if locked, enable if not - childEnable("WLCloudScrollX"); - childEnable("WLCloudScrollY"); - - // *HACK cloud scrolling is off my an additive of 10 - childSetValue("WLCloudScrollX", scroll_rate[0] - 10.0f); - childSetValue("WLCloudScrollY", scroll_rate[1] - 10.0f); - - // Tweak extras - - mSkyAdapter->mWLGamma = psky->getGamma(); - childSetValue("WLGamma", (F32) mSkyAdapter->mWLGamma); - - childSetValue("WLStarAlpha", psky->getStarBrightness()); -} - -void LLFloaterEditSky::setColorSwatch(const std::string& name, const WLColorControl& from_ctrl, F32 k) -{ - // Set the value, dividing it by first. - LLColor4 color = from_ctrl.getColor4(); - getChild(name)->set(color / k); -} - -// color control callbacks -void LLFloaterEditSky::onColorControlMoved(LLUICtrl* ctrl, WLColorControl* color_ctrl) -{ - LLColorSwatchCtrl* swatch = static_cast(ctrl); - LLColor4 color_vec(swatch->get().mV); - - // Multiply RGB values by the appropriate factor. - F32 k = WL_CLOUD_SLIDER_SCALE; - if (color_ctrl->getIsSunOrAmbientColor()) - { - k = WL_SUN_AMBIENT_SLIDER_SCALE; - } - else if (color_ctrl->getIsBlueHorizonOrDensity()) - { - k = WL_BLUE_HORIZON_DENSITY_SCALE; - } - - color_vec *= k; // intensity isn't affected by the multiplication - - // Set intensity to maximum of the RGB values. - color_vec.mV[3] = color_max(color_vec); - - // Apply the new RGBI value. - color_ctrl->setColor4(color_vec); - color_ctrl->update(mEditSettings); -} - -void LLFloaterEditSky::onColorControlRMoved(LLUICtrl* ctrl, void* userdata) -{ - LLSliderCtrl* sldr_ctrl = static_cast(ctrl); - WLColorControl* color_ctrl = static_cast(userdata); - - F32 red_value = sldr_ctrl->getValueF32(); - F32 k = 1.0f; - - if (color_ctrl->getIsSunOrAmbientColor()) - { - k = WL_SUN_AMBIENT_SLIDER_SCALE; - } - if (color_ctrl->getIsBlueHorizonOrDensity()) - { - k = WL_BLUE_HORIZON_DENSITY_SCALE; - } - color_ctrl->setRed(red_value * k); - - adjustIntensity(color_ctrl, red_value, k); - color_ctrl->update(mEditSettings); -} - -void LLFloaterEditSky::onColorControlGMoved(LLUICtrl* ctrl, void* userdata) -{ - LLSliderCtrl* sldr_ctrl = static_cast(ctrl); - WLColorControl* color_ctrl = static_cast(userdata); - - F32 green_value = sldr_ctrl->getValueF32(); - F32 k = 1.0f; - - if (color_ctrl->getIsSunOrAmbientColor()) - { - k = WL_SUN_AMBIENT_SLIDER_SCALE; - } - if (color_ctrl->getIsBlueHorizonOrDensity()) - { - k = WL_BLUE_HORIZON_DENSITY_SCALE; - } - color_ctrl->setGreen(green_value * k); - - adjustIntensity(color_ctrl, green_value, k); - color_ctrl->update(mEditSettings); -} - -void LLFloaterEditSky::onColorControlBMoved(LLUICtrl* ctrl, void* userdata) -{ - LLSliderCtrl* sldr_ctrl = static_cast(ctrl); - WLColorControl* color_ctrl = static_cast(userdata); - - F32 blue_value = sldr_ctrl->getValueF32(); - F32 k = 1.0f; - - if (color_ctrl->getIsSunOrAmbientColor()) - { - k = WL_SUN_AMBIENT_SLIDER_SCALE; - } - if (color_ctrl->getIsBlueHorizonOrDensity()) - { - k = WL_BLUE_HORIZON_DENSITY_SCALE; - } - color_ctrl->setBlue(blue_value * k); - - adjustIntensity(color_ctrl, blue_value, k); - color_ctrl->update(mEditSettings); -} - -void LLFloaterEditSky::adjustIntensity(WLColorControl *ctrl, F32 val, F32 scale) -{ - if (ctrl->getHasSliderName()) - { - LLColor4 color = ctrl->getColor4(); - F32 i = color_max(color) / scale; - ctrl->setIntensity(i); - std::string name = ctrl->getSliderName(); - name.append("I"); - - childSetValue(name, i); - } -} - - -/// GLOW SPECIFIC CODE -void LLFloaterEditSky::onGlowRMoved(LLUICtrl* ctrl, void* userdata) -{ - - LLSliderCtrl* sldr_ctrl = static_cast(ctrl); - WLColorControl* color_ctrl = static_cast(userdata); - - // scaled by 20 - color_ctrl->setRed((2 - sldr_ctrl->getValueF32()) * 20); - - color_ctrl->update(mEditSettings); -} - -/// \NOTE that we want NEGATIVE (-) B -void LLFloaterEditSky::onGlowBMoved(LLUICtrl* ctrl, void* userdata) -{ - LLSliderCtrl* sldr_ctrl = static_cast(ctrl); - WLColorControl* color_ctrl = static_cast(userdata); - - /// \NOTE that we want NEGATIVE (-) B and NOT by 20 as 20 is too big - color_ctrl->setBlue(-sldr_ctrl->getValueF32() * 5); - - color_ctrl->update(mEditSettings); -} - -void LLFloaterEditSky::onFloatControlMoved(LLUICtrl* ctrl, void* userdata) -{ - LLSliderCtrl* sldr_ctrl = static_cast(ctrl); - WLFloatControl * floatControl = static_cast(userdata); - - floatControl->setValue(sldr_ctrl->getValueF32() / floatControl->getMult()); - - floatControl->update(mEditSettings); -} - - -// Lighting callbacks - -// time of day -void LLFloaterEditSky::onSunMoved(LLUICtrl* ctrl, void* userdata) -{ - LLMultiSliderCtrl* sun_msldr = getChild("WLSunPos"); - LLSliderCtrl* east_sldr = getChild("WLEastAngle"); - LLTimeCtrl* time_ctrl = getChild("WLDayTime"); - WLColorControl* color_ctrl = static_cast(userdata); - - F32 time24 = sun_msldr->getCurSliderValue(); - time_ctrl->setTime24(time24); // sync the time ctrl with the new sun position - - // get the two angles - F32 azimuth = F_TWO_PI * east_sldr->getValueF32(); - F32 altitude = F_TWO_PI * time24_to_sun_pos(time24); - mEditSettings->setSunRotation(azimuth, altitude); - mEditSettings->setMoonRotation(azimuth + F_PI, -altitude); - - LLVector4 sunnorm( mEditSettings->getSunDirection(), 1.f ); - - color_ctrl->update(mEditSettings); -} - -void LLFloaterEditSky::onTimeChanged() -{ - F32 time24 = getChild("WLDayTime")->getTime24(); - getChild("WLSunPos")->setCurSliderValue(time24, TRUE); - onSunMoved(getChild("WLSunPos"), &(mSkyAdapter->mLightnorm)); -} - -void LLFloaterEditSky::onSunRotationChanged() -{ - LLJoystickQuaternion* sun_spinner = getChild("WLSunRotation"); - LLQuaternion sunrot(sun_spinner->getRotation()); - - mEditSettings->setSunRotation(sunrot); -} - -void LLFloaterEditSky::onMoonRotationChanged() -{ - LLJoystickQuaternion* moon_spinner = getChild("WLMoonRotation"); - LLQuaternion moonrot(moon_spinner->getRotation()); - - mEditSettings->setMoonRotation(moonrot); -} - -void LLFloaterEditSky::onStarAlphaMoved(LLUICtrl* ctrl) -{ - LLSliderCtrl* sldr_ctrl = static_cast(ctrl); - - mEditSettings->setStarBrightness(sldr_ctrl->getValueF32()); -} - -// Clouds -void LLFloaterEditSky::onCloudScrollXMoved(LLUICtrl* ctrl) -{ - LLSliderCtrl* sldr_ctrl = static_cast(ctrl); - // *HACK all cloud scrolling is off by an additive of 10. - mEditSettings->setCloudScrollRateX(sldr_ctrl->getValueF32() + 10.0f); -} - -void LLFloaterEditSky::onCloudScrollYMoved(LLUICtrl* ctrl) -{ - LLSliderCtrl* sldr_ctrl = static_cast(ctrl); - - // *HACK all cloud scrolling is off by an additive of 10. - mEditSettings->setCloudScrollRateY(sldr_ctrl->getValueF32() + 10.0f); -} - -//================================================================================================= - -void LLFloaterEditSky::reset() -{ - if (isNewPreset()) - { - mSkyPresetNameEditor->setValue(LLSD()); - mSaveButton->setEnabled(FALSE); // will be enabled as soon as users enters a name - } - else - { - refreshSkyPresetsList(); - - // Disable controls until a sky preset to edit is selected. - enableEditing(false); - } -} - -bool LLFloaterEditSky::isNewPreset() const -{ - return mKey.asString() == "new"; -} - -void LLFloaterEditSky::refreshSkyPresetsList() -{ - mSkyPresetCombo->removeall(); - - LLEnvironment::list_name_id_t list = LLEnvironment::instance().getSkyList(); - - for (LLEnvironment::list_name_id_t::iterator it = list.begin(); it != list.end(); ++it) - { - mSkyPresetCombo->add((*it).first, LLSDArray((*it).first)((*it).second)); - } - - mSkyPresetCombo->setLabel(getString("combo_label")); -} - -void LLFloaterEditSky::enableEditing(bool enable) -{ - // Enable/disable the tab and their contents. - LLTabContainer* tab_container = getChild("WindLight Tabs"); - tab_container->setEnabled(enable); - for (S32 i = 0; i < tab_container->getTabCount(); ++i) - { - tab_container->enableTabButton(i, enable); - tab_container->getPanelByIndex(i)->setCtrlsEnabled(enable); - } - - // Enable/disable saving. - mSaveButton->setEnabled(enable); - mMakeDefaultCheckBox->setEnabled(enable); -} - -void LLFloaterEditSky::saveRegionSky() -{ -#if 0 - LLWLParamKey key(getSelectedSkyPreset()); - llassert(key.scope == LLEnvKey::SCOPE_REGION); - - LL_DEBUGS("Windlight") << "Saving region sky preset: " << key.name << LL_ENDL; - LLWLParamManager& wl_mgr = LLWLParamManager::instance(); - wl_mgr.mCurParams.mName = key.name; - wl_mgr.setParamSet(key, wl_mgr.mCurParams); - - // *TODO: save to cached region settings. - LL_WARNS("Windlight") << "Saving region sky is not fully implemented yet" << LL_ENDL; -#endif -} - -std::string LLFloaterEditSky::getSelectedPresetName() const -{ - std::string name; - if (mSkyPresetNameEditor->getVisible()) - { - name = mSkyPresetNameEditor->getText(); - } - else - { - LLSD combo_val = mSkyPresetCombo->getValue(); - name = combo_val[0].asString(); - } - - return name; -} - -void LLFloaterEditSky::onSkyPresetNameEdited() -{ - std::string name = mSkyPresetNameEditor->getText(); - LLSettingsWater::ptr_t psky = LLEnvironment::instance().getCurrentWater(); - - psky->setName(name); -} - -void LLFloaterEditSky::onSkyPresetSelected() -{ - std::string name; - - name = getSelectedPresetName(); - - LLSettingsSky::ptr_t psky = LLEnvironment::instance().findSkyByName(name); - - if (!psky) - { - LL_WARNS("WATEREDIT") << "Could not find water preset" << LL_ENDL; - enableEditing(false); - return; - } - - psky = psky->buildClone(); - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, psky); - mEditSettings = psky; - - syncControls(); - enableEditing(true); - -} - -bool LLFloaterEditSky::onSaveAnswer(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - - // If they choose save, do it. Otherwise, don't do anything - if (option == 0) - { - onSaveConfirmed(); - } - - return false; -} - -void LLFloaterEditSky::onSaveConfirmed() -{ - // Save currently displayed water params to the selected preset. - std::string name = mEditSettings->getName(); - - LL_DEBUGS("Windlight") << "Saving sky preset " << name << LL_ENDL; - - LLEnvironment::instance().addSky(mEditSettings); - - // Change preference if requested. - if (mMakeDefaultCheckBox->getEnabled() && mMakeDefaultCheckBox->getValue()) - { - LL_DEBUGS("Windlight") << name << " is now the new preferred sky preset" << LL_ENDL; - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, mEditSettings); - } - - closeFloater(); -} - -void LLFloaterEditSky::onBtnSave() -{ - LLEnvironment::instance().addSky(mEditSettings); - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, mEditSettings); - - closeFloater(); -} - -void LLFloaterEditSky::onBtnCancel() -{ - closeFloater(); -} - -void LLFloaterEditSky::onSkyPresetListChange() -{ - refreshSkyPresetsList(); -} - -void LLFloaterEditSky::onRegionSettingsChange() -{ -#if 0 - // If creating a new sky, don't bother. - if (isNewPreset()) - { - return; - } - - if (getSelectedSkyPreset().scope == LLEnvKey::SCOPE_REGION) // if editing a region sky - { - // reset the floater to its initial state - reset(); - - // *TODO: Notify user? - } - else // editing a local sky - { - refreshSkyPresetsList(); - } -#endif -} - -void LLFloaterEditSky::onRegionInfoUpdate() -{ -#if 0 - bool can_edit = true; - - // If we've selected a region sky preset for editing. - if (getSelectedSkyPreset().scope == LLEnvKey::SCOPE_REGION) - { - // check whether we have the access - can_edit = LLEnvManagerNew::canEditRegionSettings(); - } - - enableEditing(can_edit); -#endif -} -#endif - -- cgit v1.2.3 From 3c18de21369260ec9b7ba39c0e360045dd65e30d Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 10 May 2018 17:08:13 -0700 Subject: Settings editor available from the open context on the menu. Can edit inventory items. --- indra/newview/llfloaterfixedenvironment.cpp | 165 ++++++++++++++++++++-------- 1 file changed, 122 insertions(+), 43 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index f95e41408f..f03c8ba7d1 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -38,6 +38,8 @@ #include "lltabcontainer.h" #include "llfilepicker.h" +#include "llviewerparcelmgr.h" + // newview #include "llpaneleditwater.h" #include "llpaneleditsky.h" @@ -47,8 +49,10 @@ #include "llenvironment.h" #include "llagent.h" +#include "llparcel.h" #include "llsettingsvo.h" +#include "llinventorymodel.h" namespace { @@ -56,21 +60,30 @@ namespace const std::string CONTROL_TAB_AREA("tab_settings"); - const std::string BUTTON_NAME_LOAD("btn_load"); const std::string BUTTON_NAME_IMPORT("btn_import"); const std::string BUTTON_NAME_COMMIT("btn_commit"); const std::string BUTTON_NAME_CANCEL("btn_cancel"); + const std::string BUTTON_NAME_FLYOUT("btn_flyout"); const std::string ACTION_SAVE("save_settings"); const std::string ACTION_SAVEAS("save_as_new_settings"); const std::string ACTION_APPLY_LOCAL("apply_local"); const std::string ACTION_APPLY_PARCEL("apply_parcel"); const std::string ACTION_APPLY_REGION("apply_region"); + + const std::string XML_FLYOUTMENU_FILE("menu_save_settings.xml"); } +//========================================================================= +const std::string LLFloaterFixedEnvironment::KEY_INVENTORY_ID("inventory_id"); + + +//========================================================================= LLFloaterFixedEnvironment::LLFloaterFixedEnvironment(const LLSD &key) : LLFloater(key), - mFlyoutControl(nullptr) + mFlyoutControl(nullptr), + mInventoryId(), + mInventoryItem(nullptr) { } @@ -87,16 +100,40 @@ BOOL LLFloaterFixedEnvironment::postBuild() mTxtName->setCommitOnFocusLost(TRUE); mTxtName->setCommitCallback([this](LLUICtrl *, const LLSD &) { onNameChanged(mTxtName->getValue().asString()); }); - getChild(BUTTON_NAME_LOAD)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonLoad(); }); getChild(BUTTON_NAME_IMPORT)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonImport(); }); getChild(BUTTON_NAME_CANCEL)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonCancel(); }); - mFlyoutControl = new LLFlyoutComboBtn(this, "btn_commit", "btn_flyout", "menu_save_settings.xml"); + mFlyoutControl = new LLFlyoutComboBtn(this, BUTTON_NAME_COMMIT, BUTTON_NAME_FLYOUT, XML_FLYOUTMENU_FILE); mFlyoutControl->setAction([this](LLUICtrl *ctrl, const LLSD &data) { onButtonApply(ctrl, data); }); return TRUE; } +void LLFloaterFixedEnvironment::onOpen(const LLSD& key) +{ + LLUUID invid; + + if (key.has(KEY_INVENTORY_ID)) + { + invid = key[KEY_INVENTORY_ID].asUUID(); + } + + loadInventoryItem(invid); + LL_INFOS("SETTINGS") << "Setting edit inventory item to " << mInventoryId << "." << LL_ENDL; + + updateEditEnvironment(); + syncronizeTabs(); + refresh(); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_EDIT, LLEnvironment::TRANSITION_FAST); + +} + +void LLFloaterFixedEnvironment::onClose(bool app_quitting) +{ + mSettings.reset(); + syncronizeTabs(); +} + void LLFloaterFixedEnvironment::onFocusReceived() { updateEditEnvironment(); @@ -119,12 +156,10 @@ void LLFloaterFixedEnvironment::refresh() return; } - bool enableApplyAndLoad = canUseInventory(); + bool is_inventory_avail = canUseInventory(); - mFlyoutControl->setMenuItemEnabled(ACTION_SAVE, enableApplyAndLoad); - mFlyoutControl->setMenuItemEnabled(ACTION_SAVEAS, enableApplyAndLoad); - - getChild(BUTTON_NAME_LOAD)->setEnabled(enableApplyAndLoad); + mFlyoutControl->setMenuItemEnabled(ACTION_SAVE, is_inventory_avail); + mFlyoutControl->setMenuItemEnabled(ACTION_SAVEAS, is_inventory_avail); mTxtName->setValue(mSettings->getName()); @@ -150,14 +185,42 @@ void LLFloaterFixedEnvironment::syncronizeTabs() } } -void LLFloaterFixedEnvironment::onNameChanged(const std::string &name) +void LLFloaterFixedEnvironment::loadInventoryItem(const LLUUID &inventoryId) { - mSettings->setName(name); + if (inventoryId.isNull()) + { + mInventoryItem = nullptr; + mInventoryId.setNull(); + return; + } + + mInventoryId = inventoryId; + LL_INFOS("SETTINGS") << "Setting edit inventory item to " << mInventoryId << "." << LL_ENDL; + mInventoryItem = gInventory.getItem(mInventoryId); + + if (!mInventoryItem) + { + LL_WARNS("SETTINGS") << "Could not find inventory item with Id = " << mInventoryId << LL_ENDL; + mInventoryId.setNull(); + mInventoryItem = nullptr; + return; + } + + LLSettingsVOBase::getSettingsAsset(mInventoryItem->getAssetUUID(), + [this](LLUUID asset_id, LLSettingsBase::ptr_t settins, S32 status, LLExtStat) { onAssetLoaded(asset_id, settins, status); }); } -void LLFloaterFixedEnvironment::onButtonLoad() +void LLFloaterFixedEnvironment::onAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settins, S32 status) { - doLoadFromInventory(); + mSettings = settins; + updateEditEnvironment(); + syncronizeTabs(); + refresh(); +} + +void LLFloaterFixedEnvironment::onNameChanged(const std::string &name) +{ + mSettings->setName(name); } void LLFloaterFixedEnvironment::onButtonImport() @@ -171,11 +234,11 @@ void LLFloaterFixedEnvironment::onButtonApply(LLUICtrl *ctrl, const LLSD &data) if (ctrl_action == ACTION_SAVE) { - doApplyCreateNewInventory(); + doApplyUpdateInventory(); } else if (ctrl_action == ACTION_SAVEAS) { - doApplyUpdateInventory(); + doApplyCreateNewInventory(); } else if ((ctrl_action == ACTION_APPLY_LOCAL) || (ctrl_action == ACTION_APPLY_PARCEL) || @@ -198,12 +261,15 @@ void LLFloaterFixedEnvironment::onButtonCancel() void LLFloaterFixedEnvironment::doApplyCreateNewInventory() { // This method knows what sort of settings object to create. - LLSettingsVOBase::createInventoryItem(mSettings); + LLSettingsVOBase::createInventoryItem(mSettings, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); } void LLFloaterFixedEnvironment::doApplyUpdateInventory() { - // todo update existing inventory object. + if (mInventoryId.isNull()) + LLSettingsVOBase::createInventoryItem(mSettings, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); + else + LLSettingsVOBase::updateInventoryItem(mSettings, mInventoryId, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryUpdated(asset_id, inventory_id, results); }); } void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) @@ -230,20 +296,50 @@ void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) } } +void LLFloaterFixedEnvironment::onInventoryCreated(LLUUID asset_id, LLUUID inventory_id, LLSD results) +{ + LL_WARNS("ENVIRONMENT") << "Inventory item " << inventory_id << " has been created with asset " << asset_id << " results are:" << results << LL_ENDL; + + setFocus(TRUE); // Call back the focus... + loadInventoryItem(inventory_id); +} + +void LLFloaterFixedEnvironment::onInventoryUpdated(LLUUID asset_id, LLUUID inventory_id, LLSD results) +{ + LL_WARNS("ENVIRONMENT") << "Inventory item " << inventory_id << " has been updated with asset " << asset_id << " results are:" << results << LL_ENDL; + + if (inventory_id != mInventoryId) + { + loadInventoryItem(inventory_id); + } +} + //------------------------------------------------------------------------- bool LLFloaterFixedEnvironment::canUseInventory() const { - return !gAgent.getRegionCapability("UpdateSettingsAgentInventory").empty(); + return LLEnvironment::instance().isInventoryEnabled(); } bool LLFloaterFixedEnvironment::canApplyRegion() const { - return true; + return gAgent.canManageEstate(); } bool LLFloaterFixedEnvironment::canApplyParcel() const { - return false; + LLParcelSelectionHandle handle(LLViewerParcelMgr::instance().getParcelSelection()); + LLParcel *parcel(nullptr); + + if (handle) + parcel = handle->getParcel(); + if (!parcel) + parcel = LLViewerParcelMgr::instance().getAgentParcel(); + + if (!parcel) + return false; + + return parcel->allowModifyBy(gAgent.getID(), gAgent.getGroupID()) && + LLEnvironment::instance().isExtendedEnvironmentEnabled(); } //========================================================================= @@ -282,21 +378,12 @@ void LLFloaterFixedEnvironmentWater::onOpen(const LLSD& key) // TODO: Should we grab sky and keep it around for reference? } - updateEditEnvironment(); - syncronizeTabs(); - refresh(); - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_EDIT, LLEnvironment::TRANSITION_FAST); + LLFloaterFixedEnvironment::onOpen(key); } void LLFloaterFixedEnvironmentWater::onClose(bool app_quitting) { - mSettings.reset(); - syncronizeTabs(); -} - -void LLFloaterFixedEnvironmentWater::doLoadFromInventory() -{ - + LLFloaterFixedEnvironment::onClose(app_quitting); } void LLFloaterFixedEnvironmentWater::doImportFromDisk() @@ -364,24 +451,16 @@ void LLFloaterFixedEnvironmentSky::onOpen(const LLSD& key) mSettings = LLEnvironment::instance().getEnvironmentFixedSky(LLEnvironment::ENV_CURRENT)->buildClone(); mSettings->setName("Snapshot sky (new)"); - // TODO: Should we grab sky and keep it around for reference? + // TODO: Should we grab water and keep it around for reference? } - updateEditEnvironment(); - syncronizeTabs(); - refresh(); - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_EDIT, LLEnvironment::TRANSITION_FAST); -} + LLFloaterFixedEnvironment::onOpen(key); -void LLFloaterFixedEnvironmentSky::onClose(bool app_quitting) -{ - mSettings.reset(); - syncronizeTabs(); } -void LLFloaterFixedEnvironmentSky::doLoadFromInventory() +void LLFloaterFixedEnvironmentSky::onClose(bool app_quitting) { - + LLFloaterFixedEnvironment::onClose(app_quitting); } void LLFloaterFixedEnvironmentSky::doImportFromDisk() -- cgit v1.2.3 From 4c1a633c232880f4ac6e01807f1084e5d5c68b1e Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 18 May 2018 13:27:11 -0700 Subject: Day cycle editor changes for loading settings. (Not complete) --- indra/newview/llfloaterfixedenvironment.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index f03c8ba7d1..8365311179 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -210,9 +210,9 @@ void LLFloaterFixedEnvironment::loadInventoryItem(const LLUUID &inventoryId) [this](LLUUID asset_id, LLSettingsBase::ptr_t settins, S32 status, LLExtStat) { onAssetLoaded(asset_id, settins, status); }); } -void LLFloaterFixedEnvironment::onAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settins, S32 status) +void LLFloaterFixedEnvironment::onAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status) { - mSettings = settins; + mSettings = settings; updateEditEnvironment(); syncronizeTabs(); refresh(); -- cgit v1.2.3 From b6ba9dd565b59e516571445e56f9dafe3bdf4061 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 22 May 2018 20:32:56 +0300 Subject: MAINT-8344 Day Cycle Editor (part 4, finalization) --- indra/newview/llfloaterfixedenvironment.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index f03c8ba7d1..84d80bc32f 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -103,7 +103,7 @@ BOOL LLFloaterFixedEnvironment::postBuild() getChild(BUTTON_NAME_IMPORT)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonImport(); }); getChild(BUTTON_NAME_CANCEL)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonCancel(); }); - mFlyoutControl = new LLFlyoutComboBtn(this, BUTTON_NAME_COMMIT, BUTTON_NAME_FLYOUT, XML_FLYOUTMENU_FILE); + mFlyoutControl = new LLFlyoutComboBtnCtrl(this, BUTTON_NAME_COMMIT, BUTTON_NAME_FLYOUT, XML_FLYOUTMENU_FILE); mFlyoutControl->setAction([this](LLUICtrl *ctrl, const LLSD &data) { onButtonApply(ctrl, data); }); return TRUE; -- cgit v1.2.3 From 2a613d7363c4e91a7258d4f0ea3971db1569e788 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 1 Jun 2018 16:24:36 -0700 Subject: Rework preset loading and context menu from inventory. --- indra/newview/llfloaterfixedenvironment.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index d5fc34a04b..6c1080294d 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -212,6 +212,15 @@ void LLFloaterFixedEnvironment::loadInventoryItem(const LLUUID &inventoryId) void LLFloaterFixedEnvironment::onAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status) { + if (!settings || status) + { + LLSD args; + args["DESC"] = (mInventoryItem) ? mInventoryItem->getName() : "Unknown"; + LLNotificationsUtil::add("FailedToFindSettings", args); + closeFloater(); + return; + } + mSettings = settings; updateEditEnvironment(); syncronizeTabs(); -- cgit v1.2.3 From b06803225bff30e863ea18cae1d33f42a4fd937e Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 4 Jun 2018 16:50:13 -0700 Subject: Reconnect apply to region and parcel reconnected to interface. --- indra/newview/llfloaterfixedenvironment.cpp | 39 +++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 11 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 6c1080294d..e7b8481caa 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -160,6 +160,8 @@ void LLFloaterFixedEnvironment::refresh() mFlyoutControl->setMenuItemEnabled(ACTION_SAVE, is_inventory_avail); mFlyoutControl->setMenuItemEnabled(ACTION_SAVEAS, is_inventory_avail); + mFlyoutControl->setMenuItemEnabled(ACTION_APPLY_PARCEL, canApplyParcel()); + mFlyoutControl->setMenuItemEnabled(ACTION_APPLY_REGION, canApplyRegion()); mTxtName->setValue(mSettings->getName()); @@ -283,26 +285,41 @@ void LLFloaterFixedEnvironment::doApplyUpdateInventory() void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) { - LLEnvironment::EnvSelection_t env(LLEnvironment::ENV_DEFAULT); - bool updateSimulator( where != ACTION_APPLY_LOCAL ); - if (where == ACTION_APPLY_LOCAL) - env = LLEnvironment::ENV_LOCAL; + { + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, mSettings); + } else if (where == ACTION_APPLY_PARCEL) - env = LLEnvironment::ENV_PARCEL; + { + LLParcelSelectionHandle handle(LLViewerParcelMgr::instance().getParcelSelection()); + LLParcel *parcel(nullptr); + + if (handle) + parcel = handle->getParcel(); + if (!parcel) + parcel = LLViewerParcelMgr::instance().getAgentParcel(); + + if (!parcel) + return; + + if (mSettings->getSettingType() == "sky") + LLEnvironment::instance().updateParcel(parcel->getLocalID(), std::static_pointer_cast(mSettings), -1, -1); + else if (mSettings->getSettingType() == "water") + LLEnvironment::instance().updateParcel(parcel->getLocalID(), std::static_pointer_cast(mSettings), -1, -1); + } else if (where == ACTION_APPLY_REGION) - env = LLEnvironment::ENV_REGION; + { + if (mSettings->getSettingType() == "sky") + LLEnvironment::instance().updateRegion(std::static_pointer_cast(mSettings), -1, -1); + else if (mSettings->getSettingType() == "water") + LLEnvironment::instance().updateRegion(std::static_pointer_cast(mSettings), -1, -1); + } else { LL_WARNS("ENVIRONMENT") << "Unknown apply '" << where << "'" << LL_ENDL; return; } - LLEnvironment::instance().setEnvironment(env, mSettings); - if (updateSimulator) - { - LL_WARNS("ENVIRONMENT") << "Attempting apply" << LL_ENDL; - } } void LLFloaterFixedEnvironment::onInventoryCreated(LLUUID asset_id, LLUUID inventory_id, LLSD results) -- cgit v1.2.3 From 197fbaa7f6b4e7c6edc1d8be3c84146d7fb456cc Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 5 Jun 2018 18:24:48 +0100 Subject: Speculative fix for Clang not making the semantic leap on ptr_t casts. --- indra/newview/llfloaterfixedenvironment.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index e7b8481caa..ad6935ada4 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -285,6 +285,9 @@ void LLFloaterFixedEnvironment::doApplyUpdateInventory() void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) { + LLSettingsSky::ptr_t psky = std::dynamic_pointer_cast(mSettings); + LLSettingsWater::ptr_t pwater = std::dynamic_pointer_cast(mSettings); + if (where == ACTION_APPLY_LOCAL) { LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, mSettings); @@ -303,16 +306,16 @@ void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) return; if (mSettings->getSettingType() == "sky") - LLEnvironment::instance().updateParcel(parcel->getLocalID(), std::static_pointer_cast(mSettings), -1, -1); + LLEnvironment::instance().updateParcel(parcel->getLocalID(), psky, -1, -1); else if (mSettings->getSettingType() == "water") - LLEnvironment::instance().updateParcel(parcel->getLocalID(), std::static_pointer_cast(mSettings), -1, -1); + LLEnvironment::instance().updateParcel(parcel->getLocalID(), pwater, -1, -1); } else if (where == ACTION_APPLY_REGION) { if (mSettings->getSettingType() == "sky") - LLEnvironment::instance().updateRegion(std::static_pointer_cast(mSettings), -1, -1); + LLEnvironment::instance().updateRegion(psky, -1, -1); else if (mSettings->getSettingType() == "water") - LLEnvironment::instance().updateRegion(std::static_pointer_cast(mSettings), -1, -1); + LLEnvironment::instance().updateRegion(pwater, -1, -1); } else { -- cgit v1.2.3 From 5b4eb9fb93af87cbbe163ad6f87d98362a963389 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 5 Jun 2018 20:40:17 +0100 Subject: Back out change to fix pointer casts on OS X. --- indra/newview/llfloaterfixedenvironment.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index ad6935ada4..e7b8481caa 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -285,9 +285,6 @@ void LLFloaterFixedEnvironment::doApplyUpdateInventory() void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) { - LLSettingsSky::ptr_t psky = std::dynamic_pointer_cast(mSettings); - LLSettingsWater::ptr_t pwater = std::dynamic_pointer_cast(mSettings); - if (where == ACTION_APPLY_LOCAL) { LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, mSettings); @@ -306,16 +303,16 @@ void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) return; if (mSettings->getSettingType() == "sky") - LLEnvironment::instance().updateParcel(parcel->getLocalID(), psky, -1, -1); + LLEnvironment::instance().updateParcel(parcel->getLocalID(), std::static_pointer_cast(mSettings), -1, -1); else if (mSettings->getSettingType() == "water") - LLEnvironment::instance().updateParcel(parcel->getLocalID(), pwater, -1, -1); + LLEnvironment::instance().updateParcel(parcel->getLocalID(), std::static_pointer_cast(mSettings), -1, -1); } else if (where == ACTION_APPLY_REGION) { if (mSettings->getSettingType() == "sky") - LLEnvironment::instance().updateRegion(psky, -1, -1); + LLEnvironment::instance().updateRegion(std::static_pointer_cast(mSettings), -1, -1); else if (mSettings->getSettingType() == "water") - LLEnvironment::instance().updateRegion(pwater, -1, -1); + LLEnvironment::instance().updateRegion(std::static_pointer_cast(mSettings), -1, -1); } else { -- cgit v1.2.3 From 8365945f8af6e27e7180b40aae79f210f99bb7c8 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 8 Jun 2018 16:40:01 -0700 Subject: Settings inventory picker. --- indra/newview/llfloaterfixedenvironment.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index e7b8481caa..0c6127c61f 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -302,16 +302,16 @@ void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) if (!parcel) return; - if (mSettings->getSettingType() == "sky") + if (mSettings->getSettingsType() == "sky") LLEnvironment::instance().updateParcel(parcel->getLocalID(), std::static_pointer_cast(mSettings), -1, -1); - else if (mSettings->getSettingType() == "water") + else if (mSettings->getSettingsType() == "water") LLEnvironment::instance().updateParcel(parcel->getLocalID(), std::static_pointer_cast(mSettings), -1, -1); } else if (where == ACTION_APPLY_REGION) { - if (mSettings->getSettingType() == "sky") + if (mSettings->getSettingsType() == "sky") LLEnvironment::instance().updateRegion(std::static_pointer_cast(mSettings), -1, -1); - else if (mSettings->getSettingType() == "water") + else if (mSettings->getSettingsType() == "water") LLEnvironment::instance().updateRegion(std::static_pointer_cast(mSettings), -1, -1); } else -- cgit v1.2.3 From 97da85de0b1e0f8c2fc60c156c31b237b869230a Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 11 Jun 2018 11:43:50 -0700 Subject: remove legacy environmental edit floater and some lingering transition functions. Change floater environment switch behavior. --- indra/newview/llfloaterfixedenvironment.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 0c6127c61f..be7b55bd45 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -130,6 +130,9 @@ void LLFloaterFixedEnvironment::onOpen(const LLSD& key) void LLFloaterFixedEnvironment::onClose(bool app_quitting) { + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); + LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_EDIT); + mSettings.reset(); syncronizeTabs(); } @@ -142,10 +145,6 @@ void LLFloaterFixedEnvironment::onFocusReceived() void LLFloaterFixedEnvironment::onFocusLost() { - // *TODO*: If the window receiving focus is from a select color or select image control... - // We have technically not changed out of what we are doing so don't change back to displaying - // the local environment. (unfortunately the focus manager has - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); } void LLFloaterFixedEnvironment::refresh() -- cgit v1.2.3 From 19069ce25c30f6744310e015dbf767954efbd8ae Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 28 Jun 2018 17:06:49 -0700 Subject: Creating settings objects in the correct folders. Correctly check if clouds paused. --- indra/newview/llfloaterfixedenvironment.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index be7b55bd45..d926697117 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -270,16 +270,20 @@ void LLFloaterFixedEnvironment::onButtonCancel() void LLFloaterFixedEnvironment::doApplyCreateNewInventory() { + LLUUID parent_id = mInventoryItem ? mInventoryItem->getParentUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS); // This method knows what sort of settings object to create. - LLSettingsVOBase::createInventoryItem(mSettings, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); + LLSettingsVOBase::createInventoryItem(mSettings, parent_id, + [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); } void LLFloaterFixedEnvironment::doApplyUpdateInventory() { if (mInventoryId.isNull()) - LLSettingsVOBase::createInventoryItem(mSettings, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); + LLSettingsVOBase::createInventoryItem(mSettings, gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS), + [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); else - LLSettingsVOBase::updateInventoryItem(mSettings, mInventoryId, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryUpdated(asset_id, inventory_id, results); }); + LLSettingsVOBase::updateInventoryItem(mSettings, mInventoryId, + [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryUpdated(asset_id, inventory_id, results); }); } void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) -- cgit v1.2.3 From ef09ef2b09f054ced394776a9b3d19babcfd3986 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 29 Jun 2018 15:56:09 -0700 Subject: Put up notifications to the user when things go terribly terribly wrong. --- indra/newview/llfloaterfixedenvironment.cpp | 32 ++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index d926697117..7efd45ca56 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -202,11 +202,26 @@ void LLFloaterFixedEnvironment::loadInventoryItem(const LLUUID &inventoryId) if (!mInventoryItem) { LL_WARNS("SETTINGS") << "Could not find inventory item with Id = " << mInventoryId << LL_ENDL; + LLNotificationsUtil::add("CantFindInvItem"); + closeFloater(); + + mInventoryId.setNull(); + mInventoryItem = nullptr; + return; + } + + if (mInventoryItem->getAssetUUID().isNull()) + { + LL_WARNS("ENVIRONMENT") << "Asset ID in inventory item is NULL (" << mInventoryId << ")" << LL_ENDL; + LLNotificationsUtil::add("UnableEditItem"); + closeFloater(); + mInventoryId.setNull(); mInventoryItem = nullptr; return; } + LLSettingsVOBase::getSettingsAsset(mInventoryItem->getAssetUUID(), [this](LLUUID asset_id, LLSettingsBase::ptr_t settins, S32 status, LLExtStat) { onAssetLoaded(asset_id, settins, status); }); } @@ -216,7 +231,7 @@ void LLFloaterFixedEnvironment::onAssetLoaded(LLUUID asset_id, LLSettingsBase::p if (!settings || status) { LLSD args; - args["DESC"] = (mInventoryItem) ? mInventoryItem->getName() : "Unknown"; + args["NAME"] = (mInventoryItem) ? mInventoryItem->getName() : "Unknown"; LLNotificationsUtil::add("FailedToFindSettings", args); closeFloater(); return; @@ -329,6 +344,12 @@ void LLFloaterFixedEnvironment::onInventoryCreated(LLUUID asset_id, LLUUID inven { LL_WARNS("ENVIRONMENT") << "Inventory item " << inventory_id << " has been created with asset " << asset_id << " results are:" << results << LL_ENDL; + if (inventory_id.isNull() || !results["success"].asBoolean()) + { + LLNotificationsUtil::add("CantCreateInventory"); + return; + } + setFocus(TRUE); // Call back the focus... loadInventoryItem(inventory_id); } @@ -427,7 +448,9 @@ void LLFloaterFixedEnvironmentWater::doImportFromDisk() LLSettingsWater::ptr_t legacywater = LLEnvironment::createWaterFromLegacyPreset(filename); if (!legacywater) - { // *TODO* Put up error dialog here. Could not create water from filename + { + LLSD args(LLSDMap("FILE", filename)); + LLNotificationsUtil::add("WLImportFail", args); return; } @@ -504,7 +527,10 @@ void LLFloaterFixedEnvironmentSky::doImportFromDisk() LLSettingsSky::ptr_t legacysky = LLEnvironment::createSkyFromLegacyPreset(filename); if (!legacysky) - { // *TODO* Put up error dialog here. Could not create water from filename + { + LLSD args(LLSDMap("FILE", filename)); + LLNotificationsUtil::add("WLImportFail", args); + return; } -- cgit v1.2.3 From a4137d72ebc9f49dfd8bd124b255da0dfbc4ba92 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 3 Jul 2018 14:18:24 -0700 Subject: MAINT-8821: New "My Environments" floater. First pass. --- indra/newview/llfloaterfixedenvironment.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 7efd45ca56..fd72bb3624 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -317,8 +317,12 @@ void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) if (!parcel) parcel = LLViewerParcelMgr::instance().getAgentParcel(); - if (!parcel) + if ((!parcel) || (parcel->getLocalID() == INVALID_PARCEL_ID)) + { + LL_WARNS("ENVIRONMENT") << "Can not identify parcel. Not applying." << LL_ENDL; + LLNotificationsUtil::add("WLParcelApplyFail"); return; + } if (mSettings->getSettingsType() == "sky") LLEnvironment::instance().updateParcel(parcel->getLocalID(), std::static_pointer_cast(mSettings), -1, -1); -- cgit v1.2.3 From 3bbfd3c676e098f986aad887fe24c7a4dbfd84c4 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 25 Jul 2018 18:46:26 +0300 Subject: MAINT-8886 EEP - Implement code for load button in fixed environment floater --- indra/newview/llfloaterfixedenvironment.cpp | 42 +++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index fd72bb3624..0b4de90703 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -37,6 +37,7 @@ #include "llsliderctrl.h" #include "lltabcontainer.h" #include "llfilepicker.h" +#include "llsettingspicker.h" #include "llviewerparcelmgr.h" @@ -64,6 +65,7 @@ namespace const std::string BUTTON_NAME_COMMIT("btn_commit"); const std::string BUTTON_NAME_CANCEL("btn_cancel"); const std::string BUTTON_NAME_FLYOUT("btn_flyout"); + const std::string BUTTON_NAME_LOAD("btn_load"); const std::string ACTION_SAVE("save_settings"); const std::string ACTION_SAVEAS("save_as_new_settings"); @@ -102,6 +104,7 @@ BOOL LLFloaterFixedEnvironment::postBuild() getChild(BUTTON_NAME_IMPORT)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonImport(); }); getChild(BUTTON_NAME_CANCEL)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonCancel(); }); + getChild(BUTTON_NAME_LOAD)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonLoad(); }); mFlyoutControl = new LLFlyoutComboBtnCtrl(this, BUTTON_NAME_COMMIT, BUTTON_NAME_FLYOUT, XML_FLYOUTMENU_FILE); mFlyoutControl->setAction([this](LLUICtrl *ctrl, const LLSD &data) { onButtonApply(ctrl, data); }); @@ -130,6 +133,8 @@ void LLFloaterFixedEnvironment::onOpen(const LLSD& key) void LLFloaterFixedEnvironment::onClose(bool app_quitting) { + doCloseInventoryFloater(app_quitting); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_EDIT); @@ -226,6 +231,12 @@ void LLFloaterFixedEnvironment::loadInventoryItem(const LLUUID &inventoryId) [this](LLUUID asset_id, LLSettingsBase::ptr_t settins, S32 status, LLExtStat) { onAssetLoaded(asset_id, settins, status); }); } +void LLFloaterFixedEnvironment::onPickerCommitSetting(LLUUID asset_id) +{ + LLSettingsVOBase::getSettingsAsset(asset_id, + [this](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { onAssetLoaded(asset_id, settings, status); }); +} + void LLFloaterFixedEnvironment::onAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status) { if (!settings || status) @@ -283,6 +294,27 @@ void LLFloaterFixedEnvironment::onButtonCancel() this->closeFloater(); } +void LLFloaterFixedEnvironment::onButtonLoad() +{ + // LLUI::sWindow->setCursor(UI_CURSOR_WAIT); + LLFloaterSettingsPicker *picker = static_cast(mInventoryFloater.get()); + + // Show the dialog + if (!picker) + { + picker = new LLFloaterSettingsPicker(this, + LLUUID::null, "SELECT SETTINGS"); + + mInventoryFloater = picker->getHandle(); + + picker->setCommitCallback([this](LLUICtrl *, const LLSD &data){ onPickerCommitSetting(data.asUUID()); }); + } + + picker->setSettingsFilter(mSettings->getSettingsTypeValue()); + picker->openFloater(); + picker->setFocus(TRUE); +} + void LLFloaterFixedEnvironment::doApplyCreateNewInventory() { LLUUID parent_id = mInventoryItem ? mInventoryItem->getParentUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS); @@ -344,6 +376,16 @@ void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) } +void LLFloaterFixedEnvironment::doCloseInventoryFloater(bool quitting) +{ + LLFloater* floaterp = mInventoryFloater.get(); + + if (floaterp) + { + floaterp->closeFloater(quitting); + } +} + void LLFloaterFixedEnvironment::onInventoryCreated(LLUUID asset_id, LLUUID inventory_id, LLSD results) { LL_WARNS("ENVIRONMENT") << "Inventory item " << inventory_id << " has been created with asset " << asset_id << " results are:" << results << LL_ENDL; -- cgit v1.2.3 From d5f2267369d2695a8aec7c1d0cfa25954ae3c706 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 24 Aug 2018 11:59:28 -0700 Subject: Remove "Commit" from fixed editor. Check isDirty() before replacing or closing fixed editor. --- indra/newview/llfloaterfixedenvironment.cpp | 110 +++++++++++++++++++--------- 1 file changed, 76 insertions(+), 34 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 0b4de90703..6f7bd85699 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -69,6 +69,7 @@ namespace const std::string ACTION_SAVE("save_settings"); const std::string ACTION_SAVEAS("save_as_new_settings"); + const std::string ACTION_COMMIT("commit_changes"); const std::string ACTION_APPLY_LOCAL("apply_local"); const std::string ACTION_APPLY_PARCEL("apply_parcel"); const std::string ACTION_APPLY_REGION("apply_region"); @@ -85,7 +86,8 @@ LLFloaterFixedEnvironment::LLFloaterFixedEnvironment(const LLSD &key) : LLFloater(key), mFlyoutControl(nullptr), mInventoryId(), - mInventoryItem(nullptr) + mInventoryItem(nullptr), + mIsDirty(false) { } @@ -108,6 +110,7 @@ BOOL LLFloaterFixedEnvironment::postBuild() mFlyoutControl = new LLFlyoutComboBtnCtrl(this, BUTTON_NAME_COMMIT, BUTTON_NAME_FLYOUT, XML_FLYOUTMENU_FILE); mFlyoutControl->setAction([this](LLUICtrl *ctrl, const LLSD &data) { onButtonApply(ctrl, data); }); + mFlyoutControl->setMenuItemVisible(ACTION_COMMIT, false); return TRUE; } @@ -191,6 +194,24 @@ void LLFloaterFixedEnvironment::syncronizeTabs() } } +LLFloaterSettingsPicker * LLFloaterFixedEnvironment::getSettingsPicker() +{ + LLFloaterSettingsPicker *picker = static_cast(mInventoryFloater.get()); + + // Show the dialog + if (!picker) + { + picker = new LLFloaterSettingsPicker(this, + LLUUID::null, "SELECT SETTINGS"); + + mInventoryFloater = picker->getHandle(); + + picker->setCommitCallback([this](LLUICtrl *, const LLSD &data){ onPickerCommitSetting(data.asUUID()); }); + } + + return picker; +} + void LLFloaterFixedEnvironment::loadInventoryItem(const LLUUID &inventoryId) { if (inventoryId.isNull()) @@ -231,6 +252,30 @@ void LLFloaterFixedEnvironment::loadInventoryItem(const LLUUID &inventoryId) [this](LLUUID asset_id, LLSettingsBase::ptr_t settins, S32 status, LLExtStat) { onAssetLoaded(asset_id, settins, status); }); } + +void LLFloaterFixedEnvironment::checkAndConfirmSettingsLoss(LLFloaterFixedEnvironment::on_confirm_fn cb) +{ + if (isDirty()) + { + LLSD args(LLSDMap("TYPE", mSettings->getSettingsType()) + ("NAME", mSettings->getName())); + + // create and show confirmation textbox + LLNotificationsUtil::add("SettingsConfirmLoss", args, LLSD(), + [this, cb](const LLSD¬if, const LLSD&resp) + { + S32 opt = LLNotificationsUtil::getSelectedOption(notif, resp); + if (opt == 0) + cb(); + }); + } + else if (cb) + { + cb(); + } + +} + void LLFloaterFixedEnvironment::onPickerCommitSetting(LLUUID asset_id) { LLSettingsVOBase::getSettingsAsset(asset_id, @@ -257,11 +302,12 @@ void LLFloaterFixedEnvironment::onAssetLoaded(LLUUID asset_id, LLSettingsBase::p void LLFloaterFixedEnvironment::onNameChanged(const std::string &name) { mSettings->setName(name); + setDirtyFlag(); } void LLFloaterFixedEnvironment::onButtonImport() { - doImportFromDisk(); + checkAndConfirmSettingsLoss([this](){ doImportFromDisk(); }); } void LLFloaterFixedEnvironment::onButtonApply(LLUICtrl *ctrl, const LLSD &data) @@ -290,29 +336,12 @@ void LLFloaterFixedEnvironment::onButtonApply(LLUICtrl *ctrl, const LLSD &data) void LLFloaterFixedEnvironment::onButtonCancel() { - // *TODO*: If changed issue a warning? - this->closeFloater(); + checkAndConfirmSettingsLoss([this](){ closeFloater(); }); } void LLFloaterFixedEnvironment::onButtonLoad() { - // LLUI::sWindow->setCursor(UI_CURSOR_WAIT); - LLFloaterSettingsPicker *picker = static_cast(mInventoryFloater.get()); - - // Show the dialog - if (!picker) - { - picker = new LLFloaterSettingsPicker(this, - LLUUID::null, "SELECT SETTINGS"); - - mInventoryFloater = picker->getHandle(); - - picker->setCommitCallback([this](LLUICtrl *, const LLSD &data){ onPickerCommitSetting(data.asUUID()); }); - } - - picker->setSettingsFilter(mSettings->getSettingsTypeValue()); - picker->openFloater(); - picker->setFocus(TRUE); + checkAndConfirmSettingsLoss([this](){ doSelectFromInventory(); }); } void LLFloaterFixedEnvironment::doApplyCreateNewInventory() @@ -396,6 +425,7 @@ void LLFloaterFixedEnvironment::onInventoryCreated(LLUUID asset_id, LLUUID inven return; } + clearDirtyFlag(); setFocus(TRUE); // Call back the focus... loadInventoryItem(inventory_id); } @@ -404,12 +434,29 @@ void LLFloaterFixedEnvironment::onInventoryUpdated(LLUUID asset_id, LLUUID inven { LL_WARNS("ENVIRONMENT") << "Inventory item " << inventory_id << " has been updated with asset " << asset_id << " results are:" << results << LL_ENDL; + clearDirtyFlag(); if (inventory_id != mInventoryId) { loadInventoryItem(inventory_id); } } + +void LLFloaterFixedEnvironment::doSelectFromInventory() +{ + LLFloaterSettingsPicker *picker = getSettingsPicker(); + + picker->setSettingsFilter(mSettings->getSettingsTypeValue()); + picker->openFloater(); + picker->setFocus(TRUE); +} + +void LLFloaterFixedEnvironment::onPanelDirtyFlagChanged(bool value) +{ + if (value) + setDirtyFlag(); +} + //------------------------------------------------------------------------- bool LLFloaterFixedEnvironment::canUseInventory() const { @@ -452,6 +499,7 @@ BOOL LLFloaterFixedEnvironmentWater::postBuild() panel = new LLPanelSettingsWaterMainTab; panel->buildFromFile("panel_settings_water.xml"); panel->setWater(std::static_pointer_cast(mSettings)); + panel->setOnDirtyFlagChanged( [this] (LLPanel *, bool value) { onPanelDirtyFlagChanged(value); }); mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(true)); return TRUE; @@ -477,11 +525,6 @@ void LLFloaterFixedEnvironmentWater::onOpen(const LLSD& key) LLFloaterFixedEnvironment::onOpen(key); } -void LLFloaterFixedEnvironmentWater::onClose(bool app_quitting) -{ - LLFloaterFixedEnvironment::onClose(app_quitting); -} - void LLFloaterFixedEnvironmentWater::doImportFromDisk() { // Load a a legacy Windlight XML from disk. @@ -500,8 +543,9 @@ void LLFloaterFixedEnvironmentWater::doImportFromDisk() return; } + clearDirtyFlag(); LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, legacywater); - this->setEditSettings(legacywater); + setEditSettings(legacywater); LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST, true); } } @@ -520,16 +564,19 @@ BOOL LLFloaterFixedEnvironmentSky::postBuild() panel = new LLPanelSettingsSkyAtmosTab; panel->buildFromFile("panel_settings_sky_atmos.xml"); panel->setSky(std::static_pointer_cast(mSettings)); + panel->setOnDirtyFlagChanged([this](LLPanel *, bool value) { onPanelDirtyFlagChanged(value); }); mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(true)); panel = new LLPanelSettingsSkyCloudTab; panel->buildFromFile("panel_settings_sky_clouds.xml"); panel->setSky(std::static_pointer_cast(mSettings)); + panel->setOnDirtyFlagChanged([this](LLPanel *, bool value) { onPanelDirtyFlagChanged(value); }); mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(false)); panel = new LLPanelSettingsSkySunMoonTab; panel->buildFromFile("panel_settings_sky_sunmoon.xml"); panel->setSky(std::static_pointer_cast(mSettings)); + panel->setOnDirtyFlagChanged([this](LLPanel *, bool value) { onPanelDirtyFlagChanged(value); }); mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(false)); return TRUE; @@ -553,12 +600,6 @@ void LLFloaterFixedEnvironmentSky::onOpen(const LLSD& key) } LLFloaterFixedEnvironment::onOpen(key); - -} - -void LLFloaterFixedEnvironmentSky::onClose(bool app_quitting) -{ - LLFloaterFixedEnvironment::onClose(app_quitting); } void LLFloaterFixedEnvironmentSky::doImportFromDisk() @@ -580,8 +621,9 @@ void LLFloaterFixedEnvironmentSky::doImportFromDisk() return; } + clearDirtyFlag(); LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, legacysky); - this->setEditSettings(legacysky); + setEditSettings(legacysky); LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST, true); } } -- cgit v1.2.3 From d62079002df2d8391c7205029f2ff1242aaddf6a Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 24 Aug 2018 12:39:14 -0700 Subject: Some work on clearDirtyFlag and fix a unit test. --- indra/newview/llfloaterfixedenvironment.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 6f7bd85699..915bc687d8 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -442,6 +442,21 @@ void LLFloaterFixedEnvironment::onInventoryUpdated(LLUUID asset_id, LLUUID inven } +void LLFloaterFixedEnvironment::clearDirtyFlag() +{ + mIsDirty = false; + + S32 count = mTab->getTabCount(); + + for (S32 idx = 0; idx < count; ++idx) + { + LLSettingsEditPanel *panel = static_cast(mTab->getPanelByIndex(idx)); + if (panel) + panel->clearIsDirty(); + } + +} + void LLFloaterFixedEnvironment::doSelectFromInventory() { LLFloaterSettingsPicker *picker = getSettingsPicker(); -- cgit v1.2.3 From 185915aeede50dec00822c336537a335404252ed Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 24 Aug 2018 14:25:31 -0700 Subject: Finish dirty and close warning for fixed environment editors. --- indra/newview/llfloaterfixedenvironment.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 915bc687d8..cbc41f724e 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -105,7 +105,7 @@ BOOL LLFloaterFixedEnvironment::postBuild() mTxtName->setCommitCallback([this](LLUICtrl *, const LLSD &) { onNameChanged(mTxtName->getValue().asString()); }); getChild(BUTTON_NAME_IMPORT)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonImport(); }); - getChild(BUTTON_NAME_CANCEL)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonCancel(); }); + getChild(BUTTON_NAME_CANCEL)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onClickCloseBtn(); }); getChild(BUTTON_NAME_LOAD)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonLoad(); }); mFlyoutControl = new LLFlyoutComboBtnCtrl(this, BUTTON_NAME_COMMIT, BUTTON_NAME_FLYOUT, XML_FLYOUTMENU_FILE); @@ -334,9 +334,12 @@ void LLFloaterFixedEnvironment::onButtonApply(LLUICtrl *ctrl, const LLSD &data) } } -void LLFloaterFixedEnvironment::onButtonCancel() +void LLFloaterFixedEnvironment::onClickCloseBtn(bool app_quitting) { - checkAndConfirmSettingsLoss([this](){ closeFloater(); }); + if (!app_quitting) + checkAndConfirmSettingsLoss([this](){ closeFloater(); }); + else + closeFloater(); } void LLFloaterFixedEnvironment::onButtonLoad() @@ -558,7 +561,7 @@ void LLFloaterFixedEnvironmentWater::doImportFromDisk() return; } - clearDirtyFlag(); + setDirtyFlag(); LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, legacywater); setEditSettings(legacywater); LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST, true); -- cgit v1.2.3 From 06a77dd5fe228a3bbf4c57ae3b0c51937871d6a2 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 24 Aug 2018 16:46:07 -0700 Subject: is dirty code in day cycle editor. When environment panel closes disconnect commit hook for crash. --- indra/newview/llfloaterfixedenvironment.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index cbc41f724e..ece4898935 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -273,7 +273,6 @@ void LLFloaterFixedEnvironment::checkAndConfirmSettingsLoss(LLFloaterFixedEnviro { cb(); } - } void LLFloaterFixedEnvironment::onPickerCommitSetting(LLUUID asset_id) -- cgit v1.2.3 From 964a472461bed91b3efa383aaea34d425b96111d Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 29 Aug 2018 21:13:09 +0100 Subject: Hook up sky density panel to fixedenv and edit_ext_daycycle UI. Fix retrieving LLSD for density configs (element not array) in density UI. Tweak layout of sky density controls. --- indra/newview/llfloaterfixedenvironment.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index ece4898935..7ff1663942 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -596,6 +596,12 @@ BOOL LLFloaterFixedEnvironmentSky::postBuild() panel->setOnDirtyFlagChanged([this](LLPanel *, bool value) { onPanelDirtyFlagChanged(value); }); mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(false)); + panel = new LLPanelSettingsSkyDensityTab; + panel->buildFromFile("panel_settings_sky_density.xml"); + panel->setSky(std::static_pointer_cast(mSettings)); + panel->setOnDirtyFlagChanged([this](LLPanel *, bool value) { onPanelDirtyFlagChanged(value); }); + mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(false)); + return TRUE; } -- cgit v1.2.3 From a32a4dc6369dd076eb75e648674843bd16a9258e Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Mon, 3 Sep 2018 15:20:53 +0300 Subject: MAINT-9068 FIXED EEP closing Day Cycle editor by clicking Cancel makes the environment static --- indra/newview/llfloaterfixedenvironment.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index ece4898935..82f056710e 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -147,8 +147,11 @@ void LLFloaterFixedEnvironment::onClose(bool app_quitting) void LLFloaterFixedEnvironment::onFocusReceived() { - updateEditEnvironment(); - LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_EDIT, LLEnvironment::TRANSITION_FAST); + if (isInVisibleChain()) + { + updateEditEnvironment(); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_EDIT, LLEnvironment::TRANSITION_FAST); + } } void LLFloaterFixedEnvironment::onFocusLost() -- cgit v1.2.3 From a4c49904c67e123df0d8e1f68714cf13acfa1ffc Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 3 Sep 2018 19:32:22 +0300 Subject: MAINT-8989 Menu updates button instead of executing command --- indra/newview/llfloaterfixedenvironment.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index ece4898935..3fc5a03d3a 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -108,7 +108,7 @@ BOOL LLFloaterFixedEnvironment::postBuild() getChild(BUTTON_NAME_CANCEL)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onClickCloseBtn(); }); getChild(BUTTON_NAME_LOAD)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonLoad(); }); - mFlyoutControl = new LLFlyoutComboBtnCtrl(this, BUTTON_NAME_COMMIT, BUTTON_NAME_FLYOUT, XML_FLYOUTMENU_FILE); + mFlyoutControl = new LLFlyoutComboBtnCtrl(this, BUTTON_NAME_COMMIT, BUTTON_NAME_FLYOUT, XML_FLYOUTMENU_FILE, false); mFlyoutControl->setAction([this](LLUICtrl *ctrl, const LLSD &data) { onButtonApply(ctrl, data); }); mFlyoutControl->setMenuItemVisible(ACTION_COMMIT, false); -- cgit v1.2.3 From 451ab80ca65a7ae75316442086f42b6553ea6bbe Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 6 Sep 2018 22:50:26 +0100 Subject: Fix tex format mismatch between what libatmosphere was generating and what we were claiming to use in rendering. First pass at sky shader using libatmosphere sky radiance lookup. Add atmo density controls to ext daycycle floater tabs. --- indra/newview/llfloaterfixedenvironment.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index d38098c0a6..1104717dc1 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -55,6 +55,8 @@ #include "llsettingsvo.h" #include "llinventorymodel.h" +extern LLControlGroup gSavedSettings; + namespace { const std::string FIELD_SETTINGS_NAME("settings_name"); @@ -599,12 +601,14 @@ BOOL LLFloaterFixedEnvironmentSky::postBuild() panel->setOnDirtyFlagChanged([this](LLPanel *, bool value) { onPanelDirtyFlagChanged(value); }); mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(false)); - panel = new LLPanelSettingsSkyDensityTab; - panel->buildFromFile("panel_settings_sky_density.xml"); - panel->setSky(std::static_pointer_cast(mSettings)); - panel->setOnDirtyFlagChanged([this](LLPanel *, bool value) { onPanelDirtyFlagChanged(value); }); - mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(false)); - + if (gSavedSettings.getBOOL("RenderUseAdvancedAtmospherics")) + { + panel = new LLPanelSettingsSkyDensityTab; + panel->buildFromFile("panel_settings_sky_density.xml"); + panel->setSky(std::static_pointer_cast(mSettings)); + panel->setOnDirtyFlagChanged([this](LLPanel *, bool value) { onPanelDirtyFlagChanged(value); }); + mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(false)); + } return TRUE; } -- cgit v1.2.3 From 770870898483fc254f6c23014f4ae9a02fb6182d Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 7 Sep 2018 18:49:07 +0100 Subject: Nerf OSX warning about use of this in lambda. --- indra/newview/llfloaterfixedenvironment.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 39e37034e7..1200bf8183 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -267,6 +267,7 @@ void LLFloaterFixedEnvironment::checkAndConfirmSettingsLoss(LLFloaterFixedEnviro LLNotificationsUtil::add("SettingsConfirmLoss", args, LLSD(), [this, cb](const LLSD¬if, const LLSD&resp) { + (void)this; S32 opt = LLNotificationsUtil::getSelectedOption(notif, resp); if (opt == 0) cb(); -- cgit v1.2.3 From 0c599af9173c641ad96db8dc510a5364e93a5a29 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 7 Sep 2018 19:03:52 +0100 Subject: Merge --- indra/newview/llfloaterfixedenvironment.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 1104717dc1..fef3fabb4a 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -269,6 +269,7 @@ void LLFloaterFixedEnvironment::checkAndConfirmSettingsLoss(LLFloaterFixedEnviro LLNotificationsUtil::add("SettingsConfirmLoss", args, LLSD(), [this, cb](const LLSD¬if, const LLSD&resp) { + (void)this; S32 opt = LLNotificationsUtil::getSelectedOption(notif, resp); if (opt == 0) cb(); -- cgit v1.2.3 From 114e358aae80e9e3ca70de093d51e4700c46df37 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 7 Sep 2018 16:09:32 -0700 Subject: Work to make edit floaters respect no mod and no trans. Importing no-trans frame will cause day cycle to become no trans. --- indra/newview/llfloaterfixedenvironment.cpp | 60 ++++++++++++++++++++++++----- 1 file changed, 51 insertions(+), 9 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 39e37034e7..47b07a8315 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -87,7 +87,9 @@ LLFloaterFixedEnvironment::LLFloaterFixedEnvironment(const LLSD &key) : mFlyoutControl(nullptr), mInventoryId(), mInventoryItem(nullptr), - mIsDirty(false) + mIsDirty(false), + mCanCopy(false), + mCanMod(false) { } @@ -168,12 +170,13 @@ void LLFloaterFixedEnvironment::refresh() bool is_inventory_avail = canUseInventory(); - mFlyoutControl->setMenuItemEnabled(ACTION_SAVE, is_inventory_avail); - mFlyoutControl->setMenuItemEnabled(ACTION_SAVEAS, is_inventory_avail); + mFlyoutControl->setMenuItemEnabled(ACTION_SAVE, is_inventory_avail && mCanMod && !mInventoryId.isNull()); + mFlyoutControl->setMenuItemEnabled(ACTION_SAVEAS, is_inventory_avail && mCanCopy); mFlyoutControl->setMenuItemEnabled(ACTION_APPLY_PARCEL, canApplyParcel()); mFlyoutControl->setMenuItemEnabled(ACTION_APPLY_REGION, canApplyRegion()); mTxtName->setValue(mSettings->getName()); + mTxtName->setEnabled(mCanMod); S32 count = mTab->getTabCount(); @@ -181,7 +184,10 @@ void LLFloaterFixedEnvironment::refresh() { LLSettingsEditPanel *panel = static_cast(mTab->getPanelByIndex(idx)); if (panel) + { panel->refresh(); + panel->setCanChangeSettings(mCanMod); + } } } @@ -221,6 +227,8 @@ void LLFloaterFixedEnvironment::loadInventoryItem(const LLUUID &inventoryId) { mInventoryItem = nullptr; mInventoryId.setNull(); + mCanMod = true; + mCanCopy = true; return; } @@ -250,9 +258,11 @@ void LLFloaterFixedEnvironment::loadInventoryItem(const LLUUID &inventoryId) return; } + mCanCopy = mInventoryItem->getPermissions().allowCopyBy(gAgent.getID()); + mCanMod = mInventoryItem->getPermissions().allowModifyBy(gAgent.getID()); LLSettingsVOBase::getSettingsAsset(mInventoryItem->getAssetUUID(), - [this](LLUUID asset_id, LLSettingsBase::ptr_t settins, S32 status, LLExtStat) { onAssetLoaded(asset_id, settins, status); }); + [this](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { onAssetLoaded(asset_id, settings, status); }); } @@ -265,7 +275,7 @@ void LLFloaterFixedEnvironment::checkAndConfirmSettingsLoss(LLFloaterFixedEnviro // create and show confirmation textbox LLNotificationsUtil::add("SettingsConfirmLoss", args, LLSD(), - [this, cb](const LLSD¬if, const LLSD&resp) + [cb](const LLSD¬if, const LLSD&resp) { S32 opt = LLNotificationsUtil::getSelectedOption(notif, resp); if (opt == 0) @@ -296,6 +306,9 @@ void LLFloaterFixedEnvironment::onAssetLoaded(LLUUID asset_id, LLSettingsBase::p } mSettings = settings; + if (mInventoryItem) + mSettings->setName(mInventoryItem->getName()); + updateEditEnvironment(); syncronizeTabs(); refresh(); @@ -359,12 +372,19 @@ void LLFloaterFixedEnvironment::doApplyCreateNewInventory() void LLFloaterFixedEnvironment::doApplyUpdateInventory() { + LL_WARNS("LAPRAS") << "Update inventory for " << mInventoryId << LL_ENDL; if (mInventoryId.isNull()) - LLSettingsVOBase::createInventoryItem(mSettings, gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS), - [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); + { + LL_WARNS("LAPRAS") << "Inventory ID is NULL. Creating New!!!" << LL_ENDL; + LLSettingsVOBase::createInventoryItem(mSettings, gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS), + [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); + } else - LLSettingsVOBase::updateInventoryItem(mSettings, mInventoryId, - [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryUpdated(asset_id, inventory_id, results); }); + { + LL_WARNS("LAPRAS") << "Updating inventory ID " << mInventoryId << LL_ENDL; + LLSettingsVOBase::updateInventoryItem(mSettings, mInventoryId, + [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryUpdated(asset_id, inventory_id, results); }); + } } void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) @@ -430,6 +450,18 @@ void LLFloaterFixedEnvironment::onInventoryCreated(LLUUID asset_id, LLUUID inven return; } + if (mInventoryItem) + { + LLPermissions perms = mInventoryItem->getPermissions(); + + LLInventoryItem *created_item = gInventory.getItem(mInventoryId); + + if (created_item) + { + created_item->setPermissions(perms); + created_item->updateServer(false); + } + } clearDirtyFlag(); setFocus(TRUE); // Call back the focus... loadInventoryItem(inventory_id); @@ -563,10 +595,13 @@ void LLFloaterFixedEnvironmentWater::doImportFromDisk() return; } + loadInventoryItem(LLUUID::null); + setDirtyFlag(); LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, legacywater); setEditSettings(legacywater); LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST, true); + } } @@ -641,6 +676,8 @@ void LLFloaterFixedEnvironmentSky::doImportFromDisk() return; } + loadInventoryItem(LLUUID::null); + clearDirtyFlag(); LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, legacysky); setEditSettings(legacysky); @@ -650,3 +687,8 @@ void LLFloaterFixedEnvironmentSky::doImportFromDisk() //========================================================================= +void LLSettingsEditPanel::setCanChangeSettings(bool enabled) +{ + setEnabled(enabled); + setAllChildrenEnabled(enabled); +} -- cgit v1.2.3 From 8c9d758e3a5de9e11b2e33753e61a5359dbff8de Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 7 Sep 2018 17:10:27 -0700 Subject: Get rid of (void)this... (this should not have been captured in the first place.) --- indra/newview/llfloaterfixedenvironment.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 4b420888a0..47b07a8315 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -277,7 +277,6 @@ void LLFloaterFixedEnvironment::checkAndConfirmSettingsLoss(LLFloaterFixedEnviro LLNotificationsUtil::add("SettingsConfirmLoss", args, LLSD(), [cb](const LLSD¬if, const LLSD&resp) { - (void)this; S32 opt = LLNotificationsUtil::getSelectedOption(notif, resp); if (opt == 0) cb(); -- cgit v1.2.3 From 642a4ddd60745db292c543a5cea3b1e5fe606795 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 10 Sep 2018 20:39:48 +0100 Subject: Fixes for switching between atmospherics implementations on the fly. --- indra/newview/llfloaterfixedenvironment.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 09a05eb7e2..e5d6412218 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -55,6 +55,8 @@ #include "llsettingsvo.h" #include "llinventorymodel.h" +#pragma optimize("", off) + extern LLControlGroup gSavedSettings; namespace -- cgit v1.2.3 From 555dfdc6ef0dab37bc4eaf6ae0b00a857f0609da Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 10 Sep 2018 23:21:34 +0100 Subject: Add copies of existing lighting shaders for advanced atmo path. Enable advanced atmo by default. Disable nSight in settings.xml Remove MSVC debug pragmas. --- indra/newview/llfloaterfixedenvironment.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index e5d6412218..09a05eb7e2 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -55,8 +55,6 @@ #include "llsettingsvo.h" #include "llinventorymodel.h" -#pragma optimize("", off) - extern LLControlGroup gSavedSettings; namespace -- cgit v1.2.3 From 8f44ac231921cd7b83c0b0e47fbef0b6a52a0b57 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Mon, 17 Sep 2018 17:03:10 +0300 Subject: SL-9664 FIXED [EEP] File pickers are not threaded --- indra/newview/llfloaterfixedenvironment.cpp | 78 ++++++++++++++--------------- 1 file changed, 39 insertions(+), 39 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 09a05eb7e2..45662cb37b 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -38,7 +38,7 @@ #include "lltabcontainer.h" #include "llfilepicker.h" #include "llsettingspicker.h" - +#include "llviewermenufile.h" // LLFilePickerReplyThread #include "llviewerparcelmgr.h" // newview @@ -581,30 +581,29 @@ void LLFloaterFixedEnvironmentWater::onOpen(const LLSD& key) void LLFloaterFixedEnvironmentWater::doImportFromDisk() { // Load a a legacy Windlight XML from disk. + (new LLFilePickerReplyThread(boost::bind(&LLFloaterFixedEnvironmentWater::loadWaterSettingFromFile, this, _1), LLFilePicker::FFLOAD_XML, false))->getFile(); +} - LLFilePicker& picker = LLFilePicker::instance(); - if (picker.getOpenFile(LLFilePicker::FFLOAD_XML)) - { - std::string filename = picker.getFirstFile(); - - LL_WARNS("LAPRAS") << "Selected file: " << filename << LL_ENDL; - LLSettingsWater::ptr_t legacywater = LLEnvironment::createWaterFromLegacyPreset(filename); - - if (!legacywater) - { - LLSD args(LLSDMap("FILE", filename)); - LLNotificationsUtil::add("WLImportFail", args); - return; - } +void LLFloaterFixedEnvironmentWater::loadWaterSettingFromFile(const std::vector& filenames) +{ + if (filenames.size() < 1) return; + std::string filename = filenames[0]; + LL_WARNS("LAPRAS") << "Selected file: " << filename << LL_ENDL; + LLSettingsWater::ptr_t legacywater = LLEnvironment::createWaterFromLegacyPreset(filename); - loadInventoryItem(LLUUID::null); + if (!legacywater) + { + LLSD args(LLSDMap("FILE", filename)); + LLNotificationsUtil::add("WLImportFail", args); + return; + } - setDirtyFlag(); - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, legacywater); - setEditSettings(legacywater); - LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST, true); + loadInventoryItem(LLUUID::null); - } + setDirtyFlag(); + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, legacywater); + setEditSettings(legacywater); + LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST, true); } //========================================================================= @@ -669,30 +668,31 @@ void LLFloaterFixedEnvironmentSky::onOpen(const LLSD& key) void LLFloaterFixedEnvironmentSky::doImportFromDisk() { // Load a a legacy Windlight XML from disk. + (new LLFilePickerReplyThread(boost::bind(&LLFloaterFixedEnvironmentSky::loadSkySettingFromFile, this, _1), LLFilePicker::FFLOAD_XML, false))->getFile(); +} - LLFilePicker& picker = LLFilePicker::instance(); - if (picker.getOpenFile(LLFilePicker::FFLOAD_XML)) - { - std::string filename = picker.getFirstFile(); +void LLFloaterFixedEnvironmentSky::loadSkySettingFromFile(const std::vector& filenames) +{ + if (filenames.size() < 1) return; + std::string filename = filenames[0]; - LL_WARNS("LAPRAS") << "Selected file: " << filename << LL_ENDL; - LLSettingsSky::ptr_t legacysky = LLEnvironment::createSkyFromLegacyPreset(filename); + LL_WARNS("LAPRAS") << "Selected file: " << filename << LL_ENDL; + LLSettingsSky::ptr_t legacysky = LLEnvironment::createSkyFromLegacyPreset(filename); - if (!legacysky) - { - LLSD args(LLSDMap("FILE", filename)); - LLNotificationsUtil::add("WLImportFail", args); + if (!legacysky) + { + LLSD args(LLSDMap("FILE", filename)); + LLNotificationsUtil::add("WLImportFail", args); - return; - } + return; + } - loadInventoryItem(LLUUID::null); + loadInventoryItem(LLUUID::null); - clearDirtyFlag(); - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, legacysky); - setEditSettings(legacysky); - LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST, true); - } + clearDirtyFlag(); + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, legacysky); + setEditSettings(legacysky); + LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST, true); } //========================================================================= -- cgit v1.2.3 From 17fb7d0bf4cc4db1c3f30dbbbdee7610d168336c Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 17 Sep 2018 14:21:38 -0700 Subject: SL-9667, SL-9669: Do not attempt to request environment for non-eep parcels, use handle to panel passed to static for callbacks. --- indra/newview/llfloaterfixedenvironment.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 45662cb37b..9831a5fa84 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -586,7 +586,7 @@ void LLFloaterFixedEnvironmentWater::doImportFromDisk() void LLFloaterFixedEnvironmentWater::loadWaterSettingFromFile(const std::vector& filenames) { - if (filenames.size() < 1) return; + if (filenames.size() < 1) return; std::string filename = filenames[0]; LL_WARNS("LAPRAS") << "Selected file: " << filename << LL_ENDL; LLSettingsWater::ptr_t legacywater = LLEnvironment::createWaterFromLegacyPreset(filename); @@ -673,7 +673,7 @@ void LLFloaterFixedEnvironmentSky::doImportFromDisk() void LLFloaterFixedEnvironmentSky::loadSkySettingFromFile(const std::vector& filenames) { - if (filenames.size() < 1) return; + if (filenames.size() < 1) return; std::string filename = filenames[0]; LL_WARNS("LAPRAS") << "Selected file: " << filename << LL_ENDL; -- cgit v1.2.3 From 89c48daf35ba1499100cdf81e07a91a75eea63c8 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 18 Sep 2018 18:37:18 +0300 Subject: SL-9678 EEP Sometimes not switching inventory based environments --- indra/newview/llfloaterfixedenvironment.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 9831a5fa84..d65a578a6d 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -292,12 +292,30 @@ void LLFloaterFixedEnvironment::checkAndConfirmSettingsLoss(LLFloaterFixedEnviro void LLFloaterFixedEnvironment::onPickerCommitSetting(LLUUID asset_id) { + mInventoryItem = NULL; + mInventoryId.setNull(); + if (!mInventoryFloater.isDead()) + { + LLFloaterSettingsPicker *picker = static_cast(mInventoryFloater.get()); + if (picker) + { + mInventoryId = picker->findItemID(asset_id, false); + mInventoryItem = gInventory.getItem(mInventoryId); + } + } + LLSettingsVOBase::getSettingsAsset(asset_id, [this](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { onAssetLoaded(asset_id, settings, status); }); } void LLFloaterFixedEnvironment::onAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status) { + if (mInventoryItem && mInventoryItem->getAssetUUID() != asset_id) + { + LL_WARNS("ENVIRONMENT") << "Discarding obsolete asset callback" << LL_ENDL; + return; + } + if (!settings || status) { LLSD args; -- cgit v1.2.3 From 9353022c5a06d4dc868b4231f41c1bb9aaf1ed3e Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 19 Sep 2018 19:18:55 +0300 Subject: SL-9707 EEP Make behavior more consistent for applying inventory --- indra/newview/llfloaterfixedenvironment.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index d65a578a6d..2eda405f51 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -430,17 +430,33 @@ void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) return; } - if (mSettings->getSettingsType() == "sky") + if (mInventoryItem && !isDirty()) + { + LLEnvironment::instance().updateParcel(parcel->getLocalID(), mInventoryItem->getAssetUUID(), -1, -1); + } + else if (mSettings->getSettingsType() == "sky") + { LLEnvironment::instance().updateParcel(parcel->getLocalID(), std::static_pointer_cast(mSettings), -1, -1); + } else if (mSettings->getSettingsType() == "water") + { LLEnvironment::instance().updateParcel(parcel->getLocalID(), std::static_pointer_cast(mSettings), -1, -1); + } } else if (where == ACTION_APPLY_REGION) { - if (mSettings->getSettingsType() == "sky") + if (mInventoryItem && !isDirty()) + { + LLEnvironment::instance().updateRegion(mInventoryItem->getAssetUUID(), -1, -1); + } + else if (mSettings->getSettingsType() == "sky") + { LLEnvironment::instance().updateRegion(std::static_pointer_cast(mSettings), -1, -1); + } else if (mSettings->getSettingsType() == "water") + { LLEnvironment::instance().updateRegion(std::static_pointer_cast(mSettings), -1, -1); + } } else { -- cgit v1.2.3 From 405f5c879c44f32635dcb94de2c7dfb9e4a8673a Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Wed, 26 Sep 2018 17:39:55 +0300 Subject: SL-9732 FIXED [EEP] Save As does not provide dialogue to supply new setting name --- indra/newview/llfloaterfixedenvironment.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 2eda405f51..b9ea044a06 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -355,7 +355,9 @@ void LLFloaterFixedEnvironment::onButtonApply(LLUICtrl *ctrl, const LLSD &data) } else if (ctrl_action == ACTION_SAVEAS) { - doApplyCreateNewInventory(); + LLSD args; + args["DESC"] = mSettings->getName(); + LLNotificationsUtil::add("SaveSettingAs", args, LLSD(), boost::bind(&LLFloaterFixedEnvironment::onSaveAsCommit, this, _1, _2)); } else if ((ctrl_action == ACTION_APPLY_LOCAL) || (ctrl_action == ACTION_APPLY_PARCEL) || @@ -369,6 +371,17 @@ void LLFloaterFixedEnvironment::onButtonApply(LLUICtrl *ctrl, const LLSD &data) } } +void LLFloaterFixedEnvironment::onSaveAsCommit(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (0 == option) + { + std::string settings_name = response["message"].asString(); + LLStringUtil::trim(settings_name); + doApplyCreateNewInventory(settings_name); + } +} + void LLFloaterFixedEnvironment::onClickCloseBtn(bool app_quitting) { if (!app_quitting) @@ -382,11 +395,11 @@ void LLFloaterFixedEnvironment::onButtonLoad() checkAndConfirmSettingsLoss([this](){ doSelectFromInventory(); }); } -void LLFloaterFixedEnvironment::doApplyCreateNewInventory() +void LLFloaterFixedEnvironment::doApplyCreateNewInventory(std::string settings_name) { LLUUID parent_id = mInventoryItem ? mInventoryItem->getParentUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS); // This method knows what sort of settings object to create. - LLSettingsVOBase::createInventoryItem(mSettings, parent_id, + LLSettingsVOBase::createInventoryItem(mSettings, parent_id, settings_name, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); } @@ -396,7 +409,7 @@ void LLFloaterFixedEnvironment::doApplyUpdateInventory() if (mInventoryId.isNull()) { LL_WARNS("LAPRAS") << "Inventory ID is NULL. Creating New!!!" << LL_ENDL; - LLSettingsVOBase::createInventoryItem(mSettings, gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS), + LLSettingsVOBase::createInventoryItem(mSettings, gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS), std::string(), [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); } else -- cgit v1.2.3 From 3cfeff4bb357542d7eba7368a83d606d5393f7c2 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 27 Sep 2018 19:09:21 +0300 Subject: SL-9755 EEP Cannot apply a new Sky setting to the parcel. --- indra/newview/llfloaterfixedenvironment.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index b9ea044a06..71d3ef6405 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -571,19 +571,7 @@ bool LLFloaterFixedEnvironment::canApplyRegion() const bool LLFloaterFixedEnvironment::canApplyParcel() const { - LLParcelSelectionHandle handle(LLViewerParcelMgr::instance().getParcelSelection()); - LLParcel *parcel(nullptr); - - if (handle) - parcel = handle->getParcel(); - if (!parcel) - parcel = LLViewerParcelMgr::instance().getAgentParcel(); - - if (!parcel) - return false; - - return parcel->allowModifyBy(gAgent.getID(), gAgent.getGroupID()) && - LLEnvironment::instance().isExtendedEnvironmentEnabled(); + return LLEnvironment::instance().canAgentUpdateParcelEnvironment(); } //========================================================================= -- cgit v1.2.3 From 100fd88d2c6e29026b132b13bdb82278e3cd72c7 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 1 Oct 2018 16:46:16 +0300 Subject: SL-9755 EEP Cannot apply a new Sky setting to the parcel. --- indra/newview/llfloaterfixedenvironment.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 71d3ef6405..216556cf89 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -428,13 +428,7 @@ void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) } else if (where == ACTION_APPLY_PARCEL) { - LLParcelSelectionHandle handle(LLViewerParcelMgr::instance().getParcelSelection()); - LLParcel *parcel(nullptr); - - if (handle) - parcel = handle->getParcel(); - if (!parcel) - parcel = LLViewerParcelMgr::instance().getAgentParcel(); + LLParcel *parcel(LLViewerParcelMgr::instance().getAgentOrSelectedParcel()); if ((!parcel) || (parcel->getLocalID() == INVALID_PARCEL_ID)) { -- cgit v1.2.3 From 57ff71c915727abe09e794da4aa1615eb43f0abf Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 4 Oct 2018 22:12:17 +0300 Subject: SL-9654 [EEP] Settings Picker reliability --- indra/newview/llfloaterfixedenvironment.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 216556cf89..5cd99e6ad2 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -290,21 +290,12 @@ void LLFloaterFixedEnvironment::checkAndConfirmSettingsLoss(LLFloaterFixedEnviro } } -void LLFloaterFixedEnvironment::onPickerCommitSetting(LLUUID asset_id) +void LLFloaterFixedEnvironment::onPickerCommitSetting(LLUUID item_id) { - mInventoryItem = NULL; - mInventoryId.setNull(); - if (!mInventoryFloater.isDead()) - { - LLFloaterSettingsPicker *picker = static_cast(mInventoryFloater.get()); - if (picker) - { - mInventoryId = picker->findItemID(asset_id, false); - mInventoryItem = gInventory.getItem(mInventoryId); - } - } + mInventoryId = item_id; + mInventoryItem = gInventory.getItem(mInventoryId); - LLSettingsVOBase::getSettingsAsset(asset_id, + LLSettingsVOBase::getSettingsAsset(mInventoryItem->getAssetUUID(), [this](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { onAssetLoaded(asset_id, settings, status); }); } -- cgit v1.2.3 From 6bb496625f4492fabd44bd0e86acb8b599df8c43 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 8 Oct 2018 20:27:10 +0300 Subject: SL-9746 [EEP] Local Texture options should work with EEP --- indra/newview/llfloaterfixedenvironment.cpp | 58 +++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 5cd99e6ad2..201c6679b3 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -37,6 +37,7 @@ #include "llsliderctrl.h" #include "lltabcontainer.h" #include "llfilepicker.h" +#include "lllocalbitmaps.h" #include "llsettingspicker.h" #include "llviewermenufile.h" // LLFilePickerReplyThread #include "llviewerparcelmgr.h" @@ -51,6 +52,7 @@ #include "llenvironment.h" #include "llagent.h" #include "llparcel.h" +#include "lltrans.h" #include "llsettingsvo.h" #include "llinventorymodel.h" @@ -340,6 +342,62 @@ void LLFloaterFixedEnvironment::onButtonApply(LLUICtrl *ctrl, const LLSD &data) { std::string ctrl_action = ctrl->getName(); + std::string local_desc; + bool is_local = false; // because getString can be empty + if (mSettings->getSettingsType() == "water") + { + LLSettingsWater::ptr_t water = std::static_pointer_cast(mSettings); + if (water) + { + // LLViewerFetchedTexture and check for FTT_LOCAL_FILE or check LLLocalBitmapMgr + if (LLLocalBitmapMgr::isLocal(water->getNormalMapID())) + { + local_desc = LLTrans::getString("EnvironmentNormalMap"); + is_local = true; + } + else if (LLLocalBitmapMgr::isLocal(water->getTransparentTextureID())) + { + local_desc = LLTrans::getString("EnvironmentTransparent"); + is_local = true; + } + } + } + else if (mSettings->getSettingsType() == "sky") + { + LLSettingsSky::ptr_t sky = std::static_pointer_cast(mSettings); + if (sky) + { + if (LLLocalBitmapMgr::isLocal(sky->getSunTextureId())) + { + local_desc = LLTrans::getString("EnvironmentSun"); + is_local = true; + } + else if (LLLocalBitmapMgr::isLocal(sky->getMoonTextureId())) + { + local_desc = LLTrans::getString("EnvironmentMoon"); + is_local = true; + } + else if (LLLocalBitmapMgr::isLocal(sky->getCloudNoiseTextureId())) + { + local_desc = LLTrans::getString("EnvironmentCloudNoise"); + is_local = true; + } + else if (LLLocalBitmapMgr::isLocal(sky->getBloomTextureId())) + { + local_desc = LLTrans::getString("EnvironmentBloom"); + is_local = true; + } + } + } + + if (is_local) + { + LLSD args; + args["FIELD"] = local_desc; + LLNotificationsUtil::add("WLLocalTextureFixedBlock", args); + return; + } + if (ctrl_action == ACTION_SAVE) { doApplyUpdateInventory(); -- cgit v1.2.3 From 5a4d07f5ab63afc0352ec11d220fe1d5053ee974 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 17 Oct 2018 18:48:25 +0300 Subject: SL-9902 EEP Editors retaining dirty flags when they shouldn't --- indra/newview/llfloaterfixedenvironment.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 201c6679b3..ceb68de3c5 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -309,6 +309,8 @@ void LLFloaterFixedEnvironment::onAssetLoaded(LLUUID asset_id, LLSettingsBase::p return; } + clearDirtyFlag(); + if (!settings || status) { LLSD args; @@ -434,7 +436,7 @@ void LLFloaterFixedEnvironment::onSaveAsCommit(const LLSD& notification, const L void LLFloaterFixedEnvironment::onClickCloseBtn(bool app_quitting) { if (!app_quitting) - checkAndConfirmSettingsLoss([this](){ closeFloater(); }); + checkAndConfirmSettingsLoss([this](){ closeFloater(); clearDirtyFlag(); }); else closeFloater(); } -- cgit v1.2.3 From e6cc137b672db039c0dc043af6f215f4a9607eed Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 17 Oct 2018 19:04:09 +0300 Subject: SL-9902 EEP Importing Sky from file should mark editor as dirty --- indra/newview/llfloaterfixedenvironment.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index ceb68de3c5..ad4dcd567a 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -769,7 +769,7 @@ void LLFloaterFixedEnvironmentSky::loadSkySettingFromFile(const std::vector Date: Fri, 2 Nov 2018 09:17:19 -0700 Subject: SL-9886: Viewer send and receive new day_name(s) information in the environment protocol for viewer specified names on individual tracks. --- indra/newview/llfloaterfixedenvironment.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index ad4dcd567a..d35dd5ec98 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -490,7 +490,7 @@ void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) if (mInventoryItem && !isDirty()) { - LLEnvironment::instance().updateParcel(parcel->getLocalID(), mInventoryItem->getAssetUUID(), -1, -1); + LLEnvironment::instance().updateParcel(parcel->getLocalID(), mInventoryItem->getAssetUUID(), mInventoryItem->getName(), -1, -1); } else if (mSettings->getSettingsType() == "sky") { @@ -505,7 +505,7 @@ void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) { if (mInventoryItem && !isDirty()) { - LLEnvironment::instance().updateRegion(mInventoryItem->getAssetUUID(), -1, -1); + LLEnvironment::instance().updateRegion(mInventoryItem->getAssetUUID(), mInventoryItem->getName(), -1, -1); } else if (mSettings->getSettingsType() == "sky") { -- cgit v1.2.3 From 25e046594464551d6d66eceee0471f10722c53ce Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 31 Oct 2018 15:57:19 +0200 Subject: SL-9924 [EEP] Environment Settings permissions can be dropped by Save As button --- indra/newview/llfloaterfixedenvironment.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index d35dd5ec98..b9e23fb245 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -448,10 +448,20 @@ void LLFloaterFixedEnvironment::onButtonLoad() void LLFloaterFixedEnvironment::doApplyCreateNewInventory(std::string settings_name) { - LLUUID parent_id = mInventoryItem ? mInventoryItem->getParentUUID() : gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS); - // This method knows what sort of settings object to create. - LLSettingsVOBase::createInventoryItem(mSettings, parent_id, settings_name, + if (mInventoryItem) + { + LLUUID parent_id = mInventoryItem->getParentUUID(); + U32 next_owner_perm = mInventoryItem->getPermissions().getMaskNextOwner(); + LLSettingsVOBase::createInventoryItem(mSettings, next_owner_perm, parent_id, settings_name, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); + } + else + { + LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS); + // This method knows what sort of settings object to create. + LLSettingsVOBase::createInventoryItem(mSettings, parent_id, settings_name, + [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); + } } void LLFloaterFixedEnvironment::doApplyUpdateInventory() -- cgit v1.2.3 From 87e83274f7f0be38c571c9f01848368d0fc160bf Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 10 Dec 2018 20:21:18 +0200 Subject: SL-9924 [EEP] Environment Settings permissions can be dropped by Save As button --- indra/newview/llfloaterfixedenvironment.cpp | 57 ++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index b9e23fb245..712c7cf31a 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -85,6 +85,30 @@ namespace const std::string LLFloaterFixedEnvironment::KEY_INVENTORY_ID("inventory_id"); +//========================================================================= + +class LLFixedSettingCopiedCallback : public LLInventoryCallback +{ +public: + LLFixedSettingCopiedCallback(LLHandle handle) : mHandle(handle) {} + + virtual void fire(const LLUUID& inv_item_id) + { + if (!mHandle.isDead()) + { + LLViewerInventoryItem* item = gInventory.getItem(inv_item_id); + if (item) + { + LLFloaterFixedEnvironment* floater = (LLFloaterFixedEnvironment*)mHandle.get(); + floater->onInventoryCreated(item->getAssetUUID(), inv_item_id); + } + } + } + +private: + LLHandle mHandle; +}; + //========================================================================= LLFloaterFixedEnvironment::LLFloaterFixedEnvironment(const LLSD &key) : LLFloater(key), @@ -429,7 +453,32 @@ void LLFloaterFixedEnvironment::onSaveAsCommit(const LLSD& notification, const L { std::string settings_name = response["message"].asString(); LLStringUtil::trim(settings_name); - doApplyCreateNewInventory(settings_name); + if (mCanMod) + { + doApplyCreateNewInventory(settings_name); + } + else if (mInventoryItem) + { + const LLUUID &marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); + LLUUID parent_id = mInventoryItem->getParentUUID(); + if (marketplacelistings_id == parent_id) + { + parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS); + } + + LLPointer cb = new LLFixedSettingCopiedCallback(getHandle()); + copy_inventory_item( + gAgent.getID(), + mInventoryItem->getPermissions().getOwner(), + mInventoryItem->getUUID(), + parent_id, + settings_name, + cb); + } + else + { + LL_WARNS() << "Failed to copy fixed env setting" << LL_ENDL; + } } } @@ -547,13 +596,17 @@ void LLFloaterFixedEnvironment::doCloseInventoryFloater(bool quitting) void LLFloaterFixedEnvironment::onInventoryCreated(LLUUID asset_id, LLUUID inventory_id, LLSD results) { LL_WARNS("ENVIRONMENT") << "Inventory item " << inventory_id << " has been created with asset " << asset_id << " results are:" << results << LL_ENDL; - + if (inventory_id.isNull() || !results["success"].asBoolean()) { LLNotificationsUtil::add("CantCreateInventory"); return; } + onInventoryCreated(asset_id, inventory_id); +} +void LLFloaterFixedEnvironment::onInventoryCreated(LLUUID asset_id, LLUUID inventory_id) +{ if (mInventoryItem) { LLPermissions perms = mInventoryItem->getPermissions(); -- cgit v1.2.3 From 00d8caa359a216620db46d49696bc79a95fe8dc2 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 10 Jan 2019 22:11:11 +0200 Subject: SL-10279 Finalize drag and drop support --- indra/newview/llfloaterfixedenvironment.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 712c7cf31a..4e6bc6eae0 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -549,7 +549,7 @@ void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) if (mInventoryItem && !isDirty()) { - LLEnvironment::instance().updateParcel(parcel->getLocalID(), mInventoryItem->getAssetUUID(), mInventoryItem->getName(), -1, -1); + LLEnvironment::instance().updateParcel(parcel->getLocalID(), mInventoryItem->getAssetUUID(), mInventoryItem->getName(), LLEnvironment::NO_TRACK, -1, -1); } else if (mSettings->getSettingsType() == "sky") { @@ -564,7 +564,7 @@ void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) { if (mInventoryItem && !isDirty()) { - LLEnvironment::instance().updateRegion(mInventoryItem->getAssetUUID(), mInventoryItem->getName(), -1, -1); + LLEnvironment::instance().updateRegion(mInventoryItem->getAssetUUID(), mInventoryItem->getName(), LLEnvironment::NO_TRACK, -1, -1); } else if (mSettings->getSettingsType() == "sky") { -- cgit v1.2.3 From d693c5350933e664e5131c98babc7fbb2b4571aa Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 22 Jan 2019 22:01:00 +0200 Subject: SL-1932 Day Cycle Edit feature "Load Track" Part 1 --- indra/newview/llfloaterfixedenvironment.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 4e6bc6eae0..98cec04898 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -243,7 +243,7 @@ LLFloaterSettingsPicker * LLFloaterFixedEnvironment::getSettingsPicker() mInventoryFloater = picker->getHandle(); - picker->setCommitCallback([this](LLUICtrl *, const LLSD &data){ onPickerCommitSetting(data.asUUID()); }); + picker->setCommitCallback([this](LLUICtrl *, const LLSD &data){ onPickerCommitSetting(data["ItemId"].asUUID() /*data["Track"]*/); }); } return picker; -- cgit v1.2.3 From deac9ae7d84776d1f8497af82ed39e5d53e722d9 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 23 Jan 2019 20:33:41 +0200 Subject: SL-1932 Day Cycle Edit feature "Load Track" Part 2 --- indra/newview/llfloaterfixedenvironment.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 98cec04898..ce231973c7 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -239,7 +239,7 @@ LLFloaterSettingsPicker * LLFloaterFixedEnvironment::getSettingsPicker() if (!picker) { picker = new LLFloaterSettingsPicker(this, - LLUUID::null, "SELECT SETTINGS"); + LLUUID::null); mInventoryFloater = picker->getHandle(); -- cgit v1.2.3 From 42220977792ba7bc1fe99fedb315e0d408f3bff4 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Mon, 28 Jan 2019 17:25:44 +0200 Subject: SL-10413 FIXED environment does not change after double-clicking Sky Setting in Inventory the first time. --- indra/newview/llfloaterfixedenvironment.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index ce231973c7..35860de7a2 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -351,6 +351,7 @@ void LLFloaterFixedEnvironment::onAssetLoaded(LLUUID asset_id, LLSettingsBase::p updateEditEnvironment(); syncronizeTabs(); refresh(); + LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST); } void LLFloaterFixedEnvironment::onNameChanged(const std::string &name) -- cgit v1.2.3 From c7e02b0835cbb50777c677f618c4a957e69fabee Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 30 Jan 2019 14:36:46 -0800 Subject: SL-9925: Viewer now shows an error message if import from legacy windlight fails. --- indra/newview/llfloaterfixedenvironment.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index ce231973c7..67c6a1bba0 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -729,15 +729,15 @@ void LLFloaterFixedEnvironmentWater::doImportFromDisk() void LLFloaterFixedEnvironmentWater::loadWaterSettingFromFile(const std::vector& filenames) { + LLSD messages; if (filenames.size() < 1) return; std::string filename = filenames[0]; LL_WARNS("LAPRAS") << "Selected file: " << filename << LL_ENDL; - LLSettingsWater::ptr_t legacywater = LLEnvironment::createWaterFromLegacyPreset(filename); + LLSettingsWater::ptr_t legacywater = LLEnvironment::createWaterFromLegacyPreset(filename, messages); if (!legacywater) { - LLSD args(LLSDMap("FILE", filename)); - LLNotificationsUtil::add("WLImportFail", args); + LLNotificationsUtil::add("WLImportFail", messages); return; } @@ -818,14 +818,14 @@ void LLFloaterFixedEnvironmentSky::loadSkySettingFromFile(const std::vector Date: Thu, 31 Jan 2019 18:45:37 +0200 Subject: SL-9924 EEP Environment Settings permissions can be dropped by Save As button --- indra/newview/llfloaterfixedenvironment.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 5eac6b317b..dfd60acb50 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -117,7 +117,8 @@ LLFloaterFixedEnvironment::LLFloaterFixedEnvironment(const LLSD &key) : mInventoryItem(nullptr), mIsDirty(false), mCanCopy(false), - mCanMod(false) + mCanMod(false), + mCanTrans(false) { } @@ -257,6 +258,7 @@ void LLFloaterFixedEnvironment::loadInventoryItem(const LLUUID &inventoryId) mInventoryId.setNull(); mCanMod = true; mCanCopy = true; + mCanTrans = true; return; } @@ -288,6 +290,7 @@ void LLFloaterFixedEnvironment::loadInventoryItem(const LLUUID &inventoryId) mCanCopy = mInventoryItem->getPermissions().allowCopyBy(gAgent.getID()); mCanMod = mInventoryItem->getPermissions().allowModifyBy(gAgent.getID()); + mCanTrans = mInventoryItem->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()); LLSettingsVOBase::getSettingsAsset(mInventoryItem->getAssetUUID(), [this](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { onAssetLoaded(asset_id, settings, status); }); @@ -348,6 +351,21 @@ void LLFloaterFixedEnvironment::onAssetLoaded(LLUUID asset_id, LLSettingsBase::p if (mInventoryItem) mSettings->setName(mInventoryItem->getName()); + if (mCanCopy) + settings->clearFlag(LLSettingsBase::FLAG_NOCOPY); + else + settings->setFlag(LLSettingsBase::FLAG_NOCOPY); + + if (mCanMod) + settings->clearFlag(LLSettingsBase::FLAG_NOMOD); + else + settings->setFlag(LLSettingsBase::FLAG_NOMOD); + + if (mCanTrans) + settings->clearFlag(LLSettingsBase::FLAG_NOTRANS); + else + settings->setFlag(LLSettingsBase::FLAG_NOTRANS); + updateEditEnvironment(); syncronizeTabs(); refresh(); -- cgit v1.2.3 From 2401712d1073e85b4b9183d20c6e9274bc874f64 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 20 Feb 2019 15:20:30 -0800 Subject: SL-9660: Next pass cleanup. Removed and downgraded a number of logs. Removed refs to LAPAS. Better sync with legacy regions. --- indra/newview/llfloaterfixedenvironment.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index dfd60acb50..b7e92e7e56 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -534,16 +534,14 @@ void LLFloaterFixedEnvironment::doApplyCreateNewInventory(std::string settings_n void LLFloaterFixedEnvironment::doApplyUpdateInventory() { - LL_WARNS("LAPRAS") << "Update inventory for " << mInventoryId << LL_ENDL; + LL_DEBUGS("ENVEDIT") << "Update inventory for " << mInventoryId << LL_ENDL; if (mInventoryId.isNull()) { - LL_WARNS("LAPRAS") << "Inventory ID is NULL. Creating New!!!" << LL_ENDL; LLSettingsVOBase::createInventoryItem(mSettings, gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS), std::string(), [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); } else { - LL_WARNS("LAPRAS") << "Updating inventory ID " << mInventoryId << LL_ENDL; LLSettingsVOBase::updateInventoryItem(mSettings, mInventoryId, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryUpdated(asset_id, inventory_id, results); }); } @@ -751,7 +749,7 @@ void LLFloaterFixedEnvironmentWater::loadWaterSettingFromFile(const std::vector< LLSD messages; if (filenames.size() < 1) return; std::string filename = filenames[0]; - LL_WARNS("LAPRAS") << "Selected file: " << filename << LL_ENDL; + LL_DEBUGS("ENVEDIT") << "Selected file: " << filename << LL_ENDL; LLSettingsWater::ptr_t legacywater = LLEnvironment::createWaterFromLegacyPreset(filename, messages); if (!legacywater) @@ -839,7 +837,7 @@ void LLFloaterFixedEnvironmentSky::loadSkySettingFromFile(const std::vector Date: Sat, 2 Mar 2019 07:17:46 -0800 Subject: SL-10664 --- indra/newview/llfloaterfixedenvironment.cpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index b7e92e7e56..f08c36a7e7 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -795,14 +795,6 @@ BOOL LLFloaterFixedEnvironmentSky::postBuild() panel->setOnDirtyFlagChanged([this](LLPanel *, bool value) { onPanelDirtyFlagChanged(value); }); mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(false)); - if (gSavedSettings.getBOOL("RenderUseAdvancedAtmospherics")) - { - panel = new LLPanelSettingsSkyDensityTab; - panel->buildFromFile("panel_settings_sky_density.xml"); - panel->setSky(std::static_pointer_cast(mSettings)); - panel->setOnDirtyFlagChanged([this](LLPanel *, bool value) { onPanelDirtyFlagChanged(value); }); - mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(false)); - } return TRUE; } -- cgit v1.2.3 From ba7ad1af7222ae39dfc0e0303fdee820636eddf2 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 9 May 2019 16:18:44 +0300 Subject: SL-9684 Fixed editor edits environment that was freshly applied from same editor --- indra/newview/llfloaterfixedenvironment.cpp | 45 +++++++++++++++-------------- 1 file changed, 24 insertions(+), 21 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index f08c36a7e7..a94b7c219f 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -388,12 +388,14 @@ void LLFloaterFixedEnvironment::onButtonApply(LLUICtrl *ctrl, const LLSD &data) std::string ctrl_action = ctrl->getName(); std::string local_desc; + LLSettingsBase::ptr_t setting_clone; bool is_local = false; // because getString can be empty if (mSettings->getSettingsType() == "water") { LLSettingsWater::ptr_t water = std::static_pointer_cast(mSettings); if (water) { + setting_clone = water->buildClone(); // LLViewerFetchedTexture and check for FTT_LOCAL_FILE or check LLLocalBitmapMgr if (LLLocalBitmapMgr::isLocal(water->getNormalMapID())) { @@ -412,6 +414,7 @@ void LLFloaterFixedEnvironment::onButtonApply(LLUICtrl *ctrl, const LLSD &data) LLSettingsSky::ptr_t sky = std::static_pointer_cast(mSettings); if (sky) { + setting_clone = sky->buildClone(); if (LLLocalBitmapMgr::isLocal(sky->getSunTextureId())) { local_desc = LLTrans::getString("EnvironmentSun"); @@ -445,19 +448,19 @@ void LLFloaterFixedEnvironment::onButtonApply(LLUICtrl *ctrl, const LLSD &data) if (ctrl_action == ACTION_SAVE) { - doApplyUpdateInventory(); + doApplyUpdateInventory(setting_clone); } else if (ctrl_action == ACTION_SAVEAS) { LLSD args; args["DESC"] = mSettings->getName(); - LLNotificationsUtil::add("SaveSettingAs", args, LLSD(), boost::bind(&LLFloaterFixedEnvironment::onSaveAsCommit, this, _1, _2)); + LLNotificationsUtil::add("SaveSettingAs", args, LLSD(), boost::bind(&LLFloaterFixedEnvironment::onSaveAsCommit, this, _1, _2, setting_clone)); } else if ((ctrl_action == ACTION_APPLY_LOCAL) || (ctrl_action == ACTION_APPLY_PARCEL) || (ctrl_action == ACTION_APPLY_REGION)) { - doApplyEnvironment(ctrl_action); + doApplyEnvironment(ctrl_action, setting_clone); } else { @@ -465,7 +468,7 @@ void LLFloaterFixedEnvironment::onButtonApply(LLUICtrl *ctrl, const LLSD &data) } } -void LLFloaterFixedEnvironment::onSaveAsCommit(const LLSD& notification, const LLSD& response) +void LLFloaterFixedEnvironment::onSaveAsCommit(const LLSD& notification, const LLSD& response, const LLSettingsBase::ptr_t &settings) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (0 == option) @@ -474,7 +477,7 @@ void LLFloaterFixedEnvironment::onSaveAsCommit(const LLSD& notification, const L LLStringUtil::trim(settings_name); if (mCanMod) { - doApplyCreateNewInventory(settings_name); + doApplyCreateNewInventory(settings_name, settings); } else if (mInventoryItem) { @@ -514,44 +517,44 @@ void LLFloaterFixedEnvironment::onButtonLoad() checkAndConfirmSettingsLoss([this](){ doSelectFromInventory(); }); } -void LLFloaterFixedEnvironment::doApplyCreateNewInventory(std::string settings_name) +void LLFloaterFixedEnvironment::doApplyCreateNewInventory(std::string settings_name, const LLSettingsBase::ptr_t &settings) { if (mInventoryItem) { LLUUID parent_id = mInventoryItem->getParentUUID(); U32 next_owner_perm = mInventoryItem->getPermissions().getMaskNextOwner(); - LLSettingsVOBase::createInventoryItem(mSettings, next_owner_perm, parent_id, settings_name, + LLSettingsVOBase::createInventoryItem(settings, next_owner_perm, parent_id, settings_name, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); } else { LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS); // This method knows what sort of settings object to create. - LLSettingsVOBase::createInventoryItem(mSettings, parent_id, settings_name, + LLSettingsVOBase::createInventoryItem(settings, parent_id, settings_name, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); } } -void LLFloaterFixedEnvironment::doApplyUpdateInventory() +void LLFloaterFixedEnvironment::doApplyUpdateInventory(const LLSettingsBase::ptr_t &settings) { LL_DEBUGS("ENVEDIT") << "Update inventory for " << mInventoryId << LL_ENDL; if (mInventoryId.isNull()) { - LLSettingsVOBase::createInventoryItem(mSettings, gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS), std::string(), + LLSettingsVOBase::createInventoryItem(settings, gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS), std::string(), [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryCreated(asset_id, inventory_id, results); }); } else { - LLSettingsVOBase::updateInventoryItem(mSettings, mInventoryId, + LLSettingsVOBase::updateInventoryItem(settings, mInventoryId, [this](LLUUID asset_id, LLUUID inventory_id, LLUUID, LLSD results) { onInventoryUpdated(asset_id, inventory_id, results); }); } } -void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) +void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where, const LLSettingsBase::ptr_t &settings) { if (where == ACTION_APPLY_LOCAL) { - LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, mSettings); + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, settings); } else if (where == ACTION_APPLY_PARCEL) { @@ -568,13 +571,13 @@ void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) { LLEnvironment::instance().updateParcel(parcel->getLocalID(), mInventoryItem->getAssetUUID(), mInventoryItem->getName(), LLEnvironment::NO_TRACK, -1, -1); } - else if (mSettings->getSettingsType() == "sky") + else if (settings->getSettingsType() == "sky") { - LLEnvironment::instance().updateParcel(parcel->getLocalID(), std::static_pointer_cast(mSettings), -1, -1); + LLEnvironment::instance().updateParcel(parcel->getLocalID(), std::static_pointer_cast(settings), -1, -1); } - else if (mSettings->getSettingsType() == "water") + else if (settings->getSettingsType() == "water") { - LLEnvironment::instance().updateParcel(parcel->getLocalID(), std::static_pointer_cast(mSettings), -1, -1); + LLEnvironment::instance().updateParcel(parcel->getLocalID(), std::static_pointer_cast(settings), -1, -1); } } else if (where == ACTION_APPLY_REGION) @@ -583,13 +586,13 @@ void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where) { LLEnvironment::instance().updateRegion(mInventoryItem->getAssetUUID(), mInventoryItem->getName(), LLEnvironment::NO_TRACK, -1, -1); } - else if (mSettings->getSettingsType() == "sky") + else if (settings->getSettingsType() == "sky") { - LLEnvironment::instance().updateRegion(std::static_pointer_cast(mSettings), -1, -1); + LLEnvironment::instance().updateRegion(std::static_pointer_cast(settings), -1, -1); } - else if (mSettings->getSettingsType() == "water") + else if (settings->getSettingsType() == "water") { - LLEnvironment::instance().updateRegion(std::static_pointer_cast(mSettings), -1, -1); + LLEnvironment::instance().updateRegion(std::static_pointer_cast(settings), -1, -1); } } else -- cgit v1.2.3 From 9f2fc2b433f1c67b85786467ab17ff0b662b90f7 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Fri, 24 May 2019 17:54:36 +0300 Subject: SL-11273 FIXED [EEP] The beacon checkboxes in the Day Cycle window can only be changed while a keyframe is selected. --- indra/newview/llfloaterfixedenvironment.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index a94b7c219f..f852cc7395 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -214,8 +214,8 @@ void LLFloaterFixedEnvironment::refresh() LLSettingsEditPanel *panel = static_cast(mTab->getPanelByIndex(idx)); if (panel) { - panel->refresh(); panel->setCanChangeSettings(mCanMod); + panel->refresh(); } } } @@ -851,9 +851,3 @@ void LLFloaterFixedEnvironmentSky::loadSkySettingFromFile(const std::vector Date: Tue, 28 May 2019 18:06:08 +0300 Subject: SL-11279 [EEP] Automatically toggle the beacon checkboxes --- indra/newview/llfloaterfixedenvironment.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index f852cc7395..b1fdc2d2a5 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -814,13 +814,20 @@ void LLFloaterFixedEnvironmentSky::onOpen(const LLSD& key) // Initialize the settings, take a snapshot of the current water. mSettings = LLEnvironment::instance().getEnvironmentFixedSky(LLEnvironment::ENV_CURRENT)->buildClone(); mSettings->setName("Snapshot sky (new)"); - + LLEnvironment::instance().saveBeaconsState(); // TODO: Should we grab water and keep it around for reference? } LLFloaterFixedEnvironment::onOpen(key); } +void LLFloaterFixedEnvironmentSky::onClose(bool app_quitting) +{ + LLEnvironment::instance().revertBeaconsState(); + + LLFloaterFixedEnvironment::onClose(app_quitting); +} + void LLFloaterFixedEnvironmentSky::doImportFromDisk() { // Load a a legacy Windlight XML from disk. (new LLFilePickerReplyThread(boost::bind(&LLFloaterFixedEnvironmentSky::loadSkySettingFromFile, this, _1), LLFilePicker::FFLOAD_XML, false))->getFile(); -- cgit v1.2.3 From b6eabbc4e3b99a07ef5d8cdd3594a97de8ff5ad3 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 29 Jul 2019 17:44:39 +0300 Subject: SL-11660 Empty names should not be allowed --- indra/newview/llfloaterfixedenvironment.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index b1fdc2d2a5..05da640258 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -474,7 +474,15 @@ void LLFloaterFixedEnvironment::onSaveAsCommit(const LLSD& notification, const L if (0 == option) { std::string settings_name = response["message"].asString(); - LLStringUtil::trim(settings_name); + + LLInventoryObject::correctInventoryName(settings_name); + if (settings_name.empty()) + { + // Ideally notification should disable 'OK' button if name won't fit our requirements, + // for now either display notification, or use some default name + settings_name = "Unnamed"; + } + if (mCanMod) { doApplyCreateNewInventory(settings_name, settings); -- cgit v1.2.3 From 1f656735d339fc4d83da86efbb400af1361c27db Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 26 Aug 2019 11:43:45 -0700 Subject: SL-11705, SL-11706: New flags in llsettings base for tracking by simulator. --- indra/newview/llfloaterfixedenvironment.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 05da640258..dccfca62a4 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -560,6 +560,19 @@ void LLFloaterFixedEnvironment::doApplyUpdateInventory(const LLSettingsBase::ptr void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where, const LLSettingsBase::ptr_t &settings) { + U32 flags(0); + + if (mInventoryItem) + { + if (!mInventoryItem->getPermissions().allowOperationBy(PERM_MODIFY, gAgent.getID())) + flags |= LLSettingsBase::FLAG_NOMOD; + if (!mInventoryItem->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID())) + flags |= LLSettingsBase::FLAG_NOTRANS; + } + + flags |= settings->getFlags(); + settings->setFlag(flags); + if (where == ACTION_APPLY_LOCAL) { LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, settings); @@ -577,7 +590,7 @@ void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where, con if (mInventoryItem && !isDirty()) { - LLEnvironment::instance().updateParcel(parcel->getLocalID(), mInventoryItem->getAssetUUID(), mInventoryItem->getName(), LLEnvironment::NO_TRACK, -1, -1); + LLEnvironment::instance().updateParcel(parcel->getLocalID(), mInventoryItem->getAssetUUID(), mInventoryItem->getName(), LLEnvironment::NO_TRACK, -1, -1, flags); } else if (settings->getSettingsType() == "sky") { @@ -592,7 +605,7 @@ void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where, con { if (mInventoryItem && !isDirty()) { - LLEnvironment::instance().updateRegion(mInventoryItem->getAssetUUID(), mInventoryItem->getName(), LLEnvironment::NO_TRACK, -1, -1); + LLEnvironment::instance().updateRegion(mInventoryItem->getAssetUUID(), mInventoryItem->getName(), LLEnvironment::NO_TRACK, -1, -1, flags); } else if (settings->getSettingsType() == "sky") { -- cgit v1.2.3 From f79fc96d08e37f119653f7db5a299a05454ff79c Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 26 Aug 2019 14:20:59 -0700 Subject: SL-11706: Correctly load settings when pushing the Load button in the fixed environment editor. --- indra/newview/llfloaterfixedenvironment.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index dccfca62a4..f564dce629 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -321,11 +321,16 @@ void LLFloaterFixedEnvironment::checkAndConfirmSettingsLoss(LLFloaterFixedEnviro void LLFloaterFixedEnvironment::onPickerCommitSetting(LLUUID item_id) { - mInventoryId = item_id; - mInventoryItem = gInventory.getItem(mInventoryId); - - LLSettingsVOBase::getSettingsAsset(mInventoryItem->getAssetUUID(), - [this](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { onAssetLoaded(asset_id, settings, status); }); + loadInventoryItem(item_id); +// mInventoryId = item_id; +// mInventoryItem = gInventory.getItem(mInventoryId); +// +// mCanCopy = mInventoryItem->getPermissions().allowCopyBy(gAgent.getID()); +// mCanMod = mInventoryItem->getPermissions().allowModifyBy(gAgent.getID()); +// mCanTrans = mInventoryItem->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()); +// +// LLSettingsVOBase::getSettingsAsset(mInventoryItem->getAssetUUID(), +// [this](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { onAssetLoaded(asset_id, settings, status); }); } void LLFloaterFixedEnvironment::onAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status) -- cgit v1.2.3 From cc3cf17e5e335b6e78d86755e015161ab92c50db Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Tue, 15 Oct 2019 18:07:55 +0300 Subject: SL-11907 Fixed assigning permissions to environment when using "Save As" --- indra/newview/llfloaterfixedenvironment.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index f564dce629..38b1f5066d 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -250,7 +250,7 @@ LLFloaterSettingsPicker * LLFloaterFixedEnvironment::getSettingsPicker() return picker; } -void LLFloaterFixedEnvironment::loadInventoryItem(const LLUUID &inventoryId) +void LLFloaterFixedEnvironment::loadInventoryItem(const LLUUID &inventoryId, bool can_trans) { if (inventoryId.isNull()) { @@ -290,7 +290,7 @@ void LLFloaterFixedEnvironment::loadInventoryItem(const LLUUID &inventoryId) mCanCopy = mInventoryItem->getPermissions().allowCopyBy(gAgent.getID()); mCanMod = mInventoryItem->getPermissions().allowModifyBy(gAgent.getID()); - mCanTrans = mInventoryItem->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()); + mCanTrans = can_trans && mInventoryItem->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()); LLSettingsVOBase::getSettingsAsset(mInventoryItem->getAssetUUID(), [this](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { onAssetLoaded(asset_id, settings, status); }); @@ -653,6 +653,7 @@ void LLFloaterFixedEnvironment::onInventoryCreated(LLUUID asset_id, LLUUID inven void LLFloaterFixedEnvironment::onInventoryCreated(LLUUID asset_id, LLUUID inventory_id) { + bool can_trans = true; if (mInventoryItem) { LLPermissions perms = mInventoryItem->getPermissions(); @@ -661,13 +662,14 @@ void LLFloaterFixedEnvironment::onInventoryCreated(LLUUID asset_id, LLUUID inven if (created_item) { + can_trans = perms.allowOperationBy(PERM_TRANSFER, gAgent.getID()); created_item->setPermissions(perms); created_item->updateServer(false); } } clearDirtyFlag(); setFocus(TRUE); // Call back the focus... - loadInventoryItem(inventory_id); + loadInventoryItem(inventory_id, can_trans); } void LLFloaterFixedEnvironment::onInventoryUpdated(LLUUID asset_id, LLUUID inventory_id, LLSD results) -- cgit v1.2.3 From e9c0a93f99c4e6a4844da1a93ac261c4b206b79b Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Thu, 14 Nov 2019 15:19:55 -0700 Subject: Fix merge-related compile errors --- indra/newview/llfloaterfixedenvironment.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 38b1f5066d..41d9a6d99b 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -402,12 +402,12 @@ void LLFloaterFixedEnvironment::onButtonApply(LLUICtrl *ctrl, const LLSD &data) { setting_clone = water->buildClone(); // LLViewerFetchedTexture and check for FTT_LOCAL_FILE or check LLLocalBitmapMgr - if (LLLocalBitmapMgr::isLocal(water->getNormalMapID())) + if (LLLocalBitmapMgr::getInstance()->isLocal(water->getNormalMapID())) { local_desc = LLTrans::getString("EnvironmentNormalMap"); is_local = true; } - else if (LLLocalBitmapMgr::isLocal(water->getTransparentTextureID())) + else if (LLLocalBitmapMgr::getInstance()->isLocal(water->getTransparentTextureID())) { local_desc = LLTrans::getString("EnvironmentTransparent"); is_local = true; @@ -420,22 +420,22 @@ void LLFloaterFixedEnvironment::onButtonApply(LLUICtrl *ctrl, const LLSD &data) if (sky) { setting_clone = sky->buildClone(); - if (LLLocalBitmapMgr::isLocal(sky->getSunTextureId())) + if (LLLocalBitmapMgr::getInstance()->isLocal(sky->getSunTextureId())) { local_desc = LLTrans::getString("EnvironmentSun"); is_local = true; } - else if (LLLocalBitmapMgr::isLocal(sky->getMoonTextureId())) + else if (LLLocalBitmapMgr::getInstance()->isLocal(sky->getMoonTextureId())) { local_desc = LLTrans::getString("EnvironmentMoon"); is_local = true; } - else if (LLLocalBitmapMgr::isLocal(sky->getCloudNoiseTextureId())) + else if (LLLocalBitmapMgr::getInstance()->isLocal(sky->getCloudNoiseTextureId())) { local_desc = LLTrans::getString("EnvironmentCloudNoise"); is_local = true; } - else if (LLLocalBitmapMgr::isLocal(sky->getBloomTextureId())) + else if (LLLocalBitmapMgr::getInstance()->isLocal(sky->getBloomTextureId())) { local_desc = LLTrans::getString("EnvironmentBloom"); is_local = true; -- cgit v1.2.3 From 6620211bff5dca7df0667cf9220da1a9e7ce079c Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 27 Mar 2020 00:13:33 +0200 Subject: SL-12911 Add Debug setting EnvironmentPersistAcrossLogin --- indra/newview/llfloaterfixedenvironment.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfloaterfixedenvironment.cpp') diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index 41d9a6d99b..37e162b249 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -580,6 +580,7 @@ void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where, con if (where == ACTION_APPLY_LOCAL) { + settings->setName("Local"); // To distinguish and make sure there is a name. Safe, because this is a copy. LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, settings); } else if (where == ACTION_APPLY_PARCEL) -- cgit v1.2.3