summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llinventory/llsettingsdaycycle.cpp1
-rw-r--r--indra/llinventory/llsettingsdaycycle.h1
-rw-r--r--indra/newview/llfloatereditextdaycycle.cpp10
-rw-r--r--indra/newview/llfloatereditextdaycycle.h3
-rw-r--r--indra/newview/llpanelenvironment.cpp30
-rw-r--r--indra/newview/llpanelenvironment.h1
6 files changed, 42 insertions, 4 deletions
diff --git a/indra/llinventory/llsettingsdaycycle.cpp b/indra/llinventory/llsettingsdaycycle.cpp
index 25cd99b997..c911ef23c0 100644
--- a/indra/llinventory/llsettingsdaycycle.cpp
+++ b/indra/llinventory/llsettingsdaycycle.cpp
@@ -115,6 +115,7 @@ const LLSettingsDay::Seconds LLSettingsDay::DEFAULT_DAYOFFSET(57600); // +16 ho
const LLSettingsDay::Seconds LLSettingsDay::MAXIMUM_DAYOFFSET(86400); // 24 hours
const S32 LLSettingsDay::TRACK_WATER(0); // water track is 0
+const S32 LLSettingsDay::TRACK_GROUND_LEVEL(1);
const S32 LLSettingsDay::TRACK_MAX(5); // 5 tracks, 4 skys, 1 water
const S32 LLSettingsDay::FRAME_MAX(56);
diff --git a/indra/llinventory/llsettingsdaycycle.h b/indra/llinventory/llsettingsdaycycle.h
index 46dc0cec74..8776f6725d 100644
--- a/indra/llinventory/llsettingsdaycycle.h
+++ b/indra/llinventory/llsettingsdaycycle.h
@@ -60,6 +60,7 @@ public:
static const Seconds MAXIMUM_DAYOFFSET;
static const S32 TRACK_WATER;
+ static const S32 TRACK_GROUND_LEVEL;
static const S32 TRACK_MAX;
static const S32 FRAME_MAX;
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index 0b59239f8c..ce4797c380 100644
--- a/indra/newview/llfloatereditextdaycycle.cpp
+++ b/indra/newview/llfloatereditextdaycycle.cpp
@@ -62,8 +62,6 @@
#include "llenvironment.h"
#include "lltrans.h"
-extern LLControlGroup gSavedSettings;
-
//=========================================================================
namespace {
const std::string track_tabs[] = {
@@ -116,6 +114,7 @@ namespace {
const std::string LLFloaterEditExtDayCycle::KEY_INVENTORY_ID("inventory_id");
const std::string LLFloaterEditExtDayCycle::KEY_EDIT_CONTEXT("edit_context");
const std::string LLFloaterEditExtDayCycle::KEY_DAY_LENGTH("day_length");
+const std::string LLFloaterEditExtDayCycle::KEY_CANMOD("canmod");
const std::string LLFloaterEditExtDayCycle::VALUE_CONTEXT_INVENTORY("inventory");
const std::string LLFloaterEditExtDayCycle::VALUE_CONTEXT_PARCEL("parcel");
@@ -260,6 +259,11 @@ void LLFloaterEditExtDayCycle::onOpen(const LLSD& key)
mEditContext = CONTEXT_REGION;
}
+ if (key.has(KEY_CANMOD))
+ {
+ mCanMod = key[KEY_CANMOD].asBoolean();
+ }
+
if (mEditContext == CONTEXT_UNKNOWN)
{
LL_WARNS("ENVDAYEDIT") << "Unknown editing context!" << LL_ENDL;
@@ -891,7 +895,7 @@ void LLFloaterEditExtDayCycle::updateButtons()
//mAddFrameButton->setEnabled(can_add);
//mDeleteFrameButton->setEnabled(!can_add);
mAddFrameButton->setEnabled(true && mCanMod);
- mDeleteFrameButton->setEnabled(true && mCanMod);
+ mDeleteFrameButton->setEnabled(isRemovingFrameAllowed() && mCanMod);
}
void LLFloaterEditExtDayCycle::updateSlider()
diff --git a/indra/newview/llfloatereditextdaycycle.h b/indra/newview/llfloatereditextdaycycle.h
index c64ed3ff5a..76f7d705a2 100644
--- a/indra/newview/llfloatereditextdaycycle.h
+++ b/indra/newview/llfloatereditextdaycycle.h
@@ -57,6 +57,7 @@ public:
static const std::string KEY_INVENTORY_ID;
static const std::string KEY_EDIT_CONTEXT;
static const std::string KEY_DAY_LENGTH;
+ static const std::string KEY_CANMOD;
static const std::string VALUE_CONTEXT_INVENTORY;
static const std::string VALUE_CONTEXT_PARCEL;
@@ -166,6 +167,8 @@ private:
void setDirtyFlag() { mIsDirty = true; }
virtual void clearDirtyFlag();
+ bool isRemovingFrameAllowed();
+
LLSettingsDay::ptr_t mEditDay; // edited copy
LLSettingsDay::Seconds mDayLength;
U32 mCurrentTrack;
diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp
index 51b2fa380f..3edfd4156c 100644
--- a/indra/newview/llpanelenvironment.cpp
+++ b/indra/newview/llpanelenvironment.cpp
@@ -141,6 +141,7 @@ void LLPanelEnvironmentInfo::refresh()
return;
setControlsEnabled(canEdit());
+
if (!mCurrentEnvironment)
{
return;
@@ -240,6 +241,7 @@ LLFloaterEditExtDayCycle * LLPanelEnvironmentInfo::getEditFloater(bool create)
if (!editor)
return nullptr;
+ mEditFloater = editor->getHandle();
}
if (editor && !mCommitConnection.connected())
@@ -248,6 +250,30 @@ LLFloaterEditExtDayCycle * LLPanelEnvironmentInfo::getEditFloater(bool create)
return editor;
}
+
+void LLPanelEnvironmentInfo::updateEditFloater(const LLEnvironment::EnvironmentInfo::ptr_t &nextenv)
+{
+ LLFloaterEditExtDayCycle *dayeditor(getEditFloater(false));
+
+ if (!dayeditor)
+ return;
+
+ if (!nextenv || !nextenv->mDayCycle)
+ {
+ if (mCommitConnection.connected())
+ mCommitConnection.disconnect();
+
+ if (dayeditor->isDirty())
+ dayeditor->refresh();
+ else
+ dayeditor->closeFloater();
+ }
+ else
+ {
+ /*TODO: Swap in new day to edit?*/
+ }
+}
+
void LLPanelEnvironmentInfo::setControlsEnabled(bool enabled)
{
S32 rdo_selection = getChild<LLRadioGroup>(RDG_ENVIRONMENT_SELECT)->getSelectedIndex();
@@ -272,6 +298,7 @@ void LLPanelEnvironmentInfo::setControlsEnabled(bool enabled)
getChild<LLUICtrl>(PNL_BUTTONS)->setVisible(!is_unavailable);
getChild<LLUICtrl>(PNL_DISABLED)->setVisible(is_unavailable);
+ updateEditFloater(mCurrentEnvironment);
}
void LLPanelEnvironmentInfo::setApplyProgress(bool started)
@@ -357,7 +384,8 @@ void LLPanelEnvironmentInfo::onBtnEdit()
LLFloaterEditExtDayCycle *dayeditor = getEditFloater();
LLSD params(LLSDMap(LLFloaterEditExtDayCycle::KEY_EDIT_CONTEXT, (mCurrentParcelId == INVALID_PARCEL_ID) ? LLFloaterEditExtDayCycle::VALUE_CONTEXT_REGION : LLFloaterEditExtDayCycle::VALUE_CONTEXT_REGION)
- (LLFloaterEditExtDayCycle::KEY_DAY_LENGTH, mCurrentEnvironment ? (S32)(mCurrentEnvironment->mDayLength.value()) : FOURHOURS));
+ (LLFloaterEditExtDayCycle::KEY_DAY_LENGTH, mCurrentEnvironment ? (S32)(mCurrentEnvironment->mDayLength.value()) : FOURHOURS)
+ (LLFloaterEditExtDayCycle::KEY_CANMOD, LLSD::Boolean(true)));
dayeditor->openFloater(params);
if (mCurrentEnvironment->mDayCycle)
diff --git a/indra/newview/llpanelenvironment.h b/indra/newview/llpanelenvironment.h
index b867a7b61d..a8a1f018cf 100644
--- a/indra/newview/llpanelenvironment.h
+++ b/indra/newview/llpanelenvironment.h
@@ -121,6 +121,7 @@ protected:
LLFloaterSettingsPicker * getSettingsPicker();
LLFloaterEditExtDayCycle * getEditFloater(bool create = true);
+ void updateEditFloater(const LLEnvironment::EnvironmentInfo::ptr_t &nextenv);
LLEnvironment::EnvironmentInfo::ptr_t mCurrentEnvironment;
S32 mCurrentParcelId;