Merge
commit
11a7c22b72
|
|
@ -624,6 +624,17 @@ LLSettingsBase::ptr_t LLSettingsDay::getSettingsAtKeyframe(const LLSettingsBase:
|
|||
return LLSettingsBase::ptr_t();
|
||||
}
|
||||
|
||||
void LLSettingsDay::clearTrack(S32 track)
|
||||
{
|
||||
if ((track < 0) || (track >= TRACK_MAX))
|
||||
{
|
||||
LL_WARNS("DAYCYCLE") << "Attempt to clear track (#" << track << ") out of range!" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
mDayTracks[track].clear();
|
||||
}
|
||||
|
||||
LLSettingsBase::TrackPosition LLSettingsDay::getUpperBoundFrame(S32 track, const LLSettingsBase::TrackPosition& keyframe)
|
||||
{
|
||||
return get_wrapping_atafter(mDayTracks[track], keyframe)->first;
|
||||
|
|
|
|||
|
|
@ -100,6 +100,8 @@ public:
|
|||
LLSettingsSkyPtr_t getSkyAtKeyframe(const LLSettingsBase::TrackPosition& keyframe, S32 track) const;
|
||||
void setSettingsAtKeyframe(const LLSettingsBase::ptr_t &settings, const LLSettingsBase::TrackPosition& keyframe, S32 track);
|
||||
LLSettingsBase::ptr_t getSettingsAtKeyframe(const LLSettingsBase::TrackPosition& keyframe, S32 track) const;
|
||||
void clearTrack(S32 track);
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
void startDayCycle();
|
||||
|
||||
|
|
|
|||
|
|
@ -363,6 +363,26 @@ void LLEnvironment::getAtmosphericModelSettings(AtmosphericModelSettings& settin
|
|||
}
|
||||
}
|
||||
|
||||
bool LLEnvironment::canAgentUpdateParcelEnvironment(bool useselected) const
|
||||
{
|
||||
if (!LLEnvironment::instance().isExtendedEnvironmentEnabled())
|
||||
return false;
|
||||
// *TODO*
|
||||
//LLParcel* parcel = (useselected) ? LLViewerParcelMgr::instance().getParcelSelection() : LLViewerParcelMgr::instance().getAgentParcel();
|
||||
LLParcel* parcel = LLViewerParcelMgr::instance().getAgentParcel();
|
||||
if (parcel)
|
||||
{
|
||||
return parcel->allowTerraformBy(gAgent.getID());
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool LLEnvironment::canAgentUpdateRegionEnvironment() const
|
||||
{
|
||||
return gAgent.getRegion()->canManageEstate();
|
||||
}
|
||||
|
||||
bool LLEnvironment::isExtendedEnvironmentEnabled() const
|
||||
{
|
||||
return !gAgent.getRegionCapability("ExtEnvironment").empty();
|
||||
|
|
@ -1099,7 +1119,6 @@ void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentI
|
|||
setEnvironment(ENV_PARCEL, pday, envinfo->mDayLength, envinfo->mDayOffset);
|
||||
}
|
||||
|
||||
/*TODO: track_altitudes*/
|
||||
updateEnvironment();
|
||||
}
|
||||
|
||||
|
|
@ -1126,6 +1145,29 @@ void LLEnvironment::updateRegion(LLSettingsDay::ptr_t &pday, S32 day_length, S32
|
|||
updateParcel(INVALID_PARCEL_ID, pday, day_length, day_offset);
|
||||
}
|
||||
|
||||
void LLEnvironment::updateRegion(const LLUUID &asset_id, S32 day_length, S32 day_offset)
|
||||
{
|
||||
if (!isExtendedEnvironmentEnabled())
|
||||
{
|
||||
LL_WARNS("ENVIRONMENT") << "attempt to apply asset id to region not supporting it." << LL_ENDL;
|
||||
LLNotificationsUtil::add("NoEnvironmentSettings");
|
||||
return;
|
||||
}
|
||||
|
||||
updateParcel(INVALID_PARCEL_ID, asset_id, day_length, day_offset);
|
||||
}
|
||||
|
||||
void LLEnvironment::updateRegion(LLSettingsSky::ptr_t &psky, S32 day_length, S32 day_offset)
|
||||
{
|
||||
updateParcel(INVALID_PARCEL_ID, psky, day_length, day_offset);
|
||||
}
|
||||
|
||||
void LLEnvironment::updateRegion(LLSettingsWater::ptr_t &pwater, S32 day_length, S32 day_offset)
|
||||
{
|
||||
updateParcel(INVALID_PARCEL_ID, pwater, day_length, day_offset);
|
||||
}
|
||||
|
||||
|
||||
void LLEnvironment::resetRegion()
|
||||
{
|
||||
resetParcel(INVALID_PARCEL_ID);
|
||||
|
|
@ -1139,6 +1181,52 @@ void LLEnvironment::requestParcel(S32 parcel_id)
|
|||
[this](S32 pid, EnvironmentInfo::ptr_t envinfo) { recordEnvironment(pid, envinfo); }));
|
||||
}
|
||||
|
||||
void LLEnvironment::updateParcel(S32 parcel_id, const LLUUID &asset_id, S32 day_length, S32 day_offset)
|
||||
{
|
||||
LLSettingsVOBase::getSettingsAsset(asset_id,
|
||||
[this, parcel_id, day_length, day_offset](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { onUpdateParcelAssetLoaded(asset_id, settings, status, parcel_id, day_length, day_offset); });
|
||||
}
|
||||
|
||||
void LLEnvironment::onUpdateParcelAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, S32 parcel_id, S32 day_length, S32 day_offset)
|
||||
{
|
||||
if (status)
|
||||
{
|
||||
LL_WARNS("ENVIRONMENT") << "Unable to get settings asset with id " << asset_id << "!" << LL_ENDL;
|
||||
LLNotificationsUtil::add("FailedToLoadSettingsApply");
|
||||
return;
|
||||
}
|
||||
|
||||
LLSettingsDay::ptr_t pday;
|
||||
|
||||
if (settings->getSettingType() == "daycycle")
|
||||
pday = std::static_pointer_cast<LLSettingsDay>(settings);
|
||||
else
|
||||
{
|
||||
pday = createDayCycleFromEnvironment( (parcel_id == INVALID_PARCEL_ID) ? ENV_REGION : ENV_PARCEL, settings);
|
||||
}
|
||||
|
||||
if (!pday)
|
||||
{
|
||||
LL_WARNS("ENVIRONMENT") << "Unable to construct day around " << asset_id << "!" << LL_ENDL;
|
||||
LLNotificationsUtil::add("FailedToBuildSettingsDay");
|
||||
return;
|
||||
}
|
||||
|
||||
updateParcel(parcel_id, pday, day_length, day_offset);
|
||||
}
|
||||
|
||||
void LLEnvironment::updateParcel(S32 parcel_id, LLSettingsSky::ptr_t &psky, S32 day_length, S32 day_offset)
|
||||
{
|
||||
LLSettingsDay::ptr_t pday = createDayCycleFromEnvironment((parcel_id == INVALID_PARCEL_ID) ? ENV_REGION : ENV_PARCEL, psky);
|
||||
updateParcel(parcel_id, pday, day_length, day_offset);
|
||||
}
|
||||
|
||||
void LLEnvironment::updateParcel(S32 parcel_id, LLSettingsWater::ptr_t &pwater, S32 day_length, S32 day_offset)
|
||||
{
|
||||
LLSettingsDay::ptr_t pday = createDayCycleFromEnvironment((parcel_id == INVALID_PARCEL_ID) ? ENV_REGION : ENV_PARCEL, pwater);
|
||||
updateParcel(parcel_id, pday, day_length, day_offset);
|
||||
}
|
||||
|
||||
void LLEnvironment::updateParcel(S32 parcel_id, LLSettingsDay::ptr_t &pday, S32 day_length, S32 day_offset)
|
||||
{
|
||||
std::string coroname =
|
||||
|
|
@ -1224,6 +1312,20 @@ void LLEnvironment::coroUpdateEnvironment(S32 parcel_id, LLSettingsDay::ptr_t pd
|
|||
if (url.empty())
|
||||
return;
|
||||
|
||||
if (day_length < 1)
|
||||
{
|
||||
day_length = getEnvironmentDayLength((parcel_id == INVALID_PARCEL_ID) ? ENV_REGION : ENV_PARCEL).value();
|
||||
if ((day_length < 1) && (parcel_id != INVALID_PARCEL_ID))
|
||||
day_length = getEnvironmentDayLength(ENV_REGION).value();
|
||||
}
|
||||
|
||||
if (day_offset < 1)
|
||||
{
|
||||
day_offset = getEnvironmentDayOffset((parcel_id == INVALID_PARCEL_ID) ? ENV_REGION : ENV_PARCEL).value();
|
||||
if ((day_offset < 1) && (parcel_id != INVALID_PARCEL_ID))
|
||||
day_offset = getEnvironmentDayOffset(ENV_REGION).value();
|
||||
}
|
||||
|
||||
LLSD body(LLSD::emptyMap());
|
||||
body["environment"] = LLSD::emptyMap();
|
||||
|
||||
|
|
@ -1454,6 +1556,47 @@ LLSettingsDay::ptr_t LLEnvironment::createDayCycleFromLegacyPreset(const std::st
|
|||
return day;
|
||||
}
|
||||
|
||||
LLSettingsDay::ptr_t LLEnvironment::createDayCycleFromEnvironment(EnvSelection_t env, LLSettingsBase::ptr_t settings)
|
||||
{
|
||||
std::string type(settings->getSettingType());
|
||||
|
||||
if (type == "daycycle")
|
||||
return std::static_pointer_cast<LLSettingsDay>(settings);
|
||||
|
||||
if ((env != ENV_PARCEL) && (env != ENV_REGION))
|
||||
{
|
||||
LL_WARNS("ENVIRONMENT") << "May only create from parcel or region environment." << LL_ENDL;
|
||||
return LLSettingsDay::ptr_t();
|
||||
}
|
||||
|
||||
LLSettingsDay::ptr_t day = this->getEnvironmentDay(env);
|
||||
if (!day && (env == ENV_PARCEL))
|
||||
{
|
||||
day = this->getEnvironmentDay(ENV_REGION);
|
||||
}
|
||||
|
||||
if (!day)
|
||||
{
|
||||
LL_WARNS("ENVIRONMENT") << "Could not retrieve existing day settings." << LL_ENDL;
|
||||
return LLSettingsDay::ptr_t();
|
||||
}
|
||||
|
||||
day = day->buildClone();
|
||||
|
||||
if (type == "sky")
|
||||
{
|
||||
for (S32 idx = 1; idx < LLSettingsDay::TRACK_MAX; ++idx)
|
||||
day->clearTrack(idx);
|
||||
day->setSettingsAtKeyframe(settings, 0.0f, 1);
|
||||
}
|
||||
else if (type == "water")
|
||||
{
|
||||
day->clearTrack(LLSettingsDay::TRACK_WATER);
|
||||
day->setSettingsAtKeyframe(settings, 0.0f, LLSettingsDay::TRACK_WATER);
|
||||
}
|
||||
|
||||
return day;
|
||||
}
|
||||
|
||||
void LLEnvironment::legacyLoadAllPresets()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@
|
|||
//-------------------------------------------------------------------------
|
||||
class LLViewerCamera;
|
||||
class LLGLSLShader;
|
||||
class AtmosphericModelSettings;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
class LLEnvironment : public LLSingleton<LLEnvironment>
|
||||
|
|
@ -56,6 +55,9 @@ public:
|
|||
static const F32Seconds TRANSITION_SLOW;
|
||||
static const F32Seconds TRANSITION_ALTITUDE;
|
||||
|
||||
static const LLUUID KNOWN_SKY_DEFAULT;
|
||||
static const LLUUID KNOWN_WATER_DEFAULT;
|
||||
static const LLUUID KNOWN_DAY_DEFAULT;
|
||||
static const LLUUID KNOWN_SKY_SUNRISE;
|
||||
static const LLUUID KNOWN_SKY_MIDDAY;
|
||||
static const LLUUID KNOWN_SKY_SUNSET;
|
||||
|
|
@ -67,15 +69,15 @@ public:
|
|||
|
||||
typedef std::shared_ptr<EnvironmentInfo> ptr_t;
|
||||
|
||||
S32 mParcelId;
|
||||
LLUUID mRegionId;
|
||||
LLSettingsDay::Seconds mDayLength;
|
||||
LLSettingsDay::Seconds mDayOffset;
|
||||
size_t mDayHash;
|
||||
LLSD mDaycycleData;
|
||||
std::array<F32, 4> mAltitudes;
|
||||
bool mIsDefault;
|
||||
bool mIsRegion;
|
||||
S32 mParcelId;
|
||||
LLUUID mRegionId;
|
||||
S64Seconds mDayLength;
|
||||
S64Seconds mDayOffset;
|
||||
size_t mDayHash;
|
||||
LLSD mDaycycleData;
|
||||
std::array<F32, 4> mAltitudes;
|
||||
bool mIsDefault;
|
||||
bool mIsRegion;
|
||||
|
||||
|
||||
static ptr_t extract(LLSD);
|
||||
|
|
@ -146,6 +148,8 @@ public:
|
|||
bool canEdit() const;
|
||||
bool isExtendedEnvironmentEnabled() const;
|
||||
bool isInventoryEnabled() const;
|
||||
bool canAgentUpdateParcelEnvironment(bool useselected = false) const;
|
||||
bool canAgentUpdateRegionEnvironment() const;
|
||||
|
||||
LLSettingsSky::ptr_t getCurrentSky() const { return mCurrentEnvironment->getSky(); }
|
||||
LLSettingsWater::ptr_t getCurrentWater() const { return mCurrentEnvironment->getWater(); }
|
||||
|
|
@ -219,6 +223,9 @@ public:
|
|||
static LLSettingsSky::ptr_t createSkyFromLegacyPreset(const std::string filename);
|
||||
static LLSettingsDay::ptr_t createDayCycleFromLegacyPreset(const std::string filename);
|
||||
|
||||
// Construct a new day cycle based on the environment. Replacing either the water or the sky tracks.
|
||||
LLSettingsDay::ptr_t createDayCycleFromEnvironment(EnvSelection_t env, LLSettingsBase::ptr_t settings);
|
||||
|
||||
//-------------------------------------------
|
||||
connection_t setSkyListChange(const change_signal_t::slot_type& cb);
|
||||
connection_t setWaterListChange(const change_signal_t::slot_type& cb);
|
||||
|
|
@ -229,10 +236,16 @@ public:
|
|||
void onLegacyRegionSettings(LLSD data);
|
||||
|
||||
void requestRegion();
|
||||
void updateRegion(const LLUUID &asset_id, S32 day_length, S32 day_offset);
|
||||
void updateRegion(LLSettingsDay::ptr_t &pday, S32 day_length, S32 day_offset);
|
||||
void updateRegion(LLSettingsSky::ptr_t &psky, S32 day_length, S32 day_offset);
|
||||
void updateRegion(LLSettingsWater::ptr_t &pwater, S32 day_length, S32 day_offset);
|
||||
void resetRegion();
|
||||
void requestParcel(S32 parcel_id);
|
||||
void updateParcel(S32 parcel_id, const LLUUID &asset_id, S32 day_length, S32 day_offset);
|
||||
void updateParcel(S32 parcel_id, LLSettingsDay::ptr_t &pday, S32 day_length, S32 day_offset);
|
||||
void updateParcel(S32 parcel_id, LLSettingsSky::ptr_t &psky, S32 day_length, S32 day_offset);
|
||||
void updateParcel(S32 parcel_id, LLSettingsWater::ptr_t &pwater, S32 day_length, S32 day_offset);
|
||||
void resetParcel(S32 parcel_id);
|
||||
|
||||
void selectAgentEnvironment();
|
||||
|
|
@ -398,6 +411,8 @@ private:
|
|||
void onAgentPositionHasChanged(const LLVector3 &localpos);
|
||||
|
||||
void onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status);
|
||||
void onUpdateParcelAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, S32 parcel_id, S32 day_length, S32 day_offset);
|
||||
|
||||
//=========================================================================
|
||||
void legacyLoadAllPresets();
|
||||
static std::string getSysDir(const std::string &subdir);
|
||||
|
|
|
|||
|
|
@ -267,7 +267,8 @@ void LLFloaterEditExtDayCycle::refresh()
|
|||
|
||||
mFlyoutControl->setMenuItemEnabled(ACTION_SAVE, is_inventory_avail);
|
||||
mFlyoutControl->setMenuItemEnabled(ACTION_SAVEAS, is_inventory_avail);
|
||||
|
||||
mFlyoutControl->setMenuItemEnabled(ACTION_APPLY_PARCEL, canApplyParcel());
|
||||
mFlyoutControl->setMenuItemEnabled(ACTION_APPLY_REGION, canApplyRegion());
|
||||
|
||||
LLFloater::refresh();
|
||||
}
|
||||
|
|
@ -953,26 +954,35 @@ void LLFloaterEditExtDayCycle::doApplyUpdateInventory()
|
|||
|
||||
void LLFloaterEditExtDayCycle::doApplyEnvironment(const std::string &where)
|
||||
{
|
||||
LLEnvironment::EnvSelection_t env(LLEnvironment::ENV_DEFAULT);
|
||||
bool updateSimulator(where != ACTION_APPLY_LOCAL);
|
||||
|
||||
if (where == ACTION_APPLY_LOCAL)
|
||||
env = LLEnvironment::ENV_LOCAL;
|
||||
{
|
||||
LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, mEditDay);
|
||||
}
|
||||
else if (where == ACTION_APPLY_PARCEL)
|
||||
env = LLEnvironment::ENV_PARCEL;
|
||||
{
|
||||
LLParcelSelectionHandle handle(LLViewerParcelMgr::instance().getParcelSelection());
|
||||
LLParcel *parcel(nullptr);
|
||||
|
||||
if (handle)
|
||||
parcel = handle->getParcel();
|
||||
if (!parcel)
|
||||
parcel = LLViewerParcelMgr::instance().getAgentParcel();
|
||||
|
||||
if (!parcel)
|
||||
return;
|
||||
|
||||
LLEnvironment::instance().updateParcel(parcel->getLocalID(), mEditDay, -1, -1);
|
||||
}
|
||||
else if (where == ACTION_APPLY_REGION)
|
||||
env = LLEnvironment::ENV_REGION;
|
||||
{
|
||||
LLEnvironment::instance().updateRegion(mEditDay, -1, -1);
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS("ENVIRONMENT") << "Unknown apply '" << where << "'" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
LLEnvironment::instance().setEnvironment(env, mEditDay);
|
||||
if (updateSimulator)
|
||||
{
|
||||
LL_WARNS("ENVIRONMENT") << "Attempting apply" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterEditExtDayCycle::onInventoryCreated(LLUUID asset_id, LLUUID inventory_id, LLSD results)
|
||||
|
|
@ -1041,7 +1051,7 @@ bool LLFloaterEditExtDayCycle::canApplyParcel() const
|
|||
if (!parcel)
|
||||
return false;
|
||||
|
||||
return parcel->allowModifyBy(gAgent.getID(), gAgent.getGroupID()) &&
|
||||
return parcel->allowTerraformBy(gAgent.getID()) &&
|
||||
LLEnvironment::instance().isExtendedEnvironmentEnabled();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -160,6 +160,8 @@ void LLFloaterFixedEnvironment::refresh()
|
|||
|
||||
mFlyoutControl->setMenuItemEnabled(ACTION_SAVE, is_inventory_avail);
|
||||
mFlyoutControl->setMenuItemEnabled(ACTION_SAVEAS, is_inventory_avail);
|
||||
mFlyoutControl->setMenuItemEnabled(ACTION_APPLY_PARCEL, canApplyParcel());
|
||||
mFlyoutControl->setMenuItemEnabled(ACTION_APPLY_REGION, canApplyRegion());
|
||||
|
||||
mTxtName->setValue(mSettings->getName());
|
||||
|
||||
|
|
@ -283,26 +285,41 @@ void LLFloaterFixedEnvironment::doApplyUpdateInventory()
|
|||
|
||||
void LLFloaterFixedEnvironment::doApplyEnvironment(const std::string &where)
|
||||
{
|
||||
LLEnvironment::EnvSelection_t env(LLEnvironment::ENV_DEFAULT);
|
||||
bool updateSimulator( where != ACTION_APPLY_LOCAL );
|
||||
|
||||
if (where == ACTION_APPLY_LOCAL)
|
||||
env = LLEnvironment::ENV_LOCAL;
|
||||
{
|
||||
LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, mSettings);
|
||||
}
|
||||
else if (where == ACTION_APPLY_PARCEL)
|
||||
env = LLEnvironment::ENV_PARCEL;
|
||||
{
|
||||
LLParcelSelectionHandle handle(LLViewerParcelMgr::instance().getParcelSelection());
|
||||
LLParcel *parcel(nullptr);
|
||||
|
||||
if (handle)
|
||||
parcel = handle->getParcel();
|
||||
if (!parcel)
|
||||
parcel = LLViewerParcelMgr::instance().getAgentParcel();
|
||||
|
||||
if (!parcel)
|
||||
return;
|
||||
|
||||
if (mSettings->getSettingType() == "sky")
|
||||
LLEnvironment::instance().updateParcel(parcel->getLocalID(), std::static_pointer_cast<LLSettingsSky>(mSettings), -1, -1);
|
||||
else if (mSettings->getSettingType() == "water")
|
||||
LLEnvironment::instance().updateParcel(parcel->getLocalID(), std::static_pointer_cast<LLSettingsWater>(mSettings), -1, -1);
|
||||
}
|
||||
else if (where == ACTION_APPLY_REGION)
|
||||
env = LLEnvironment::ENV_REGION;
|
||||
{
|
||||
if (mSettings->getSettingType() == "sky")
|
||||
LLEnvironment::instance().updateRegion(std::static_pointer_cast<LLSettingsSky>(mSettings), -1, -1);
|
||||
else if (mSettings->getSettingType() == "water")
|
||||
LLEnvironment::instance().updateRegion(std::static_pointer_cast<LLSettingsWater>(mSettings), -1, -1);
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS("ENVIRONMENT") << "Unknown apply '" << where << "'" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
LLEnvironment::instance().setEnvironment(env, mSettings);
|
||||
if (updateSimulator)
|
||||
{
|
||||
LL_WARNS("ENVIRONMENT") << "Attempting apply" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterFixedEnvironment::onInventoryCreated(LLUUID asset_id, LLUUID inventory_id, LLSD results)
|
||||
|
|
|
|||
|
|
@ -81,6 +81,8 @@
|
|||
#include "llwearableitemslist.h"
|
||||
#include "lllandmarkactions.h"
|
||||
#include "llpanellandmarks.h"
|
||||
#include "llviewerparcelmgr.h"
|
||||
#include "llparcel.h"
|
||||
|
||||
#include "llenvironment.h"
|
||||
|
||||
|
|
@ -6920,11 +6922,16 @@ void LLSettingsBridge::performAction(LLInventoryModel* model, std::string action
|
|||
if (!item)
|
||||
return;
|
||||
LLUUID asset_id = item->getProtectedAssetUUID();
|
||||
// *LAPRAS* TODO update on simulator.
|
||||
LL_WARNS("LAPRAS") << "Only updating locally!!! NOT REALLY PARCEL UPDATE" << LL_ENDL;
|
||||
LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_LOCAL);
|
||||
LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_PARCEL, asset_id);
|
||||
LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL);
|
||||
|
||||
LLParcel *parcel = LLViewerParcelMgr::instance().getAgentParcel();
|
||||
if (!parcel)
|
||||
{
|
||||
LL_WARNS("INVENTORY") << "could not identify parcel." << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
S32 parcel_id = parcel->getLocalID();
|
||||
|
||||
LLEnvironment::instance().updateParcel(parcel_id, asset_id, -1, -1);
|
||||
}
|
||||
else if ("apply_settings_region" == action)
|
||||
{
|
||||
|
|
@ -6933,11 +6940,8 @@ void LLSettingsBridge::performAction(LLInventoryModel* model, std::string action
|
|||
if (!item)
|
||||
return;
|
||||
LLUUID asset_id = item->getProtectedAssetUUID();
|
||||
// *LAPRAS* TODO update on simulator.
|
||||
LL_WARNS("LAPRAS") << "Only updating locally!!! NOT REALLY REGION UPDATE" << LL_ENDL;
|
||||
LLEnvironment::instance().clearEnvironment(LLEnvironment::ENV_LOCAL);
|
||||
LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_REGION, asset_id);
|
||||
LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL);
|
||||
|
||||
LLEnvironment::instance().updateRegion(asset_id, -1, -1);
|
||||
}
|
||||
else
|
||||
LLItemBridge::performAction(model, action);
|
||||
|
|
@ -6988,24 +6992,34 @@ void LLSettingsBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
|
|||
items.push_back("Settings Apply Local");
|
||||
|
||||
items.push_back("Settings Apply Parcel");
|
||||
// *LAPRAS* TODO: test for permission
|
||||
|
||||
if (!canUpdateParcel())
|
||||
disabled_items.push_back("Settings Apply Parcel");
|
||||
|
||||
items.push_back("Settings Apply Region");
|
||||
// *LAPRAS* TODO: test for permission
|
||||
if (!canUpdateRegion())
|
||||
disabled_items.push_back("Settings Apply Region");
|
||||
}
|
||||
addLinkReplaceMenuOption(items, disabled_items);
|
||||
hide_context_entries(menu, items, disabled_items);
|
||||
}
|
||||
std::string LLSettingsBridge::getLabelSuffix() const
|
||||
{
|
||||
return LLItemBridge::getLabelSuffix();
|
||||
}
|
||||
|
||||
BOOL LLSettingsBridge::renameItem(const std::string& new_name)
|
||||
{
|
||||
/*TODO: change internal settings name? */
|
||||
return LLItemBridge::renameItem(new_name);
|
||||
}
|
||||
|
||||
bool LLSettingsBridge::canUpdateParcel() const
|
||||
{
|
||||
return LLEnvironment::instance().canAgentUpdateParcelEnvironment();
|
||||
}
|
||||
|
||||
bool LLSettingsBridge::canUpdateRegion() const
|
||||
{
|
||||
return LLEnvironment::instance().canAgentUpdateRegionEnvironment();
|
||||
}
|
||||
|
||||
|
||||
// +=================================================+
|
||||
// | LLLinkBridge |
|
||||
// +=================================================+
|
||||
|
|
|
|||
|
|
@ -622,13 +622,15 @@ public:
|
|||
virtual void performAction(LLInventoryModel* model, std::string action);
|
||||
virtual void openItem();
|
||||
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
|
||||
virtual std::string getLabelSuffix() const;
|
||||
virtual BOOL renameItem(const std::string& new_name);
|
||||
virtual BOOL renameItem(const std::string& new_name);
|
||||
virtual LLSettingsType::type_e getSettingsType() const { return mSettingsType; }
|
||||
|
||||
|
||||
protected:
|
||||
bool canUpdateRegion() const;
|
||||
bool canUpdateParcel() const;
|
||||
|
||||
LLSettingsType::type_e mSettingsType;
|
||||
|
||||
};
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
|
|
|||
|
|
@ -11113,4 +11113,31 @@ Failed to find the settisgs named [DESC] in database.
|
|||
<tag>fail</tag>
|
||||
</notification>
|
||||
|
||||
<notification
|
||||
icon="notify.tga"
|
||||
name="FailedToLoadSettingsApply"
|
||||
persist="true"
|
||||
type="alertmodal">
|
||||
Unable to apply those settings to the environment.
|
||||
<tag>fail</tag>
|
||||
</notification>
|
||||
|
||||
<notification
|
||||
icon="notify.tga"
|
||||
name="FailedToBuildSettingsDay"
|
||||
persist="true"
|
||||
type="alertmodal">
|
||||
Unable to apply those settings to the environment.
|
||||
<tag>fail</tag>
|
||||
</notification>
|
||||
|
||||
<notification
|
||||
icon="notify.tga"
|
||||
name="NoEnvironmentSettings"
|
||||
persist="true"
|
||||
type="alertmodal">
|
||||
This Region does not support environmental settings.
|
||||
<tag>fail</tag>
|
||||
</notification>
|
||||
|
||||
</notifications>
|
||||
|
|
|
|||
Loading…
Reference in New Issue