summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2018-10-08 20:27:10 +0300
committerandreykproductengine <andreykproductengine@lindenlab.com>2018-10-08 20:27:10 +0300
commit6bb496625f4492fabd44bd0e86acb8b599df8c43 (patch)
tree79ff247106e144e1d6b73f2d03516857d49a43a2 /indra
parentc1d1935fcce68874511f85a079cfcc1a5af28fa8 (diff)
SL-9746 [EEP] Local Texture options should work with EEP
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfloatereditextdaycycle.cpp80
-rw-r--r--indra/newview/llfloaterfixedenvironment.cpp58
-rw-r--r--indra/newview/lllocalbitmaps.cpp13
-rw-r--r--indra/newview/lllocalbitmaps.h1
-rw-r--r--indra/newview/llpaneleditsky.cpp6
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml16
-rw-r--r--indra/newview/skins/default/xui/en/strings.xml7
7 files changed, 175 insertions, 6 deletions
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index 840b392f5d..e1220e5592 100644
--- a/indra/newview/llfloatereditextdaycycle.cpp
+++ b/indra/newview/llfloatereditextdaycycle.cpp
@@ -34,6 +34,7 @@
#include "llcheckboxctrl.h"
#include "llcombobox.h"
#include "llloadingindicator.h"
+#include "lllocalbitmaps.h"
#include "llmultisliderctrl.h"
#include "llnotifications.h"
#include "llnotificationsutil.h"
@@ -346,7 +347,7 @@ void LLFloaterEditExtDayCycle::onOpen(const LLSD& key)
getChild<LLButton>(track_tabs[idx + 1], true)->setLabel(formatted_label.getString());
}
- for (int i = 2; i < LLSettingsDay::TRACK_MAX; i++) //skies #2 through #4
+ for (U32 i = 2; i < LLSettingsDay::TRACK_MAX; i++) //skies #2 through #4
{
getChild<LLButton>(track_tabs[i])->setEnabled(extended_env);
}
@@ -513,6 +514,81 @@ void LLFloaterEditExtDayCycle::onButtonApply(LLUICtrl *ctrl, const LLSD &data)
return;
}
+ // brute-force local texture scan
+ for (U32 i = 0; i <= LLSettingsDay::TRACK_MAX; i++)
+ {
+ LLSettingsDay::CycleTrack_t &day_track = dayclone->getCycleTrack(i);
+
+ LLSettingsDay::CycleTrack_t::iterator iter = day_track.begin();
+ LLSettingsDay::CycleTrack_t::iterator end = day_track.end();
+ S32 frame_num = 0;
+
+ while (iter != end)
+ {
+ frame_num++;
+ std::string desc;
+ bool is_local = false; // because getString can be empty
+ if (i == LLSettingsDay::TRACK_WATER)
+ {
+ LLSettingsWater::ptr_t water = std::static_pointer_cast<LLSettingsWater>(iter->second);
+ if (water)
+ {
+ // LLViewerFetchedTexture and check for FTT_LOCAL_FILE or check LLLocalBitmapMgr
+ if (LLLocalBitmapMgr::isLocal(water->getNormalMapID()))
+ {
+ desc = LLTrans::getString("EnvironmentNormalMap");
+ is_local = true;
+ }
+ else if (LLLocalBitmapMgr::isLocal(water->getTransparentTextureID()))
+ {
+ desc = LLTrans::getString("EnvironmentTransparent");
+ is_local = true;
+ }
+ }
+ }
+ else
+ {
+ LLSettingsSky::ptr_t sky = std::static_pointer_cast<LLSettingsSky>(iter->second);
+ if (sky)
+ {
+ if (LLLocalBitmapMgr::isLocal(sky->getSunTextureId()))
+ {
+ desc = LLTrans::getString("EnvironmentSun");
+ is_local = true;
+ }
+ else if (LLLocalBitmapMgr::isLocal(sky->getMoonTextureId()))
+ {
+ desc = LLTrans::getString("EnvironmentMoon");
+ is_local = true;
+ }
+ else if (LLLocalBitmapMgr::isLocal(sky->getCloudNoiseTextureId()))
+ {
+ desc = LLTrans::getString("EnvironmentCloudNoise");
+ is_local = true;
+ }
+ else if (LLLocalBitmapMgr::isLocal(sky->getBloomTextureId()))
+ {
+ desc = LLTrans::getString("EnvironmentBloom");
+ is_local = true;
+ }
+ }
+ }
+
+ if (is_local)
+ {
+ LLSD args;
+ LLButton* button = getChild<LLButton>(track_tabs[i], true);
+ args["TRACK"] = button->getCurrentLabel();
+ args["FRAME"] = iter->first * 100; // %
+ args["FIELD"] = desc;
+ args["FRAMENO"] = frame_num;
+ LLNotificationsUtil::add("WLLocalTextureDayBlock", args);
+ return;
+ }
+ iter++;
+ }
+ }
+
if (ctrl_action == ACTION_SAVE)
{
doApplyUpdateInventory(dayclone);
@@ -817,7 +893,7 @@ void LLFloaterEditExtDayCycle::selectTrack(U32 track_index, bool force )
return;
}
- for (int i = 0; i < LLSettingsDay::TRACK_MAX; i++) // use max value
+ for (U32 i = 0; i < LLSettingsDay::TRACK_MAX; i++) // use max value
{
getChild<LLButton>(track_tabs[i], true)->setToggleState(i == mCurrentTrack);
}
diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp
index 5cd99e6ad2..201c6679b3 100644
--- a/indra/newview/llfloaterfixedenvironment.cpp
+++ b/indra/newview/llfloaterfixedenvironment.cpp
@@ -37,6 +37,7 @@
#include "llsliderctrl.h"
#include "lltabcontainer.h"
#include "llfilepicker.h"
+#include "lllocalbitmaps.h"
#include "llsettingspicker.h"
#include "llviewermenufile.h" // LLFilePickerReplyThread
#include "llviewerparcelmgr.h"
@@ -51,6 +52,7 @@
#include "llenvironment.h"
#include "llagent.h"
#include "llparcel.h"
+#include "lltrans.h"
#include "llsettingsvo.h"
#include "llinventorymodel.h"
@@ -340,6 +342,62 @@ void LLFloaterFixedEnvironment::onButtonApply(LLUICtrl *ctrl, const LLSD &data)
{
std::string ctrl_action = ctrl->getName();
+ std::string local_desc;
+ bool is_local = false; // because getString can be empty
+ if (mSettings->getSettingsType() == "water")
+ {
+ LLSettingsWater::ptr_t water = std::static_pointer_cast<LLSettingsWater>(mSettings);
+ if (water)
+ {
+ // LLViewerFetchedTexture and check for FTT_LOCAL_FILE or check LLLocalBitmapMgr
+ if (LLLocalBitmapMgr::isLocal(water->getNormalMapID()))
+ {
+ local_desc = LLTrans::getString("EnvironmentNormalMap");
+ is_local = true;
+ }
+ else if (LLLocalBitmapMgr::isLocal(water->getTransparentTextureID()))
+ {
+ local_desc = LLTrans::getString("EnvironmentTransparent");
+ is_local = true;
+ }
+ }
+ }
+ else if (mSettings->getSettingsType() == "sky")
+ {
+ LLSettingsSky::ptr_t sky = std::static_pointer_cast<LLSettingsSky>(mSettings);
+ if (sky)
+ {
+ if (LLLocalBitmapMgr::isLocal(sky->getSunTextureId()))
+ {
+ local_desc = LLTrans::getString("EnvironmentSun");
+ is_local = true;
+ }
+ else if (LLLocalBitmapMgr::isLocal(sky->getMoonTextureId()))
+ {
+ local_desc = LLTrans::getString("EnvironmentMoon");
+ is_local = true;
+ }
+ else if (LLLocalBitmapMgr::isLocal(sky->getCloudNoiseTextureId()))
+ {
+ local_desc = LLTrans::getString("EnvironmentCloudNoise");
+ is_local = true;
+ }
+ else if (LLLocalBitmapMgr::isLocal(sky->getBloomTextureId()))
+ {
+ local_desc = LLTrans::getString("EnvironmentBloom");
+ is_local = true;
+ }
+ }
+ }
+
+ if (is_local)
+ {
+ LLSD args;
+ args["FIELD"] = local_desc;
+ LLNotificationsUtil::add("WLLocalTextureFixedBlock", args);
+ return;
+ }
+
if (ctrl_action == ACTION_SAVE)
{
doApplyUpdateInventory();
diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp
index 760325b652..47b6da708c 100644
--- a/indra/newview/lllocalbitmaps.cpp
+++ b/indra/newview/lllocalbitmaps.cpp
@@ -976,6 +976,19 @@ LLUUID LLLocalBitmapMgr::getWorldID(LLUUID tracking_id)
return world_id;
}
+bool LLLocalBitmapMgr::isLocal(const LLUUID world_id)
+{
+ for (local_list_iter iter = sBitmapList.begin(); iter != sBitmapList.end(); iter++)
+ {
+ LLLocalBitmap* unit = *iter;
+ if (unit->getWorldID() == world_id)
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
std::string LLLocalBitmapMgr::getFilename(LLUUID tracking_id)
{
std::string filename = "";
diff --git a/indra/newview/lllocalbitmaps.h b/indra/newview/lllocalbitmaps.h
index ee4161fb45..3b33091fdb 100644
--- a/indra/newview/lllocalbitmaps.h
+++ b/indra/newview/lllocalbitmaps.h
@@ -123,6 +123,7 @@ class LLLocalBitmapMgr
static bool checkTextureDimensions(std::string filename);
static LLUUID getWorldID(LLUUID tracking_id);
+ static bool isLocal(const LLUUID world_id);
static std::string getFilename(LLUUID tracking_id);
static void feedScrollList(LLScrollListCtrl* ctrl);
diff --git a/indra/newview/llpaneleditsky.cpp b/indra/newview/llpaneleditsky.cpp
index 0d8c9a988a..972b849510 100644
--- a/indra/newview/llpaneleditsky.cpp
+++ b/indra/newview/llpaneleditsky.cpp
@@ -258,7 +258,6 @@ BOOL LLPanelSettingsSkyCloudTab::postBuild()
getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudMapChanged(); });
getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP)->setDefaultImageAssetID(LLSettingsSky::GetDefaultCloudNoiseTextureId());
getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP)->setAllowNoTexture(TRUE);
- getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP)->setAllowLocalTexture(FALSE);
getChild<LLUICtrl>(FIELD_SKY_CLOUD_DENSITY_X)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudDensityChanged(); });
getChild<LLUICtrl>(FIELD_SKY_CLOUD_DENSITY_Y)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudDensityChanged(); });
@@ -348,7 +347,8 @@ void LLPanelSettingsSkyCloudTab::onCloudScrollChanged()
void LLPanelSettingsSkyCloudTab::onCloudMapChanged()
{
- mSkySettings->setCloudNoiseTextureId(getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP)->getValue().asUUID());
+ LLTextureCtrl* ctrl = getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP);
+ mSkySettings->setCloudNoiseTextureId(ctrl->getValue().asUUID());
setIsDirty();
}
@@ -391,13 +391,11 @@ BOOL LLPanelSettingsSkySunMoonTab::postBuild()
getChild<LLTextureCtrl>(FIELD_SKY_SUN_IMAGE)->setBlankImageAssetID(LLSettingsSky::GetBlankSunTextureId());
getChild<LLTextureCtrl>(FIELD_SKY_SUN_IMAGE)->setDefaultImageAssetID(LLSettingsSky::GetBlankSunTextureId());
getChild<LLTextureCtrl>(FIELD_SKY_SUN_IMAGE)->setAllowNoTexture(TRUE);
- getChild<LLTextureCtrl>(FIELD_SKY_SUN_IMAGE)->setAllowLocalTexture(FALSE);
getChild<LLUICtrl>(FIELD_SKY_MOON_ROTATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonRotationChanged(); });
getChild<LLUICtrl>(FIELD_SKY_MOON_IMAGE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonImageChanged(); });
getChild<LLTextureCtrl>(FIELD_SKY_MOON_IMAGE)->setDefaultImageAssetID(LLSettingsSky::GetDefaultMoonTextureId());
getChild<LLTextureCtrl>(FIELD_SKY_MOON_IMAGE)->setBlankImageAssetID(LLSettingsSky::GetBlankSunTextureId());
getChild<LLTextureCtrl>(FIELD_SKY_MOON_IMAGE)->setAllowNoTexture(TRUE);
- getChild<LLTextureCtrl>(FIELD_SKY_MOON_IMAGE)->setAllowLocalTexture(FALSE);
getChild<LLUICtrl>(FIELD_SKY_MOON_SCALE)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonScaleChanged(); });
getChild<LLUICtrl>(FIELD_SKY_MOON_BRIGHTNESS)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonBrightnessChanged(); });
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 69503cdbf2..23e1701dc6 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -6072,6 +6072,22 @@ Sorry, the settings couldn't be applied to the region. Reason: [FAIL_REASON]
</notification>
<notification
+ icon="alertmodal.tga"
+ name="WLLocalTextureDayBlock"
+ type="alertmodal">
+A Local texture is in use on track [TRACK], frame #[FRAMENO] ([FRAME]%) in field [FIELD].
+Settings may not be saved using local textures.
+ </notification>
+
+ <notification
+ icon="alertmodal.tga"
+ name="WLLocalTextureFixedBlock"
+ type="alertmodal">
+A local texture is in use in field [FIELD].
+Settings may not be saved using local textures.
+ </notification>
+
+ <notification
functor="GenericAcknowledge"
icon="alertmodal.tga"
name="EnvCannotDeleteLastDayCycleKey"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 8681c867bd..39c2cb79ad 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2782,6 +2782,13 @@ If you continue to receive this message, please contact Second Life support for
<string name="RegionSettings">Region Settings</string>
<string name="NoEnvironmentSettings">This Region does not support environmental settings.</string>
+ <string name="EnvironmentSun">Sun</string>
+ <string name="EnvironmentMoon">Moon</string>
+ <string name="EnvironmentBloom">Bloom</string>
+ <string name="EnvironmentCloudNoise">Cloud Noise</string>
+ <string name="EnvironmentNormalMap">Normal Map</string>
+ <string name="EnvironmentTransparent">Transparent</string>
+
<!-- panel classified -->
<string name="ClassifiedClicksTxt">Clicks: [TELEPORT] teleport, [MAP] map, [PROFILE] profile</string>
<string name="ClassifiedUpdateAfterPublish">(will update after publish)</string>