summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfloatereditextdaycycle.cpp29
-rw-r--r--indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml4
2 files changed, 25 insertions, 8 deletions
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index 554757840f..daf0c931fa 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);
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"