summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llfloatereditextdaycycle.cpp92
-rw-r--r--indra/newview/llfloatereditextdaycycle.h18
-rw-r--r--indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml345
3 files changed, 300 insertions, 155 deletions
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index 048090aea6..9583f9f792 100644
--- a/indra/newview/llfloatereditextdaycycle.cpp
+++ b/indra/newview/llfloatereditextdaycycle.cpp
@@ -85,6 +85,9 @@ namespace {
const std::string BTN_DELFRAME("delete_frame");
const std::string BTN_IMPORT("btn_import");
const std::string BTN_LOADFRAME("btn_load_frame");
+ const std::string BTN_CLONETRACK("copy_track");
+ const std::string BTN_LOADTRACK("load_track");
+ const std::string BTN_CLEARTRACK("clear_track");
const std::string SLDR_TIME("WLTimeSlider");
const std::string SLDR_KEYFRAMES("WLDayCycleFrames");
const std::string VIEW_SKY_SETTINGS("frame_settings_sky");
@@ -116,6 +119,8 @@ namespace {
const std::string STR_COMMIT_PARCEL("commit_parcel");
const std::string STR_COMMIT_REGION("commit_region");
+ //---------------------------------------------------------------------
+
}
//=========================================================================
@@ -175,7 +180,10 @@ LLFloaterEditExtDayCycle::LLFloaterEditExtDayCycle(const LLSD &key) :
mIsDirty(false),
mCanCopy(false),
mCanMod(false),
- mMakeNoTrans(false)
+ mMakeNoTrans(false),
+ mCloneTrack(nullptr),
+ mLoadTrack(nullptr),
+ mClearTrack(nullptr)
{
mCommitCallbackRegistrar.add(EVNT_DAYTRACK, [this](LLUICtrl *ctrl, const LLSD &data) { onTrackSelectionCallback(data); });
@@ -209,17 +217,25 @@ BOOL LLFloaterEditExtDayCycle::postBuild()
mCurrentTimeLabel = getChild<LLTextBox>(LBL_CURRENT_TIME, true);
mImportButton = getChild<LLButton>(BTN_IMPORT, true);
mLoadFrame = getChild<LLButton>(BTN_LOADFRAME, true);
+ mCloneTrack = getChild<LLButton>(BTN_CLONETRACK, true);
+ mLoadTrack = getChild<LLButton>(BTN_LOADTRACK, true);
+ mClearTrack = getChild<LLButton>(BTN_CLEARTRACK, true);
mFlyoutControl = new LLFlyoutComboBtnCtrl(this, BTN_SAVE, BTN_FLYOUT, XML_FLYOUTMENU_FILE, false);
mFlyoutControl->setAction([this](LLUICtrl *ctrl, const LLSD &data) { onButtonApply(ctrl, data); });
getChild<LLButton>(BTN_CANCEL, true)->setCommitCallback([this](LLUICtrl *ctrl, const LLSD &data) { onClickCloseBtn(); });
mTimeSlider->setCommitCallback([this](LLUICtrl *ctrl, const LLSD &data) { onTimeSliderCallback(); });
- mAddFrameButton->setCommitCallback([this](LLUICtrl *ctrl, const LLSD &data) { onAddTrack(); });
- mDeleteFrameButton->setCommitCallback([this](LLUICtrl *ctrl, const LLSD &data) { onRemoveTrack(); });
+ mAddFrameButton->setCommitCallback([this](LLUICtrl *ctrl, const LLSD &data) { onAddFrame(); });
+ mDeleteFrameButton->setCommitCallback([this](LLUICtrl *ctrl, const LLSD &data) { onRemoveFrame(); });
mImportButton->setCommitCallback([this](LLUICtrl *, const LLSD &){ onButtonImport(); });
mLoadFrame->setCommitCallback([this](LLUICtrl *, const LLSD &){ onButtonLoadFrame(); });
+ mCloneTrack->setCommitCallback([this](LLUICtrl *, const LLSD&){ onCloneTrack(); });
+ mLoadTrack->setCommitCallback([this](LLUICtrl *, const LLSD&){ onLoadTrack();});
+ mClearTrack->setCommitCallback([this](LLUICtrl *, const LLSD&){ onClearTrack(); });
+
+
mFramesSlider->setCommitCallback([this](LLUICtrl *, const LLSD &data) { onFrameSliderCallback(data); });
mFramesSlider->setDoubleClickCallback([this](LLUICtrl*, S32 x, S32 y, MASK mask){ onFrameSliderDoubleClick(x, y, mask); });
mFramesSlider->setMouseDownCallback([this](LLUICtrl*, S32 x, S32 y, MASK mask){ onFrameSliderMouseDown(x, y, mask); });
@@ -566,7 +582,6 @@ BOOL LLFloaterEditExtDayCycle::handleKeyUp(KEY key, MASK mask, BOOL called_from_
return LLFloater::handleKeyUp(key, mask, called_from_parent);
}
-
void LLFloaterEditExtDayCycle::onButtonApply(LLUICtrl *ctrl, const LLSD &data)
{
std::string ctrl_action = ctrl->getName();
@@ -740,7 +755,7 @@ void LLFloaterEditExtDayCycle::onButtonLoadFrame()
doOpenInventoryFloater((mCurrentTrack == LLSettingsDay::TRACK_WATER) ? LLSettingsType::ST_WATER : LLSettingsType::ST_SKY, curitemId);
}
-void LLFloaterEditExtDayCycle::onAddTrack()
+void LLFloaterEditExtDayCycle::onAddFrame()
{
LLSettingsBase::Seconds frame(mTimeSlider->getCurSliderValue());
LLSettingsBase::ptr_t setting;
@@ -775,7 +790,7 @@ void LLFloaterEditExtDayCycle::onAddTrack()
updateTabs();
}
-void LLFloaterEditExtDayCycle::onRemoveTrack()
+void LLFloaterEditExtDayCycle::onRemoveFrame()
{
std::string sldr_key = mFramesSlider->getCurSlider();
if (sldr_key.empty())
@@ -786,6 +801,41 @@ void LLFloaterEditExtDayCycle::onRemoveTrack()
updateTabs();
}
+
+void LLFloaterEditExtDayCycle::onCloneTrack()
+{
+
+}
+
+
+void LLFloaterEditExtDayCycle::onLoadTrack()
+{
+
+}
+
+
+void LLFloaterEditExtDayCycle::onClearTrack()
+{
+ if (mCurrentTrack > 1)
+ mEditDay->getCycleTrack(mCurrentTrack).clear();
+ else
+ {
+ LLSettingsDay::CycleTrack_t &track(mEditDay->getCycleTrack(mCurrentTrack));
+
+ auto first = track.begin();
+ auto last = track.end();
+ ++first;
+ track.erase(first, last);
+ }
+
+ updateEditEnvironment();
+ LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_EDIT, LLEnvironment::TRANSITION_INSTANT);
+ LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_INSTANT);
+ synchronizeTabs();
+ updateTabs();
+ refresh();
+}
+
void LLFloaterEditExtDayCycle::onCommitName(class LLLineEditor* caller, void* user_data)
{
mEditDay->setName(caller->getText());
@@ -900,7 +950,7 @@ void LLFloaterEditExtDayCycle::onFrameSliderCallback(const LLSD &data)
void LLFloaterEditExtDayCycle::onFrameSliderDoubleClick(S32 x, S32 y, MASK mask)
{
stopPlay();
- onAddTrack();
+ onAddFrame();
}
void LLFloaterEditExtDayCycle::onFrameSliderMouseDown(S32 x, S32 y, MASK mask)
@@ -994,7 +1044,6 @@ void LLFloaterEditExtDayCycle::selectTrack(U32 track_index, bool force )
std::string iconname = (show_water) ? "Inv_SettingsWater" : "Inv_SettingsSky";
mFramesSlider->setSliderThumbImage(iconname);
-
updateSlider();
updateLabels();
}
@@ -1126,6 +1175,33 @@ void LLFloaterEditExtDayCycle::updateButtons()
mAddFrameButton->setEnabled(!mIsPlaying && isAddingFrameAllowed() && mCanMod);
mDeleteFrameButton->setEnabled(!mIsPlaying && isRemovingFrameAllowed() && mCanMod);
mLoadFrame->setEnabled(!mIsPlaying && mCanMod);
+
+ bool can_clone(false);
+ bool can_load(true);
+ bool can_clear(true);
+
+ can_clear = (mCurrentTrack > 1) ? (!mEditDay->getCycleTrack(mCurrentTrack).empty()) : (mEditDay->getCycleTrack(mCurrentTrack).size() > 1);
+
+ if (mCurrentTrack == 0)
+ {
+ can_clone = false;
+ }
+ else
+ {
+ for (S32 track = 1; track < LLSettingsDay::TRACK_MAX; ++track)
+ {
+ if (track == mCurrentTrack)
+ continue;
+ can_clone |= !mEditDay->getCycleTrack(track).empty();
+ }
+ }
+
+ mCloneTrack->setEnabled(can_clone && false);
+ mCloneTrack->setVisible(false);
+ mLoadTrack->setEnabled(can_load && false);
+ mLoadTrack->setVisible(false);
+ mClearTrack->setEnabled(can_clear);
+
}
void LLFloaterEditExtDayCycle::updateSlider()
diff --git a/indra/newview/llfloatereditextdaycycle.h b/indra/newview/llfloatereditextdaycycle.h
index 1967f5a470..67a6f1e0e9 100644
--- a/indra/newview/llfloatereditextdaycycle.h
+++ b/indra/newview/llfloatereditextdaycycle.h
@@ -111,8 +111,11 @@ private:
virtual void onClickCloseBtn(bool app_quitting = false) override;
void onButtonImport();
void onButtonLoadFrame();
- void onAddTrack();
- void onRemoveTrack();
+ void onAddFrame();
+ void onRemoveFrame();
+ void onCloneTrack();
+ void onLoadTrack();
+ void onClearTrack();
void onCommitName(class LLLineEditor* caller, void* user_data);
void onTrackSelectionCallback(const LLSD& user_data);
void onPlayActionCallback(const LLSD& user_data);
@@ -147,10 +150,10 @@ private:
void doImportFromDisk();
void loadSettingFromFile(const std::vector<std::string>& filenames);
- void doApplyCreateNewInventory(const LLSettingsDay::ptr_t &day, std::string settings_name);
- void doApplyUpdateInventory(const LLSettingsDay::ptr_t &day);
- void doApplyEnvironment(const std::string &where, const LLSettingsDay::ptr_t &day);
- void doApplyCommit(LLSettingsDay::ptr_t day);
+ void doApplyCreateNewInventory(const LLSettingsDay::ptr_t &day, std::string settings_name);
+ void doApplyUpdateInventory(const LLSettingsDay::ptr_t &day);
+ void doApplyEnvironment(const std::string &where, const LLSettingsDay::ptr_t &day);
+ void doApplyCommit(LLSettingsDay::ptr_t day);
void onInventoryCreated(LLUUID asset_id, LLUUID inventory_id);
void onInventoryCreated(LLUUID asset_id, LLUUID inventory_id, LLSD results);
void onInventoryUpdated(LLUUID asset_id, LLUUID inventory_id, LLSD results);
@@ -194,6 +197,9 @@ private:
LLButton* mDeleteFrameButton;
LLButton* mImportButton;
LLButton* mLoadFrame;
+ LLButton * mCloneTrack;
+ LLButton * mLoadTrack;
+ LLButton * mClearTrack;
LLMultiSliderCtrl* mTimeSlider;
LLMultiSliderCtrl* mFramesSlider;
LLView* mSkyTabLayoutContainer;
diff --git a/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml b/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml
index 1aea1391d8..284b30da6c 100644
--- a/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml
+++ b/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml
@@ -26,7 +26,7 @@
<string name="commit_parcel">Apply To Parcel</string>
<string name="commit_region">Apply To Region</string>
-
+
<!-- Layout -->
<layout_stack name="outer_stack"
width="705"
@@ -270,162 +270,225 @@
width="70" />
<layout_stack
- name="progress_control"
- follows="top|left"
- height="25"
- width="83"
- layout="topleft"
+ follows="all"
+ height="200"
animate="false"
- left="225"
- top_pad="40"
+ top_pad="5"
+ left="0"
orientation="horizontal">
-
<layout_panel
- name="skip_back"
- mouse_opaque="false"
+ border="false"
+ bevel_style="in"
auto_resize="false"
- layout="topleft"
- top="0"
- height="25"
- min_width="25"
- width="25">
+ user_resize="false"
+ height="150"
+ width="200"
+ min_height="0"
+ visible="true">
<button
- name="skip_back_btn"
- follows="top"
- image_overlay="SkipBackward_Off"
- image_disabled="PushButton_Disabled"
- image_disabled_selected="PushButton_Disabled"
- image_selected="PushButton_Selected"
- image_unselected="PushButton_Off"
- hover_glow_amount="0.15"
- auto_resize="false"
- width="25"
- height="25"
- layout="topleft"
- tool_tip="Step back"
- top="0"
- left="0">
- <button.commit_callback
- function="DayCycle.PlayActions"
- parameter="back" />
- </button>
+ follows="top|left"
+ height="23"
+ width="90"
+ label="Clone From"
+ left="10"
+ top_pad="10"
+ name="copy_track" />
+ <button
+ follows="top|left"
+ height="23"
+ width="90"
+ label="Load From"
+ top_pad="0"
+ left_delta="0"
+ name="load_track" />
+ <button
+ follows="top|left"
+ height="23"
+ width="90"
+ label="Clear"
+ top_pad="0"
+ left_delta="0"
+ name="clear_track" />
+
</layout_panel>
-
<layout_panel
- name="play_layout"
- mouse_opaque="false"
+ border="false"
+ bevel_style="in"
auto_resize="false"
- layout="topleft"
- top="0"
- height="25"
- min_width="25"
- width="25">
- <button
- name="play_btn"
- follows="top"
- image_overlay="Play_Off"
- image_disabled="PushButton_Disabled"
- image_disabled_selected="PushButton_Disabled"
- image_selected="PushButton_Selected"
- image_unselected="PushButton_Off"
- hover_glow_amount="0.15"
- auto_resize="false"
- layout="topleft"
+ user_resize="false"
+ height="150"
+ width="200"
+ min_height="0"
+ visible="true">
+ <layout_stack
+ name="progress_control"
+ follows="top|left"
height="25"
- width="25"
- left="0"
- top="0">
- <button.commit_callback
- function="DayCycle.PlayActions"
- parameter="play" />
- </button>
- </layout_panel>
+ width="83"
+ layout="topleft"
+ animate="false"
+ left="31"
+ top="40"
+ orientation="horizontal">
+
+ <layout_panel
+ name="skip_back"
+ mouse_opaque="false"
+ auto_resize="false"
+ layout="topleft"
+ top="0"
+ height="25"
+ min_width="25"
+ width="25">
+ <button
+ name="skip_back_btn"
+ follows="top"
+ image_overlay="SkipBackward_Off"
+ image_disabled="PushButton_Disabled"
+ image_disabled_selected="PushButton_Disabled"
+ image_selected="PushButton_Selected"
+ image_unselected="PushButton_Off"
+ hover_glow_amount="0.15"
+ auto_resize="false"
+ width="25"
+ height="25"
+ layout="topleft"
+ tool_tip="Step back"
+ top="0"
+ left="0">
+ <button.commit_callback
+ function="DayCycle.PlayActions"
+ parameter="back" />
+ </button>
+ </layout_panel>
+
+ <layout_panel
+ name="play_layout"
+ mouse_opaque="false"
+ auto_resize="false"
+ layout="topleft"
+ top="0"
+ height="25"
+ min_width="25"
+ width="25">
+ <button
+ name="play_btn"
+ follows="top"
+ image_overlay="Play_Off"
+ image_disabled="PushButton_Disabled"
+ image_disabled_selected="PushButton_Disabled"
+ image_selected="PushButton_Selected"
+ image_unselected="PushButton_Off"
+ hover_glow_amount="0.15"
+ auto_resize="false"
+ layout="topleft"
+ height="25"
+ width="25"
+ left="0"
+ top="0">
+ <button.commit_callback
+ function="DayCycle.PlayActions"
+ parameter="play" />
+ </button>
+ </layout_panel>
+ <layout_panel
+ name="pause_layout"
+ mouse_opaque="false"
+ auto_resize="false"
+ layout="topleft"
+ top="0"
+ height="25"
+ min_width="25"
+ width="25"
+ visible="false">
+ <button
+ name="pause_btn"
+ follows="top"
+ image_overlay="Pause_Off"
+ image_disabled="PushButton_Disabled"
+ image_disabled_selected="PushButton_Disabled"
+ image_selected="PushButton_Selected"
+ image_unselected="PushButton_Off"
+ hover_glow_amount="0.15"
+ auto_resize="false"
+ layout="topleft"
+ height="25"
+ width="25"
+ left="0"
+ top="0">
+ <button.commit_callback
+ function="DayCycle.PlayActions"
+ parameter="pause" />
+ </button>
+ </layout_panel>
+
+ <layout_panel
+ name="skip_forward"
+ mouse_opaque="false"
+ auto_resize="false"
+ layout="topleft"
+ top="0"
+ height="25"
+ min_width="25"
+ width="25">
+ <button
+ name="skip_forward_btn"
+ follows="top"
+ image_overlay="SkipForward_Off"
+ image_disabled="PushButton_Disabled"
+ image_disabled_selected="PushButton_Disabled"
+ image_selected="PushButton_Selected"
+ image_unselected="PushButton_Off"
+ hover_glow_amount="0.15"
+ width="25"
+ height="25"
+ layout="topleft"
+ tool_tip="Step forward"
+ top="0">
+ <button.commit_callback
+ function="DayCycle.PlayActions"
+ parameter="forward" />
+ </button>
+ </layout_panel>
+ </layout_stack>
+ </layout_panel>
<layout_panel
- name="pause_layout"
- mouse_opaque="false"
+ border="false"
+ bevel_style="in"
auto_resize="false"
- layout="topleft"
- top="0"
- height="25"
- min_width="25"
- width="25"
- visible="false">
+ user_resize="false"
+ width="190"
+ height="150"
+ min_height="0"
+ visible="true">
<button
- name="pause_btn"
- follows="top"
- image_overlay="Pause_Off"
- image_disabled="PushButton_Disabled"
- image_disabled_selected="PushButton_Disabled"
- image_selected="PushButton_Selected"
- image_unselected="PushButton_Off"
- hover_glow_amount="0.15"
- auto_resize="false"
- layout="topleft"
- height="25"
- width="25"
- left="0"
- top="0">
- <button.commit_callback
- function="DayCycle.PlayActions"
- parameter="pause" />
- </button>
- </layout_panel>
- <layout_panel
- name="skip_forward"
- mouse_opaque="false"
- auto_resize="false"
- layout="topleft"
- top="0"
- height="25"
- min_width="25"
- width="25">
+ follows="top|right"
+ height="23"
+ width="90"
+ right="-10"
+ top_pad="10"
+ label="Add [FRAME]"
+ name="add_frame" />
<button
- name="skip_forward_btn"
- follows="top"
- image_overlay="SkipForward_Off"
- image_disabled="PushButton_Disabled"
- image_disabled_selected="PushButton_Disabled"
- image_selected="PushButton_Selected"
- image_unselected="PushButton_Off"
- hover_glow_amount="0.15"
- width="25"
- height="25"
- layout="topleft"
- tool_tip="Step forward"
- top="0">
- <button.commit_callback
- function="DayCycle.PlayActions"
- parameter="forward" />
- </button>
+ follows="top|left"
+ height="23"
+ width="90"
+ label="Load [FRAME]"
+ top_pad="0"
+ left_delta="0"
+ name="btn_load_frame" />
+ <button
+ follows="left|top"
+ height="23"
+ width="90"
+ label="Delete [FRAME]"
+ top_pad="0"
+ left_delta="0"
+ name="delete_frame" />
</layout_panel>
</layout_stack>
-
- <button
- follows="top|left"
- height="23"
- width="90"
- label="Add [FRAME]"
- left_pad="175"
- top_delta="-20"
- name="add_frame" />
- <button
- follows="top|left"
- height="23"
- width="90"
- label="Load [FRAME]"
- top_pad="0"
- left_delta="0"
- name="btn_load_frame" />
- <button
- follows="left|top"
- height="23"
- width="90"
- label="Delete [FRAME]"
- top_pad="0"
- left_delta="0"
- name="delete_frame" />
</panel>
</layout_panel>
<layout_panel name="frame_edit_controls"
@@ -447,7 +510,7 @@
font="SansSerif"
text_color="Yellow"
width="500">
-Select a key frame from the timeline above to edit settings.
+ Select a key frame from the timeline above to edit settings.
</text>
</layout_panel>
<layout_panel name="frame_settings_water"