diff options
| author | Graham Linden graham@lindenlab.com <Graham Linden graham@lindenlab.com> | 2018-05-09 22:20:19 +0100 | 
|---|---|---|
| committer | Graham Linden graham@lindenlab.com <Graham Linden graham@lindenlab.com> | 2018-05-09 22:20:19 +0100 | 
| commit | 23d2a97cda93d73ae1f5cae300b0e7534868f455 (patch) | |
| tree | de7bbe636c5735b7c5809b1efdd892faa9b3d609 | |
| parent | 5c18b349f06457bd6da3fcb12290932fb0d44826 (diff) | |
| parent | c238fa3ac5a3f93dcbf95e3cf7a7f8b576ab751c (diff) | |
Merge
26 files changed, 2595 insertions, 1257 deletions
diff --git a/indra/llinventory/llsettingssky.h b/indra/llinventory/llsettingssky.h index d08e2bbd03..1451162744 100644 --- a/indra/llinventory/llsettingssky.h +++ b/indra/llinventory/llsettingssky.h @@ -189,6 +189,11 @@ public:          return mSettings[SETTING_CLOUD_TEXTUREID].asUUID();      } +    void setCloudNoiseTextureId(const LLUUID &id) +    { +        setValue(SETTING_CLOUD_TEXTUREID, id); +    } +      LLColor3 getCloudPosDensity1() const      {          return LLColor3(mSettings[SETTING_CLOUD_POS_DENSITY1]); @@ -300,6 +305,11 @@ public:          return mSettings[SETTING_MAX_Y].asReal();      } +    void setMaxY(F32 val)  +    { +        setValue(SETTING_MAX_Y, val); +    } +      LLQuaternion getMoonRotation() const      {          return LLQuaternion(mSettings[SETTING_MOON_ROTATION]); @@ -324,6 +334,11 @@ public:          return mSettings[SETTING_MOON_TEXTUREID].asUUID();      } +    void setMoonTextureId(LLUUID id) +    { +        setValue(SETTING_MOON_TEXTUREID, id); +    } +      F32 getStarBrightness() const      {          return mSettings[SETTING_STAR_BRIGHTNESS].asReal(); @@ -368,6 +383,11 @@ public:          return mSettings[SETTING_SUN_TEXTUREID].asUUID();      } +    void setSunTextureId(LLUUID id)  +    { +        setValue(SETTING_SUN_TEXTUREID, id); +    } +      // Internal/calculated settings      LLVector3 getLightDirection() const      { diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 109001f82e..1a08bb6d74 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -320,6 +320,7 @@ set(viewer_SOURCE_FILES      llfolderviewmodelinventory.cpp      llfollowcam.cpp      llfriendcard.cpp +    llflyoutcombobtn.cpp      llgesturelistener.cpp      llgesturemgr.cpp      llgiveinventory.cpp @@ -421,6 +422,7 @@ set(viewer_SOURCE_FILES      llpanelblockedlist.cpp      llpanelclassified.cpp      llpanelcontents.cpp +    llpaneleditsky.cpp      llpaneleditwater.cpp      llpaneleditwearable.cpp      llpanelenvironment.cpp @@ -940,6 +942,7 @@ set(viewer_HEADER_FILES      llfolderviewmodelinventory.h      llfollowcam.h      llfriendcard.h +    llflyoutcombobtn.h      llgesturelistener.h      llgesturemgr.h      llgiveinventory.h @@ -1031,6 +1034,7 @@ set(viewer_HEADER_FILES      llpanelblockedlist.h      llpanelclassified.h      llpanelcontents.h +    llpaneleditsky.h      llpaneleditwater.h      llpaneleditwearable.h      llpanelenvironment.h diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 214ebb82b0..98da6ea22f 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -135,6 +135,17 @@ bool LLEnvironment::canEdit() const      return true;  } +bool LLEnvironment::isExtendedEnvironmentEnabled() const +{ +    return !gAgent.getRegionCapability("ExtEnvironment").empty(); +} + +bool LLEnvironment::isInventoryEnabled() const +{ +    return (!gAgent.getRegionCapability("UpdateSettingsAgentInventory").empty() && +        !gAgent.getRegionCapability("UpdateSettingsTaskInventory").empty()); +} +  LLEnvironment::connection_t LLEnvironment::setSkyListChange(const LLEnvironment::change_signal_t::slot_type& cb)  { @@ -202,10 +213,10 @@ bool LLEnvironment::getIsDayTime() const  }  //------------------------------------------------------------------------- -void LLEnvironment::setSelectedEnvironment(LLEnvironment::EnvSelection_t env, F64Seconds transition) +void LLEnvironment::setSelectedEnvironment(LLEnvironment::EnvSelection_t env, F64Seconds transition, bool forced)  {      mSelectedEnvironment = env; -    updateEnvironment(transition); +    updateEnvironment(transition, forced);  }  bool LLEnvironment::hasEnvironment(LLEnvironment::EnvSelection_t env) @@ -266,6 +277,41 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, LLEnvironm      /*TODO: readjust environment*/  } +void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, const LLSettingsBase::ptr_t &settings) +{ +    DayInstance::ptr_t environment = getEnvironmentInstance(env); + +    if (settings->getSettingType() == "daycycle") +    { +        S64Seconds daylength(LLSettingsDay::DEFAULT_DAYLENGTH); +        S64Seconds dayoffset(LLSettingsDay::DEFAULT_DAYOFFSET); +        if (environment) +        { +            daylength = environment->getDayLength(); +            dayoffset = environment->getDayOffset(); +        } +        setEnvironment(env, std::static_pointer_cast<LLSettingsDay>(settings), daylength, dayoffset); +    } +    else if (settings->getSettingType() == "sky") +    { +        fixedEnvironment_t fixedenv(std::static_pointer_cast<LLSettingsSky>(settings), LLSettingsWater::ptr_t()); +        if (environment) +        { +            fixedenv.second = environment->getWater(); +        } +        setEnvironment(env, fixedenv); +    } +    else if (settings->getSettingType() == "water") +    { +        fixedEnvironment_t fixedenv(LLSettingsSky::ptr_t(), std::static_pointer_cast<LLSettingsWater>(settings)); +        if (environment) +        { +            fixedenv.first = environment->getSky(); +        } +        setEnvironment(env, fixedenv); +    } +} +  void LLEnvironment::clearEnvironment(LLEnvironment::EnvSelection_t env)  { @@ -337,6 +383,9 @@ LLEnvironment::fixedEnvironment_t LLEnvironment::getEnvironmentFixed(LLEnvironme              if (fixed.first && fixed.second)                  break; +            if (idx == ENV_EDIT) +                continue;   // skip the edit environment. +              DayInstance::ptr_t environment = getEnvironmentInstance(static_cast<EnvSelection_t>(idx));              if (environment)              { @@ -379,11 +428,11 @@ LLEnvironment::DayInstance::ptr_t LLEnvironment::getSelectedEnvironmentInstance(  } -void LLEnvironment::updateEnvironment(F64Seconds transition) +void LLEnvironment::updateEnvironment(F64Seconds transition, bool forced)  {      DayInstance::ptr_t pinstance = getSelectedEnvironmentInstance(); -    if (mCurrentEnvironment != pinstance) +    if ((mCurrentEnvironment != pinstance) || forced)      {          DayInstance::ptr_t trans = std::make_shared<DayTransition>(              mCurrentEnvironment->getSky(), mCurrentEnvironment->getWater(), pinstance, transition); @@ -756,7 +805,7 @@ void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentI  //=========================================================================  void LLEnvironment::requestRegion()  { -    if (gAgent.getRegionCapability("ExtEnvironment").empty()) +    if (!isExtendedEnvironmentEnabled())      {          LLEnvironmentRequest::initiate();          return; @@ -767,7 +816,7 @@ void LLEnvironment::requestRegion()  void LLEnvironment::updateRegion(LLSettingsDay::ptr_t &pday, S32 day_length, S32 day_offset)  { -    if (gAgent.getRegionCapability("ExtEnvironment").empty()) +    if (!isExtendedEnvironmentEnabled())      {          LLEnvironmentApply::initiateRequest( LLSettingsVODay::convertToLegacy(pday) );          return; @@ -1067,6 +1116,30 @@ std::string LLEnvironment::getUserDir(const std::string &subdir)      return gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "windlight\\"+subdir, "");  } +LLSettingsWater::ptr_t LLEnvironment::createWaterFromLegacyPreset(const std::string filename) +{ +    LLSD data = legacyLoadPreset(filename); +    if (!data) +        return LLSettingsWater::ptr_t(); + +    std::string name(gDirUtilp->getBaseFileName(LLURI::unescape(filename), true)); +    LLSettingsWater::ptr_t water = LLSettingsVOWater::buildFromLegacyPreset(name, data); + +    return water; +} + +LLSettingsSky::ptr_t LLEnvironment::createSkyFromLegacyPreset(const std::string filename) +{ +    LLSD data = legacyLoadPreset(filename); +    if (!data) +        return LLSettingsSky::ptr_t(); + +    std::string name(gDirUtilp->getBaseFileName(LLURI::unescape(filename), true)); +    LLSettingsSky::ptr_t sky = LLSettingsVOSky::buildFromLegacyPreset(name, data); + +    return sky; +} +  LLSD LLEnvironment::legacyLoadPreset(const std::string& path)  {      llifstream xml_file; diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h index 95b24314cb..ad7d93c3c8 100644 --- a/indra/newview/llenvironment.h +++ b/indra/newview/llenvironment.h @@ -134,6 +134,8 @@ public:      const UserPrefs &           getPreferences() const { return mUserPrefs; }      bool                        canEdit() const; +    bool                        isExtendedEnvironmentEnabled() const; +    bool                        isInventoryEnabled() const;      LLSettingsSky::ptr_t        getCurrentSky() const { return mCurrentEnvironment->getSky(); }      LLSettingsWater::ptr_t      getCurrentWater() const { return mCurrentEnvironment->getWater(); } @@ -143,12 +145,13 @@ public:      void                        updateGLVariablesForSettings(LLGLSLShader *shader, const LLSettingsBase::ptr_t &psetting);      void                        updateShaderUniforms(LLGLSLShader *shader); -    void                        setSelectedEnvironment(EnvSelection_t env, F64Seconds transition = TRANSITION_DEFAULT); +    void                        setSelectedEnvironment(EnvSelection_t env, F64Seconds transition = TRANSITION_DEFAULT, bool forced = false);      EnvSelection_t              getSelectedEnvironment() const                  { return mSelectedEnvironment; }      bool                        hasEnvironment(EnvSelection_t env);      void                        setEnvironment(EnvSelection_t env, const LLSettingsDay::ptr_t &pday, S64Seconds daylength, S64Seconds dayoffset);      void                        setEnvironment(EnvSelection_t env, fixedEnvironment_t fixed); +    void                        setEnvironment(EnvSelection_t env, const LLSettingsBase::ptr_t &fixed);       void                        setEnvironment(EnvSelection_t env, const LLSettingsSky::ptr_t & fixed) { setEnvironment(env, fixedEnvironment_t(fixed, LLSettingsWater::ptr_t())); }      void                        setEnvironment(EnvSelection_t env, const LLSettingsWater::ptr_t & fixed) { setEnvironment(env, fixedEnvironment_t(LLSettingsSky::ptr_t(), fixed)); }      void                        clearEnvironment(EnvSelection_t env); @@ -159,7 +162,7 @@ public:      LLSettingsSky::ptr_t        getEnvironmentFixedSky(EnvSelection_t env)      { return getEnvironmentFixed(env).first; };      LLSettingsWater::ptr_t      getEnvironmentFixedWater(EnvSelection_t env)    { return getEnvironmentFixed(env).second; }; -    void                        updateEnvironment(F64Seconds transition = TRANSITION_DEFAULT); +    void                        updateEnvironment(F64Seconds transition = TRANSITION_DEFAULT, bool forced = false);      void                        addSky(const LLSettingsSky::ptr_t &sky);      void                        addWater(const LLSettingsWater::ptr_t &sky); @@ -187,6 +190,9 @@ public:      inline LLVector4            getClampedLightDirection() const { return LLVector4(mCurrentEnvironment->getSky()->getClampedLightDirection(), 0.0f); }      inline LLVector4            getRotatedLight() const { return mRotatedLight; } +    static LLSettingsWater::ptr_t   createWaterFromLegacyPreset(const std::string filename); +    static LLSettingsSky::ptr_t createSkyFromLegacyPreset(const std::string filename); +      //-------------------------------------------      connection_t                setSkyListChange(const change_signal_t::slot_type& cb);      connection_t                setWaterListChange(const change_signal_t::slot_type& cb); @@ -356,7 +362,7 @@ private:      void onTransitionDone(const LLSettingsBlender::ptr_t, bool isSky);      //=========================================================================      void                        legacyLoadAllPresets(); -    LLSD                        legacyLoadPreset(const std::string& path); +    static LLSD                 legacyLoadPreset(const std::string& path);      static std::string          getSysDir(const std::string &subdir);      static std::string          getUserDir(const std::string &subdir); diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp index d5162ef622..f95e41408f 100644 --- a/indra/newview/llfloaterfixedenvironment.cpp +++ b/indra/newview/llfloaterfixedenvironment.cpp @@ -36,14 +36,19 @@  #include "llnotificationsutil.h"  #include "llsliderctrl.h"  #include "lltabcontainer.h" +#include "llfilepicker.h"  // newview  #include "llpaneleditwater.h" +#include "llpaneleditsky.h"  #include "llsettingssky.h"  #include "llsettingswater.h"  #include "llenvironment.h" +#include "llagent.h" + +#include "llsettingsvo.h"  namespace  { @@ -55,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() @@ -70,22 +87,45 @@ BOOL LLFloaterFixedEnvironment::postBuild()      mTxtName->setCommitOnFocusLost(TRUE);      mTxtName->setCommitCallback([this](LLUICtrl *, const LLSD &) { onNameChanged(mTxtName->getValue().asString()); }); +    getChild<LLButton>(BUTTON_NAME_LOAD)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonLoad(); }); +    getChild<LLButton>(BUTTON_NAME_IMPORT)->setClickedCallback([this](LLUICtrl *, const LLSD &) { onButtonImport(); }); +    getChild<LLButton>(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;  }  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(); + +    mFlyoutControl->setMenuItemEnabled(ACTION_SAVE, enableApplyAndLoad); +    mFlyoutControl->setMenuItemEnabled(ACTION_SAVEAS, enableApplyAndLoad); + +    getChild<LLButton>(BUTTON_NAME_LOAD)->setEnabled(enableApplyAndLoad); +      mTxtName->setValue(mSettings->getName());      S32 count = mTab->getTabCount(); @@ -115,703 +155,256 @@ 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<LLSettingsWater>(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) +void LLFloaterFixedEnvironment::onButtonLoad()  { -    LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT,  -        std::static_pointer_cast<LLSettingsWater>(mSettings)); +    doLoadFromInventory();  } -//========================================================================= - -#if 0 -// virtual -BOOL LLFloaterEditSky::postBuild() +void LLFloaterFixedEnvironment::onButtonImport()  { -	mSkyPresetNameEditor = getChild<LLLineEditor>("sky_preset_name"); -	mSkyPresetCombo = getChild<LLComboBox>("sky_preset_combo"); -	mMakeDefaultCheckBox = getChild<LLCheckBoxCtrl>("make_default_cb"); -	mSaveButton = getChild<LLButton>("save"); -    mSkyAdapter = boost::make_shared<LLSkySettingsAdapter>(); - -    LLEnvironment::instance().setSkyListChange(boost::bind(&LLFloaterEditSky::onSkyPresetListChange, this)); - -	initCallbacks(); - -// 	// Create the sun position scrubber on the slider. -// 	getChild<LLMultiSliderCtrl>("WLSunPos")->addSlider(12.f); - -	return TRUE; +    doImportFromDisk();  } -// virtual -void LLFloaterEditSky::onOpen(const LLSD& key) +void LLFloaterFixedEnvironment::onButtonApply(LLUICtrl *ctrl, const LLSD &data)  { -	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)); +    std::string ctrl_action = ctrl->getName(); -	// Update floater title. -	setTitle(floater_title); - -	// Update the hint at the top. -	getChild<LLUICtrl>("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<LLButton>("cancel")->setCommitCallback(boost::bind(&LLFloaterEditSky::onBtnCancel, this)); - -	// Connect to region info updates. -	LLRegionInfoModel::instance().setUpdateCallback(boost::bind(&LLFloaterEditSky::onRegionInfoUpdate, this)); - -	//------------------------------------------------------------------------- -// LEGACY_ATMOSPHERICS -    // ambient -    getChild<LLUICtrl>("WLAmbient")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlMoved, this, _1, &mSkyAdapter->mAmbient)); - -	// blue horizon/density -	getChild<LLUICtrl>("WLBlueHorizon")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlMoved, this, _1, &mSkyAdapter->mBlueHorizon)); -    getChild<LLUICtrl>("WLBlueDensity")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlMoved, this, _1, &mSkyAdapter->mBlueDensity)); - -	// haze density, horizon, mult, and altitude -    getChild<LLUICtrl>("WLHazeDensity")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mHazeDensity)); -    getChild<LLUICtrl>("WLHazeHorizon")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mHazeHorizon)); -    getChild<LLUICtrl>("WLDensityMult")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mDensityMult)); -    getChild<LLUICtrl>("WLDistanceMult")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mDistanceMult)); -    getChild<LLUICtrl>("WLMaxAltitude")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mMaxAlt)); - -	// sunlight -    getChild<LLUICtrl>("WLSunlight")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlMoved, this, _1, &mSkyAdapter->mSunlight)); - -	// glow -    getChild<LLUICtrl>("WLGlowR")->setCommitCallback(boost::bind(&LLFloaterEditSky::onGlowRMoved, this, _1, &mSkyAdapter->mGlow)); -    getChild<LLUICtrl>("WLGlowB")->setCommitCallback(boost::bind(&LLFloaterEditSky::onGlowBMoved, this, _1, &mSkyAdapter->mGlow)); - -	// time of day -//     getChild<LLUICtrl>("WLSunPos")->setCommitCallback(boost::bind(&LLFloaterEditSky::onSunMoved, this, _1, &mSkyAdapter->mLightnorm));     // multi-slider -// 	getChild<LLTimeCtrl>("WLDayTime")->setCommitCallback(boost::bind(&LLFloaterEditSky::onTimeChanged, this));                          // time ctrl -//     getChild<LLUICtrl>("WLEastAngle")->setCommitCallback(boost::bind(&LLFloaterEditSky::onSunMoved, this, _1, &mSkyAdapter->mLightnorm)); -    getChild<LLJoystickQuaternion>("WLSunRotation")->setCommitCallback(boost::bind(&LLFloaterEditSky::onSunRotationChanged, this)); -    getChild<LLJoystickQuaternion>("WLMoonRotation")->setCommitCallback(boost::bind(&LLFloaterEditSky::onMoonRotationChanged, this)); - -	// Clouds - -	// Cloud Color -    getChild<LLUICtrl>("WLCloudColor")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlMoved, this, _1, &mSkyAdapter->mCloudColor)); - -	// Cloud -    getChild<LLUICtrl>("WLCloudX")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlRMoved, this, _1, &mSkyAdapter->mCloudMain)); -    getChild<LLUICtrl>("WLCloudY")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlGMoved, this, _1, &mSkyAdapter->mCloudMain)); -    getChild<LLUICtrl>("WLCloudDensity")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlBMoved, this, _1, &mSkyAdapter->mCloudMain)); - -	// Cloud Detail -    getChild<LLUICtrl>("WLCloudDetailX")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlRMoved, this, _1, &mSkyAdapter->mCloudDetail)); -    getChild<LLUICtrl>("WLCloudDetailY")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlGMoved, this, _1, &mSkyAdapter->mCloudDetail)); -    getChild<LLUICtrl>("WLCloudDetailDensity")->setCommitCallback(boost::bind(&LLFloaterEditSky::onColorControlBMoved, this, _1, &mSkyAdapter->mCloudDetail)); - -	// Cloud extras -    getChild<LLUICtrl>("WLCloudCoverage")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mCloudCoverage)); -    getChild<LLUICtrl>("WLCloudScale")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mCloudScale)); -	getChild<LLUICtrl>("WLCloudScrollX")->setCommitCallback(boost::bind(&LLFloaterEditSky::onCloudScrollXMoved, this, _1)); -	getChild<LLUICtrl>("WLCloudScrollY")->setCommitCallback(boost::bind(&LLFloaterEditSky::onCloudScrollYMoved, this, _1)); -     - -	// Dome -    getChild<LLUICtrl>("WLGamma")->setCommitCallback(boost::bind(&LLFloaterEditSky::onFloatControlMoved, this, _1, &mSkyAdapter->mWLGamma)); -	getChild<LLUICtrl>("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<LLMultiSliderCtrl>("WLSunPos")->setCurSliderValue(time24, TRUE); -// 	getChild<LLTimeCtrl>("WLDayTime")->setTime24(time24); -// 	childSetValue("WLEastAngle", azal.first / F_TWO_PI); -    getChild<LLJoystickQuaternion>("WLSunRotation")->setRotation(psky->getSunRotation()); -    getChild<LLJoystickQuaternion>("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 <k> first. -	LLColor4 color = from_ctrl.getColor4(); -	getChild<LLColorSwatchCtrl>(name)->set(color / k); +    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; +    }  } -// color control callbacks -void LLFloaterEditSky::onColorControlMoved(LLUICtrl* ctrl, WLColorControl* color_ctrl) +void LLFloaterFixedEnvironment::onButtonCancel()  { -	LLColorSwatchCtrl* swatch = static_cast<LLColorSwatchCtrl*>(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); +    // *TODO*: If changed issue a warning? +    this->closeFloater();  } -void LLFloaterEditSky::onColorControlRMoved(LLUICtrl* ctrl, void* userdata) +void LLFloaterFixedEnvironment::doApplyCreateNewInventory()  { -	LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); -	WLColorControl* color_ctrl = static_cast<WLColorControl *>(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); +    // This method knows what sort of settings object to create. +    LLSettingsVOBase::createInventoryItem(mSettings);  } -void LLFloaterEditSky::onColorControlGMoved(LLUICtrl* ctrl, void* userdata) +void LLFloaterFixedEnvironment::doApplyUpdateInventory()  { -    LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); -    WLColorControl* color_ctrl = static_cast<WLColorControl *>(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); +    // todo update existing inventory object.  } -void LLFloaterEditSky::onColorControlBMoved(LLUICtrl* ctrl, void* userdata) +void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where)  { -    LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); -    WLColorControl* color_ctrl = static_cast<WLColorControl *>(userdata); +    LLEnvironment::EnvSelection_t env(LLEnvironment::ENV_DEFAULT); +    bool updateSimulator( where != ACTION_APPLY_LOCAL ); -    F32 blue_value = sldr_ctrl->getValueF32(); -    F32 k = 1.0f; - -    if (color_ctrl->getIsSunOrAmbientColor()) -    { -        k = WL_SUN_AMBIENT_SLIDER_SCALE; -    } -    if (color_ctrl->getIsBlueHorizonOrDensity()) +    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      { -        k = WL_BLUE_HORIZON_DENSITY_SCALE; +        LL_WARNS("ENVIRONMENT") << "Unknown apply '" << where << "'" << LL_ENDL; +        return;      } -    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()) +    LLEnvironment::instance().setEnvironment(env, mSettings); +    if (updateSimulator)      { -        LLColor4 color = ctrl->getColor4(); -        F32 i = color_max(color) / scale; -        ctrl->setIntensity(i); -        std::string name = ctrl->getSliderName(); -        name.append("I"); - -        childSetValue(name, i); +        LL_WARNS("ENVIRONMENT") << "Attempting apply" << LL_ENDL;      }  } - -/// GLOW SPECIFIC CODE -void LLFloaterEditSky::onGlowRMoved(LLUICtrl* ctrl, void* userdata) +//------------------------------------------------------------------------- +bool LLFloaterFixedEnvironment::canUseInventory() const  { - -	LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); -	WLColorControl* color_ctrl = static_cast<WLColorControl *>(userdata); - -	// scaled by 20 -	color_ctrl->setRed((2 - sldr_ctrl->getValueF32()) * 20); - -	color_ctrl->update(mEditSettings); +    return !gAgent.getRegionCapability("UpdateSettingsAgentInventory").empty();  } -/// \NOTE that we want NEGATIVE (-) B -void LLFloaterEditSky::onGlowBMoved(LLUICtrl* ctrl, void* userdata) +bool LLFloaterFixedEnvironment::canApplyRegion() const  { -	LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); -	WLColorControl* color_ctrl = static_cast<WLColorControl *>(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); +    return true;  } -void LLFloaterEditSky::onFloatControlMoved(LLUICtrl* ctrl, void* userdata) +bool LLFloaterFixedEnvironment::canApplyParcel() const  { -	LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); -	WLFloatControl * floatControl = static_cast<WLFloatControl *>(userdata); - -	floatControl->setValue(sldr_ctrl->getValueF32() / floatControl->getMult()); - -	floatControl->update(mEditSettings); +    return false;  } +//========================================================================= +LLFloaterFixedEnvironmentWater::LLFloaterFixedEnvironmentWater(const LLSD &key): +    LLFloaterFixedEnvironment(key) +{} -// Lighting callbacks - -// time of day -void LLFloaterEditSky::onSunMoved(LLUICtrl* ctrl, void* userdata) +BOOL LLFloaterFixedEnvironmentWater::postBuild()  { -	LLMultiSliderCtrl* sun_msldr = getChild<LLMultiSliderCtrl>("WLSunPos"); -	LLSliderCtrl* east_sldr = getChild<LLSliderCtrl>("WLEastAngle"); -	LLTimeCtrl* time_ctrl = getChild<LLTimeCtrl>("WLDayTime"); -	WLColorControl* color_ctrl = static_cast<WLColorControl *>(userdata); - -	F32 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); +    if (!LLFloaterFixedEnvironment::postBuild()) +        return FALSE; -    LLVector4 sunnorm( mEditSettings->getSunDirection(), 1.f ); +    LLPanelSettingsWater * panel; +    panel = new LLPanelSettingsWaterMainTab; +    panel->buildFromFile("panel_settings_water.xml"); +    panel->setWater(std::static_pointer_cast<LLSettingsWater>(mSettings)); +    mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(true)); -	color_ctrl->update(mEditSettings); +    return TRUE;  } -void LLFloaterEditSky::onTimeChanged() +void LLFloaterFixedEnvironmentWater::updateEditEnvironment(void)  { -	F32 time24 = getChild<LLTimeCtrl>("WLDayTime")->getTime24(); -	getChild<LLMultiSliderCtrl>("WLSunPos")->setCurSliderValue(time24, TRUE); -    onSunMoved(getChild<LLUICtrl>("WLSunPos"), &(mSkyAdapter->mLightnorm)); +    LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT,  +        std::static_pointer_cast<LLSettingsWater>(mSettings));  } -void LLFloaterEditSky::onSunRotationChanged() +void LLFloaterFixedEnvironmentWater::onOpen(const LLSD& key)  { -    LLJoystickQuaternion* sun_spinner = getChild<LLJoystickQuaternion>("WLSunRotation"); -    LLQuaternion sunrot(sun_spinner->getRotation()); +    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? +    } -    mEditSettings->setSunRotation(sunrot); +    updateEditEnvironment(); +    syncronizeTabs(); +    refresh(); +    LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_EDIT, LLEnvironment::TRANSITION_FAST);  } -void LLFloaterEditSky::onMoonRotationChanged() +void LLFloaterFixedEnvironmentWater::onClose(bool app_quitting)  { -    LLJoystickQuaternion* moon_spinner = getChild<LLJoystickQuaternion>("WLMoonRotation"); -    LLQuaternion moonrot(moon_spinner->getRotation()); - -    mEditSettings->setMoonRotation(moonrot); +    mSettings.reset(); +    syncronizeTabs();  } -void LLFloaterEditSky::onStarAlphaMoved(LLUICtrl* ctrl) +void LLFloaterFixedEnvironmentWater::doLoadFromInventory()  { -	LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); -    mEditSettings->setStarBrightness(sldr_ctrl->getValueF32());  } -// Clouds -void LLFloaterEditSky::onCloudScrollXMoved(LLUICtrl* ctrl) -{ -	LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); -	// *HACK  all cloud scrolling is off by an additive of 10. -    mEditSettings->setCloudScrollRateX(sldr_ctrl->getValueF32() + 10.0f); -} +void LLFloaterFixedEnvironmentWater::doImportFromDisk() +{   // Load a a legacy Windlight XML from disk. -void LLFloaterEditSky::onCloudScrollYMoved(LLUICtrl* ctrl) -{ -	LLSliderCtrl* sldr_ctrl = static_cast<LLSliderCtrl*>(ctrl); +    LLFilePicker& picker = LLFilePicker::instance(); +    if (picker.getOpenFile(LLFilePicker::FFLOAD_XML)) +    { +        std::string filename = picker.getFirstFile(); -	// *HACK  all cloud scrolling is off by an additive of 10. -    mEditSettings->setCloudScrollRateY(sldr_ctrl->getValueF32() + 10.0f); -} +        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; +        } -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); -	} +        LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, legacywater); +        this->setEditSettings(legacywater); +        LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST, true); +    }  } -bool LLFloaterEditSky::isNewPreset() const -{ -	return mKey.asString() == "new"; -} +//========================================================================= +LLFloaterFixedEnvironmentSky::LLFloaterFixedEnvironmentSky(const LLSD &key) : +    LLFloaterFixedEnvironment(key) +{} -void LLFloaterEditSky::refreshSkyPresetsList() +BOOL LLFloaterFixedEnvironmentSky::postBuild()  { -	mSkyPresetCombo->removeall(); +    if (!LLFloaterFixedEnvironment::postBuild()) +        return FALSE; -    LLEnvironment::list_name_id_t list = LLEnvironment::instance().getSkyList(); +    LLPanelSettingsSky * panel; +    panel = new LLPanelSettingsSkyAtmosTab; +    panel->buildFromFile("panel_settings_sky_atmos.xml"); +    panel->setSky(std::static_pointer_cast<LLSettingsSky>(mSettings)); +    mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(true)); -    for (LLEnvironment::list_name_id_t::iterator it = list.begin(); it != list.end(); ++it) -    { -        mSkyPresetCombo->add((*it).first, LLSDArray((*it).first)((*it).second)); -    } +    panel = new LLPanelSettingsSkyCloudTab; +    panel->buildFromFile("panel_settings_sky_clouds.xml"); +    panel->setSky(std::static_pointer_cast<LLSettingsSky>(mSettings)); +    mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(false)); -	mSkyPresetCombo->setLabel(getString("combo_label")); -} +    panel = new LLPanelSettingsSkySunMoonTab; +    panel->buildFromFile("panel_settings_sky_sunmoon.xml"); +    panel->setSky(std::static_pointer_cast<LLSettingsSky>(mSettings)); +    mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(false)); -void LLFloaterEditSky::enableEditing(bool enable) -{ -	// Enable/disable the tab and their contents. -	LLTabContainer* tab_container = getChild<LLTabContainer>("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); +    return TRUE;  } -void LLFloaterEditSky::saveRegionSky() +void LLFloaterFixedEnvironmentSky::updateEditEnvironment(void)  { -#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 +    LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT,  +        std::static_pointer_cast<LLSettingsSky>(mSettings));  } -std::string LLFloaterEditSky::getSelectedPresetName() const +void LLFloaterFixedEnvironmentSky::onOpen(const LLSD& key)  { -    std::string name; -    if (mSkyPresetNameEditor->getVisible()) +    if (!mSettings)      { -        name = mSkyPresetNameEditor->getText(); -    } -    else -    { -        LLSD combo_val = mSkyPresetCombo->getValue(); -        name = combo_val[0].asString(); -    } - -    return name; -} +        // Initialize the settings, take a snapshot of the current water.  +        mSettings = LLEnvironment::instance().getEnvironmentFixedSky(LLEnvironment::ENV_CURRENT)->buildClone(); +        mSettings->setName("Snapshot sky (new)"); -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; +        // TODO: Should we grab sky and keep it around for reference?      } -    psky = psky->buildClone(); -    LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, psky); -    mEditSettings = psky; - -    syncControls(); -    enableEditing(true); - +    updateEditEnvironment(); +    syncronizeTabs(); +    refresh(); +    LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_EDIT, LLEnvironment::TRANSITION_FAST);  } -bool LLFloaterEditSky::onSaveAnswer(const LLSD& notification, const LLSD& response) +void LLFloaterFixedEnvironmentSky::onClose(bool app_quitting)  { -	S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - -	// If they choose save, do it.  Otherwise, don't do anything -	if (option == 0) -	{ -		onSaveConfirmed(); -	} - -	return false; +    mSettings.reset(); +    syncronizeTabs();  } -void LLFloaterEditSky::onSaveConfirmed() +void LLFloaterFixedEnvironmentSky::doLoadFromInventory()  { -    // 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); +void LLFloaterFixedEnvironmentSky::doImportFromDisk() +{   // Load a a legacy Windlight XML from disk. -    closeFloater(); -} +    LLFilePicker& picker = LLFilePicker::instance(); +    if (picker.getOpenFile(LLFilePicker::FFLOAD_XML)) +    { +        std::string filename = picker.getFirstFile(); -void LLFloaterEditSky::onBtnCancel() -{ -	closeFloater(); -} +        LL_WARNS("LAPRAS") << "Selected file: " << filename << LL_ENDL; +        LLSettingsSky::ptr_t legacysky = LLEnvironment::createSkyFromLegacyPreset(filename); -void LLFloaterEditSky::onSkyPresetListChange() -{ -    refreshSkyPresetsList(); -} +        if (!legacysky) +        {   // *TODO* Put up error dialog here.  Could not create water from filename +            return; +        } -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 +        LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, legacysky); +        this->setEditSettings(legacysky); +        LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_FAST, true); +    }  } -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 +//========================================================================= diff --git a/indra/newview/llfloaterfixedenvironment.h b/indra/newview/llfloaterfixedenvironment.h index 0d2d21533e..22ce167244 100644 --- a/indra/newview/llfloaterfixedenvironment.h +++ b/indra/newview/llfloaterfixedenvironment.h @@ -29,6 +29,7 @@  #include "llfloater.h"  #include "llsettingsbase.h" +#include "llflyoutcombobtn.h"  class LLTabContainer;  class LLButton; @@ -43,18 +44,19 @@ class LLFloaterFixedEnvironment : public LLFloater  public:                              LLFloaterFixedEnvironment(const LLSD &key); +                            ~LLFloaterFixedEnvironment();      virtual BOOL	        postBuild()         override;      virtual void            onFocusReceived()   override;      virtual void            onFocusLost()       override; -    void                    setEditSettings(LLSettingsBase::ptr_t &settings)    { mSettings = settings; syncronizeTabs(); } +    void                    setEditSettings(const LLSettingsBase::ptr_t &settings)  { mSettings = settings; syncronizeTabs(); refresh(); }      LLSettingsBase::ptr_t   getEditSettings()   const                           { return mSettings; }  protected:      virtual void            updateEditEnvironment() = 0; -    virtual void            refresh(); +    virtual void            refresh()           override;      virtual void            syncronizeTabs(); @@ -63,93 +65,66 @@ protected:      LLSettingsBase::ptr_t   mSettings; +    virtual void            doLoadFromInventory() = 0; +    virtual void            doImportFromDisk() = 0; +    virtual void            doApplyCreateNewInventory(); +    virtual void            doApplyUpdateInventory(); +    virtual void            doApplyEnvironment(const std::string &where); -private: -    void onNameChanged(const std::string &name); - -#if 0 - -	/*virtual*/	BOOL	postBuild(); -	/*virtual*/ void	onOpen(const LLSD& key); -	/*virtual*/ void	onClose(bool app_quitting); -	/*virtual*/ void	draw(); - - -	//-- WL stuff begins ------------------------------------------------------ - -	void syncControls(); /// sync up sliders with parameters - -	void setColorSwatch(const std::string& name, const WLColorControl& from_ctrl, F32 k); +    bool                    canUseInventory() const; +    bool                    canApplyRegion() const; +    bool                    canApplyParcel() const; -	// general purpose callbacks for dealing with color controllers -	void onColorControlMoved(LLUICtrl* ctrl, WLColorControl* color_ctrl); -	void onColorControlRMoved(LLUICtrl* ctrl, void* userdata); -	void onColorControlGMoved(LLUICtrl* ctrl, void* userdata); -	void onColorControlBMoved(LLUICtrl* ctrl, void* userdata); -	void onFloatControlMoved(LLUICtrl* ctrl, void* userdata); +    LLFlyoutComboBtn *      mFlyoutControl; -    void adjustIntensity(WLColorControl *ctrl, F32 color, F32 scale); - -	// lighting callbacks for glow -	void onGlowRMoved(LLUICtrl* ctrl, void* userdata); -	void onGlowBMoved(LLUICtrl* ctrl, void* userdata); - -	// lighting callbacks for sun -	void onSunMoved(LLUICtrl* ctrl, void* userdata); -	void onTimeChanged(); - -    void onSunRotationChanged(); -    void onMoonRotationChanged(); +private: +    void                    onNameChanged(const std::string &name); -	// for handling when the star slider is moved to adjust the alpha -	void onStarAlphaMoved(LLUICtrl* ctrl); +    void                    onButtonLoad(); +    void                    onButtonImport(); +    void                    onButtonApply(LLUICtrl *ctrl, const LLSD &data); +    void                    onButtonCancel(); -	// handle cloud scrolling -	void onCloudScrollXMoved(LLUICtrl* ctrl); -	void onCloudScrollYMoved(LLUICtrl* ctrl); +}; -	//-- WL stuff ends -------------------------------------------------------- +class LLFloaterFixedEnvironmentWater : public LLFloaterFixedEnvironment +{ +    LOG_CLASS(LLFloaterFixedEnvironmentWater); -	void reset(); /// reset the floater to its initial state -	bool isNewPreset() const; -	void refreshSkyPresetsList(); -	void enableEditing(bool enable); -	void saveRegionSky(); -	std::string getSelectedPresetName() const; +public: +    LLFloaterFixedEnvironmentWater(const LLSD &key); -	void onSkyPresetNameEdited(); -	void onSkyPresetSelected(); -	bool onSaveAnswer(const LLSD& notification, const LLSD& response); -	void onSaveConfirmed(); +    BOOL	                postBuild()                 override; -	void onBtnSave(); -	void onBtnCancel(); +    virtual void            onOpen(const LLSD& key)     override; +    virtual void            onClose(bool app_quitting)  override; -	void onSkyPresetListChange(); -	void onRegionSettingsChange(); -	void onRegionInfoUpdate(); +protected: +    virtual void            updateEditEnvironment()     override; -    LLSettingsSky::ptr_t mEditSettings; +    virtual void            doLoadFromInventory()       override; +    virtual void            doImportFromDisk()          override; -	LLLineEditor*	mSkyPresetNameEditor; -	LLComboBox*		mSkyPresetCombo; -	LLCheckBoxCtrl*	mMakeDefaultCheckBox; -	LLButton*		mSaveButton; -    LLSkySettingsAdapterPtr mSkyAdapter; -#endif +private:  }; -class LLFloaterFixedEnvironmentWater : public LLFloaterFixedEnvironment +class LLFloaterFixedEnvironmentSky : public LLFloaterFixedEnvironment  { -    LOG_CLASS(LLFloaterFixedEnvironmentWater); +    LOG_CLASS(LLFloaterFixedEnvironmentSky);  public: -    LLFloaterFixedEnvironmentWater(const LLSD &key); +    LLFloaterFixedEnvironmentSky(const LLSD &key); -    BOOL	        postBuild() override; +    BOOL	                postBuild()                 override; + +    virtual void            onOpen(const LLSD& key)     override; +    virtual void            onClose(bool app_quitting)  override; + +protected: +    virtual void            updateEditEnvironment()     override; -protected:     -    virtual void    updateEditEnvironment() override; +    virtual void            doLoadFromInventory()       override; +    virtual void            doImportFromDisk()          override;  private:  }; @@ -159,7 +134,7 @@ class LLSettingsEditPanel : public LLPanel  public:      virtual void setSettings(LLSettingsBase::ptr_t &) = 0; -    virtual void refresh() = 0; +//     virtual void refresh() override;  protected:      LLSettingsEditPanel() : diff --git a/indra/newview/llflyoutcombobtn.cpp b/indra/newview/llflyoutcombobtn.cpp new file mode 100644 index 0000000000..efe76b5653 --- /dev/null +++ b/indra/newview/llflyoutcombobtn.cpp @@ -0,0 +1,127 @@ +/**  + * @file llsaveoutfitcombobtn.cpp + * @brief Represents outfit save/save as combo button. + * + * $LicenseInfo:firstyear=2010&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, 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 "llflyoutcombobtn.h" +#include "llviewermenu.h" + +LLFlyoutComboBtn::LLFlyoutComboBtn(LLPanel* parent, const std::string &action_button, const std::string &flyout_button, const std::string &menu_file) : +	mParent(parent), +    mActionButton(action_button), +    mFlyoutButton(flyout_button) +{ +	// register action mapping before creating menu +	LLUICtrl::CommitCallbackRegistry::ScopedRegistrar save_registar; +    save_registar.add("FlyoutCombo.Button.Action", [this](LLUICtrl *ctrl, const LLSD &data) { onFlyoutItemSelected(ctrl, data); }); + +    mParent->childSetAction(flyout_button, [this](LLUICtrl *ctrl, const LLSD &data) { onFlyoutButton(ctrl, data); }); +    mParent->childSetAction(action_button, [this](LLUICtrl *ctrl, const LLSD &data) { onFlyoutAction(ctrl, data); }); + +	mFlyoutMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu> (menu_file, gMenuHolder, +			LLViewerMenuHolderGL::child_registry_t::instance()); + +    // select the first item in the list. +    setSelectedItem(0); +} + +void LLFlyoutComboBtn::setAction(LLUICtrl::commit_callback_t cb) +{ +    mActionSignal.connect(cb); +} + + +U32 LLFlyoutComboBtn::getItemCount() +{ +    return mFlyoutMenu->getItemCount(); +} + +void LLFlyoutComboBtn::setSelectedItem(S32 itemno) +{ +    LLMenuItemGL *pitem = mFlyoutMenu->getItem(itemno); +    setSelectedItem(pitem); +} + +void LLFlyoutComboBtn::setSelectedItem(const std::string &item) +{ +    LLMenuItemGL *pitem = mFlyoutMenu->getChild<LLMenuItemGL>(item, false); +    setSelectedItem(pitem); +} + +void LLFlyoutComboBtn::setSelectedItem(LLMenuItemGL *pitem) +{ +    if (!pitem) +    { +        LL_WARNS("INTERFACE") << "NULL item selected" << LL_ENDL; +        return; +    } + +    mSelectedName = pitem->getName(); +     +    LLButton *action_button = mParent->getChild<LLButton>(mActionButton); +    action_button->setEnabled(pitem->getEnabled()); +    action_button->setLabel(pitem->getLabel()); +} + +void LLFlyoutComboBtn::setMenuItemEnabled(const std::string& item, bool enabled) +{ +    mFlyoutMenu->setItemEnabled(item, enabled); +    if (item == mSelectedName) +    { +        mParent->getChildView(mActionButton)->setEnabled(enabled); +    } +} + +void LLFlyoutComboBtn::setShownBtnEnabled(bool enabled) +{ +    mParent->getChildView(mActionButton)->setEnabled(enabled); +} + +void LLFlyoutComboBtn::onFlyoutButton(LLUICtrl *ctrl, const LLSD &data) +{ +	S32 x, y; +	LLUI::getMousePositionLocal(mParent, &x, &y); + +	mFlyoutMenu->updateParent(LLMenuGL::sMenuContainer); +	LLMenuGL::showPopup(mParent, mFlyoutMenu, x, y); +} + +void LLFlyoutComboBtn::onFlyoutItemSelected(LLUICtrl *ctrl, const LLSD &data) +{ +    LLMenuItemGL *pmenuitem = static_cast<LLMenuItemGL*>(ctrl); +    setSelectedItem(pmenuitem); + +    onFlyoutAction(pmenuitem, data); +} + +void LLFlyoutComboBtn::onFlyoutAction(LLUICtrl *ctrl, const LLSD &data) +{ +    LLMenuItemGL *pmenuitem = mFlyoutMenu->getChild<LLMenuItemGL>(mSelectedName); + +    if (!mActionSignal.empty()) +        mActionSignal(pmenuitem, data); +} + diff --git a/indra/newview/llflyoutcombobtn.h b/indra/newview/llflyoutcombobtn.h new file mode 100644 index 0000000000..ebf7564422 --- /dev/null +++ b/indra/newview/llflyoutcombobtn.h @@ -0,0 +1,71 @@ +/**  + * @file llsaveoutfitcombobtn.h + * @brief Represents outfit save/save as combo button. + * + * $LicenseInfo:firstyear=2010&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, 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$ + */ + +#ifndef LL_LLSAVECOMBOBTN_H +#define LL_LLSAVECOMBOBTN_H + +/*TODO: Make this button generic */ + +class LLButton; + +#include "lltoggleablemenu.h" + +/** + * Represents outfit Save/Save As combo button. + */ +class LLFlyoutComboBtn +{ +    LOG_CLASS(LLFlyoutComboBtn); +public: +    LLFlyoutComboBtn(LLPanel* parent, const std::string &action_button, const std::string &flyout_button, const std::string &menu_file); + +	void setMenuItemEnabled(const std::string &item, bool enabled); +	void setShownBtnEnabled(bool enabled); + +    U32 getItemCount(); +    void setSelectedItem(S32 itemno); +    void setSelectedItem(const std::string &item); + +    void setAction(LLUICtrl::commit_callback_t cb); + +protected: +    void onFlyoutButton(LLUICtrl *, const LLSD &); +    void onFlyoutItemSelected(LLUICtrl *, const LLSD &); +    void onFlyoutAction(LLUICtrl *, const LLSD &); + +    void setSelectedItem(LLMenuItemGL *pitem); + +private: +	LLPanel *                   mParent; +	LLToggleableMenu *          mFlyoutMenu; +    std::string                 mActionButton; +    std::string                 mFlyoutButton; + +    std::string                 mSelectedName; + +    LLUICtrl::commit_signal_t   mActionSignal; +}; +#endif // LL_LLSAVEOUTFITCOMBOBTN_H diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index fbc35e9192..9311861d83 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -82,6 +82,8 @@  #include "lllandmarkactions.h"  #include "llpanellandmarks.h" +#include "llenvironment.h" +  #include <boost/shared_ptr.hpp>  void copy_slurl_to_clipboard_callback_inv(const std::string& slurl); @@ -4029,10 +4031,18 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t&   items                      items.push_back(std::string("New Gesture"));                      items.push_back(std::string("New Clothes"));                      items.push_back(std::string("New Body Parts")); +                    items.push_back(std::string("New Settings"));                      items.push_back(std::string("upload_def")); + +                    if (!LLEnvironment::instance().isInventoryEnabled()) +                    { +                        disabled_items.push_back("New Settings"); +                    } +                  }  			}  			getClipboardEntries(false, items, disabled_items, flags); +  		}  		else  		{ diff --git a/indra/newview/llpaneleditsky.cpp b/indra/newview/llpaneleditsky.cpp new file mode 100644 index 0000000000..e10af29e82 --- /dev/null +++ b/indra/newview/llpaneleditsky.cpp @@ -0,0 +1,388 @@ +/** +* @file llpaneleditsky.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 "llpaneleditsky.h" + +#include "llslider.h" +#include "lltexturectrl.h" +#include "llcolorswatch.h" +#include "lljoystickbutton.h" + +namespace +{    +    // Atmosphere Tab +    const std::string   FIELD_SKY_AMBIENT_LIGHT("ambient_light"); +    const std::string   FIELD_SKY_BLUE_HORIZON("blue_horizon"); +    const std::string   FIELD_SKY_BLUE_DENSITY("blue_density"); +    const std::string   FIELD_SKY_HAZE_HORIZON("haze_horizon"); +    const std::string   FIELD_SKY_HAZE_DENSITY("haze_density"); +    const std::string   FIELD_SKY_SCENE_GAMMA("scene_gamma"); +    const std::string   FIELD_SKY_DENSITY_MULTIP("density_multip"); +    const std::string   FIELD_SKY_DISTANCE_MULTIP("distance_multip"); +    const std::string   FIELD_SKY_MAX_ALT("max_alt"); + +    const std::string   FIELD_SKY_CLOUD_COLOR("cloud_color"); +    const std::string   FIELD_SKY_CLOUD_COVERAGE("cloud_coverage"); +    const std::string   FIELD_SKY_CLOUD_SCALE("cloud_scale"); +    const std::string   FIELD_SKY_CLOUD_SCROLL_X("cloud_scroll_x"); +    const std::string   FIELD_SKY_CLOUD_SCROLL_Y("cloud_scroll_y"); +    const std::string   FIELD_SKY_CLOUD_MAP("cloud_map"); +    const std::string   FIELD_SKY_CLOUD_DENSITY_X("cloud_density_x"); +    const std::string   FIELD_SKY_CLOUD_DENSITY_Y("cloud_density_y"); +    const std::string   FIELD_SKY_CLOUD_DENSITY_D("cloud_density_d"); +    const std::string   FIELD_SKY_CLOUD_DETAIL_X("cloud_detail_x"); +    const std::string   FIELD_SKY_CLOUD_DETAIL_Y("cloud_detail_y"); +    const std::string   FIELD_SKY_CLOUD_DETAIL_D("cloud_detail_d"); + +    const std::string   FIELD_SKY_SUN_MOON_COLOR("sun_moon_color"); +    const std::string   FIELD_SKY_GLOW_FOCUS("glow_focus"); +    const std::string   FIELD_SKY_GLOW_SIZE("glow_size"); +    const std::string   FIELD_SKY_STAR_BRIGHTNESS("star_brightness"); +    const std::string   FIELD_SKY_SUN_ROTATION("sun_rotation"); +    const std::string   FIELD_SKY_SUN_IMAGE("sun_image"); +    const std::string   FIELD_SKY_MOON_ROTATION("moon_rotation"); +    const std::string   FIELD_SKY_MOON_IMAGE("moon_image"); + +    const F32 SLIDER_SCALE_SUN_AMBIENT(3.0f); +    const F32 SLIDER_SCALE_BLUE_HORIZON_DENSITY(2.0f); +    const F32 SLIDER_SCALE_GLOW_R(20.0f); +    const F32 SLIDER_SCALE_GLOW_B(-5.0f); +} + +//========================================================================== +LLPanelSettingsSky::LLPanelSettingsSky() : +    LLSettingsEditPanel(), +    mSkySettings() +{ + +} + + +//========================================================================== +LLPanelSettingsSkyAtmosTab::LLPanelSettingsSkyAtmosTab() : +    LLPanelSettingsSky() +{ +} + + +BOOL LLPanelSettingsSkyAtmosTab::postBuild() +{ +    getChild<LLUICtrl>(FIELD_SKY_AMBIENT_LIGHT)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onAmbientLightChanged(); }); +    getChild<LLUICtrl>(FIELD_SKY_BLUE_HORIZON)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onBlueHorizonChanged(); }); +    getChild<LLUICtrl>(FIELD_SKY_BLUE_DENSITY)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onBlueDensityChanged(); }); +    getChild<LLUICtrl>(FIELD_SKY_HAZE_HORIZON)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onHazeHorizonChanged(); }); +    getChild<LLUICtrl>(FIELD_SKY_HAZE_DENSITY)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onHazeDensityChanged(); }); +    getChild<LLUICtrl>(FIELD_SKY_SCENE_GAMMA)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSceneGammaChanged(); }); +    getChild<LLUICtrl>(FIELD_SKY_DENSITY_MULTIP)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onDensityMultipChanged(); }); +    getChild<LLUICtrl>(FIELD_SKY_DISTANCE_MULTIP)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onDistanceMultipChanged(); }); +    getChild<LLUICtrl>(FIELD_SKY_MAX_ALT)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMaxAltChanged(); }); + +    refresh(); + +    return TRUE; +} + +void LLPanelSettingsSkyAtmosTab::refresh() +{ +    if (!mSkySettings) +    { +        setAllChildrenEnabled(FALSE); +        setEnabled(FALSE); +        return; +    } + +    setEnabled(TRUE); +    setAllChildrenEnabled(TRUE); + +    getChild<LLColorSwatchCtrl>(FIELD_SKY_AMBIENT_LIGHT)->set(mSkySettings->getAmbientColor() / SLIDER_SCALE_SUN_AMBIENT); +    getChild<LLColorSwatchCtrl>(FIELD_SKY_BLUE_HORIZON)->set(mSkySettings->getBlueHorizon() / SLIDER_SCALE_BLUE_HORIZON_DENSITY); +    getChild<LLColorSwatchCtrl>(FIELD_SKY_BLUE_DENSITY)->set(mSkySettings->getBlueDensity() / SLIDER_SCALE_BLUE_HORIZON_DENSITY); + +    getChild<LLUICtrl>(FIELD_SKY_HAZE_HORIZON)->setValue(mSkySettings->getHazeHorizon()); +    getChild<LLUICtrl>(FIELD_SKY_HAZE_DENSITY)->setValue(mSkySettings->getHazeDensity()); +    getChild<LLUICtrl>(FIELD_SKY_SCENE_GAMMA)->setValue(mSkySettings->getGamma()); +    getChild<LLUICtrl>(FIELD_SKY_DENSITY_MULTIP)->setValue(mSkySettings->getDensityMultiplier()); +    getChild<LLUICtrl>(FIELD_SKY_DISTANCE_MULTIP)->setValue(mSkySettings->getDistanceMultiplier()); +    getChild<LLUICtrl>(FIELD_SKY_MAX_ALT)->setValue(mSkySettings->getMaxY()); + +} + +//------------------------------------------------------------------------- +void LLPanelSettingsSkyAtmosTab::onAmbientLightChanged() +{ +    mSkySettings->setAmbientColor(LLColor3(getChild<LLColorSwatchCtrl>(FIELD_SKY_AMBIENT_LIGHT)->get() * SLIDER_SCALE_SUN_AMBIENT)); +} + +void LLPanelSettingsSkyAtmosTab::onBlueHorizonChanged() +{ +    mSkySettings->setBlueHorizon(LLColor3(getChild<LLColorSwatchCtrl>(FIELD_SKY_BLUE_HORIZON)->get() * SLIDER_SCALE_BLUE_HORIZON_DENSITY)); +} + +void LLPanelSettingsSkyAtmosTab::onBlueDensityChanged() +{ +    mSkySettings->setBlueDensity(LLColor3(getChild<LLColorSwatchCtrl>(FIELD_SKY_BLUE_DENSITY)->get() * SLIDER_SCALE_BLUE_HORIZON_DENSITY)); +} + +void LLPanelSettingsSkyAtmosTab::onHazeHorizonChanged() +{ +    mSkySettings->setHazeHorizon(getChild<LLUICtrl>(FIELD_SKY_HAZE_HORIZON)->getValue().asReal()); +} + +void LLPanelSettingsSkyAtmosTab::onHazeDensityChanged() +{ +    mSkySettings->setHazeDensity(getChild<LLUICtrl>(FIELD_SKY_HAZE_DENSITY)->getValue().asReal()); +} + +void LLPanelSettingsSkyAtmosTab::onSceneGammaChanged() +{ +    mSkySettings->setGamma(getChild<LLUICtrl>(FIELD_SKY_SCENE_GAMMA)->getValue().asReal()); +} + +void LLPanelSettingsSkyAtmosTab::onDensityMultipChanged() +{ +    mSkySettings->setDensityMultiplier(getChild<LLUICtrl>(FIELD_SKY_DENSITY_MULTIP)->getValue().asReal()); +} + +void LLPanelSettingsSkyAtmosTab::onDistanceMultipChanged() +{ +    mSkySettings->setDistanceMultiplier(getChild<LLUICtrl>(FIELD_SKY_DISTANCE_MULTIP)->getValue().asReal()); +} + +void LLPanelSettingsSkyAtmosTab::onMaxAltChanged() +{ +    mSkySettings->setMaxY(getChild<LLUICtrl>(FIELD_SKY_MAX_ALT)->getValue().asReal()); +} + +//========================================================================== +LLPanelSettingsSkyCloudTab::LLPanelSettingsSkyCloudTab() : +    LLPanelSettingsSky() +{ +} + + +BOOL LLPanelSettingsSkyCloudTab::postBuild() +{ +    getChild<LLUICtrl>(FIELD_SKY_CLOUD_COLOR)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudColorChanged(); }); +    getChild<LLUICtrl>(FIELD_SKY_CLOUD_COVERAGE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudCoverageChanged(); }); +    getChild<LLUICtrl>(FIELD_SKY_CLOUD_SCALE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudScaleChanged(); }); +    getChild<LLUICtrl>(FIELD_SKY_CLOUD_SCROLL_X)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudScrollChanged(); }); +    getChild<LLUICtrl>(FIELD_SKY_CLOUD_SCROLL_Y)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudScrollChanged(); }); +    getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudMapChanged(); }); +//    getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP)->setDefaultImageAssetID(LLSettingsSky::DEFAULT_CLOUD_TEXTURE_ID); + +    getChild<LLUICtrl>(FIELD_SKY_CLOUD_DENSITY_X)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudDensityChanged(); }); +    getChild<LLUICtrl>(FIELD_SKY_CLOUD_DENSITY_Y)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudDensityChanged(); }); +    getChild<LLUICtrl>(FIELD_SKY_CLOUD_DENSITY_D)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudDensityChanged(); }); +    getChild<LLUICtrl>(FIELD_SKY_CLOUD_DETAIL_X)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudDetailChanged(); }); +    getChild<LLUICtrl>(FIELD_SKY_CLOUD_DETAIL_Y)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudDetailChanged(); }); +    getChild<LLUICtrl>(FIELD_SKY_CLOUD_DETAIL_D)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudDetailChanged(); }); + +    refresh(); + +    return TRUE; +} + +void LLPanelSettingsSkyCloudTab::refresh() +{ +    if (!mSkySettings) +    { +        setAllChildrenEnabled(FALSE); +        setEnabled(FALSE); +        return; +    } + +    setEnabled(TRUE); +    setAllChildrenEnabled(TRUE); + +    getChild<LLColorSwatchCtrl>(FIELD_SKY_CLOUD_COLOR)->set(mSkySettings->getCloudColor()); +    getChild<LLUICtrl>(FIELD_SKY_CLOUD_COVERAGE)->setValue(mSkySettings->getCloudShadow()); +    getChild<LLUICtrl>(FIELD_SKY_CLOUD_SCALE)->setValue(mSkySettings->getCloudScale()); + +    LLVector2 cloudScroll(mSkySettings->getCloudScrollRate()); +    getChild<LLUICtrl>(FIELD_SKY_CLOUD_SCROLL_X)->setValue(cloudScroll[0]); +    getChild<LLUICtrl>(FIELD_SKY_CLOUD_SCROLL_Y)->setValue(cloudScroll[1]); + +    getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP)->setValue(mSkySettings->getCloudNoiseTextureId()); + +    LLVector3 cloudDensity(mSkySettings->getCloudPosDensity1().getValue()); +    getChild<LLUICtrl>(FIELD_SKY_CLOUD_DENSITY_X)->setValue(cloudDensity[0]); +    getChild<LLUICtrl>(FIELD_SKY_CLOUD_DENSITY_Y)->setValue(cloudDensity[1]); +    getChild<LLUICtrl>(FIELD_SKY_CLOUD_DENSITY_D)->setValue(cloudDensity[2]); + +    LLVector3 cloudDetail(mSkySettings->getCloudPosDensity1().getValue()); +    getChild<LLUICtrl>(FIELD_SKY_CLOUD_DETAIL_X)->setValue(cloudDetail[0]); +    getChild<LLUICtrl>(FIELD_SKY_CLOUD_DETAIL_Y)->setValue(cloudDetail[1]); +    getChild<LLUICtrl>(FIELD_SKY_CLOUD_DETAIL_D)->setValue(cloudDetail[2]); +} + +//------------------------------------------------------------------------- +void LLPanelSettingsSkyCloudTab::onCloudColorChanged() +{ +    mSkySettings->setCloudColor(LLColor3(getChild<LLColorSwatchCtrl>(FIELD_SKY_CLOUD_COLOR)->get())); +} + +void LLPanelSettingsSkyCloudTab::onCloudCoverageChanged() +{ +    mSkySettings->setCloudShadow(getChild<LLUICtrl>(FIELD_SKY_CLOUD_COVERAGE)->getValue().asReal()); +} + +void LLPanelSettingsSkyCloudTab::onCloudScaleChanged() +{ +    mSkySettings->setCloudScale(getChild<LLUICtrl>(FIELD_SKY_CLOUD_SCALE)->getValue().asReal()); +} + +void LLPanelSettingsSkyCloudTab::onCloudScrollChanged() +{ +    LLVector2 scroll(getChild<LLUICtrl>(FIELD_SKY_CLOUD_SCROLL_X)->getValue().asReal(),  +        getChild<LLUICtrl>(FIELD_SKY_CLOUD_SCROLL_Y)->getValue().asReal()); + +    mSkySettings->setCloudScrollRate(scroll); +} + +void LLPanelSettingsSkyCloudTab::onCloudMapChanged() +{ +    mSkySettings->setCloudNoiseTextureId(getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP)->getValue().asUUID()); +} + +void LLPanelSettingsSkyCloudTab::onCloudDensityChanged() +{ +    LLColor3 density(getChild<LLUICtrl>(FIELD_SKY_CLOUD_DENSITY_X)->getValue().asReal(),  +        getChild<LLUICtrl>(FIELD_SKY_CLOUD_DENSITY_Y)->getValue().asReal(),  +        getChild<LLUICtrl>(FIELD_SKY_CLOUD_DENSITY_D)->getValue().asReal()); + +    mSkySettings->setCloudPosDensity1(density); +} + +void LLPanelSettingsSkyCloudTab::onCloudDetailChanged() +{ +    LLColor3 detail(getChild<LLUICtrl>(FIELD_SKY_CLOUD_DETAIL_X)->getValue().asReal(), +        getChild<LLUICtrl>(FIELD_SKY_CLOUD_DETAIL_Y)->getValue().asReal(), +        getChild<LLUICtrl>(FIELD_SKY_CLOUD_DETAIL_D)->getValue().asReal()); + +    mSkySettings->setCloudPosDensity2(detail); +} + +//========================================================================== +LLPanelSettingsSkySunMoonTab::LLPanelSettingsSkySunMoonTab() : +    LLPanelSettingsSky() +{ +} + + +BOOL LLPanelSettingsSkySunMoonTab::postBuild() +{ +    getChild<LLUICtrl>(FIELD_SKY_SUN_MOON_COLOR)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunMoonColorChanged(); }); +    getChild<LLUICtrl>(FIELD_SKY_GLOW_FOCUS)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onGlowChanged(); }); +    getChild<LLUICtrl>(FIELD_SKY_GLOW_SIZE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onGlowChanged(); }); +    getChild<LLUICtrl>(FIELD_SKY_STAR_BRIGHTNESS)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onStarBrightnessChanged(); }); +    getChild<LLUICtrl>(FIELD_SKY_SUN_ROTATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunRotationChanged(); }); +    getChild<LLUICtrl>(FIELD_SKY_SUN_IMAGE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onSunImageChanged(); }); +//    getChild<LLTextureCtrl>(FIELD_SKY_SUN_IMAGE)->setDefaultImageAssetID(LLSettingsSky:: ); +    getChild<LLUICtrl>(FIELD_SKY_MOON_ROTATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonRotationChanged(); }); +    getChild<LLUICtrl>(FIELD_SKY_MOON_IMAGE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonImageChanged(); }); +//    getChild<LLTextureCtrl>(FIELD_SKY_MOON_IMAGE)->setDefaultImageAssetID(LLSettingsSky:: ); + +    refresh(); + +    return TRUE; +} + +void LLPanelSettingsSkySunMoonTab::refresh() +{ +    if (!mSkySettings) +    { +        setAllChildrenEnabled(FALSE); +        setEnabled(FALSE); +        return; +    } + +    setEnabled(TRUE); +    setAllChildrenEnabled(TRUE); + +    getChild<LLColorSwatchCtrl>(FIELD_SKY_SUN_MOON_COLOR)->set(mSkySettings->getSunlightColor() / SLIDER_SCALE_SUN_AMBIENT); + +    LLColor3 glow(mSkySettings->getGlow()); + +    glow.mV[0] = 2 - (glow.mV[0] / SLIDER_SCALE_GLOW_R); +    glow.mV[2] /= SLIDER_SCALE_GLOW_B; + +    getChild<LLUICtrl>(FIELD_SKY_GLOW_FOCUS)->setValue(glow.mV[0]); +    getChild<LLUICtrl>(FIELD_SKY_GLOW_SIZE)->setValue(glow.mV[2]); + +    getChild<LLUICtrl>(FIELD_SKY_STAR_BRIGHTNESS)->setValue(mSkySettings->getStarBrightness()); +    getChild<LLJoystickQuaternion>(FIELD_SKY_SUN_ROTATION)->setRotation(mSkySettings->getSunRotation()); +    getChild<LLTextureCtrl>(FIELD_SKY_SUN_IMAGE)->setValue(mSkySettings->getSunTextureId()); +    getChild<LLJoystickQuaternion>(FIELD_SKY_MOON_ROTATION)->setRotation(mSkySettings->getMoonRotation()); +    getChild<LLTextureCtrl>(FIELD_SKY_MOON_IMAGE)->setValue(mSkySettings->getMoonTextureId()); +} + +//------------------------------------------------------------------------- +void LLPanelSettingsSkySunMoonTab::onSunMoonColorChanged() +{ +    LLColor3 color(getChild<LLColorSwatchCtrl>(FIELD_SKY_SUN_MOON_COLOR)->get()); + +    color *= SLIDER_SCALE_SUN_AMBIENT; + +    mSkySettings->setSunlightColor(color); +} + +void LLPanelSettingsSkySunMoonTab::onGlowChanged() +{ +    LLColor3 glow(getChild<LLUICtrl>(FIELD_SKY_GLOW_FOCUS)->getValue().asReal(), 0.0f,  +        getChild<LLUICtrl>(FIELD_SKY_GLOW_SIZE)->getValue().asReal()); + +    glow.mV[0] = (2 - glow.mV[0]) * SLIDER_SCALE_GLOW_R;  +    glow.mV[2] *= SLIDER_SCALE_GLOW_B; + +    mSkySettings->setGlow(glow); +} + +void LLPanelSettingsSkySunMoonTab::onStarBrightnessChanged() +{ +    mSkySettings->setStarBrightness(getChild<LLUICtrl>(FIELD_SKY_STAR_BRIGHTNESS)->getValue().asReal()); +} + +void LLPanelSettingsSkySunMoonTab::onSunRotationChanged() +{ +    mSkySettings->setSunRotation(getChild<LLJoystickQuaternion>(FIELD_SKY_SUN_ROTATION)->getRotation()); +} + +void LLPanelSettingsSkySunMoonTab::onSunImageChanged() +{ +    mSkySettings->setSunTextureId(getChild<LLTextureCtrl>(FIELD_SKY_SUN_IMAGE)->getValue().asUUID()); +} + +void LLPanelSettingsSkySunMoonTab::onMoonRotationChanged() +{ +    mSkySettings->setMoonRotation(getChild<LLJoystickQuaternion>(FIELD_SKY_MOON_ROTATION)->getRotation()); +} + +void LLPanelSettingsSkySunMoonTab::onMoonImageChanged() +{ +    mSkySettings->setMoonTextureId(getChild<LLTextureCtrl>(FIELD_SKY_MOON_IMAGE)->getValue().asUUID()); +} diff --git a/indra/newview/llpaneleditsky.h b/indra/newview/llpaneleditsky.h new file mode 100644 index 0000000000..497c98af1f --- /dev/null +++ b/indra/newview/llpaneleditsky.h @@ -0,0 +1,124 @@ +/** +* @file llpaneleditsky.h +* @brief Panels for sky settings +* +* $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$ +*/ + +#ifndef LLPANEL_EDIT_SKY_H +#define LLPANEL_EDIT_SKY_H + +#include "llpanel.h" +#include "llsettingssky.h" + +#include "llfloaterfixedenvironment.h" + +//========================================================================= +class LLSlider; +class LLColorSwatchCtrl; +class LLTextureCtrl; + +//========================================================================= +class LLPanelSettingsSky : public LLSettingsEditPanel +{ +    LOG_CLASS(LLPanelSettingsSky); + +public: +                            LLPanelSettingsSky(); + +    virtual void            setSettings(LLSettingsBase::ptr_t &settings) override   { setSky(std::static_pointer_cast<LLSettingsSky>(settings)); } + +    LLSettingsSky::ptr_t    getSky() const                                          { return mSkySettings; } +    void                    setSky(const LLSettingsSky::ptr_t &sky)                 { mSkySettings = sky; refresh(); } + +protected: +    LLSettingsSky::ptr_t  mSkySettings; +}; + +class LLPanelSettingsSkyAtmosTab : public LLPanelSettingsSky +{ +    LOG_CLASS(LLPanelSettingsSkyAtmosTab); + +public: +                            LLPanelSettingsSkyAtmosTab(); + +    virtual BOOL	        postBuild() override; + +protected: +    virtual void            refresh() override; + +private: +    void                    onAmbientLightChanged(); +    void                    onBlueHorizonChanged(); +    void                    onBlueDensityChanged(); +    void                    onHazeHorizonChanged(); +    void                    onHazeDensityChanged(); +    void                    onSceneGammaChanged(); +    void                    onDensityMultipChanged(); +    void                    onDistanceMultipChanged(); +    void                    onMaxAltChanged(); +}; + +class LLPanelSettingsSkyCloudTab : public LLPanelSettingsSky +{ +    LOG_CLASS(LLPanelSettingsSkyCloudTab); + +public: +                            LLPanelSettingsSkyCloudTab(); + +    virtual BOOL	        postBuild() override; + +protected: +    virtual void            refresh() override; + +private: +    void                    onCloudColorChanged(); +    void                    onCloudCoverageChanged(); +    void                    onCloudScaleChanged(); +    void                    onCloudScrollChanged(); +    void                    onCloudMapChanged(); +    void                    onCloudDensityChanged(); +    void                    onCloudDetailChanged(); +}; + +class LLPanelSettingsSkySunMoonTab : public LLPanelSettingsSky +{ +    LOG_CLASS(LLPanelSettingsSkySunMoonTab); + +public: +                            LLPanelSettingsSkySunMoonTab(); + +    virtual BOOL	        postBuild() override; + +protected: +    virtual void            refresh() override; + +private: +    void                    onSunMoonColorChanged(); +    void                    onGlowChanged(); +    void                    onStarBrightnessChanged(); +    void                    onSunRotationChanged(); +    void                    onSunImageChanged(); +    void                    onMoonRotationChanged(); +    void                    onMoonImageChanged(); +}; +#endif // LLPANEL_EDIT_SKY_H diff --git a/indra/newview/llpaneleditwater.cpp b/indra/newview/llpaneleditwater.cpp index 08ba198894..3cb1dcfda4 100644 --- a/indra/newview/llpaneleditwater.cpp +++ b/indra/newview/llpaneleditwater.cpp @@ -80,11 +80,12 @@ BOOL LLPanelSettingsWaterMainTab::postBuild()      mClrFogColor = getChild<LLColorSwatchCtrl>(FIELD_WATER_FOG_COLOR);      mTxtNormalMap = getChild<LLTextureCtrl>(FIELD_WATER_NORMAL_MAP); -      mClrFogColor->setCommitCallback([this](LLUICtrl *, const LLSD &) { onFogColorChanged(); });      getChild<LLUICtrl>(FIELD_WATER_FOG_DENSITY)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onFogDensityChanged(); });  //    getChild<LLUICtrl>(FIELD_WATER_FOG_DENSITY)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onFogDensityChanged(getChild<LLUICtrl>(FIELD_WATER_FOG_DENSITY)->getValue().asReal()); });      getChild<LLUICtrl>(FIELD_WATER_UNDERWATER_MOD)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onFogUnderWaterChanged(); }); + +    mTxtNormalMap->setDefaultImageAssetID(LLSettingsWater::DEFAULT_WATER_NORMAL_ID);      mTxtNormalMap->setCommitCallback([this](LLUICtrl *, const LLSD &) { onNormalMapChanged(); });      getChild<LLUICtrl>(FIELD_WATER_WAVE1_X)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onLargeWaveChanged(); }); diff --git a/indra/newview/llpaneleditwater.h b/indra/newview/llpaneleditwater.h index 5c700c7231..72ffa05767 100644 --- a/indra/newview/llpaneleditwater.h +++ b/indra/newview/llpaneleditwater.h @@ -72,26 +72,26 @@ protected:  private:      LLColorSwatchCtrl *     mClrFogColor; -    LLSlider *              mSldFogDensity; -    LLSlider *              mSldUnderWaterMod; +//     LLSlider *              mSldFogDensity; +//     LLSlider *              mSldUnderWaterMod;      LLTextureCtrl *         mTxtNormalMap; -    // Temp until XY control -    LLSlider *              mSldWave1X; -    LLSlider *              mSldWave1Y; - -    // Temp until XY control -    LLSlider *              mSldWave2X; -    LLSlider *              mSldWave2Y; - -    LLSlider *              mSldNormalScaleX; -    LLSlider *              mSldNormalScaleY; -    LLSlider *              mSldNormalScaleZ; -    LLSlider *              mSldFresnelScale; -    LLSlider *              mSldFresnelOffset; -    LLSlider *              mSldScaleAbove; -    LLSlider *              mSldScaleBelow; -    LLSlider *              mSldBlurMultip; +//     // Temp until XY control +//     LLSlider *              mSldWave1X; +//     LLSlider *              mSldWave1Y; +//  +//     // Temp until XY control +//     LLSlider *              mSldWave2X; +//     LLSlider *              mSldWave2Y; +//  +//     LLSlider *              mSldNormalScaleX; +//     LLSlider *              mSldNormalScaleY; +//     LLSlider *              mSldNormalScaleZ; +//     LLSlider *              mSldFresnelScale; +//     LLSlider *              mSldFresnelOffset; +//     LLSlider *              mSldScaleAbove; +//     LLSlider *              mSldScaleBelow; +//     LLSlider *              mSldBlurMultip;      void                    onFogColorChanged();      void                    onFogDensityChanged(); diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 1af6ecb8b6..7e0a3a5fd8 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -228,6 +228,7 @@ void LLViewerFloaterReg::registerFloaters()  	LLFloaterReg::add("env_edit_day_cycle", "floater_edit_day_cycle.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterEditDayCycle>);      LLFloaterReg::add("env_fixed_environmentent_water", "floater_fixedenvironment.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterFixedEnvironmentWater>); +    LLFloaterReg::add("env_fixed_environmentent_sky", "floater_fixedenvironment.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterFixedEnvironmentSky>);      //LLFloaterReg::add("env_fixed_environmentent", "floater_fixedenvironment.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterFixedEnvironment>);      LLFloaterReg::add("env_edit_extdaycycle", "floater_edit_ext_day_cycle.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterEditExtDayCycle>); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index f5c08a4b0f..8665fb3234 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -70,6 +70,7 @@  #include "llfloaterperms.h"  #include "llclipboard.h"  #include "llhttpretrypolicy.h" +#include "llsettingsvo.h"  // do-nothing ops for use in callbacks.  void no_op_inventory_func(const LLUUID&) {}  @@ -1820,6 +1821,40 @@ void menu_create_inventory_item(LLInventoryPanel* panel, LLFolderBridge *bridge,  					  LLInventoryType::IT_GESTURE,  					  PERM_ALL);	// overridden in create_new_item  	} +    else if (("sky" == type_name) || ("water" == type_name) || ("daycycle" == type_name)) +    { +        LL_WARNS("LAPRAS") << "Creating settings object of type: '" << type_name << "'" << LL_ENDL; + +        LLSettingsBase::ptr_t settings; +        std::string name; + +        if ("sky" == type_name) +        { +            settings = LLSettingsVOSky::buildDefaultSky(); +            name = LLTrans::getString("New Sky"); +        } +        else if ("water" == type_name) +        { +            settings = LLSettingsVOWater::buildDefaultWater(); +            name = LLTrans::getString("New Water"); +        } +        else if ("daycycle" == type_name) +        { +            settings = LLSettingsVODay::buildDefaultDayCycle(); +            name = LLTrans::getString("New Daycycle"); +        } +        else +            LL_ERRS(LOG_INV) << "Unknown settings type: '" << type_name << "'" << LL_ENDL; + +        if (!settings) +        { +            LL_WARNS(LOG_INV) << "Unable to create a default setting object of type '" << type_name << "'" << LL_ENDL; +            return; +        } + +        settings->setName(name); +        LLSettingsVOBase::createInventoryItem(settings); +    }  	else  	{  		// Use for all clothing and body parts.  Adding new wearable types requires updating LLWearableDictionary. diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 9f25890917..6bc28ad284 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -8476,22 +8476,20 @@ class LLWorldEnvPreset : public view_listener_t  		if (item == "new_water")  		{ -			//LLFloaterReg::showInstance("env_edit_water", "new");              LLFloaterReg::showInstance("env_fixed_environmentent_water", "new");  		}  		else if (item == "edit_water")  		{ -			//LLFloaterReg::showInstance("env_edit_water", "edit");              LLFloaterReg::showInstance("env_fixed_environmentent_water", "edit");          }  		else if (item == "new_sky")  		{ -			LLFloaterReg::showInstance("env_edit_sky", "new"); -		} +            LLFloaterReg::showInstance("env_fixed_environmentent_sky", "new"); +        }  		else if (item == "edit_sky")  		{ -			LLFloaterReg::showInstance("env_edit_sky", "edit"); -		} +            LLFloaterReg::showInstance("env_fixed_environmentent_sky", "edit"); +        }  		else if (item == "new_day_cycle")  		{  			LLFloaterReg::showInstance("env_edit_day_cycle", "new"); diff --git a/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml b/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml index 03bbc05dad..38ce131dc2 100644 --- a/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml +++ b/indra/newview/skins/default/xui/en/floater_fixedenvironment.xml @@ -26,7 +26,6 @@          <layout_panel name="info_panel"                  auto_resize="false"                  user_resize="false" -                bg_alpha_color="blue"                  min_height="60">              <text                      follows="left|top" @@ -35,7 +34,7 @@                      width="35"                      height="20"                      font="SansSerif"> -            Name: +                Name:              </text>              <line_editor                      follows="left|top" @@ -81,7 +80,11 @@                      tab_position="top"                      tab_width="120"                      tab_padding_right="3"> -                <!-- move to own file --> +                <!-- Tabs inserted here in code --> +                <!-- --> +                <!-- --> + +                <!-- -->              </tab_container>          </layout_panel>          <layout_panel name="button_panel" @@ -90,25 +93,71 @@                  user_resize="false"                  height="40"                  visible="true"> -            <button +            <layout_stack +                    follows="bottom|left|right"                      height="23" -                    label="Save" -                    follows="left|top" -                    font="SansSerif" -                    name="btn_commit" -                    tool_tip="Load a settings from inventory"  -                    width="96" /> -            <button -                    height="23" -                    label="Cancel" -                    follows="right|top" -                    right="-10" -                    top_delta="0" -                    font="SansSerif" -                    name="btn_cancel" -                    tool_tip="Load a settings from inventory"  -                    width="96" /> - +                    layout="topleft" +                    mouse_opaque="false" +                    name="button_bar_ls" +                    left="0" +                    orientation="horizontal" +                    top="0" +                    width="313"> +                <layout_panel +                        follows="bottom|left|right" +                        height="23" +                        layout="bottomleft" +                        left="0" +                        mouse_opaque="false" +                        name="save_btn_lp" +                        auto_resize="true" +                        width="156"> +                    <button +                            follows="bottom|left|right" +                            height="23" +                            label="Save" +                            left="1" +                            layout="topleft" +                            name="btn_commit" +                            top="0" +                            width="155" /> +                    <button +                            follows="bottom|right" +                            height="23" +                            name="btn_flyout" +                            label="" +                            layout="topleft" +                            left_pad="-20" +                            tab_stop="false" +                            top="0" +                            image_selected="SegmentedBtn_Right_Selected_Press" +                            image_unselected="SegmentedBtn_Right_Off" +                            image_pressed="SegmentedBtn_Right_Press" +                            image_pressed_selected="SegmentedBtn_Right_Selected_Press" +                            image_overlay="Arrow_Small_Up" +                            width="20"/> +                </layout_panel> +                <layout_panel +                        follows="bottom|left|right" +                        height="23" +                        layout="bottomleft" +                        left_pad="3" +                        mouse_opaque="false" +                        name="revert_btn_lp" +                        auto_resize="true" +                        width="147"> +                    <button +                            follows="bottom|right" +                            height="23" +                            right="-1" +                            label="Cancel" +                            layout="topleft" +                            name="btn_cancel" +                            top="0" +                            tool_tip="Revert to last saved version" +                            width="147" /> +                </layout_panel> +            </layout_stack>          </layout_panel>      </layout_stack>  </floater> diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index 5b45364127..29915788f1 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -322,6 +322,35 @@          </menu_item_call>      </menu>      <menu +     label="New Settings" +     layout="topleft" +     name="New Settings"> +        <menu_item_call +         label="New Sky" +         layout="topleft" +         name="New Sky"> +            <menu_item_call.on_click +             function="Inventory.DoCreate" +             parameter="sky"/> +        </menu_item_call> +        <menu_item_call +         label="New Water" +         layout="topleft" +         name="New Water"> +            <menu_item_call.on_click +             function="Inventory.DoCreate" +             parameter="water"/> +        </menu_item_call> +        <menu_item_call +         label="New Day Cycle" +         layout="topleft" +         name="New Day Cycle"> +            <menu_item_call.on_click +             function="Inventory.DoCreate" +             parameter="daycycle"/> +        </menu_item_call> +    </menu> +    <menu       label="Use as default for"       layout="topleft"       name="upload_def"> diff --git a/indra/newview/skins/default/xui/en/menu_inventory_add.xml b/indra/newview/skins/default/xui/en/menu_inventory_add.xml index afeb1bf226..7c31bfe54d 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory_add.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory_add.xml @@ -245,4 +245,33 @@                       parameter="eyes" />                  </menu_item_call>              </menu> +            <menu +             label="New Settings" +             layout="topleft" +             name="New Settings"> +                <menu_item_call +                 label="New Sky" +                 layout="topleft" +                 name="New Sky"> +                    <menu_item_call.on_click +                     function="Inventory.DoCreate" +                     parameter="sky"/> +                </menu_item_call> +                <menu_item_call +                 label="New Water" +                 layout="topleft" +                 name="New Water"> +                    <menu_item_call.on_click +                     function="Inventory.DoCreate" +                     parameter="water"/> +                </menu_item_call> +                <menu_item_call +                 label="New Day Cycle" +                 layout="topleft" +                 name="New Day Cycle"> +                    <menu_item_call.on_click +                     function="Inventory.DoCreate" +                     parameter="daycycle"/> +                </menu_item_call> +            </menu>  </menu>
\ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/menu_save_settings.xml b/indra/newview/skins/default/xui/en/menu_save_settings.xml new file mode 100644 index 0000000000..fcdd711366 --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_save_settings.xml @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<toggleable_menu +        height="602" +        layout="topleft" +        mouse_opaque="false" +        name="save_settings_menu" +        width="120"> +    <menu_item_call  +            name="save_settings"  +            label="Save"> +        <menu_item_call.on_click  +                function="FlyoutCombo.Button.Action" +                userdata="save"/> +    </menu_item_call> +    <menu_item_call  +            name="save_as_new_settings"  +            label="Save As"> +        <menu_item_call.on_click  +                function="FlyoutCombo.Button.Action" +                userdata="saveas" /> +    </menu_item_call> +    <menu_item_call +            name="apply_local" +            label="Apply Locally"> +        <menu_item_call.on_click  +                function="FlyoutCombo.Button.Action" +                userdata="local" /> +    </menu_item_call> +    <menu_item_call +            name="apply_parcel" +            label="Apply Parcel"> +        <menu_item_call.on_click  +                function="FlyoutCombo.Button.Action" +                userdata="parcel" /> +    </menu_item_call> +    <menu_item_call +            name="apply_region" +            label="Apply Region"> +        <menu_item_call.on_click  +                function="FlyoutCombo.Button.Action" +                userdata="region" /> +    </menu_item_call> +</toggleable_menu> diff --git a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml index 3f13cea58e..afce9f6eb5 100644 --- a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml +++ b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml @@ -1,556 +1,556 @@  <?xml version="1.0" encoding="utf-8" standalone="yes" ?>  <!-- Side tray Outfit Edit panel -->  <panel - background_visible="true" - border="false" - height="600" - follows="all" - layout="topleft" - help_topic="edit_outfit" - left="0" - min_height="350" - name="outfit_edit" - top="0" - width="320"> -	<string -	 name="No Outfit" -	 value="No Outfit"/> -	<string -	 name="unsaved_changes" -	 value="Unsaved Changes"/> -	<string -	 name="now_editing" -	 value="Now Editing"/> -	<string -	 name="folder_view_off" -	 value="Hierarchy_View_Disabled" -	 translate="false"/> -	<string -	 name="folder_view_on" -	 value="Hierarchy_View_On" -	 translate="false"/> -	<string -	 name="list_view_off" -	 value="List_View_Disabled" -	 translate="false"/> -	<string -	 name="list_view_on" -	 value="List_View_On" -	 translate="false"/> +        background_visible="true" +        border="false" +        height="600" +        follows="all" +        layout="topleft" +        help_topic="edit_outfit" +        left="0" +        min_height="350" +        name="outfit_edit" +        top="0" +        width="320"> +    <string +            name="No Outfit" +            value="No Outfit"/> +    <string +            name="unsaved_changes" +            value="Unsaved Changes"/> +    <string +            name="now_editing" +            value="Now Editing"/> +    <string +            name="folder_view_off" +            value="Hierarchy_View_Disabled" +            translate="false"/> +    <string +            name="folder_view_on" +            value="Hierarchy_View_On" +            translate="false"/> +    <string +            name="list_view_off" +            value="List_View_Disabled" +            translate="false"/> +    <string +            name="list_view_on" +            value="List_View_On" +            translate="false"/> -	<panel.string -		name="not_available"> -		(N\A) -	</panel.string> -	<panel.string -		name="unknown"> -		(unknown) -	</panel.string> +    <panel.string +            name="not_available"> +        (N\A) +    </panel.string> +    <panel.string +            name="unknown"> +        (unknown) +    </panel.string> -	<!-- Wearables filtering strings --> -	<string name="Filter.All" value="All"/> -	<string name="Filter.Clothes/Body" value="Clothes/Body"/> -	<string name="Filter.Objects" value="Objects"/> -	<string name="Filter.Clothing" value="Clothing"/> -	<string name="Filter.Bodyparts" value="Body parts"/> +    <!-- Wearables filtering strings --> +    <string name="Filter.All" value="All"/> +    <string name="Filter.Clothes/Body" value="Clothes/Body"/> +    <string name="Filter.Objects" value="Objects"/> +    <string name="Filter.Clothing" value="Clothing"/> +    <string name="Filter.Bodyparts" value="Body parts"/> -	<string -	 name="replace_body_part" -	 value="Click to replace your existing shape"/> +    <string +            name="replace_body_part" +            value="Click to replace your existing shape"/> -	<button -	 follows="top|left" -	 height="24" -	 image_hover_unselected="BackButton_Over" -	 image_pressed="BackButton_Press" -	 image_unselected="BackButton_Off" -	 layout="topleft" -	 name="back_btn" -	 left="5" -	 tab_stop="false" -	 top="1" -	 width="30" -	 use_draw_context_alpha="false" /> -	<text -	 follows="top|left|right" -	 font="SansSerifHugeBold" -	 height="26" -	 layout="topleft" -	 left_pad="10" -	 name="title" -	 text_color="LtGray" -	 top="0" -	 value="Edit Outfit" -	 use_ellipses="true" -	 width="275" /> +    <button +            follows="top|left" +            height="24" +            image_hover_unselected="BackButton_Over" +            image_pressed="BackButton_Press" +            image_unselected="BackButton_Off" +            layout="topleft" +            name="back_btn" +            left="5" +            tab_stop="false" +            top="1" +            width="30" +            use_draw_context_alpha="false" /> +    <text +            follows="top|left|right" +            font="SansSerifHugeBold" +            height="26" +            layout="topleft" +            left_pad="10" +            name="title" +            text_color="LtGray" +            top="0" +            value="Edit Outfit" +            use_ellipses="true" +            width="275" /> -	<!-- "HEADER WITH ICON, STATUS TEXT AND OUTFIT NAME" --> -	<panel -	 background_visible="true" -	 bg_alpha_color="DkGray2" -	 bevel_style="none" -	 follows="top|left|right" -	 height="40" -	 layout="topleft" -	 left="6" -	 name="header_panel" -	 top_pad="5" -	 width="311"> -		<icon -		 follows="left|top" -		 height="31" -		 image_name="Shirt_Large" -		 left="2" -		 mouse_opaque="false" -		 name="outfit_icon" -		 top="2" -		 scale_image="true" -		 visible="true" -		 width="31" /> -		<panel -		 bevel_style="none" -		 follows="top|left|right" -		 height="37" -		 layout="topleft" -		 left_pad="5" -		 name="outfit_name_and_status" -		 top="2" -		 width="270"> -			<text -			 follows="top|left|right" -			 font="SansSerifSmallBold" -			 height="13" -			 layout="topleft" -			 name="status" -			 text_color="EmphasisColor" -			 top="2" -			 value="Now editing..." -			 use_ellipses="true" -			 width="245" /> -			<text -			 follows="bottom|left|right" -			 font="SansSerifLargeBold" -			 height="18" -			 layout="topleft" -			 name="curr_outfit_name" -			 parse_urls="false" -			 text_color="LtGray" -			 top_pad="2" -			 value="[Current Outfit]" -			 use_ellipses="true" -			 width="245" /> -			<loading_indicator -			 follows="right|top" -			 height="24" -			 layout="topleft" -			 right="-2" -			 name="edit_outfit_loading_indicator" -			 top="6" -			 width="24" /> -		</panel> -	</panel> +    <!-- "HEADER WITH ICON, STATUS TEXT AND OUTFIT NAME" --> +    <panel +            background_visible="true" +            bg_alpha_color="DkGray2" +            bevel_style="none" +            follows="top|left|right" +            height="40" +            layout="topleft" +            left="6" +            name="header_panel" +            top_pad="5" +            width="311"> +        <icon +                follows="left|top" +                height="31" +                image_name="Shirt_Large" +                left="2" +                mouse_opaque="false" +                name="outfit_icon" +                top="2" +                scale_image="true" +                visible="true" +                width="31" /> +        <panel +                bevel_style="none" +                follows="top|left|right" +                height="37" +                layout="topleft" +                left_pad="5" +                name="outfit_name_and_status" +                top="2" +                width="270"> +            <text +                    follows="top|left|right" +                    font="SansSerifSmallBold" +                    height="13" +                    layout="topleft" +                    name="status" +                    text_color="EmphasisColor" +                    top="2" +                    value="Now editing..." +                    use_ellipses="true" +                    width="245" /> +            <text +                    follows="bottom|left|right" +                    font="SansSerifLargeBold" +                    height="18" +                    layout="topleft" +                    name="curr_outfit_name" +                    parse_urls="false" +                    text_color="LtGray" +                    top_pad="2" +                    value="[Current Outfit]" +                    use_ellipses="true" +                    width="245" /> +            <loading_indicator +                    follows="right|top" +                    height="24" +                    layout="topleft" +                    right="-2" +                    name="edit_outfit_loading_indicator" +                    top="6" +                    width="24" /> +        </panel> +    </panel> -	<!-- LIST OF WEARABLES (CURRENT OUTFIT/ WEARABLES TO ADD) --> -	<!-- *NOTE: border_size is used to calculate space between layout panels and also to calculate resize bar's height. +    <!-- LIST OF WEARABLES (CURRENT OUTFIT/ WEARABLES TO ADD) --> +    <!-- *NOTE: border_size is used to calculate space between layout panels and also to calculate resize bar's height.  Required height for dragbar (icon in spec) is 10, so resizebar height should be 10 px.  It is calculated as border_size + 2*UIResizeBarOverlap  --> -	<layout_stack -	 animate="true" -	 border_size="8" -	 clip="false" -	 default_tab_group="2" -	 follows="all" -	 height="465" -	 width="313" -	 layout="topleft" -	 orientation="vertical" -	 name="im_panels" -	 tab_group="1" -	 top_pad="5" -	 left="5"> -		<layout_panel -		 layout="topleft" -		 height="187" -		 min_height="155" -		 name="outfit_wearables_panel" -		 width="313" -		 auto_resize="true" -		 user_resize="true"> +    <layout_stack +            animate="true" +            border_size="8" +            clip="false" +            default_tab_group="2" +            follows="all" +            height="465" +            width="313" +            layout="topleft" +            orientation="vertical" +            name="im_panels" +            tab_group="1" +            top_pad="5" +            left="5"> +        <layout_panel +                layout="topleft" +                height="187" +                min_height="155" +                name="outfit_wearables_panel" +                width="313" +                auto_resize="true" +                user_resize="true"> -			<layout_stack -			 animate="true" -			 border_size="0" -			 follows="all" -			 height="185" -			 width="313" -			 orientation="vertical" -			 layout="topleft" -			 name="filter_panels" -			 top="0" -			 left="0"> -				<layout_panel -				 auto_resize="true" -				 background_visible="false" -				 layout="topleft" -				 height="154" -				 name="add_button_and_combobox" -				 width="311" -				 visible="true"> +            <layout_stack +                    animate="true" +                    border_size="0" +                    follows="all" +                    height="185" +                    width="313" +                    orientation="vertical" +                    layout="topleft" +                    name="filter_panels" +                    top="0" +                    left="0"> +                <layout_panel +                        auto_resize="true" +                        background_visible="false" +                        layout="topleft" +                        height="154" +                        name="add_button_and_combobox" +                        width="311" +                        visible="true"> -					<!-- List containing items from the COF and Base outfit --> -					<panel -					 background_visible="false" -					 class="cof_wearables" -					 filename="panel_cof_wearables.xml" -									 follows="all" -									 height="129" -					 layout="topleft" -					 left="1" -					 name="cof_wearables_list" -					 top="0" -					 width="311" /> +                    <!-- List containing items from the COF and Base outfit --> +                    <panel +                            background_visible="false" +                            class="cof_wearables" +                            filename="panel_cof_wearables.xml" +                            follows="all" +                            height="129" +                            layout="topleft" +                            left="1" +                            name="cof_wearables_list" +                            top="0" +                            width="311" /> -					<button -					 follows="left|bottom" -					 height="22" -					 image_pressed="PushButton_Press" -					 image_pressed_selected="PushButton_Selected_Press" -					 image_selected="PushButton_Selected_Press" -					 is_toggle="true" -					 label="Add More..." -					 layout="topleft" -					 left="2" -					 name="show_add_wearables_btn" -					 top_pad="2" -					 tool_tip="Open/Close" -					 width="125" /> +                    <button +                            follows="left|bottom" +                            height="22" +                            image_pressed="PushButton_Press" +                            image_pressed_selected="PushButton_Selected_Press" +                            image_selected="PushButton_Selected_Press" +                            is_toggle="true" +                            label="Add More..." +                            layout="topleft" +                            left="2" +                            name="show_add_wearables_btn" +                            top_pad="2" +                            tool_tip="Open/Close" +                            width="125" /> -					<combo_box -					 follows="left|right|bottom" -					 height="22" -	 layout="topleft" -					 left_pad="5" -					 name="list_view_filter_combobox" -					 top_delta="0" -					 visible="false" -					 width="152"/> -					<combo_box -					 follows="left|right|bottom" -					 height="22" -					 layout="topleft" -					 left_delta="0" -					 name="folder_view_filter_combobox" -					 top_delta="0" -					 visible="false" -					 width="152"/> +                    <combo_box +                            follows="left|right|bottom" +                            height="22" +                            layout="topleft" +                            left_pad="5" +                            name="list_view_filter_combobox" +                            top_delta="0" +                            visible="false" +                            width="152"/> +                    <combo_box +                            follows="left|right|bottom" +                            height="22" +                            layout="topleft" +                            left_delta="0" +                            name="folder_view_filter_combobox" +                            top_delta="0" +                            visible="false" +                            width="152"/> -					<button -									 follows="bottom|right" -									 height="22" -					 image_overlay="Search_Icon" -									 image_pressed="PushButton_Press" -									 image_pressed_selected="PushButton_Selected_Press" -									 image_selected="PushButton_Selected_Press" -					 is_toggle="true" -					 layout="topleft" -					 name="filter_button" -									 right="-5" -					 top_delta="0" -									 visible="false" -					 width="20" /> -				</layout_panel> +                    <button +                            follows="bottom|right" +                            height="22" +                            image_overlay="Search_Icon" +                            image_pressed="PushButton_Press" +                            image_pressed_selected="PushButton_Selected_Press" +                            image_selected="PushButton_Selected_Press" +                            is_toggle="true" +                            layout="topleft" +                            name="filter_button" +                            right="-5" +                            top_delta="0" +                            visible="false" +                            width="20" /> +                </layout_panel> -				<layout_panel -				 auto_resize="false" -				 background_visible="true" -				 bg_alpha_color="DkGray2" -				 height="30" -				 name="filter_panel" -				 width="311" -				 visible="false"> +                <layout_panel +                        auto_resize="false" +                        background_visible="true" +                        bg_alpha_color="DkGray2" +                        height="30" +                        name="filter_panel" +                        width="311" +                        visible="false"> -					<filter_editor -			 background_image="TextField_Search_Off" -			 enabled="true" -			 follows="left|right|top" -			 label="Filter Inventory Wearables" -			 layout="topleft" -			 left="5" -			 width="290" -			 height="25" -			 name="look_item_filter" -			 search_button_visible="true" -			 text_color="black" -			 visible="true"/> +                    <filter_editor +                            background_image="TextField_Search_Off" +                            enabled="true" +                            follows="left|right|top" +                            label="Filter Inventory Wearables" +                            layout="topleft" +                            left="5" +                            width="290" +                            height="25" +                            name="look_item_filter" +                            search_button_visible="true" +                            text_color="black" +                            visible="true"/> -				</layout_panel> -			</layout_stack> -		</layout_panel> +                </layout_panel> +            </layout_stack> +        </layout_panel> -		<layout_panel background_visible="false" -									bg_alpha_color="DkGray2" -									auto_resize="true" -									height="450" -									min_height="80" -									name="add_wearables_panel" -									width="313" -									tab_group="2" -									user_resize="true" -									visible="false"> +        <layout_panel background_visible="false" +                bg_alpha_color="DkGray2" +                auto_resize="true" +                height="450" +                min_height="80" +                name="add_wearables_panel" +                width="313" +                tab_group="2" +                user_resize="true" +                visible="false"> -			<!-- this icon represent dragbar between layout panels. +            <!-- this icon represent dragbar between layout panels.            	 This is a workaround implemented in EXT-7255 becouse of an issue with layout stack (EXT-7471) --> -			<icon follows="left|top|right" -						height="10" -						image_name="Dragbar" -						left="0" -						top_pad="-9" -						width="313" /> -			<inventory_panel allow_multi_select="true" -											 background_visible="false" -											 border="false" -											 follows="left|top|right|bottom" -											 height="418" -											 layout="topleft" -											 left="0" -											 mouse_opaque="false" -											 name="folder_view" -											 top_pad="0" -											 width="313" -											 visible="false"/> -			<panel name="filtered_wearables_panel" -						 background_opaque="true" -						 background_visible="false" -						 layout="topleft" -						 follows="left|top|right|bottom" -						 border="false" -						 height="418" -						 left="0" -						 mouse_opaque="false" -						 width="310" -						 top_delta="0" -						 visible="true"> -				<wearable_items_list color="0.107 0.107 0.107 1" -														 name="list_view" -														 allow_select="true" -														 layout="topleft" -														 follows="all" -														 multi_select="true" -														 width="313" -														 height="418" -														 left="0" -														 top="0"/> -			</panel> -			<button follows="bottom|left" -							height="22" -							left="2" -							label="Wear Item" -							layout="topleft" -							name="plus_btn" -							top_pad="5" -							width="130" /> -		</layout_panel> -	</layout_stack> +            <icon follows="left|top|right" +                    height="10" +                    image_name="Dragbar" +                    left="0" +                    top_pad="-9" +                    width="313" /> +            <inventory_panel allow_multi_select="true" +                    background_visible="false" +                    border="false" +                    follows="left|top|right|bottom" +                    height="418" +                    layout="topleft" +                    left="0" +                    mouse_opaque="false" +                    name="folder_view" +                    top_pad="0" +                    width="313" +                    visible="false"/> +            <panel name="filtered_wearables_panel" +                    background_opaque="true" +                    background_visible="false" +                    layout="topleft" +                    follows="left|top|right|bottom" +                    border="false" +                    height="418" +                    left="0" +                    mouse_opaque="false" +                    width="310" +                    top_delta="0" +                    visible="true"> +                <wearable_items_list color="0.107 0.107 0.107 1" +                        name="list_view" +                        allow_select="true" +                        layout="topleft" +                        follows="all" +                        multi_select="true" +                        width="313" +                        height="418" +                        left="0" +                        top="0"/> +            </panel> +            <button follows="bottom|left" +                    height="22" +                    left="2" +                    label="Wear Item" +                    layout="topleft" +                    name="plus_btn" +                    top_pad="5" +                    width="130" /> +        </layout_panel> +    </layout_stack> -	<!-- BUTTON BAR --> -	<panel -	 background_visible="true" -	 bevel_style="none" -	 follows="bottom|left|right" -	 height="27" -	 layout="topleft" -	 left="5" -	 name="no_add_wearables_button_bar" -	 top_pad="0" -	 width="313"> -		<menu_button -		 follows="bottom|left" -		 height="25" -		 image_hover_unselected="Toolbar_Left_Over" -		 image_overlay="OptionsMenu_Off" -		 image_selected="Toolbar_Left_Selected" -		 image_unselected="Toolbar_Left_Off" -		 layout="topleft" -		 left="0" -		 name="gear_menu_btn" -		 top="1" -		 width="31" /> -		<icon -		 follows="bottom|left|right" -		 height="25" -		 image_name="Toolbar_Middle_Off" -		 layout="topleft" -		 left_pad="1" -		 name="dummy_right_icon" -		 width="250" /> -		<button -		 follows="bottom|right" -		 height="25" -		 image_hover_unselected="Toolbar_Right_Over" -		 image_overlay="Shop" -		 image_selected="Toolbar_Right_Selected" -		 image_unselected="Toolbar_Right_Off" -		 layout="topleft" -		 left_pad="1" -		 name="shop_btn_1" -		 top="1" -		 tool_tip="Visit the SL Marketplace. You can also select something you are wearing, then click here to see more things like it" -		 width="31" /> -	</panel> +    <!-- BUTTON BAR --> +    <panel +            background_visible="true" +            bevel_style="none" +            follows="bottom|left|right" +            height="27" +            layout="topleft" +            left="5" +            name="no_add_wearables_button_bar" +            top_pad="0" +            width="313"> +        <menu_button +                follows="bottom|left" +                height="25" +                image_hover_unselected="Toolbar_Left_Over" +                image_overlay="OptionsMenu_Off" +                image_selected="Toolbar_Left_Selected" +                image_unselected="Toolbar_Left_Off" +                layout="topleft" +                left="0" +                name="gear_menu_btn" +                top="1" +                width="31" /> +        <icon +                follows="bottom|left|right" +                height="25" +                image_name="Toolbar_Middle_Off" +                layout="topleft" +                left_pad="1" +                name="dummy_right_icon" +                width="250" /> +        <button +                follows="bottom|right" +                height="25" +                image_hover_unselected="Toolbar_Right_Over" +                image_overlay="Shop" +                image_selected="Toolbar_Right_Selected" +                image_unselected="Toolbar_Right_Off" +                layout="topleft" +                left_pad="1" +                name="shop_btn_1" +                top="1" +                tool_tip="Visit the SL Marketplace. You can also select something you are wearing, then click here to see more things like it" +                width="31" /> +    </panel> -	<!-- BUTTON BAR - WEARABLES ADDING MODE --> -	<panel -	 background_visible="true" -	 bevel_style="none" -	 follows="left|right|bottom" -	 height="27" -	 layout="topleft" -	 left="5" -	 name="add_wearables_button_bar" -	 top_delta="0" -	 visible="false" -	 width="313"> -		<menu_button -		 follows="bottom|left" -		 height="25" -		 image_hover_unselected="Toolbar_Left_Over" -		 image_overlay="OptionsMenu_Off" -		 image_selected="Toolbar_Left_Selected" -		 image_unselected="Toolbar_Left_Off" -		 layout="topleft" -		 left="0" -		 name="wearables_gear_menu_btn" -		 top="1" -		 width="31" /> -		<button -		 follows="bottom|left" -		 height="25" -		 image_hover_unselected="Toolbar_Middle_Over" -		 image_overlay="Hierarchy_View_Disabled" -		 image_selected="Toolbar_Middle_Selected" -		 image_unselected="Toolbar_Middle_Off" -		 is_toggle="true" -		 layout="topleft" -		 left_pad="1" -		 name="folder_view_btn" -		 top="1" -		 width="31" /> -		<button -		 follows="bottom|left" -		 height="25" -		 image_hover_unselected="Toolbar_Middle_Over" -		 image_overlay="List_View_On" -		 image_selected="Toolbar_Middle_Selected" -		 image_unselected="Toolbar_Middle_Off" -		 is_toggle="true" -		 layout="topleft" -		 left_pad="1" -		 name="list_view_btn" -		 top="1" -		 width="31" /> -		<icon -		 follows="bottom|left|right" -		 height="25" -			image_name="Toolbar_Middle_Off" -		 layout="topleft" -		 left_pad="1" -			name="dummy_right_icon" -			width="186" > -		</icon> -		<button -		 follows="bottom|right" -		 height="25" -		 image_hover_unselected="Toolbar_Right_Over" -		 image_overlay="Shop" -		 image_selected="Toolbar_Right_Selected" -		 image_unselected="Toolbar_Right_Off" -		 layout="topleft" -		 left_pad="1" -		 name="shop_btn_2" -		 top="1" -		 tool_tip="Visit the SL Marketplace. You can also select something you are wearing, then click here to see more things like it" -		 width="31" /> -	</panel> +    <!-- BUTTON BAR - WEARABLES ADDING MODE --> +    <panel +            background_visible="true" +            bevel_style="none" +            follows="left|right|bottom" +            height="27" +            layout="topleft" +            left="5" +            name="add_wearables_button_bar" +            top_delta="0" +            visible="false" +            width="313"> +        <menu_button +                follows="bottom|left" +                height="25" +                image_hover_unselected="Toolbar_Left_Over" +                image_overlay="OptionsMenu_Off" +                image_selected="Toolbar_Left_Selected" +                image_unselected="Toolbar_Left_Off" +                layout="topleft" +                left="0" +                name="wearables_gear_menu_btn" +                top="1" +                width="31" /> +        <button +                follows="bottom|left" +                height="25" +                image_hover_unselected="Toolbar_Middle_Over" +                image_overlay="Hierarchy_View_Disabled" +                image_selected="Toolbar_Middle_Selected" +                image_unselected="Toolbar_Middle_Off" +                is_toggle="true" +                layout="topleft" +                left_pad="1" +                name="folder_view_btn" +                top="1" +                width="31" /> +        <button +                follows="bottom|left" +                height="25" +                image_hover_unselected="Toolbar_Middle_Over" +                image_overlay="List_View_On" +                image_selected="Toolbar_Middle_Selected" +                image_unselected="Toolbar_Middle_Off" +                is_toggle="true" +                layout="topleft" +                left_pad="1" +                name="list_view_btn" +                top="1" +                width="31" /> +        <icon +                follows="bottom|left|right" +                height="25" +                image_name="Toolbar_Middle_Off" +                layout="topleft" +                left_pad="1" +                name="dummy_right_icon" +                width="186" > +        </icon> +        <button +                follows="bottom|right" +                height="25" +                image_hover_unselected="Toolbar_Right_Over" +                image_overlay="Shop" +                image_selected="Toolbar_Right_Selected" +                image_unselected="Toolbar_Right_Off" +                layout="topleft" +                left_pad="1" +                name="shop_btn_2" +                top="1" +                tool_tip="Visit the SL Marketplace. You can also select something you are wearing, then click here to see more things like it" +                width="31" /> +    </panel> -	<!-- SAVE AND REVERT BUTTONS --> -	<panel -	 follows="left|right|bottom" -	 height="30" -	 layout="topleft" -	 left="4" -	 top_pad="2" -	 name="save_revert_button_bar" -	 width="300"> -		<layout_stack -						 follows="bottom|left|right" -					 height="23" -					 layout="topleft" -					 mouse_opaque="false" -					 name="button_bar_ls" -					 left="0" -					 orientation="horizontal" -					 top="0" -					 width="313"> -			<layout_panel -					 follows="bottom|left|right" -					 height="23" -								 layout="bottomleft" -								 left="0" -								 mouse_opaque="false" -								 name="save_btn_lp" -								 auto_resize="true" -								 width="156"> -				<button -                         follows="bottom|left|right" -         height="23" -         label="Save" -                         left="1" -         layout="topleft" -         name="save_btn" -         top="0" -         width="155" /> -				<button -                         follows="bottom|right" -         height="23" -         name="save_flyout_btn" -         label="" -         layout="topleft" -         left_pad="-20" -         tab_stop="false" -         top="0" -         image_selected="SegmentedBtn_Right_Selected_Press" -         image_unselected="SegmentedBtn_Right_Off" -         image_pressed="SegmentedBtn_Right_Press" -         image_pressed_selected="SegmentedBtn_Right_Selected_Press" -         image_overlay="Arrow_Small_Up" -         width="20"/> -			</layout_panel> -			<layout_panel -								 follows="bottom|left|right" -								 height="23" -								 layout="bottomleft" -								 left_pad="3" -								 mouse_opaque="false" -								 name="revert_btn_lp" -								 auto_resize="true" -								 width="147"> -				<button -         follows="bottom|left|right" -         height="23" -                         left="0" -         label="Undo Changes" -         layout="topleft" -         name="revert_btn" -         top="0" -         tool_tip="Revert to last saved version" -         width="147" /> -			</layout_panel> -		</layout_stack> -	</panel> +    <!-- SAVE AND REVERT BUTTONS --> +    <panel +            follows="left|right|bottom" +            height="30" +            layout="topleft" +            left="4" +            top_pad="2" +            name="save_revert_button_bar" +            width="300"> +        <layout_stack +                follows="bottom|left|right" +                height="23" +                layout="topleft" +                mouse_opaque="false" +                name="button_bar_ls" +                left="0" +                orientation="horizontal" +                top="0" +                width="313"> +            <layout_panel +                    follows="bottom|left|right" +                    height="23" +                    layout="bottomleft" +                    left="0" +                    mouse_opaque="false" +                    name="save_btn_lp" +                    auto_resize="true" +                    width="156"> +                <button +                        follows="bottom|left|right" +                        height="23" +                        label="Save" +                        left="1" +                        layout="topleft" +                        name="save_btn" +                        top="0" +                        width="155" /> +                <button +                        follows="bottom|right" +                        height="23" +                        name="save_flyout_btn" +                        label="" +                        layout="topleft" +                        left_pad="-20" +                        tab_stop="false" +                        top="0" +                        image_selected="SegmentedBtn_Right_Selected_Press" +                        image_unselected="SegmentedBtn_Right_Off" +                        image_pressed="SegmentedBtn_Right_Press" +                        image_pressed_selected="SegmentedBtn_Right_Selected_Press" +                        image_overlay="Arrow_Small_Up" +                        width="20"/> +            </layout_panel> +            <layout_panel +                    follows="bottom|left|right" +                    height="23" +                    layout="bottomleft" +                    left_pad="3" +                    mouse_opaque="false" +                    name="revert_btn_lp" +                    auto_resize="true" +                    width="147"> +                <button +                        follows="bottom|left|right" +                        height="23" +                        left="0" +                        label="Undo Changes" +                        layout="topleft" +                        name="revert_btn" +                        top="0" +                        tool_tip="Revert to last saved version" +                        width="147" /> +            </layout_panel> +        </layout_stack> +    </panel>  </panel> diff --git a/indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xml b/indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xml new file mode 100644 index 0000000000..ffa7df209b --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xml @@ -0,0 +1,246 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel +        border="true" +        follows="all" +        label="Atmosphere & Lighting" +        layout="topleft" +        left="0" +        name="panel_settings_sky_atmos" +        top="0"> +    <layout_stack  +            left="5" +            top="5" +            right="-5" +            bottom="-5" +            follows="left|top|right|bottom" +            orientation="vertical"> +        <layout_panel +                border="true" +                bevel_style="in" +                auto_resize="false" +                user_resize="false" +                visible="true" +                height="75"> + +            <text +                    follows="left|top" +                    height="10" +                    layout="topleft" +                    left_delta="15" +                    top_pad="15" +                    width="80"> +                Ambient Color: +            </text> +            <color_swatch +                    can_apply_immediately="true" +                    follows="left|top" +                    height="37" +                    label_height="0" +                    layout="topleft" +                    left_delta="0" +                    name="ambient_light" +                    top_pad="5" +                    width="60" /> +            <text +                    follows="left" +                    height="10" +                    layout="topleft" +                    left_delta="90" +                    top_delta="-15" +                    width="80"> +                Blue Horizon: +            </text> +            <color_swatch +                    can_apply_immediately="true" +                    follows="left|top" +                    height="37" +                    label_height="0" +                    layout="topleft" +                    left_delta="0" +                    name="blue_horizon" +                    top_pad="5" +                    width="60" /> +            <text +                    follows="left" +                    height="10" +                    layout="topleft" +                    left_delta="90" +                    top_delta="-15" +                    width="80"> +                Blue Density: +            </text> +            <color_swatch +                    can_apply_immediately="true" +                    follows="left|top" +                    height="37" +                    label_height="0" +                    layout="topleft" +                    left_delta="0" +                    name="blue_density" +                    top_pad="5" +                    width="60" /> +        </layout_panel> +        <layout_panel +                border="true" +                bevel_style="in" +                auto_resize="true" +                user_resize="true" +                visible="true"> +            <layout_stack name="atmosphere1" +                    left="5" +                    top="5" +                    right="-5" +                    bottom="-5" +                    follows="left|top|right|bottom" +                    orientation="hoizontal"> +                <layout_panel +                        border="false" +                        bevel_style="in" +                        auto_resize="true" +                        user_resize="true" +                        visible="true" +                        min_width="225"> +                    <text +                            follows="left|top" +                            height="10" +                            layout="topleft" +                            left_delta="15" +                            top_pad="15" +                            width="80"> +                        Haze Horizon: +                    </text> +                    <slider +                            decimal_digits="2" +                            follows="left|top" +                            height="10" +                            increment="0.01" +                            initial_value="0" +                            layout="topleft" +                            left_delta="5" +                            min_val="0" +                            max_val="1" +                            name="haze_horizon" +                            top_delta="20" +                            width="200"/> +                    <text +                            follows="left|top" +                            height="10" +                            layout="topleft" +                            left_delta="-5" +                            top_delta="25" +                            width="80"> +                        Haze Density: +                    </text> +                    <slider +                            decimal_digits="2" +                            follows="left|top" +                            height="10" +                            increment="0.01" +                            initial_value="0" +                            layout="topleft" +                            left_delta="5" +                            min_val="0" +                            max_val="1" +                            name="haze_density" +                            top_delta="20" +                            width="200"/> +                    <text +                            follows="left|top" +                            height="10" +                            layout="topleft" +                            left_delta="-5" +                            top_delta="25" +                            width="80"> +                        Scene Gamma: +                    </text> +                    <slider +                            decimal_digits="2" +                            follows="left|top" +                            height="10" +                            increment="0.01" +                            initial_value="0" +                            layout="topleft" +                            left_delta="5" +                            max_val="10" +                            name="scene_gamma" +                            top_delta="20" +                            width="207"/> +                </layout_panel>             +                <layout_panel +                        border="false" +                        bevel_style="in" +                        auto_resize="true" +                        user_resize="true" +                        visible="true" +                        min_width="225"> +                    <text +                            follows="left|top" +                            height="10" +                            layout="topleft" +                            left_delta="15" +                            top_pad="15" +                            width="200"> +                        Density Multiplier: +                    </text> +                    <slider +                            decimal_digits="2" +                            follows="left|top" +                            height="10" +                            increment="0.01" +                            initial_value="0" +                            layout="topleft" +                            left_delta="5" +                            min_val="0" +                            max_val="0.9" +                            name="density_multip" +                            top_delta="20" +                            width="200"/> +                    <text +                            follows="left|top" +                            height="10" +                            layout="topleft" +                            left_delta="-5" +                            top_delta="25" +                            width="200"> +                        Distance Multiplier: +                    </text> +                    <slider +                            decimal_digits="2" +                            follows="left|top" +                            height="10" +                            increment="0.01" +                            initial_value="0" +                            layout="topleft" +                            left_delta="5" +                            min_val="0" +                            max_val="100" +                            name="distance_multip" +                            top_delta="20" +                            width="214"/> +                    <text +                            follows="left|top" +                            height="10" +                            layout="topleft" +                            left_delta="-5" +                            top_delta="25" +                            width="200"> +                        Maximum Altitude: +                    </text> +                    <slider +                            decimal_digits="1" +                            follows="left|top" +                            height="10" +                            increment="0.01" +                            initial_value="0" +                            layout="topleft" +                            left_delta="5" +                            min_val="0" +                            max_val="4000" +                            name="max_alt" +                            top_delta="20" +                            width="214"/> +                </layout_panel>             +            </layout_stack>                 +        </layout_panel> +    </layout_stack> +</panel>
\ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/panel_settings_sky_clouds.xml b/indra/newview/skins/default/xui/en/panel_settings_sky_clouds.xml new file mode 100644 index 0000000000..b88ac64323 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_settings_sky_clouds.xml @@ -0,0 +1,265 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel +        border="true" +        follows="all" +        label="Clouds" +        layout="topleft" +        left="0" +        help_topic="land_general_tab" +        name="panel_settings_sky_clouds" +        top="0"> +    <layout_stack  +            left="5" +            top="5" +            right="-5" +            bottom="-5" +            follows="left|top|right|bottom" +            orientation="hoizontal"> +        <layout_panel +                border="true" +                bevel_style="in" +                auto_resize="true" +                user_resize="true" +                visible="true" +                height="75"> +            <text +                    follows="left|top" +                    height="10" +                    layout="topleft" +                    left_delta="15" +                    top_pad="15" +                    width="80"> +                Cloud Color: +            </text> +            <color_swatch +                    can_apply_immediately="true" +                    follows="left|top" +                    height="37" +                    label_height="0" +                    layout="topleft" +                    left_delta="0" +                    name="cloud_color" +                    top_pad="5" +                    width="60" /> +            <text +                    follows="left|top" +                    height="10" +                    layout="topleft" +                    left_delta="0" +                    top_delta="47" +                    width="200"> +                Cloud Coverage: +            </text> +            <slider +                    decimal_digits="2" +                    follows="left|top" +                    height="10" +                    increment="0.01" +                    initial_value="0" +                    layout="topleft" +                    left_delta="5" +                    min_val="0" +                    max_val="1" +                    name="cloud_coverage" +                    top_delta="20" +                    width="214"/> +            <text +                    follows="left|top" +                    height="10" +                    layout="topleft" +                    left_delta="-5" +                    top_delta="25" +                    width="200"> +                Cloud Scale: +            </text> +            <slider +                    decimal_digits="2" +                    follows="left|top" +                    height="10" +                    increment="0.01" +                    initial_value="0" +                    layout="topleft" +                    left_delta="5" +                    min_val="0" +                    max_val="1" +                    name="cloud_scale" +                    top_delta="20" +                    width="214"/> +            <text +                    follows="left|top" +                    height="10" +                    layout="topleft" +                    left_delta="-5" +                    top_delta="25" +                    width="200"> +                Cloud Scroll: +            </text> +            <panel +                    follows="left|top" +                    border="true" +                    bg_alpha_color="red" +                    background_visible="true" +                    width="100" +                    height="100" +                    left_delta="5" +                    top_delta="21"> +                <text> +                    placeholder +                </text> +                <slider +                        decimal_digits="1" +                        follows="left|top" +                        increment="0.01" +                        initial_value="0" +                        layout="topleft" +                        label="X:" +                        left_delta="10" +                        max_val="10" +                        min_val="-10" +                        name="cloud_scroll_x" +                        top_pad="5" +                        width="100"/> +                <slider +                        decimal_digits="1" +                        follows="left|top" +                        increment="0.01" +                        initial_value="0" +                        layout="topleft" +                        label="Y:" +                        left_delta="0" +                        max_val="10" +                        min_val="-10" +                        name="cloud_scroll_y" +                        top_pad="5" +                        orientation="vertical"  +                        height="70"/> +            </panel> +            <text +                    follows="left|top" +                    height="10" +                    layout="topleft" +                    left_delta="115" +                    top_delta="-20" +                    width="200"> +                Cloud Image: +            </text> +            <texture_picker +                    height="100" +                    layout="topleft" +                    left_delta="5" +                    name="cloud_map" +                    top_pad="10" +                    width="100"/> +        </layout_panel> +        <layout_panel +                border="true" +                bevel_style="in" +                auto_resize="true" +                user_resize="true" +                visible="true" +                height="75"> +            <text +                    follows="left|top" +                    height="10" +                    layout="topleft" +                    left_delta="15" +                    top_pad="15" +                    width="200"> +                Cloud Density: +            </text> +            <slider +                    label="X" +                    decimal_digits="2" +                    follows="left|top" +                    height="10" +                    increment="0.01" +                    initial_value="0" +                    layout="topleft" +                    left_delta="5" +                    min_val="0" +                    max_val="1" +                    name="cloud_density_x" +                    top_delta="20" +                    width="200"/> +            <slider +                    label="Y" +                    decimal_digits="2" +                    follows="left|top" +                    height="10" +                    increment="0.01" +                    initial_value="0" +                    layout="topleft" +                    left_delta="0" +                    min_val="0" +                    max_val="1" +                    name="cloud_density_y" +                    top_delta="20" +                    width="200"/> +            <slider +                    label="D" +                    decimal_digits="2" +                    follows="left|top" +                    height="10" +                    increment="0.01" +                    initial_value="0" +                    layout="topleft" +                    left_delta="0" +                    min_val="0" +                    max_val="1" +                    name="cloud_density_d" +                    top_delta="20" +                    width="200"/> +            <text +                    follows="left|top" +                    height="10" +                    layout="topleft" +                    left_delta="-5" +                    top_delta="35" +                    width="200"> +                Cloud Detail: +            </text> +            <slider +                    label="X" +                    decimal_digits="2" +                    follows="left|top" +                    height="10" +                    increment="0.01" +                    initial_value="0" +                    layout="topleft" +                    left_delta="5" +                    min_val="0" +                    max_val="1" +                    name="cloud_detail_x" +                    top_delta="20" +                    width="200"/> +            <slider +                    label="Y" +                    decimal_digits="2" +                    follows="left|top" +                    height="10" +                    increment="0.01" +                    initial_value="0" +                    layout="topleft" +                    left_delta="0" +                    min_val="0" +                    max_val="1" +                    name="cloud_detail_y" +                    top_delta="20" +                    width="200"/> +            <slider +                    label="D" +                    decimal_digits="2" +                    follows="left|top" +                    height="10" +                    increment="0.01" +                    initial_value="0" +                    layout="topleft" +                    left_delta="0" +                    min_val="0" +                    max_val="1" +                    name="cloud_detail_d" +                    top_delta="20" +                    width="200"/> +        </layout_panel> +    </layout_stack> +</panel>                
\ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml b/indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml new file mode 100644 index 0000000000..0eb4e5be94 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml @@ -0,0 +1,237 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel +        border="true" +        follows="all" +        label="Sun & Moon" +        layout="topleft" +        left="0" +        name="panel_settings_sky_hbodies" +        top="0"> +    <layout_stack  +            left="5" +            top="5" +            right="-5" +            bottom="-5" +            follows="left|top|right|bottom" +            orientation="hoizontal"> +        <layout_panel +                border="true" +                bevel_style="in" +                auto_resize="true" +                user_resize="true" +                visible="true" +                height="75"> +            <text +                    follows="left|top" +                    height="10" +                    layout="topleft" +                    left_delta="15" +                    top_pad="15" +                    width="80"> +                Sun Color: +            </text> +            <color_swatch +                    can_apply_immediately="true" +                    follows="left|top" +                    height="37" +                    label_height="0" +                    layout="topleft" +                    left_delta="0" +                    name="sun_moon_color" +                    top_pad="5" +                    width="60" /> +            <text +                    follows="left|top" +                    height="10" +                    layout="topleft" +                    left_delta="0" +                    top_delta="57" +                    width="200"> +                Glow Focus: +            </text> +            <slider +                    decimal_digits="2" +                    follows="left|top" +                    height="10" +                    increment="0.01" +                    initial_value="0" +                    layout="topleft" +                    left_delta="5" +                    min_val="0" +                    max_val="0.5" +                    name="glow_focus" +                    top_delta="20" +                    width="200"/> +            <text +                    follows="left|top" +                    height="10" +                    layout="topleft" +                    left_delta="-5" +                    top_delta="20" +                    width="200"> +                Glow Size: +            </text> +            <slider +                    decimal_digits="2" +                    follows="left|top" +                    height="10" +                    increment="0.01" +                    initial_value="0" +                    layout="topleft" +                    left_delta="5" +                    min_val="1" +                    max_val="1.99" +                    name="glow_size" +                    top_delta="20" +                    width="200"/> +            <text +                    follows="left|top" +                    height="10" +                    layout="topleft" +                    left_delta="-5" +                    top_delta="30" +                    width="200"> +                Star Brightness: +            </text> +            <slider +                    decimal_digits="2" +                    follows="left|top" +                    height="10" +                    increment="0.01" +                    initial_value="0" +                    layout="topleft" +                    left_delta="5" +                    min_val="0" +                    max_val="2" +                    name="star_brightness" +                    top_delta="20" +                    width="200"/> +        </layout_panel> +        <layout_panel +                border="false" +                bevel_style="in" +                auto_resize="true" +                user_resize="true" +                visible="true" +                height="75"> +            <layout_stack  +                    left="5" +                    top="5" +                    right="-5" +                    bottom="-5" +                    follows="left|top|right|bottom" +                    orientation="vertical"> +                <layout_panel +                        border="true" +                        bevel_style="in" +                        auto_resize="true" +                        user_resize="true" +                        visible="true" +                        height="75"> +                    <text +                            follows="left|top" +                            height="10" +                            layout="topleft" +                            left_delta="15" +                            top_pad="15" +                            font="SansSerifBold" +                            width="80"> +                        Sun +                    </text> +                    <text +                            follows="left|top" +                            height="10" +                            layout="topleft" +                            left_delta="10" +                            top_delta="30" +                            width="100"> +                        Position: +                    </text> +                    <joystick_quat +                            follows="left|top" +                            height="78" +                            layout="topleft" +                            left_delta="0" +                            top_delta="20" +                            name="sun_rotation" +                            quadrant="left" +                            sound_flags="3" +                            visible="true" +                            tool_tip="Move sun in sky" +                            width="78" /> <!-- Should be 126x126 --> +                    <text +                            follows="left|top" +                            height="10" +                            layout="topleft" +                            left_delta="100" +                            top_delta="-20" +                            width="200"> +                        Image: +                    </text> +                    <texture_picker +                            height="100" +                            layout="topleft" +                            left_delta="5" +                            name="sun_image" +                            top_pad="10" +                            width="100"/> +                </layout_panel> +                <layout_panel +                        border="true" +                        bevel_style="in" +                        auto_resize="true" +                        user_resize="true" +                        visible="true" +                        height="75"> +                    <text +                            follows="left|top" +                            height="10" +                            layout="topleft" +                            left_delta="15" +                            top_pad="15" +                            font="SansSerifBold" +                            width="80"> +                        Moon +                    </text> +                    <text +                            follows="left|top" +                            height="10" +                            layout="topleft" +                            left_delta="10" +                            top_delta="30" +                            width="100"> +                        Position: +                    </text> +                    <joystick_quat +                            follows="left|top" +                            height="78" +                            layout="topleft" +                            left_delta="0" +                            top_delta="20" +                            name="moon_rotation" +                            quadrant="left" +                            sound_flags="3" +                            visible="true" +                            tool_tip="Move sun in sky" +                            width="78" /> <!-- Should be 126x126 --> +                    <text +                            follows="left|top" +                            height="10" +                            layout="topleft" +                            left_delta="100" +                            top_delta="-20" +                            width="200"> +                        Image: +                    </text> +                    <texture_picker +                            height="100" +                            layout="topleft" +                            left_delta="5" +                            name="moon_image" +                            top_pad="10" +                            width="100"/> +                </layout_panel> +            </layout_stack> +        </layout_panel> +    </layout_stack> +</panel>                 diff --git a/indra/newview/skins/default/xui/en/panel_settings_water.xml b/indra/newview/skins/default/xui/en/panel_settings_water.xml index fe088d98cf..eb4664616e 100644 --- a/indra/newview/skins/default/xui/en/panel_settings_water.xml +++ b/indra/newview/skins/default/xui/en/panel_settings_water.xml @@ -63,6 +63,7 @@                      decimal_digits="1"                      follows="left|top|right"                      height="10" +                    increment="0.01"                      initial_value="0"                      layout="top"                      left_delta="15" @@ -81,6 +82,7 @@                      decimal_digits="1"                      follows="left|top|right"                      height="10" +                    increment="0.01"                      initial_value="0"                      layout="top"                      left_delta="15" @@ -158,6 +160,7 @@                          <slider                                  decimal_digits="1"                                  follows="left|top" +                                increment="0.01"                                  initial_value="0"                                  layout="topleft"                                  label="X:" @@ -170,6 +173,7 @@                          <slider                                  decimal_digits="1"                                  follows="left|top" +                                increment="0.01"                                  initial_value="0"                                  layout="topleft"                                  label="Y:" @@ -205,6 +209,7 @@                          <slider                                  decimal_digits="1"                                  follows="left|top" +                                increment="0.01"                                  initial_value="0"                                  layout="topleft"                                  label="X:" @@ -217,6 +222,7 @@                          <slider                                  decimal_digits="1"                                  follows="left|top" +                                increment="0.01"                                  initial_value="0"                                  layout="topleft"                                  label="Y:" @@ -241,6 +247,7 @@                      <slider                              decimal_digits="1"                              follows="left|top" +                            increment="0.01"                              initial_value="0.7"                              layout="topleft"                              label="X:" @@ -252,6 +259,7 @@                      <slider                              decimal_digits="1"                              follows="left|top" +                            increment="0.01"                              initial_value="0.7"                              layout="topleft"                              max_val="10" @@ -262,6 +270,7 @@                      <slider                              decimal_digits="1"                              follows="left|top" +                            increment="0.01"                              initial_value="0.7"                              layout="topleft"                              max_val="10" diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 5f30a7e87d..55a871d120 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3850,6 +3850,11 @@ Abuse Report</string>    <string name="Female - Shrug">Female - Shrug</string>    <string name="Female - Stick tougue out">Female - Stick tongue out</string>    <string name="Female - Wow">Female - Wow</string> +  <!-- settings --> +  <string name="New Daycycle">New Daycycle</string> +  <string name="New Water">New Water</string> +  <string name="New Sky">New Sky</string> +      <string name="/bow">/bow</string>    <string name="/clap">/clap</string>  | 
