summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llfloatereditextdaycycle.cpp49
-rw-r--r--indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml4
2 files changed, 39 insertions, 14 deletions
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index 554757840f..cbdc026cfe 100644
--- a/indra/newview/llfloatereditextdaycycle.cpp
+++ b/indra/newview/llfloatereditextdaycycle.cpp
@@ -191,19 +191,21 @@ BOOL LLFloaterEditExtDayCycle::postBuild()
void LLFloaterEditExtDayCycle::onOpen(const LLSD& key)
{
mEditDay.reset();
+
+ LLEnvironment::EnvSelection_t env = LLEnvironment::ENV_DEFAULT;
if (key.has(KEY_INVENTORY_ID))
{
loadInventoryItem(key[KEY_INVENTORY_ID].asUUID());
}
else if (key.has(KEY_LIVE_ENVIRONMENT))
{
- LLEnvironment::EnvSelection_t env = static_cast<LLEnvironment::EnvSelection_t>(key[KEY_LIVE_ENVIRONMENT].asInteger());
+ env = static_cast<LLEnvironment::EnvSelection_t>(key[KEY_LIVE_ENVIRONMENT].asInteger());
loadLiveEnvironment(env);
}
else
{
- loadLiveEnvironment(LLEnvironment::ENV_DEFAULT);
+ loadLiveEnvironment(env);
}
mDayLength.value(0);
@@ -212,7 +214,7 @@ void LLFloaterEditExtDayCycle::onOpen(const LLSD& key)
mDayLength.value(key[KEY_DAY_LENGTH].asReal());
}
- // time labels
+ // Time&Percentage labels
mCurrentTimeLabel->setTextArg("[PRCNT]", std::string("0"));
const S32 max_elm = 5;
if (mDayLength.value() != 0)
@@ -246,15 +248,28 @@ void LLFloaterEditExtDayCycle::onOpen(const LLSD& key)
mCurrentTimeLabel->setTextArg("[DSC]", std::string());
}
+ // Altitudes&Track labels
+ LLUIString formatted_label = getString("sky_track_label");
const LLEnvironment::altitude_list_t &altitudes = LLEnvironment::instance().getRegionAltitudes();
+ bool extended_env = LLEnvironment::instance().isExtendedEnvironmentEnabled();
+ bool use_altitudes = extended_env
+ && altitudes.size() > 0
+ && (env == LLEnvironment::ENV_REGION || env == LLEnvironment::ENV_PARCEL);
for (S32 idx = 1; idx < 4; ++idx)
{
- std::stringstream label;
- label << altitudes[idx] << "m";
- getChild<LLButton>(track_tabs[idx + 1], true)->setTextArg("[DSC]", label.str());
+ std::ostringstream convert;
+ if (use_altitudes)
+ {
+ convert << altitudes[idx] << "m";
+ }
+ else
+ {
+ convert << (idx + 1);
+ }
+ formatted_label.setArg("[ALT]", convert.str());
+ getChild<LLButton>(track_tabs[idx + 1], true)->setLabel(formatted_label.getString());
}
- bool extended_env = LLEnvironment::instance().isExtendedEnvironmentEnabled();
for (int i = 2; i < LLSettingsDay::TRACK_MAX; i++) //skies #2 through #4
{
getChild<LLButton>(track_tabs[i])->setEnabled(extended_env);
@@ -960,9 +975,13 @@ void LLFloaterEditExtDayCycle::synchronizeTabs()
LLTabContainer * tabs = mWaterTabLayoutContainer->getChild<LLTabContainer>(TABS_WATER);
if (mCurrentTrack == LLSettingsDay::TRACK_WATER)
{
- canedit = !mIsPlaying;
- LLSettingsDay::CycleTrack_t::value_type found = mEditDay->getSettingsNearKeyframe(frame, LLSettingsDay::TRACK_WATER, FRAME_SLOP_FACTOR);
- psettingW = std::static_pointer_cast<LLSettingsWater>(found.second);
+ if (!mFramesSlider->getCurSlider().empty())
+ {
+ canedit = !mIsPlaying;
+ // either search mEditDay or retrieve from mSliderKeyMap
+ LLSettingsDay::CycleTrack_t::value_type found = mEditDay->getSettingsNearKeyframe(frame, LLSettingsDay::TRACK_WATER, FRAME_SLOP_FACTOR);
+ psettingW = std::static_pointer_cast<LLSettingsWater>(found.second);
+ }
mCurrentEdit = psettingW;
if (!psettingW)
{
@@ -984,9 +1003,13 @@ void LLFloaterEditExtDayCycle::synchronizeTabs()
tabs = mSkyTabLayoutContainer->getChild<LLTabContainer>(TABS_SKYS);
if (mCurrentTrack != LLSettingsDay::TRACK_WATER)
{
- canedit = !mIsPlaying;
- LLSettingsDay::CycleTrack_t::value_type found = mEditDay->getSettingsNearKeyframe(frame, mCurrentTrack, FRAME_SLOP_FACTOR);
- psettingS = std::static_pointer_cast<LLSettingsSky>(found.second);
+ if (!mFramesSlider->getCurSlider().empty())
+ {
+ canedit = !mIsPlaying;
+ // either search mEditDay or retrieve from mSliderKeyMap
+ LLSettingsDay::CycleTrack_t::value_type found = mEditDay->getSettingsNearKeyframe(frame, mCurrentTrack, FRAME_SLOP_FACTOR);
+ psettingS = std::static_pointer_cast<LLSettingsSky>(found.second);
+ }
mCurrentEdit = psettingS;
if (!psettingS)
{
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 caf7153a5c..50212fdf80 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
@@ -17,9 +17,11 @@
<string name="hint_new">Name your day cycle, adjust the controls to create it, and click "Save".</string>
<string name="hint_edit">To edit your day cycle, adjust the controls below and click "Save".</string>
- <!-- Todo: These 5 strings might be subjected to a change to get dynamic labels, consider using layout_stack to get dynamic width adjustment-->
+ <!-- Substitutions -->
<string name="time_label"> ([HH]:[MM])</string>
+ <string name="sky_track_label">Sky [ALT]</string>
+ <!-- Layout -->
<layout_stack name="outer_stack"
width="705"
height="650"