summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatereditextdaycycle.cpp
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2018-08-01 20:27:47 +0300
committerandreykproductengine <andreykproductengine@lindenlab.com>2018-08-01 20:27:47 +0300
commita59170df0e7f0f431057938571eae589693d21f6 (patch)
tree7e2124926ead42d9270ed722cdf8d4af9534d11b /indra/newview/llfloatereditextdaycycle.cpp
parentdbbb89a13c99dce50b5c2a124bd3a5ccc23ef7f6 (diff)
MAINT-8905 EEP - tracks should show altitudes
Diffstat (limited to 'indra/newview/llfloatereditextdaycycle.cpp')
-rw-r--r--indra/newview/llfloatereditextdaycycle.cpp29
1 files changed, 22 insertions, 7 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);