diff options
-rw-r--r-- | indra/newview/llfloatereditextdaycycle.cpp | 80 | ||||
-rw-r--r-- | indra/newview/llfloaterfixedenvironment.cpp | 58 | ||||
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 10 | ||||
-rw-r--r-- | indra/newview/lllocalbitmaps.cpp | 13 | ||||
-rw-r--r-- | indra/newview/lllocalbitmaps.h | 1 | ||||
-rw-r--r-- | indra/newview/llpaneleditsky.cpp | 8 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_texture_ctrl.xml | 5 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 16 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/strings.xml | 7 |
9 files changed, 183 insertions, 15 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/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index d8c2de649e..fb010fa858 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -988,7 +988,6 @@ LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id, LLInventoryO ++item_iter) { const LLViewerInventoryItem* item = (*item_iter); - if (item->getType() == LLAssetType::AT_SETTINGS) buildNewViews(item->getUUID()); } } @@ -1769,8 +1768,8 @@ public: ~LLAssetFilteredInventoryPanel() {} protected: - /*virtual*/ LLFolderViewItem* buildNewViews(const LLUUID& id); - /*virtual*/ void itemChanged(const LLUUID& item_id, U32 mask, const LLInventoryObject* model_item); + /*virtual*/ LLFolderViewItem* buildNewViews(const LLUUID& id) override; + /*virtual*/ void itemChanged(const LLUUID& item_id, U32 mask, const LLInventoryObject* model_item) override; private: LLAssetType::EType mAssetType; @@ -1785,11 +1784,10 @@ void LLAssetFilteredInventoryPanel::initFromParams(const Params& p) filter_cats &= ~(1ULL << LLFolderType::FT_TRASH); filter_cats &= ~(1ULL << LLFolderType::FT_MARKETPLACE_LISTINGS); getFilter().setFilterCategoryTypes(filter_cats); - // turn off marketplace for recent items getFilter().setFilterNoMarketplaceFolder(); } -LLFolderViewItem* LLAssetFilteredInventoryPanel::buildNewViews(const LLUUID& id) +LLFolderViewItem* LLAssetFilteredInventoryPanel::buildNewViews(const LLUUID& id) { LLInventoryObject const* objectp = gInventory.getObject(id); @@ -1806,7 +1804,7 @@ LLFolderViewItem* LLAssetFilteredInventoryPanel::buildNewViews(const LLUUID& id) return LLInventoryPanel::buildNewViews(id, objectp); } -void LLAssetFilteredInventoryPanel::itemChanged(const LLUUID& id, U32 mask, const LLInventoryObject* model_item) +void LLAssetFilteredInventoryPanel::itemChanged(const LLUUID& id, U32 mask, const LLInventoryObject* model_item) { if (!model_item) { 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 6d9f016aba..90c2325948 100644 --- a/indra/newview/llpaneleditsky.cpp +++ b/indra/newview/llpaneleditsky.cpp @@ -297,7 +297,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(); }); @@ -353,7 +352,7 @@ void LLPanelSettingsSkyCloudTab::refresh() getChild<LLUICtrl>(FIELD_SKY_CLOUD_DENSITY_Y)->setValue(cloudDensity[1]); getChild<LLUICtrl>(FIELD_SKY_CLOUD_DENSITY_D)->setValue(cloudDensity[2]); - LLVector3 cloudDetail(mSkySettings->getCloudPosDensity1().getValue()); + LLVector3 cloudDetail(mSkySettings->getCloudPosDensity2().getValue()); getChild<LLUICtrl>(FIELD_SKY_CLOUD_DETAIL_X)->setValue(cloudDetail[0]); getChild<LLUICtrl>(FIELD_SKY_CLOUD_DETAIL_Y)->setValue(cloudDetail[1]); getChild<LLUICtrl>(FIELD_SKY_CLOUD_DETAIL_D)->setValue(cloudDetail[2]); @@ -395,7 +394,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(); } @@ -438,13 +438,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/floater_texture_ctrl.xml b/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml index 53618b684b..90e2bb0923 100644 --- a/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml +++ b/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml @@ -152,7 +152,7 @@ name="inventory search editor" top="20" width="231" /> - <inventory_panel + <asset_filtered_inv_panel allow_multi_select="false" bg_visible="true" bg_alpha_color="DkGray2" @@ -163,7 +163,8 @@ left_delta="0" name="inventory panel" top_pad="4" - width="231" /> + width="231" + filter_asset_type="texture"/> <check_box height="14" initial_value="false" 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> |