MAINT-8990, MAINT-9002: First pass rework on environment panels, region/parcel
parent
30ef616af5
commit
eadf0b9101
|
|
@ -87,7 +87,7 @@ public:
|
|||
inline bool hasSetting(const std::string ¶m) const { return mSettings.has(param); }
|
||||
inline bool isDirty() const { return mDirty; }
|
||||
inline bool isVeryDirty() const { return mReplaced; }
|
||||
inline void setDirtyFlag(bool dirty) { mDirty = dirty; }
|
||||
inline void setDirtyFlag(bool dirty) { mDirty = dirty; clearAssetId(); }
|
||||
|
||||
size_t getHash() const; // Hash will not include Name, ID or a previously stored Hash
|
||||
|
||||
|
|
@ -116,10 +116,10 @@ public:
|
|||
|
||||
virtual void replaceSettings(LLSD settings)
|
||||
{
|
||||
mSettings = settings;
|
||||
mBlendedFactor = 0.0;
|
||||
setDirtyFlag(true);
|
||||
mReplaced = true;
|
||||
mSettings = settings;
|
||||
}
|
||||
|
||||
virtual LLSD getSettings() const;
|
||||
|
|
@ -130,8 +130,8 @@ public:
|
|||
{
|
||||
mSettings[name] = value;
|
||||
mDirty = true;
|
||||
if (mSettings.has(SETTING_ASSETID))
|
||||
mSettings.erase(SETTING_ASSETID);
|
||||
if (name != SETTING_ASSETID)
|
||||
clearAssetId();
|
||||
}
|
||||
|
||||
inline void setValue(const std::string &name, const LLSD &value)
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ const S32 LLSettingsDay::FRAME_MAX(56);
|
|||
|
||||
const F32 LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR(0.02501f);
|
||||
|
||||
const LLUUID LLSettingsDay::DEFAULT_ASSET_ID("283a26a3-b147-47b7-8057-cfff0302ec0e");
|
||||
const LLUUID LLSettingsDay::DEFAULT_ASSET_ID("94d296c2-6e05-963c-6b62-671199121dbb");
|
||||
|
||||
// Minimum value to prevent multislider in edit floaters from eating up frames that 'encroach' on one another's space
|
||||
static const F32 DEFAULT_MULTISLIDER_INCREMENT(0.005f);
|
||||
|
|
@ -150,6 +150,9 @@ LLSD LLSettingsDay::getSettings() const
|
|||
if (mSettings.has(SETTING_ID))
|
||||
settings[SETTING_ID] = mSettings[SETTING_ID];
|
||||
|
||||
if (mSettings.has(SETTING_ASSETID))
|
||||
settings[SETTING_ASSETID] = mSettings[SETTING_ASSETID];
|
||||
|
||||
settings[SETTING_TYPE] = getSettingsType();
|
||||
|
||||
std::map<std::string, LLSettingsBase::ptr_t> in_use;
|
||||
|
|
@ -194,6 +197,14 @@ bool LLSettingsDay::initialize(bool validate_frames)
|
|||
LLSD tracks = mSettings[SETTING_TRACKS];
|
||||
LLSD frames = mSettings[SETTING_FRAMES];
|
||||
|
||||
// save for later...
|
||||
LLUUID assetid;
|
||||
if (mSettings.has(SETTING_ASSETID))
|
||||
{
|
||||
assetid = mSettings[SETTING_ASSETID].asUUID();
|
||||
LL_WARNS("LAPRAS") << "initializing daycycle with asset id " << assetid << LL_ENDL;
|
||||
}
|
||||
|
||||
std::map<std::string, LLSettingsBase::ptr_t> used;
|
||||
|
||||
for (LLSD::map_const_iterator itFrame = frames.beginMap(); itFrame != frames.endMap(); ++itFrame)
|
||||
|
|
@ -385,6 +396,11 @@ bool LLSettingsDay::initialize(bool validate_frames)
|
|||
mSettings.erase(SETTING_TRACKS);
|
||||
mSettings.erase(SETTING_FRAMES);
|
||||
|
||||
if (!assetid.isNull())
|
||||
{
|
||||
mSettings[SETTING_ASSETID] = assetid;
|
||||
}
|
||||
|
||||
mInitialized = true;
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,6 +57,8 @@
|
|||
#include <boost/make_shared.hpp>
|
||||
|
||||
#include "llatmosphere.h"
|
||||
#include "llagent.h"
|
||||
#include "roles_constants.h"
|
||||
|
||||
//=========================================================================
|
||||
namespace
|
||||
|
|
@ -374,23 +376,33 @@ void LLEnvironment::getAtmosphericModelSettings(AtmosphericModelSettings& settin
|
|||
}
|
||||
}
|
||||
|
||||
bool LLEnvironment::canAgentUpdateParcelEnvironment(bool useselected) const
|
||||
bool LLEnvironment::canAgentUpdateParcelEnvironment() const
|
||||
{
|
||||
LLParcel *parcel(LLViewerParcelMgr::instance().getAgentOrSelectedParcel());
|
||||
|
||||
return canAgentUpdateParcelEnvironment(parcel);
|
||||
}
|
||||
|
||||
|
||||
bool LLEnvironment::canAgentUpdateParcelEnvironment(LLParcel *parcel) const
|
||||
{
|
||||
if (!parcel)
|
||||
return false;
|
||||
|
||||
if (!LLEnvironment::instance().isExtendedEnvironmentEnabled())
|
||||
return false;
|
||||
|
||||
LLParcel *parcel(LLViewerParcelMgr::instance().getAgentOrSelectedParcel());
|
||||
if (gAgent.isGodlike())
|
||||
return true;
|
||||
|
||||
if (parcel)
|
||||
{
|
||||
return parcel->allowTerraformBy(gAgent.getID());
|
||||
}
|
||||
|
||||
return false;
|
||||
return LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_OPTIONS);
|
||||
}
|
||||
|
||||
bool LLEnvironment::canAgentUpdateRegionEnvironment() const
|
||||
{
|
||||
if (gAgent.isGodlike())
|
||||
return true;
|
||||
|
||||
return gAgent.getRegion()->canManageEstate();
|
||||
}
|
||||
|
||||
|
|
@ -595,6 +607,7 @@ void LLEnvironment::onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLS
|
|||
}
|
||||
|
||||
setEnvironment(env, settings);
|
||||
updateEnvironment();
|
||||
}
|
||||
|
||||
void LLEnvironment::clearEnvironment(LLEnvironment::EnvSelection_t env)
|
||||
|
|
@ -1001,7 +1014,7 @@ void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentI
|
|||
}
|
||||
|
||||
//=========================================================================
|
||||
void LLEnvironment::requestRegion()
|
||||
void LLEnvironment::requestRegion(environment_apply_fn cb)
|
||||
{
|
||||
if (!isExtendedEnvironmentEnabled())
|
||||
{ /*TODO: When EEP is live on the entire grid, this can go away. */
|
||||
|
|
@ -1009,7 +1022,7 @@ void LLEnvironment::requestRegion()
|
|||
return;
|
||||
}
|
||||
|
||||
requestParcel(INVALID_PARCEL_ID);
|
||||
requestParcel(INVALID_PARCEL_ID, cb);
|
||||
}
|
||||
|
||||
void LLEnvironment::updateRegion(const LLSettingsDay::ptr_t &pday, S32 day_length, S32 day_offset)
|
||||
|
|
@ -1051,12 +1064,16 @@ void LLEnvironment::resetRegion()
|
|||
resetParcel(INVALID_PARCEL_ID);
|
||||
}
|
||||
|
||||
void LLEnvironment::requestParcel(S32 parcel_id)
|
||||
void LLEnvironment::requestParcel(S32 parcel_id, environment_apply_fn cb)
|
||||
{
|
||||
if (!cb)
|
||||
{
|
||||
cb = [this](S32 pid, EnvironmentInfo::ptr_t envinfo) { recordEnvironment(pid, envinfo); };
|
||||
}
|
||||
|
||||
std::string coroname =
|
||||
LLCoros::instance().launch("LLEnvironment::coroRequestEnvironment",
|
||||
boost::bind(&LLEnvironment::coroRequestEnvironment, this, parcel_id,
|
||||
[this](S32 pid, EnvironmentInfo::ptr_t envinfo) { recordEnvironment(pid, envinfo); }));
|
||||
[this, parcel_id, cb]() { coroRequestEnvironment(parcel_id, cb); });
|
||||
}
|
||||
|
||||
void LLEnvironment::updateParcel(S32 parcel_id, const LLUUID &asset_id, S32 day_length, S32 day_offset)
|
||||
|
|
@ -1065,10 +1082,6 @@ void LLEnvironment::updateParcel(S32 parcel_id, const LLUUID &asset_id, S32 day_
|
|||
LLCoros::instance().launch("LLEnvironment::coroUpdateEnvironment",
|
||||
[this, parcel_id, asset_id, day_length, day_offset]() { coroUpdateEnvironment(parcel_id, NO_TRACK,
|
||||
LLSettingsDay::ptr_t(), asset_id, day_length, day_offset, environment_apply_fn()); });
|
||||
// [this](S32 pid, EnvironmentInfo::ptr_t envinfo) { recordEnvironment(pid, envinfo); }); });
|
||||
|
||||
// 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)
|
||||
|
|
@ -1117,7 +1130,6 @@ void LLEnvironment::updateParcel(S32 parcel_id, const LLSettingsDay::ptr_t &pday
|
|||
LLCoros::instance().launch("LLEnvironment::coroUpdateEnvironment",
|
||||
[this, parcel_id, pday, day_length, day_offset]() { coroUpdateEnvironment(parcel_id, NO_TRACK,
|
||||
pday, LLUUID::null, day_length, day_offset, environment_apply_fn()); });
|
||||
// [this](S32 pid, EnvironmentInfo::ptr_t envinfo) { recordEnvironment(pid, envinfo); }); });
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1127,7 +1139,6 @@ void LLEnvironment::resetParcel(S32 parcel_id)
|
|||
std::string coroname =
|
||||
LLCoros::instance().launch("LLEnvironment::coroResetEnvironment",
|
||||
[this, parcel_id]() { coroResetEnvironment(parcel_id, NO_TRACK, environment_apply_fn()); });
|
||||
// [this](S32 pid, EnvironmentInfo::ptr_t envinfo) { recordEnvironment(pid, envinfo); }); });
|
||||
}
|
||||
|
||||
void LLEnvironment::coroRequestEnvironment(S32 parcel_id, LLEnvironment::environment_apply_fn apply)
|
||||
|
|
@ -1419,6 +1430,12 @@ LLEnvironment::EnvironmentInfo::ptr_t LLEnvironment::EnvironmentInfo::extract(LL
|
|||
pinfo->mDayHash = environment.has(KEY_DAYHASH) ? environment[KEY_DAYHASH].asInteger() : 0;
|
||||
}
|
||||
|
||||
if (environment.has(KEY_DAYASSET))
|
||||
{
|
||||
pinfo->mAssetId = environment[KEY_DAYASSET].asUUID();
|
||||
LL_WARNS("LAPRAS") << "Environment asset ID is " << pinfo->mAssetId << LL_ENDL;
|
||||
LL_WARNS("LAPRAS") << "(day cycle claims " << pinfo->mDayCycle->getAssetId() << ")" << LL_ENDL;
|
||||
}
|
||||
|
||||
return pinfo;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@
|
|||
//-------------------------------------------------------------------------
|
||||
class LLViewerCamera;
|
||||
class LLGLSLShader;
|
||||
class LLParcel;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
class LLEnvironment : public LLSingleton<LLEnvironment>
|
||||
|
|
@ -81,6 +82,7 @@ public:
|
|||
LLSettingsDay::ptr_t mDayCycle;
|
||||
std::array<F32, 4> mAltitudes;
|
||||
bool mIsDefault;
|
||||
LLUUID mAssetId;
|
||||
|
||||
static ptr_t extract(LLSD);
|
||||
};
|
||||
|
|
@ -148,7 +150,8 @@ public:
|
|||
bool canEdit() const;
|
||||
bool isExtendedEnvironmentEnabled() const;
|
||||
bool isInventoryEnabled() const;
|
||||
bool canAgentUpdateParcelEnvironment(bool useselected = true) const;
|
||||
bool canAgentUpdateParcelEnvironment() const;
|
||||
bool canAgentUpdateParcelEnvironment(LLParcel *parcel) const;
|
||||
bool canAgentUpdateRegionEnvironment() const;
|
||||
|
||||
LLSettingsDay::ptr_t getCurrentDay() const { return mCurrentEnvironment->getDayCycle(); }
|
||||
|
|
@ -228,13 +231,13 @@ public:
|
|||
|
||||
void onLegacyRegionSettings(LLSD data);
|
||||
|
||||
void requestRegion();
|
||||
void requestRegion(environment_apply_fn cb = environment_apply_fn());
|
||||
void updateRegion(const LLUUID &asset_id, S32 day_length, S32 day_offset);
|
||||
void updateRegion(const LLSettingsDay::ptr_t &pday, S32 day_length, S32 day_offset);
|
||||
void updateRegion(const LLSettingsSky::ptr_t &psky, S32 day_length, S32 day_offset);
|
||||
void updateRegion(const LLSettingsWater::ptr_t &pwater, S32 day_length, S32 day_offset);
|
||||
void resetRegion();
|
||||
void requestParcel(S32 parcel_id);
|
||||
void requestParcel(S32 parcel_id, environment_apply_fn cb = environment_apply_fn());
|
||||
void updateParcel(S32 parcel_id, const LLUUID &asset_id, S32 day_length, S32 day_offset);
|
||||
void updateParcel(S32 parcel_id, const LLSettingsDay::ptr_t &pday, S32 day_length, S32 day_offset);
|
||||
void updateParcel(S32 parcel_id, const LLSettingsSky::ptr_t &psky, S32 day_length, S32 day_offset);
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ namespace {
|
|||
|
||||
//=========================================================================
|
||||
const std::string LLFloaterEditExtDayCycle::KEY_INVENTORY_ID("inventory_id");
|
||||
const std::string LLFloaterEditExtDayCycle::KEY_LIVE_ENVIRONMENT("live_environment");
|
||||
const std::string LLFloaterEditExtDayCycle::KEY_EDIT_CONTEXT("edit_context");
|
||||
const std::string LLFloaterEditExtDayCycle::KEY_DAY_LENGTH("day_length");
|
||||
|
||||
//=========================================================================
|
||||
|
|
@ -198,9 +198,9 @@ void LLFloaterEditExtDayCycle::onOpen(const LLSD& key)
|
|||
{
|
||||
loadInventoryItem(key[KEY_INVENTORY_ID].asUUID());
|
||||
}
|
||||
else if (key.has(KEY_LIVE_ENVIRONMENT))
|
||||
else if (key.has(KEY_EDIT_CONTEXT))
|
||||
{
|
||||
env = static_cast<LLEnvironment::EnvSelection_t>(key[KEY_LIVE_ENVIRONMENT].asInteger());
|
||||
env = static_cast<LLEnvironment::EnvSelection_t>(key[KEY_EDIT_CONTEXT].asInteger());
|
||||
|
||||
loadLiveEnvironment(env);
|
||||
}
|
||||
|
|
@ -1261,6 +1261,7 @@ void LLFloaterEditExtDayCycle::doOpenInventoryFloater(LLSettingsType::type_e typ
|
|||
}
|
||||
|
||||
picker->setSettingsFilter(type);
|
||||
picker->setSettingsAssetId(currasset);
|
||||
picker->openFloater();
|
||||
picker->setFocus(TRUE);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ class LLFloaterEditExtDayCycle : public LLFloater
|
|||
public:
|
||||
// **RIDER**
|
||||
static const std::string KEY_INVENTORY_ID;
|
||||
static const std::string KEY_LIVE_ENVIRONMENT;
|
||||
static const std::string KEY_EDIT_CONTEXT;
|
||||
static const std::string KEY_DAY_LENGTH;
|
||||
// **RIDER**
|
||||
|
||||
|
|
|
|||
|
|
@ -145,14 +145,19 @@ class LLPanelLandEnvironment
|
|||
: public LLPanelEnvironmentInfo
|
||||
{
|
||||
public:
|
||||
LLPanelLandEnvironment(LLSafeHandle<LLParcelSelection>& parcelp);
|
||||
LLPanelLandEnvironment(LLSafeHandle<LLParcelSelection>& parcelp);
|
||||
|
||||
virtual BOOL postBuild();
|
||||
virtual void refresh();
|
||||
virtual bool isRegion() const override { return false; }
|
||||
|
||||
virtual BOOL postBuild() override;
|
||||
virtual void refresh() override;
|
||||
|
||||
virtual LLParcel * getParcel() override;
|
||||
|
||||
virtual bool canEdit();
|
||||
protected:
|
||||
|
||||
virtual void doApply();
|
||||
virtual void doApply();
|
||||
|
||||
|
||||
LLSafeHandle<LLParcelSelection>& mParcel;
|
||||
|
|
@ -3257,88 +3262,80 @@ BOOL LLPanelLandEnvironment::postBuild()
|
|||
if (!LLPanelEnvironmentInfo::postBuild())
|
||||
return FALSE;
|
||||
|
||||
mAllowOverRide->setVisible(FALSE);
|
||||
getChild<LLUICtrl>(RDO_USEDEFAULT)->setLabelArg("[USEDEFAULT]", getString(STR_LABEL_USEREGION));
|
||||
getChild<LLUICtrl>(CHK_ALLOWOVERRIDE)->setVisible(FALSE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLPanelLandEnvironment::refresh()
|
||||
{
|
||||
/*TODO: if legacy don't do any of this.*/
|
||||
if (gDisconnected)
|
||||
return;
|
||||
|
||||
LLParcel* parcel = mParcel->getParcel();
|
||||
LLParcel *parcel = getParcel();
|
||||
if (!parcel)
|
||||
{
|
||||
mRegionSettingsRadioGroup->setEnabled(FALSE);
|
||||
mDayLengthSlider->setEnabled(FALSE);
|
||||
mDayOffsetSlider->setEnabled(FALSE);
|
||||
mAllowOverRide->setEnabled(FALSE);
|
||||
|
||||
LL_INFOS("ENVPANEL") << "No parcel selected." << LL_ENDL;
|
||||
mCurrentEnvironment.reset();
|
||||
mCurrentParcelId = INVALID_PARCEL_ID;
|
||||
setControlsEnabled(false);
|
||||
return;
|
||||
}
|
||||
|
||||
//BOOL owner_or_god = gAgent.isGodlike() || (parcel owner or group)
|
||||
BOOL owner_or_god = true;
|
||||
//BOOL owner_or_god_or_manager = owner_or_god || (region && region->isEstateManager());
|
||||
if ((!mCurrentEnvironment) || (mCurrentEnvironment->mParcelId != parcel->getLocalID()))
|
||||
{
|
||||
mCurrentParcelId = parcel->getLocalID();
|
||||
refreshFromSource();
|
||||
return;
|
||||
}
|
||||
|
||||
F64Hours daylength;
|
||||
F64Hours dayoffset;
|
||||
LLPanelEnvironmentInfo::refresh();
|
||||
|
||||
LLEnvironment::EnvSelection_t env = LLEnvironment::ENV_PARCEL;
|
||||
}
|
||||
|
||||
if (!LLEnvironment::instance().hasEnvironment(env))
|
||||
env = LLEnvironment::ENV_REGION;
|
||||
LLParcel *LLPanelLandEnvironment::getParcel()
|
||||
{
|
||||
return mParcel->getParcel();
|
||||
}
|
||||
|
||||
daylength = LLEnvironment::instance().getEnvironmentDayLength(env);
|
||||
dayoffset = LLEnvironment::instance().getEnvironmentDayOffset(env);
|
||||
|
||||
LLSettingsDay::ptr_t pday = LLEnvironment::instance().getEnvironmentDay(env);
|
||||
|
||||
mEditingDayCycle = pday->buildClone();
|
||||
|
||||
LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_EDIT, mEditingDayCycle, daylength, dayoffset);
|
||||
|
||||
if (dayoffset.value() > 12.0)
|
||||
dayoffset = dayoffset - F32Hours(24.0f);
|
||||
|
||||
mDayLengthSlider->setValue(daylength.value());
|
||||
mDayOffsetSlider->setValue(dayoffset.value());
|
||||
|
||||
//mRegionSettingsRadioGroup->setSelectedIndex(parcel->getUsesDefaultDayCycle() ? 0 : 1);
|
||||
mRegionSettingsRadioGroup->setSelectedIndex(1);
|
||||
|
||||
setControlsEnabled(owner_or_god);
|
||||
|
||||
bool LLPanelLandEnvironment::canEdit()
|
||||
{
|
||||
LLParcel *parcel = getParcel();
|
||||
if (!parcel)
|
||||
return false;
|
||||
return LLEnvironment::instance().canAgentUpdateParcelEnvironment(parcel);
|
||||
}
|
||||
|
||||
void LLPanelLandEnvironment::doApply()
|
||||
{
|
||||
LLParcel* parcel = mParcel->getParcel();
|
||||
if (!parcel)
|
||||
{
|
||||
LL_WARNS("PARCEL") << "Could not get parcel." << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
S32 parcel_id = parcel->getLocalID();
|
||||
|
||||
if (mRegionSettingsRadioGroup->getSelectedIndex() == 0)
|
||||
{
|
||||
LLEnvironment::instance().resetParcel(parcel_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
LLSettingsDay::Seconds daylength;
|
||||
F32Hours dayoffset_h;
|
||||
|
||||
daylength = F32Hours(mDayLengthSlider->getValueF32());
|
||||
dayoffset_h = F32Hours(mDayOffsetSlider->getValueF32());
|
||||
|
||||
if (dayoffset_h.value() < 0)
|
||||
{
|
||||
dayoffset_h = F32Hours(24.0f) + dayoffset_h;
|
||||
}
|
||||
|
||||
LLSettingsDay::Seconds dayoffset_s = dayoffset_h;
|
||||
|
||||
LLEnvironment::instance().updateParcel(parcel_id, mEditingDayCycle, daylength.value(), dayoffset_s.value());
|
||||
}
|
||||
// LLParcel* parcel = mParcel->getParcel();
|
||||
// if (!parcel)
|
||||
// {
|
||||
// LL_WARNS("PARCEL") << "Could not get parcel." << LL_ENDL;
|
||||
// return;
|
||||
// }
|
||||
// S32 parcel_id = parcel->getLocalID();
|
||||
//
|
||||
// if (mRegionSettingsRadioGroup->getSelectedIndex() == 0)
|
||||
// {
|
||||
// LLEnvironment::instance().resetParcel(parcel_id);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LLSettingsDay::Seconds daylength;
|
||||
// F32Hours dayoffset_h;
|
||||
//
|
||||
// daylength = F32Hours(mDayLengthSlider->getValueF32());
|
||||
// dayoffset_h = F32Hours(mDayOffsetSlider->getValueF32());
|
||||
//
|
||||
// if (dayoffset_h.value() < 0)
|
||||
// {
|
||||
// dayoffset_h = F32Hours(24.0f) + dayoffset_h;
|
||||
// }
|
||||
//
|
||||
// LLSettingsDay::Seconds dayoffset_s = dayoffset_h;
|
||||
//
|
||||
// LLEnvironment::instance().updateParcel(parcel_id, mEditingDayCycle, daylength.value(), dayoffset_s.value());
|
||||
// }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -181,12 +181,16 @@ class LLPanelRegionEnvironment : public LLPanelEnvironmentInfo
|
|||
public:
|
||||
LLPanelRegionEnvironment();
|
||||
|
||||
void refresh();
|
||||
virtual void refresh() override;
|
||||
|
||||
virtual bool isRegion() const override { return true; }
|
||||
virtual LLParcel * getParcel() override { return nullptr; }
|
||||
virtual bool canEdit() override { return LLEnvironment::instance().canAgentUpdateRegionEnvironment(); }
|
||||
|
||||
bool refreshFromRegion(LLViewerRegion* region);
|
||||
void refreshFromEstate();
|
||||
|
||||
virtual BOOL postBuild();
|
||||
virtual BOOL postBuild() override;
|
||||
|
||||
protected:
|
||||
virtual void doApply();
|
||||
|
|
@ -194,8 +198,6 @@ protected:
|
|||
virtual void doEditCommited(LLSettingsDay::ptr_t &newday);
|
||||
BOOL sendUpdate();
|
||||
|
||||
private:
|
||||
LLViewerRegion * mLastRegion;
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -246,6 +248,7 @@ BOOL LLFloaterRegionInfo::postBuild()
|
|||
|
||||
mEnvironmentPanel = new LLPanelRegionEnvironment;
|
||||
mEnvironmentPanel->buildFromFile("panel_region_environment.xml");
|
||||
// mEnvironmentPanel->configureForRegion();
|
||||
mTab->addTabPanel(mEnvironmentPanel);
|
||||
|
||||
panel = new LLPanelRegionDebugInfo;
|
||||
|
|
@ -3367,8 +3370,7 @@ void LLPanelRegionExperiences::itemChanged( U32 event_type, const LLUUID& id )
|
|||
|
||||
//=========================================================================
|
||||
LLPanelRegionEnvironment::LLPanelRegionEnvironment():
|
||||
LLPanelEnvironmentInfo(),
|
||||
mLastRegion(NULL)
|
||||
LLPanelEnvironmentInfo()
|
||||
{
|
||||
LLEstateInfoModel& estate_info = LLEstateInfoModel::instance();
|
||||
estate_info.setCommitCallback(boost::bind(&LLPanelRegionEnvironment::refreshFromEstate, this));
|
||||
|
|
@ -3381,48 +3383,28 @@ BOOL LLPanelRegionEnvironment::postBuild()
|
|||
if (!LLPanelEnvironmentInfo::postBuild())
|
||||
return FALSE;
|
||||
|
||||
getChild<LLUICtrl>(RDO_USEDEFAULT)->setLabelArg("[USEDEFAULT]", getString(STR_LABEL_USEDEFAULT));
|
||||
getChild<LLUICtrl>(CHK_ALLOWOVERRIDE)->setVisible(TRUE);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
void LLPanelRegionEnvironment::refresh()
|
||||
{
|
||||
refreshFromRegion(mLastRegion);
|
||||
if (!mCurrentEnvironment)
|
||||
{
|
||||
refreshFromSource();
|
||||
return;
|
||||
}
|
||||
|
||||
refreshFromEstate();
|
||||
LLPanelEnvironmentInfo::refresh();
|
||||
}
|
||||
|
||||
bool LLPanelRegionEnvironment::refreshFromRegion(LLViewerRegion* region)
|
||||
{
|
||||
BOOL owner_or_god = gAgent.isGodlike() || (region && (region->getOwner() == gAgent.getID()));
|
||||
BOOL owner_or_god_or_manager = owner_or_god || (region && region->isEstateManager());
|
||||
|
||||
F64Hours daylength;
|
||||
F64Hours dayoffset;
|
||||
|
||||
daylength = LLEnvironment::instance().getEnvironmentDayLength(LLEnvironment::ENV_REGION);
|
||||
dayoffset = LLEnvironment::instance().getEnvironmentDayOffset(LLEnvironment::ENV_REGION);
|
||||
|
||||
if (dayoffset.value() > 12.0)
|
||||
dayoffset = dayoffset - F64Hours(24.0f);
|
||||
|
||||
mDayLengthSlider->setValue(daylength.value());
|
||||
mDayOffsetSlider->setValue(dayoffset.value());
|
||||
|
||||
setControlsEnabled(owner_or_god_or_manager);
|
||||
mLastRegion = region;
|
||||
|
||||
LLSettingsDay::ptr_t pday = LLEnvironment::instance().getEnvironmentDay(LLEnvironment::ENV_REGION);
|
||||
|
||||
if (pday)
|
||||
{
|
||||
mRegionSettingsRadioGroup->setSelectedIndex((pday->getAssetId() == LLSettingsDay::GetDefaultAssetId()) ? 0 : 1);
|
||||
mEditingDayCycle = std::static_pointer_cast<LLSettingsDay>(pday->buildDerivedClone());
|
||||
}
|
||||
else
|
||||
{
|
||||
mRegionSettingsRadioGroup->setSelectedIndex(1);
|
||||
}
|
||||
|
||||
refresh();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -3430,38 +3412,38 @@ void LLPanelRegionEnvironment::refreshFromEstate()
|
|||
{
|
||||
const LLEstateInfoModel& estate_info = LLEstateInfoModel::instance();
|
||||
|
||||
getChild<LLUICtrl>("allow_override_chk")->setValue(estate_info.getAllowEnvironmentOverride());
|
||||
getChild<LLUICtrl>(CHK_ALLOWOVERRIDE)->setValue(estate_info.getAllowEnvironmentOverride());
|
||||
|
||||
}
|
||||
|
||||
void LLPanelRegionEnvironment::doApply()
|
||||
{
|
||||
if (mRegionSettingsRadioGroup->getSelectedIndex() == 0)
|
||||
{
|
||||
LLEnvironment::instance().resetRegion();
|
||||
}
|
||||
else
|
||||
{
|
||||
LLSettingsDay::Seconds daylength;
|
||||
F32Hours dayoffset_h;
|
||||
|
||||
daylength = F32Hours(mDayLengthSlider->getValueF32());
|
||||
dayoffset_h = F32Hours(mDayOffsetSlider->getValueF32());
|
||||
|
||||
if (dayoffset_h.value() < 0)
|
||||
{
|
||||
dayoffset_h = F32Hours(24.0f) + dayoffset_h;
|
||||
}
|
||||
|
||||
LLSettingsDay::Seconds dayoffset_s = dayoffset_h;
|
||||
|
||||
LLEnvironment::instance().updateRegion(mEditingDayCycle, daylength.value(), dayoffset_s.value());
|
||||
}
|
||||
// if (mRegionSettingsRadioGroup->getSelectedIndex() == 0)
|
||||
// {
|
||||
// LLEnvironment::instance().resetRegion();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// LLSettingsDay::Seconds daylength;
|
||||
// F32Hours dayoffset_h;
|
||||
//
|
||||
// daylength = F32Hours(mDayLengthSlider->getValueF32());
|
||||
// dayoffset_h = F32Hours(mDayOffsetSlider->getValueF32());
|
||||
//
|
||||
// if (dayoffset_h.value() < 0)
|
||||
// {
|
||||
// dayoffset_h = F32Hours(24.0f) + dayoffset_h;
|
||||
// }
|
||||
//
|
||||
// LLSettingsDay::Seconds dayoffset_s = dayoffset_h;
|
||||
//
|
||||
// LLEnvironment::instance().updateRegion(mEditingDayCycle, daylength.value(), dayoffset_s.value());
|
||||
// }
|
||||
}
|
||||
|
||||
void LLPanelRegionEnvironment::doEditCommited(LLSettingsDay::ptr_t &newday)
|
||||
{
|
||||
mEditingDayCycle = newday;
|
||||
// mEditingDayCycle = newday;
|
||||
}
|
||||
|
||||
BOOL LLPanelRegionEnvironment::sendUpdate()
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
#include "lluictrlfactory.h"
|
||||
#include "llexperiencecache.h"
|
||||
#include "llagent.h"
|
||||
#include "llparcel.h"
|
||||
|
||||
#include "llviewerregion.h"
|
||||
#include "llpanelenvironment.h"
|
||||
|
|
@ -40,31 +41,63 @@
|
|||
#include "llfloater.h"
|
||||
#include "llfloaterreg.h"
|
||||
#include "llfloatereditextdaycycle.h"
|
||||
#include "llsettingsvo.h"
|
||||
|
||||
//static LLPanelInjector<LLPanelEnvironmentInfo> register_environment_panel("environment_panel");
|
||||
#include "llappviewer.h"
|
||||
|
||||
//=========================================================================
|
||||
namespace
|
||||
{
|
||||
const std::string FLOATER_DAY_CYCLE_EDIT("env_edit_extdaycycle");
|
||||
}
|
||||
|
||||
//=========================================================================
|
||||
const std::string LLPanelEnvironmentInfo::RDG_ENVIRONMENT_SELECT("rdg_environment_select");
|
||||
const std::string LLPanelEnvironmentInfo::RDO_USEDEFAULT("rdo_use_xxx_setting");
|
||||
const std::string LLPanelEnvironmentInfo::RDO_USEINV("rdo_use_inv_setting");
|
||||
const std::string LLPanelEnvironmentInfo::RDO_USECUSTOM("rdo_use_custom_setting");
|
||||
const std::string LLPanelEnvironmentInfo::EDT_INVNAME("edt_inventory_name");
|
||||
const std::string LLPanelEnvironmentInfo::BTN_SELECTINV("btn_select_inventory");
|
||||
const std::string LLPanelEnvironmentInfo::BTN_EDIT("btn_edit");
|
||||
const std::string LLPanelEnvironmentInfo::SLD_DAYLENGTH("sld_day_length");
|
||||
const std::string LLPanelEnvironmentInfo::SLD_DAYOFFSET("sld_day_offset");
|
||||
const std::string LLPanelEnvironmentInfo::CHK_ALLOWOVERRIDE("chk_allow_override");
|
||||
const std::string LLPanelEnvironmentInfo::BTN_APPLY("btn_apply");
|
||||
const std::string LLPanelEnvironmentInfo::BTN_CANCEL("btn_cancel");
|
||||
|
||||
const std::string LLPanelEnvironmentInfo::STR_LABEL_USEDEFAULT("str_label_use_default");
|
||||
const std::string LLPanelEnvironmentInfo::STR_LABEL_USEREGION("str_label_use_region");
|
||||
const std::string LLPanelEnvironmentInfo::STR_LABEL_UNKNOWNINV("str_unknow_inventory");
|
||||
|
||||
const S32 LLPanelEnvironmentInfo::DIRTY_FLAG_DAYCYCLE(0x01 << 0);
|
||||
const S32 LLPanelEnvironmentInfo::DIRTY_FLAG_DAYLENGTH(0x01 << 1);
|
||||
const S32 LLPanelEnvironmentInfo::DIRTY_FLAG_DAYOFFSET(0x01 << 2);
|
||||
|
||||
const S32 LLPanelEnvironmentInfo::DIRTY_FLAG_MASK(
|
||||
LLPanelEnvironmentInfo::DIRTY_FLAG_DAYCYCLE |
|
||||
LLPanelEnvironmentInfo::DIRTY_FLAG_DAYLENGTH |
|
||||
LLPanelEnvironmentInfo::DIRTY_FLAG_DAYOFFSET );
|
||||
|
||||
//=========================================================================
|
||||
LLPanelEnvironmentInfo::LLPanelEnvironmentInfo():
|
||||
mEnableEditing(false),
|
||||
mRegionSettingsRadioGroup(NULL),
|
||||
mDayLengthSlider(NULL),
|
||||
mDayOffsetSlider(NULL),
|
||||
mAllowOverRide(NULL)
|
||||
mCurrentEnvironment(),
|
||||
mCurrentParcelId(INVALID_PARCEL_ID),
|
||||
mDirtyFlag(0),
|
||||
mSettingsFloater(),
|
||||
mEditFloater()
|
||||
{
|
||||
}
|
||||
|
||||
// virtual
|
||||
BOOL LLPanelEnvironmentInfo::postBuild()
|
||||
{
|
||||
mRegionSettingsRadioGroup = getChild<LLRadioGroup>("environment_select_radio_group");
|
||||
mRegionSettingsRadioGroup->setCommitCallback(boost::bind(&LLPanelEnvironmentInfo::onSwitchDefaultSelection, this));
|
||||
getChild<LLUICtrl>(RDG_ENVIRONMENT_SELECT)->setCommitCallback([this](LLUICtrl *, const LLSD &){ onSwitchDefaultSelection(); });
|
||||
getChild<LLUICtrl>(BTN_SELECTINV)->setCommitCallback([this](LLUICtrl *, const LLSD &){ onBtnSelect(); });
|
||||
getChild<LLUICtrl>(BTN_EDIT)->setCommitCallback([this](LLUICtrl *, const LLSD &){ onBtnEdit(); });
|
||||
getChild<LLUICtrl>(BTN_APPLY)->setCommitCallback([this](LLUICtrl *, const LLSD &){ onBtnApply(); });
|
||||
getChild<LLUICtrl>(BTN_CANCEL)->setCommitCallback([this](LLUICtrl *, const LLSD &){ onBtnReset(); });
|
||||
|
||||
mDayLengthSlider = getChild<LLSliderCtrl>("day_length_sld");
|
||||
mDayOffsetSlider = getChild<LLSliderCtrl>("day_offset_sld");
|
||||
mAllowOverRide = getChild<LLCheckBoxCtrl>("allow_override_chk");
|
||||
|
||||
childSetCommitCallback("edit_btn", boost::bind(&LLPanelEnvironmentInfo::onBtnEdit, this), NULL);
|
||||
childSetCommitCallback("apply_btn", boost::bind(&LLPanelEnvironmentInfo::onBtnApply, this), NULL);
|
||||
childSetCommitCallback("cancel_btn", boost::bind(&LLPanelEnvironmentInfo::onBtnCancel, this), NULL);
|
||||
getChild<LLUICtrl>(SLD_DAYLENGTH)->setCommitCallback([this](LLUICtrl *, const LLSD &value) { onSldDayLengthChanged(value.asReal()); });
|
||||
getChild<LLUICtrl>(SLD_DAYOFFSET)->setCommitCallback([this](LLUICtrl *, const LLSD &value) { onSldDayOffsetChanged(value.asReal()); });
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -72,8 +105,7 @@ BOOL LLPanelEnvironmentInfo::postBuild()
|
|||
// virtual
|
||||
void LLPanelEnvironmentInfo::onOpen(const LLSD& key)
|
||||
{
|
||||
LL_DEBUGS("Windlight") << "Panel opened, refreshing" << LL_ENDL;
|
||||
refresh();
|
||||
refreshFromSource();
|
||||
}
|
||||
|
||||
// virtual
|
||||
|
|
@ -87,53 +119,120 @@ void LLPanelEnvironmentInfo::onVisibilityChange(BOOL new_visibility)
|
|||
|
||||
void LLPanelEnvironmentInfo::refresh()
|
||||
{
|
||||
#if 0
|
||||
if (gDisconnected)
|
||||
{
|
||||
return;
|
||||
|
||||
if (((mCurrentEnvironment->mParcelId != INVALID_PARCEL_ID) && (!mCurrentEnvironment->mDayCycle)) ||
|
||||
((mCurrentEnvironment->mParcelId == INVALID_PARCEL_ID) && (mCurrentEnvironment->mDayCycle->getAssetId() == LLSettingsDay::GetDefaultAssetId() )))
|
||||
{
|
||||
getChild<LLRadioGroup>(RDG_ENVIRONMENT_SELECT)->setSelectedIndex(0);
|
||||
getChild<LLUICtrl>(EDT_INVNAME)->setValue("");
|
||||
}
|
||||
else if (!mCurrentEnvironment->mDayCycle->getAssetId().isNull())
|
||||
{
|
||||
getChild<LLRadioGroup>(RDG_ENVIRONMENT_SELECT)->setSelectedIndex(1);
|
||||
|
||||
LLUUID asset_id = mCurrentEnvironment->mDayCycle->getAssetId();
|
||||
|
||||
std::string inventoryname = getInventoryNameForAssetId(asset_id);
|
||||
|
||||
if (inventoryname.empty())
|
||||
inventoryname = "(" + mCurrentEnvironment->mDayCycle->getName() + ")";
|
||||
|
||||
getChild<LLUICtrl>(EDT_INVNAME)->setValue(inventoryname);
|
||||
}
|
||||
else
|
||||
{ // asset id is null so this is a custom environment
|
||||
getChild<LLRadioGroup>(RDG_ENVIRONMENT_SELECT)->setSelectedIndex(2);
|
||||
getChild<LLUICtrl>(EDT_INVNAME)->setValue("");
|
||||
}
|
||||
|
||||
populateWaterPresetsList();
|
||||
populateSkyPresetsList();
|
||||
populateDayCyclesList();
|
||||
F32Hours daylength(mCurrentEnvironment->mDayLength);
|
||||
F32Hours dayoffset(mCurrentEnvironment->mDayOffset);
|
||||
|
||||
// Init radio groups.
|
||||
const LLEnvironmentSettings& settings = LLEnvManagerNew::instance().getRegionSettings();
|
||||
const LLSD& dc = settings.getWLDayCycle();
|
||||
LLSD::Real first_frame_time = dc.size() > 0 ? dc[0][0].asReal() : 0.0f;
|
||||
const bool use_fixed_sky = dc.size() == 1 && first_frame_time < 0;
|
||||
mRegionSettingsRadioGroup->setSelectedIndex(settings.getSkyMap().size() == 0 ? 0 : 1);
|
||||
mDayCycleSettingsRadioGroup->setSelectedIndex(use_fixed_sky ? 0 : 1);
|
||||
if (dayoffset.value() > 8.0f)
|
||||
dayoffset -= F32Hours(24.0);
|
||||
|
||||
setControlsEnabled(mEnableEditing);
|
||||
getChild<LLSliderCtrl>(SLD_DAYLENGTH)->setValue(daylength.value());
|
||||
getChild<LLSliderCtrl>(SLD_DAYOFFSET)->setValue(dayoffset.value());
|
||||
|
||||
setControlsEnabled(canEdit());
|
||||
}
|
||||
|
||||
setDirty(false);
|
||||
#endif
|
||||
void LLPanelEnvironmentInfo::refreshFromSource()
|
||||
{
|
||||
LLEnvironment::instance().requestParcel(mCurrentParcelId,
|
||||
[this](S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo) {handleEnvironmentReceived(parcel_id, envifo); });
|
||||
}
|
||||
|
||||
std::string LLPanelEnvironmentInfo::getInventoryNameForAssetId(LLUUID asset_id)
|
||||
{
|
||||
LLFloaterSettingsPicker *picker = getSettingsPicker();
|
||||
|
||||
if (!picker)
|
||||
{
|
||||
LL_WARNS("ENVPANEL") << "Couldn't instantiate picker." << LL_ENDL;
|
||||
return std::string();
|
||||
}
|
||||
|
||||
std::string name(picker->findItemName(asset_id, false, false));
|
||||
|
||||
if (name.empty())
|
||||
return getString(STR_LABEL_UNKNOWNINV);
|
||||
return name;
|
||||
}
|
||||
|
||||
LLFloaterSettingsPicker *LLPanelEnvironmentInfo::getSettingsPicker()
|
||||
{
|
||||
LLFloaterSettingsPicker *picker = static_cast<LLFloaterSettingsPicker *>(mSettingsFloater.get());
|
||||
|
||||
// Show the dialog
|
||||
if (!picker)
|
||||
{
|
||||
picker = new LLFloaterSettingsPicker(this,
|
||||
LLUUID::null, "SELECT SETTINGS");
|
||||
|
||||
mSettingsFloater = picker->getHandle();
|
||||
|
||||
picker->setCommitCallback([this](LLUICtrl *, const LLSD &data){ onPickerCommited(data.asUUID()); });
|
||||
}
|
||||
|
||||
return picker;
|
||||
}
|
||||
|
||||
LLFloaterEditExtDayCycle * LLPanelEnvironmentInfo::getEditFloater()
|
||||
{
|
||||
LLFloaterEditExtDayCycle *editor = static_cast<LLFloaterEditExtDayCycle *>(mEditFloater.get());
|
||||
|
||||
// Show the dialog
|
||||
if (!editor)
|
||||
{
|
||||
LLSD params(LLSDMap(LLFloaterEditExtDayCycle::KEY_EDIT_CONTEXT, "parcel")
|
||||
(LLFloaterEditExtDayCycle::KEY_DAY_LENGTH, static_cast<S32>(mCurrentEnvironment->mDayLength.value())));
|
||||
|
||||
editor = (LLFloaterEditExtDayCycle *)LLFloaterReg::getInstance(FLOATER_DAY_CYCLE_EDIT, params);
|
||||
|
||||
if (!editor)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return editor;
|
||||
}
|
||||
|
||||
void LLPanelEnvironmentInfo::setControlsEnabled(bool enabled)
|
||||
{
|
||||
mRegionSettingsRadioGroup->setEnabled(enabled);
|
||||
|
||||
mDayLengthSlider->setEnabled(false);
|
||||
mDayOffsetSlider->setEnabled(false);
|
||||
mAllowOverRide->setEnabled(enabled);
|
||||
|
||||
getChildView("edit_btn")->setEnabled(false);
|
||||
|
||||
getChildView("apply_btn")->setEnabled(enabled);
|
||||
getChildView("cancel_btn")->setEnabled(enabled);
|
||||
|
||||
if (enabled)
|
||||
{
|
||||
// Enable/disable some controls based on currently selected radio buttons.
|
||||
bool use_defaults = mRegionSettingsRadioGroup->getSelectedIndex() == 0;
|
||||
getChild<LLView>("edit_btn")->setEnabled(!use_defaults);
|
||||
|
||||
mDayLengthSlider->setEnabled(!use_defaults);
|
||||
mDayOffsetSlider->setEnabled(!use_defaults);
|
||||
|
||||
}
|
||||
getChild<LLUICtrl>(RDG_ENVIRONMENT_SELECT)->setEnabled(enabled);
|
||||
getChild<LLUICtrl>(RDO_USEDEFAULT)->setEnabled(enabled);
|
||||
getChild<LLUICtrl>(RDO_USEINV)->setEnabled(enabled);
|
||||
getChild<LLUICtrl>(RDO_USECUSTOM)->setEnabled(enabled);
|
||||
getChild<LLUICtrl>(EDT_INVNAME)->setEnabled(FALSE);
|
||||
getChild<LLUICtrl>(BTN_SELECTINV)->setEnabled(enabled);
|
||||
getChild<LLUICtrl>(BTN_EDIT)->setEnabled(enabled);
|
||||
getChild<LLUICtrl>(SLD_DAYLENGTH)->setEnabled(enabled);
|
||||
getChild<LLUICtrl>(SLD_DAYOFFSET)->setEnabled(enabled);
|
||||
getChild<LLUICtrl>(CHK_ALLOWOVERRIDE)->setEnabled(enabled && (mCurrentParcelId == INVALID_PARCEL_ID));
|
||||
getChild<LLUICtrl>(BTN_APPLY)->setEnabled(enabled && (mDirtyFlag != 0));
|
||||
getChild<LLUICtrl>(BTN_CANCEL)->setEnabled(enabled && (mDirtyFlag != 0));
|
||||
}
|
||||
|
||||
void LLPanelEnvironmentInfo::setApplyProgress(bool started)
|
||||
|
|
@ -152,270 +251,119 @@ void LLPanelEnvironmentInfo::setApplyProgress(bool started)
|
|||
// }
|
||||
}
|
||||
|
||||
void LLPanelEnvironmentInfo::setDirty(bool dirty)
|
||||
void LLPanelEnvironmentInfo::setDirtyFlag(S32 flag)
|
||||
{
|
||||
getChildView("apply_btn")->setEnabled(dirty);
|
||||
getChildView("cancel_btn")->setEnabled(dirty);
|
||||
bool can_edit = canEdit();
|
||||
mDirtyFlag |= flag;
|
||||
getChildView(BTN_APPLY)->setEnabled((mDirtyFlag != 0) && can_edit);
|
||||
getChildView(BTN_CANCEL)->setEnabled((mDirtyFlag != 0) && can_edit);
|
||||
}
|
||||
|
||||
// void LLPanelEnvironmentInfo::sendRegionSunUpdate()
|
||||
// {
|
||||
// #if 0
|
||||
// LLRegionInfoModel& region_info = LLRegionInfoModel::instance();
|
||||
//
|
||||
// // If the region is being switched to fixed sky,
|
||||
// // change the region's sun hour according to the (fixed) sun position.
|
||||
// // This is needed for llGetSunDirection() LSL function to work properly (STORM-1330).
|
||||
// const LLSD& sky_map = mNewRegionSettings.getSkyMap();
|
||||
// bool region_use_fixed_sky = sky_map.size() == 1;
|
||||
// if (region_use_fixed_sky)
|
||||
// {
|
||||
// LLWLParamSet param_set;
|
||||
// llassert(sky_map.isMap());
|
||||
// param_set.setAll(sky_map.beginMap()->second);
|
||||
// F32 sun_angle = param_set.getSunAngle();
|
||||
//
|
||||
// LL_DEBUGS("Windlight Sync") << "Old sun hour: " << region_info.mSunHour << LL_ENDL;
|
||||
// // convert value range from 0..2pi to 6..30
|
||||
// region_info.mSunHour = fmodf((sun_angle / F_TWO_PI) * 24.f, 24.f) + 6.f;
|
||||
// }
|
||||
//
|
||||
// region_info.setUseFixedSun(region_use_fixed_sky);
|
||||
// region_info.mUseEstateSun = !region_use_fixed_sky;
|
||||
// LL_DEBUGS("Windlight Sync") << "Sun hour: " << region_info.mSunHour << LL_ENDL;
|
||||
//
|
||||
// region_info.sendRegionTerrain(LLFloaterRegionInfo::getLastInvoice());
|
||||
// #endif
|
||||
// }
|
||||
|
||||
// void LLPanelEnvironmentInfo::fixEstateSun()
|
||||
// {
|
||||
// // We don't support fixed sun estates anymore and need to fix
|
||||
// // such estates for region day cycle to take effect.
|
||||
// // *NOTE: Assuming that current estate settings have arrived already.
|
||||
// LLEstateInfoModel& estate_info = LLEstateInfoModel::instance();
|
||||
// if (estate_info.getUseFixedSun())
|
||||
// {
|
||||
// LL_INFOS() << "Switching estate to global sun" << LL_ENDL;
|
||||
// estate_info.setUseFixedSun(false);
|
||||
// estate_info.sendEstateInfo();
|
||||
// }
|
||||
// }
|
||||
|
||||
// void LLPanelEnvironmentInfo::populateWaterPresetsList()
|
||||
// {
|
||||
// #if 0
|
||||
// mWaterPresetCombo->removeall();
|
||||
//
|
||||
// // If the region already has water params, add them to the list.
|
||||
// const LLEnvironmentSettings& region_settings = LLEnvManagerNew::instance().getRegionSettings();
|
||||
// if (region_settings.getWaterParams().size() != 0)
|
||||
// {
|
||||
// const std::string& region_name = gAgent.getRegion()->getName();
|
||||
// mWaterPresetCombo->add(region_name, LLWLParamKey(region_name, LLEnvKey::SCOPE_REGION).toLLSD());
|
||||
// mWaterPresetCombo->addSeparator();
|
||||
// }
|
||||
//
|
||||
// std::list<std::string> user_presets, system_presets;
|
||||
// LLWaterParamManager::instance().getPresetNames(user_presets, system_presets);
|
||||
//
|
||||
// // Add local user presets first.
|
||||
// for (std::list<std::string>::const_iterator it = user_presets.begin(); it != user_presets.end(); ++it)
|
||||
// {
|
||||
// mWaterPresetCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toLLSD());
|
||||
// }
|
||||
//
|
||||
// if (user_presets.size() > 0)
|
||||
// {
|
||||
// mWaterPresetCombo->addSeparator();
|
||||
// }
|
||||
//
|
||||
// // Add local system presets.
|
||||
// for (std::list<std::string>::const_iterator it = system_presets.begin(); it != system_presets.end(); ++it)
|
||||
// {
|
||||
// mWaterPresetCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toLLSD());
|
||||
// }
|
||||
//
|
||||
// // There's no way to select current preset because its name is not stored on server.
|
||||
// #endif
|
||||
// }
|
||||
//
|
||||
// void LLPanelEnvironmentInfo::populateSkyPresetsList()
|
||||
// {
|
||||
// #if 0
|
||||
// mSkyPresetCombo->removeall();
|
||||
//
|
||||
// LLWLParamManager::preset_name_list_t region_presets;
|
||||
// LLWLParamManager::preset_name_list_t user_presets, sys_presets;
|
||||
// LLWLParamManager::instance().getPresetNames(region_presets, user_presets, sys_presets);
|
||||
//
|
||||
// // Add region presets.
|
||||
// std::string region_name = gAgent.getRegion() ? gAgent.getRegion()->getName() : LLTrans::getString("Unknown");
|
||||
// for (LLWLParamManager::preset_name_list_t::const_iterator it = region_presets.begin(); it != region_presets.end(); ++it)
|
||||
// {
|
||||
// std::string preset_name = *it;
|
||||
// std::string item_title = preset_name + " (" + region_name + ")";
|
||||
// mSkyPresetCombo->add(item_title, LLWLParamKey(preset_name, LLEnvKey::SCOPE_REGION).toStringVal());
|
||||
// }
|
||||
//
|
||||
// if (!region_presets.empty())
|
||||
// {
|
||||
// mSkyPresetCombo->addSeparator();
|
||||
// }
|
||||
//
|
||||
// // Add user presets.
|
||||
// for (LLWLParamManager::preset_name_list_t::const_iterator it = user_presets.begin(); it != user_presets.end(); ++it)
|
||||
// {
|
||||
// mSkyPresetCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toStringVal());
|
||||
// }
|
||||
//
|
||||
// if (!user_presets.empty())
|
||||
// {
|
||||
// mSkyPresetCombo->addSeparator();
|
||||
// }
|
||||
//
|
||||
// // Add system presets.
|
||||
// for (LLWLParamManager::preset_name_list_t::const_iterator it = sys_presets.begin(); it != sys_presets.end(); ++it)
|
||||
// {
|
||||
// mSkyPresetCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toStringVal());
|
||||
// }
|
||||
//
|
||||
// // Select current preset.
|
||||
// LLSD sky_map = LLEnvManagerNew::instance().getRegionSettings().getSkyMap();
|
||||
// if (sky_map.size() == 1) // if the region is set to fixed sky
|
||||
// {
|
||||
// std::string preset_name = sky_map.beginMap()->first;
|
||||
// mSkyPresetCombo->selectByValue(LLWLParamKey(preset_name, LLEnvKey::SCOPE_REGION).toStringVal());
|
||||
// }
|
||||
// #endif
|
||||
// }
|
||||
//
|
||||
// void LLPanelEnvironmentInfo::populateDayCyclesList()
|
||||
// {
|
||||
// #if 0
|
||||
// mDayCyclePresetCombo->removeall();
|
||||
//
|
||||
// // If the region already has env. settings, add its day cycle to the list.
|
||||
// const LLSD& cur_region_dc = LLEnvManagerNew::instance().getRegionSettings().getWLDayCycle();
|
||||
// if (cur_region_dc.size() != 0)
|
||||
// {
|
||||
// LLViewerRegion* region = gAgent.getRegion();
|
||||
// llassert(region != NULL);
|
||||
//
|
||||
// LLWLParamKey key(region->getName(), LLEnvKey::SCOPE_REGION);
|
||||
// mDayCyclePresetCombo->add(region->getName(), key.toStringVal());
|
||||
// mDayCyclePresetCombo->addSeparator();
|
||||
// }
|
||||
//
|
||||
// // Add local user day cycles.
|
||||
// LLDayCycleManager::preset_name_list_t user_days, sys_days;
|
||||
// LLDayCycleManager::instance().getPresetNames(user_days, sys_days);
|
||||
// for (LLDayCycleManager::preset_name_list_t::const_iterator it = user_days.begin(); it != user_days.end(); ++it)
|
||||
// {
|
||||
// mDayCyclePresetCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toStringVal());
|
||||
// }
|
||||
//
|
||||
// if (user_days.size() > 0)
|
||||
// {
|
||||
// mDayCyclePresetCombo->addSeparator();
|
||||
// }
|
||||
//
|
||||
// // Add local system day cycles.
|
||||
// for (LLDayCycleManager::preset_name_list_t::const_iterator it = sys_days.begin(); it != sys_days.end(); ++it)
|
||||
// {
|
||||
// mDayCyclePresetCombo->add(*it, LLWLParamKey(*it, LLEnvKey::SCOPE_LOCAL).toStringVal());
|
||||
// }
|
||||
//
|
||||
// // Current day cycle is already selected.
|
||||
// #endif
|
||||
// }
|
||||
|
||||
void LLPanelEnvironmentInfo::onSwitchDefaultSelection()
|
||||
{
|
||||
bool use_defaults = mRegionSettingsRadioGroup->getSelectedIndex() == 0;
|
||||
|
||||
getChild<LLView>("edit_btn")->setEnabled(!use_defaults);
|
||||
|
||||
mDayLengthSlider->setEnabled(!use_defaults);
|
||||
mDayOffsetSlider->setEnabled(!use_defaults);
|
||||
|
||||
setDirty(true);
|
||||
setDirtyFlag(DIRTY_FLAG_DAYCYCLE);
|
||||
// bool use_defaults = mRegionSettingsRadioGroup->getSelectedIndex() == 0;
|
||||
//
|
||||
// getChild<LLView>("edit_btn")->setEnabled(!use_defaults);
|
||||
//
|
||||
// mDayLengthSlider->setEnabled(!use_defaults);
|
||||
// mDayOffsetSlider->setEnabled(!use_defaults);
|
||||
//
|
||||
// setDirty(true);
|
||||
}
|
||||
|
||||
|
||||
void LLPanelEnvironmentInfo::onSldDayLengthChanged(F32 value)
|
||||
{
|
||||
F32Hours daylength(value);
|
||||
|
||||
mCurrentEnvironment->mDayLength = daylength;
|
||||
setDirtyFlag(DIRTY_FLAG_DAYLENGTH);
|
||||
}
|
||||
|
||||
|
||||
void LLPanelEnvironmentInfo::onSldDayOffsetChanged(F32 value)
|
||||
{
|
||||
F32Hours dayoffset(value);
|
||||
|
||||
if (dayoffset.value() < 0.0f)
|
||||
dayoffset += F32Hours(24.0);
|
||||
|
||||
mCurrentEnvironment->mDayLength = dayoffset;
|
||||
setDirtyFlag(DIRTY_FLAG_DAYOFFSET);
|
||||
}
|
||||
|
||||
void LLPanelEnvironmentInfo::onBtnApply()
|
||||
{
|
||||
doApply();
|
||||
// doApply();
|
||||
}
|
||||
|
||||
void LLPanelEnvironmentInfo::onBtnCancel()
|
||||
void LLPanelEnvironmentInfo::onBtnReset()
|
||||
{
|
||||
// Reload last saved region settings.
|
||||
refresh();
|
||||
mCurrentEnvironment.reset();
|
||||
refreshFromSource();
|
||||
}
|
||||
|
||||
void LLPanelEnvironmentInfo::onBtnEdit()
|
||||
{
|
||||
LLFloaterEditExtDayCycle *dayeditor = (LLFloaterEditExtDayCycle *)LLFloaterReg::getInstance("env_edit_extdaycycle");
|
||||
LLFloaterEditExtDayCycle *dayeditor = getEditFloater();
|
||||
|
||||
if (dayeditor)
|
||||
{ //*TODO Determine if region or parcel.
|
||||
LLSD params(LLSDMap(LLFloaterEditExtDayCycle::KEY_LIVE_ENVIRONMENT, "parcel")
|
||||
(LLFloaterEditExtDayCycle::KEY_DAY_LENGTH, mDayLengthSlider->getValueF32() * (60.0 * 60.0)));
|
||||
dayeditor->openFloater(dayeditor->getKey());
|
||||
}
|
||||
|
||||
LLFloaterReg::showInstance("env_edit_extdaycycle", params, TAKE_FOCUS_YES);
|
||||
|
||||
// dayeditor->openFloater(mEditingDayCycle, F32Hours(mDayLengthSlider->getValue().asReal()), F32Hours(mDayOffsetSlider->getValue().asReal()));
|
||||
void LLPanelEnvironmentInfo::onBtnSelect()
|
||||
{
|
||||
LLFloaterSettingsPicker *picker = getSettingsPicker();
|
||||
if (picker)
|
||||
{
|
||||
picker->setSettingsFilter(LLSettingsType::ST_NONE);
|
||||
picker->setSettingsAssetId((mCurrentEnvironment->mDayCycle) ? mCurrentEnvironment->mDayCycle->getAssetId() : LLUUID::null);
|
||||
picker->openFloater();
|
||||
picker->setFocus(TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelEnvironmentInfo::onPickerCommited(LLUUID asset_id)
|
||||
{
|
||||
LLSettingsVOBase::getSettingsAsset(asset_id, [this](LLUUID, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) {
|
||||
if (status)
|
||||
return;
|
||||
onPickerAssetDownloaded(settings);
|
||||
});
|
||||
}
|
||||
|
||||
void LLPanelEnvironmentInfo::onEditiCommited(LLSettingsDay::ptr_t newday)
|
||||
{
|
||||
doEditCommited(newday);
|
||||
}
|
||||
|
||||
void LLPanelEnvironmentInfo::doEditCommited(LLSettingsDay::ptr_t &newday)
|
||||
void LLPanelEnvironmentInfo::onPickerAssetDownloaded(LLSettingsBase::ptr_t settings)
|
||||
{
|
||||
mEditingDayCycle = newday;
|
||||
/*TODO pure virtual*/
|
||||
LLSettingsVODay::buildFromOtherSetting(settings, [this](LLSettingsDay::ptr_t pday)
|
||||
{
|
||||
if (pday)
|
||||
{
|
||||
mCurrentEnvironment->mDayCycle = pday;
|
||||
setDirtyFlag(DIRTY_FLAG_DAYCYCLE);
|
||||
}
|
||||
refresh();
|
||||
});
|
||||
}
|
||||
|
||||
// void LLPanelEnvironmentInfo::onRegionSettingschange()
|
||||
// {
|
||||
// LL_DEBUGS("Windlight") << "Region settings changed, refreshing" << LL_ENDL;
|
||||
// refresh();
|
||||
//
|
||||
// // Stop applying progress indicator (it may be running if it's us who initiated settings update).
|
||||
// setApplyProgress(false);
|
||||
// }
|
||||
//
|
||||
// void LLPanelEnvironmentInfo::onRegionSettingsApplied(bool ok)
|
||||
// {
|
||||
// // If applying new settings has failed, stop the indicator right away.
|
||||
// // Otherwise it will be stopped when we receive the updated settings from server.
|
||||
// if (ok)
|
||||
// {
|
||||
// // Set the region sun phase/flags according to the chosen new preferences.
|
||||
// //
|
||||
// // If we do this earlier we may get jerky transition from fixed sky to a day cycle (STORM-1481).
|
||||
// // That is caused by the simulator re-sending the region info, which in turn makes us
|
||||
// // re-request and display old region environment settings while the new ones haven't been applied yet.
|
||||
// sendRegionSunUpdate();
|
||||
//
|
||||
// // Switch estate to not using fixed sun for the region day cycle to work properly (STORM-1506).
|
||||
// fixEstateSun();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// setApplyProgress(false);
|
||||
//
|
||||
// // We need to re-request environment setting here,
|
||||
// // otherwise our subsequent attempts to change region settings will fail with the following error:
|
||||
// // "Unable to update environment settings because the last update your viewer saw was not the same
|
||||
// // as the last update sent from the simulator. Try sending your update again, and if this
|
||||
// // does not work, try leaving and returning to the region."
|
||||
// // LLEnvManagerNew::instance().requestRegionSettings();
|
||||
// }
|
||||
// }
|
||||
|
||||
void LLPanelEnvironmentInfo::handleEnvironmentReceived(S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo)
|
||||
{
|
||||
if (parcel_id != mCurrentParcelId)
|
||||
{
|
||||
LL_WARNS("ENVPANEL") << "Have environment for parcel " << parcel_id << " expecting " << mCurrentParcelId << ". Discarding." << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
mCurrentEnvironment = envifo;
|
||||
setDirtyFlag(DIRTY_FLAG_DAYCYCLE);
|
||||
refresh();
|
||||
}
|
||||
|
||||
void LLPanelEnvironmentInfo::doEditCommited(LLSettingsDay::ptr_t &newday)
|
||||
{
|
||||
// mEditingDayCycle = newday;
|
||||
/*TODO pure virtual*/
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,52 +32,96 @@
|
|||
#include "llcheckboxctrl.h"
|
||||
#include "llsliderctrl.h"
|
||||
#include "llsettingsdaycycle.h"
|
||||
#include "llenvironment.h"
|
||||
#include "llparcel.h"
|
||||
#include "llsettingspicker.h"
|
||||
#include "llfloatereditextdaycycle.h"
|
||||
|
||||
class LLViewerRegion;
|
||||
|
||||
class LLPanelEnvironmentInfo : public LLPanel
|
||||
{
|
||||
public:
|
||||
LLPanelEnvironmentInfo();
|
||||
LLPanelEnvironmentInfo();
|
||||
|
||||
// LLPanel
|
||||
/*virtual*/ BOOL postBuild();
|
||||
/*virtual*/ void onOpen(const LLSD& key);
|
||||
virtual BOOL postBuild() override;
|
||||
virtual void onOpen(const LLSD& key) override;
|
||||
|
||||
// LLView
|
||||
/*virtual*/ void onVisibilityChange(BOOL new_visibility);
|
||||
virtual void onVisibilityChange(BOOL new_visibility) override;
|
||||
|
||||
virtual void refresh() override;
|
||||
|
||||
virtual void refresh();
|
||||
S32 getCurrentParcelId() const { return mCurrentParcelId; }
|
||||
void setCurrentParcelId(S32 parcel_id) { mCurrentParcelId = parcel_id; }
|
||||
|
||||
virtual bool isRegion() const = 0;
|
||||
virtual LLParcel * getParcel() = 0;
|
||||
virtual bool canEdit() = 0;
|
||||
|
||||
protected:
|
||||
LOG_CLASS(LLPanelEnvironmentInfo);
|
||||
|
||||
void setControlsEnabled(bool enabled);
|
||||
void setApplyProgress(bool started);
|
||||
void setDirty(bool dirty);
|
||||
static const std::string RDG_ENVIRONMENT_SELECT;
|
||||
static const std::string RDO_USEDEFAULT;
|
||||
static const std::string RDO_USEINV;
|
||||
static const std::string RDO_USECUSTOM;
|
||||
static const std::string EDT_INVNAME;
|
||||
static const std::string BTN_SELECTINV;
|
||||
static const std::string BTN_EDIT;
|
||||
static const std::string SLD_DAYLENGTH;
|
||||
static const std::string SLD_DAYOFFSET;
|
||||
static const std::string CHK_ALLOWOVERRIDE;
|
||||
static const std::string BTN_APPLY;
|
||||
static const std::string BTN_CANCEL;
|
||||
|
||||
void onSwitchDefaultSelection();
|
||||
static const std::string STR_LABEL_USEDEFAULT;
|
||||
static const std::string STR_LABEL_USEREGION;
|
||||
static const std::string STR_LABEL_UNKNOWNINV;
|
||||
|
||||
void onBtnApply();
|
||||
void onBtnCancel();
|
||||
void onBtnEdit();
|
||||
static const S32 DIRTY_FLAG_DAYCYCLE;
|
||||
static const S32 DIRTY_FLAG_DAYLENGTH;
|
||||
static const S32 DIRTY_FLAG_DAYOFFSET;
|
||||
|
||||
void onEditiCommited(LLSettingsDay::ptr_t newday);
|
||||
static const S32 DIRTY_FLAG_MASK;
|
||||
|
||||
virtual void doApply() = 0;
|
||||
virtual void doEditCommited(LLSettingsDay::ptr_t &newday);
|
||||
void setControlsEnabled(bool enabled);
|
||||
void setApplyProgress(bool started);
|
||||
void setDirtyFlag(S32 flag);
|
||||
bool getIsDirty() const { return (mDirtyFlag != 0); }
|
||||
bool getIsDirtyFlag(S32 flag) const { return ((mDirtyFlag & flag) != 0); }
|
||||
|
||||
/// New environment settings that are being applied to the region.
|
||||
// LLEnvironmentSettings mNewRegionSettings;
|
||||
void onSwitchDefaultSelection();
|
||||
void onSldDayLengthChanged(F32 value);
|
||||
void onSldDayOffsetChanged(F32 value);
|
||||
void onBtnApply();
|
||||
void onBtnReset();
|
||||
void onBtnEdit();
|
||||
void onBtnSelect();
|
||||
|
||||
bool mEnableEditing;
|
||||
void onPickerCommited(LLUUID asset_id);
|
||||
void onEditiCommited(LLSettingsDay::ptr_t newday);
|
||||
void onPickerAssetDownloaded(LLSettingsBase::ptr_t settings);
|
||||
|
||||
LLRadioGroup* mRegionSettingsRadioGroup;
|
||||
LLSliderCtrl* mDayLengthSlider;
|
||||
LLSliderCtrl* mDayOffsetSlider;
|
||||
LLCheckBoxCtrl* mAllowOverRide;
|
||||
void handleEnvironmentReceived(S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envifo);
|
||||
|
||||
LLSettingsDay::ptr_t mEditingDayCycle;
|
||||
virtual void doEditCommited(LLSettingsDay::ptr_t &newday);
|
||||
|
||||
void refreshFromSource();
|
||||
|
||||
std::string getInventoryNameForAssetId(LLUUID asset_id);
|
||||
|
||||
LLFloaterSettingsPicker * getSettingsPicker();
|
||||
LLFloaterEditExtDayCycle * getEditFloater();
|
||||
|
||||
LLEnvironment::EnvironmentInfo::ptr_t mCurrentEnvironment;
|
||||
S32 mCurrentParcelId;
|
||||
|
||||
|
||||
private:
|
||||
LLHandle<LLFloater> mSettingsFloater;
|
||||
LLHandle<LLFloater> mEditFloater;
|
||||
S32 mDirtyFlag;
|
||||
};
|
||||
#endif // LL_LLPANELEXPERIENCES_H
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -32,6 +32,7 @@
|
|||
#include "llfloater.h"
|
||||
#include "llpermissionsflags.h"
|
||||
#include "llfolderview.h"
|
||||
#include "llinventory.h"
|
||||
|
||||
#include <boost/signals2.hpp>
|
||||
|
||||
|
|
@ -52,14 +53,13 @@ public:
|
|||
virtual ~LLFloaterSettingsPicker() override;
|
||||
|
||||
void setActive(bool active);
|
||||
void setSettingsID(const LLUUID &settings_id, bool set_selection = true);
|
||||
|
||||
virtual BOOL postBuild() override;
|
||||
virtual void onClose(bool app_quitting) override;
|
||||
virtual void draw() override;
|
||||
|
||||
void setSettingsAssetID(LLUUID setting_asset_id);
|
||||
LLUUID getSettingsAssetID() const { return mSettingAssetID; }
|
||||
void setSettingsAssetId(const LLUUID &settings_id, bool set_selection = true);
|
||||
LLUUID getSettingsAssetId() const { return mSettingAssetID; }
|
||||
|
||||
void setDefaultSettingsAssetID(LLUUID id) { mDefaultSettingsAssetID = id; }
|
||||
LLUUID getDefaultSettingsAssetID() const { return mDefaultSettingsAssetID; }
|
||||
|
|
@ -71,6 +71,24 @@ public:
|
|||
virtual void setValue(const LLSD& value) override;
|
||||
virtual LLSD getValue() const override;
|
||||
|
||||
LLUUID findItemID(const LLUUID& asset_id, bool copyable_only, bool ignore_library = false)
|
||||
{
|
||||
LLInventoryItem *pitem = findItem(asset_id, copyable_only, ignore_library);
|
||||
if (pitem)
|
||||
return pitem->getUUID();
|
||||
return LLUUID::null;
|
||||
}
|
||||
|
||||
std::string findItemName(const LLUUID& asset_id, bool copyable_only, bool ignore_library = false)
|
||||
{
|
||||
LLInventoryItem *pitem = findItem(asset_id, copyable_only, ignore_library);
|
||||
if (pitem)
|
||||
return pitem->getName();
|
||||
return std::string();
|
||||
}
|
||||
|
||||
LLInventoryItem * findItem(const LLUUID& asset_id, bool copyable_only, bool ignore_library);
|
||||
|
||||
private:
|
||||
typedef std::deque<LLFolderViewItem *> itemlist_t;
|
||||
|
||||
|
|
@ -79,7 +97,6 @@ private:
|
|||
void onButtonCancel();
|
||||
void onButtonSelect();
|
||||
|
||||
LLUUID findItemID(const LLUUID& asset_id, bool copyable_only, bool ignore_library = false);
|
||||
|
||||
LLView* mOwner;
|
||||
std::string mLabel;
|
||||
|
|
@ -105,347 +122,4 @@ private:
|
|||
boost::signals2::signal<void(const LLUUID& asset_id)> mChangeIDSignal;
|
||||
};
|
||||
|
||||
#if 0
|
||||
#include "llcoord.h"
|
||||
#include "llfiltereditor.h"
|
||||
#include "llfolderview.h"
|
||||
#include "lllocalbitmaps.h"
|
||||
#include "llstring.h"
|
||||
#include "lluictrl.h"
|
||||
#include "llradiogroup.h"
|
||||
#include "lltextbox.h" // for params
|
||||
#include "llviewerinventory.h"
|
||||
#include "llviewborder.h" // for params
|
||||
#include "llviewerobject.h"
|
||||
#include "llviewertexture.h"
|
||||
#include "llwindow.h"
|
||||
|
||||
class LLButton;
|
||||
class LLFloaterTexturePicker;
|
||||
class LLInventoryItem;
|
||||
class LLViewerFetchedTexture;
|
||||
|
||||
// used for setting drag & drop callbacks.
|
||||
typedef boost::function<BOOL (LLUICtrl*, LLInventoryItem*)> drag_n_drop_callback;
|
||||
typedef boost::function<void (LLInventoryItem*)> texture_selected_callback;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// LLTextureCtrl
|
||||
|
||||
|
||||
class LLTextureCtrl
|
||||
: public LLUICtrl
|
||||
{
|
||||
public:
|
||||
typedef enum e_texture_pick_op
|
||||
{
|
||||
TEXTURE_CHANGE,
|
||||
TEXTURE_SELECT,
|
||||
TEXTURE_CANCEL
|
||||
} ETexturePickOp;
|
||||
|
||||
public:
|
||||
struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
|
||||
{
|
||||
Optional<LLUUID> image_id;
|
||||
Optional<LLUUID> default_image_id;
|
||||
Optional<std::string> default_image_name;
|
||||
Optional<bool> allow_no_texture;
|
||||
Optional<bool> can_apply_immediately;
|
||||
Optional<bool> no_commit_on_selection; // alternative mode: commit occurs and the widget gets dirty
|
||||
// only on DnD or when OK is pressed in the picker
|
||||
Optional<S32> label_width;
|
||||
Optional<LLUIColor> border_color;
|
||||
Optional<LLUIImage*> fallback_image;
|
||||
|
||||
Optional<LLTextBox::Params> multiselect_text,
|
||||
caption_text;
|
||||
|
||||
Optional<LLViewBorder::Params> border;
|
||||
|
||||
Params()
|
||||
: image_id("image"),
|
||||
default_image_id("default_image_id"),
|
||||
default_image_name("default_image_name"),
|
||||
allow_no_texture("allow_no_texture"),
|
||||
can_apply_immediately("can_apply_immediately"),
|
||||
no_commit_on_selection("no_commit_on_selection", false),
|
||||
label_width("label_width", -1),
|
||||
border_color("border_color"),
|
||||
fallback_image("fallback_image"),
|
||||
multiselect_text("multiselect_text"),
|
||||
caption_text("caption_text"),
|
||||
border("border")
|
||||
{}
|
||||
};
|
||||
protected:
|
||||
LLTextureCtrl(const Params&);
|
||||
friend class LLUICtrlFactory;
|
||||
public:
|
||||
virtual ~LLTextureCtrl();
|
||||
|
||||
// LLView interface
|
||||
|
||||
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
|
||||
virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask,
|
||||
BOOL drop, EDragAndDropType cargo_type, void *cargo_data,
|
||||
EAcceptance *accept,
|
||||
std::string& tooltip_msg);
|
||||
virtual BOOL handleHover(S32 x, S32 y, MASK mask);
|
||||
virtual BOOL handleUnicodeCharHere(llwchar uni_char);
|
||||
|
||||
virtual void draw();
|
||||
virtual void setVisible( BOOL visible );
|
||||
virtual void setEnabled( BOOL enabled );
|
||||
|
||||
void setValid(BOOL valid);
|
||||
|
||||
// LLUICtrl interface
|
||||
virtual void clear();
|
||||
|
||||
// Takes a UUID, wraps get/setImageAssetID
|
||||
virtual void setValue(const LLSD& value);
|
||||
virtual LLSD getValue() const;
|
||||
|
||||
// LLTextureCtrl interface
|
||||
void showPicker(BOOL take_focus);
|
||||
bool isPickerShown() { return !mFloaterHandle.isDead(); }
|
||||
void setLabel(const std::string& label);
|
||||
void setLabelWidth(S32 label_width) {mLabelWidth =label_width;}
|
||||
const std::string& getLabel() const { return mLabel; }
|
||||
|
||||
void setAllowNoTexture( BOOL b ) { mAllowNoTexture = b; }
|
||||
bool getAllowNoTexture() const { return mAllowNoTexture; }
|
||||
|
||||
const LLUUID& getImageItemID() { return mImageItemID; }
|
||||
|
||||
virtual void setImageAssetName(const std::string& name);
|
||||
|
||||
void setImageAssetID(const LLUUID &image_asset_id);
|
||||
const LLUUID& getImageAssetID() const { return mImageAssetID; }
|
||||
|
||||
void setDefaultImageAssetID( const LLUUID& id ) { mDefaultImageAssetID = id; }
|
||||
const LLUUID& getDefaultImageAssetID() const { return mDefaultImageAssetID; }
|
||||
|
||||
const std::string& getDefaultImageName() const { return mDefaultImageName; }
|
||||
|
||||
void setBlankImageAssetID( const LLUUID& id ) { mBlankImageAssetID = id; }
|
||||
const LLUUID& getBlankImageAssetID() const { return mBlankImageAssetID; }
|
||||
|
||||
void setCaption(const std::string& caption);
|
||||
void setCanApplyImmediately(BOOL b);
|
||||
|
||||
void setCanApply(bool can_preview, bool can_apply);
|
||||
|
||||
void setImmediateFilterPermMask(PermissionMask mask)
|
||||
{ mImmediateFilterPermMask = mask; }
|
||||
void setDnDFilterPermMask(PermissionMask mask)
|
||||
{ mDnDFilterPermMask = mask; }
|
||||
void setNonImmediateFilterPermMask(PermissionMask mask)
|
||||
{ mNonImmediateFilterPermMask = mask; }
|
||||
PermissionMask getImmediateFilterPermMask() { return mImmediateFilterPermMask; }
|
||||
PermissionMask getNonImmediateFilterPermMask() { return mNonImmediateFilterPermMask; }
|
||||
|
||||
void closeDependentFloater();
|
||||
|
||||
void onFloaterClose();
|
||||
void onFloaterCommit(ETexturePickOp op, LLUUID id);
|
||||
|
||||
// This call is returned when a drag is detected. Your callback
|
||||
// should return TRUE if the drag is acceptable.
|
||||
void setDragCallback(drag_n_drop_callback cb) { mDragCallback = cb; }
|
||||
|
||||
// This callback is called when the drop happens. Return TRUE if
|
||||
// the drop happened - resulting in an on commit callback, but not
|
||||
// necessariliy any other change.
|
||||
void setDropCallback(drag_n_drop_callback cb) { mDropCallback = cb; }
|
||||
|
||||
void setOnCancelCallback(commit_callback_t cb) { mOnCancelCallback = cb; }
|
||||
void setOnCloseCallback(commit_callback_t cb) { mOnCloseCallback = cb; }
|
||||
void setOnSelectCallback(commit_callback_t cb) { mOnSelectCallback = cb; }
|
||||
|
||||
/*
|
||||
* callback for changing texture selection in inventory list of texture floater
|
||||
*/
|
||||
void setOnTextureSelectedCallback(texture_selected_callback cb);
|
||||
|
||||
void setShowLoadingPlaceholder(BOOL showLoadingPlaceholder);
|
||||
|
||||
LLViewerFetchedTexture* getTexture() { return mTexturep; }
|
||||
|
||||
private:
|
||||
BOOL allowDrop(LLInventoryItem* item);
|
||||
BOOL doDrop(LLInventoryItem* item);
|
||||
|
||||
private:
|
||||
drag_n_drop_callback mDragCallback;
|
||||
drag_n_drop_callback mDropCallback;
|
||||
commit_callback_t mOnCancelCallback;
|
||||
commit_callback_t mOnSelectCallback;
|
||||
commit_callback_t mOnCloseCallback;
|
||||
texture_selected_callback mOnTextureSelectedCallback;
|
||||
LLPointer<LLViewerFetchedTexture> mTexturep;
|
||||
LLUIColor mBorderColor;
|
||||
LLUUID mImageItemID;
|
||||
LLUUID mImageAssetID;
|
||||
LLUUID mDefaultImageAssetID;
|
||||
LLUUID mBlankImageAssetID;
|
||||
LLUIImagePtr mFallbackImage;
|
||||
std::string mDefaultImageName;
|
||||
LLHandle<LLFloater> mFloaterHandle;
|
||||
LLTextBox* mTentativeLabel;
|
||||
LLTextBox* mCaption;
|
||||
std::string mLabel;
|
||||
BOOL mAllowNoTexture; // If true, the user can select "none" as an option
|
||||
PermissionMask mImmediateFilterPermMask;
|
||||
PermissionMask mDnDFilterPermMask;
|
||||
PermissionMask mNonImmediateFilterPermMask;
|
||||
BOOL mCanApplyImmediately;
|
||||
BOOL mCommitOnSelection;
|
||||
BOOL mNeedsRawImageData;
|
||||
LLViewBorder* mBorder;
|
||||
BOOL mValid;
|
||||
BOOL mShowLoadingPlaceholder;
|
||||
std::string mLoadingPlaceholderString;
|
||||
S32 mLabelWidth;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// LLFloaterTexturePicker
|
||||
typedef boost::function<void(LLTextureCtrl::ETexturePickOp op, LLUUID id)> floater_commit_callback;
|
||||
typedef boost::function<void()> floater_close_callback;
|
||||
typedef boost::function<void(const LLUUID& asset_id)> set_image_asset_id_callback;
|
||||
typedef boost::function<void(LLPointer<LLViewerTexture> texture)> set_on_update_image_stats_callback;
|
||||
|
||||
class LLFloaterTexturePicker : public LLFloater
|
||||
{
|
||||
public:
|
||||
LLFloaterTexturePicker(
|
||||
LLView* owner,
|
||||
LLUUID image_asset_id,
|
||||
LLUUID default_image_asset_id,
|
||||
LLUUID blank_image_asset_id,
|
||||
BOOL tentative,
|
||||
BOOL allow_no_texture,
|
||||
const std::string& label,
|
||||
PermissionMask immediate_filter_perm_mask,
|
||||
PermissionMask dnd_filter_perm_mask,
|
||||
PermissionMask non_immediate_filter_perm_mask,
|
||||
BOOL can_apply_immediately,
|
||||
LLUIImagePtr fallback_image_name
|
||||
);
|
||||
|
||||
virtual ~LLFloaterTexturePicker();
|
||||
|
||||
// LLView overrides
|
||||
/*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask,
|
||||
BOOL drop, EDragAndDropType cargo_type, void *cargo_data,
|
||||
EAcceptance *accept,
|
||||
std::string& tooltip_msg);
|
||||
/*virtual*/ void draw();
|
||||
/*virtual*/ BOOL handleKeyHere(KEY key, MASK mask);
|
||||
|
||||
// LLFloater overrides
|
||||
/*virtual*/ BOOL postBuild();
|
||||
/*virtual*/ void onClose(bool app_settings);
|
||||
|
||||
// New functions
|
||||
void setImageID(const LLUUID& image_asset_id, bool set_selection = true);
|
||||
void updateImageStats();
|
||||
const LLUUID& getAssetID() { return mImageAssetID; }
|
||||
const LLUUID& findItemID(const LLUUID& asset_id, BOOL copyable_only, BOOL ignore_library = FALSE);
|
||||
void setCanApplyImmediately(BOOL b);
|
||||
|
||||
void setActive(BOOL active);
|
||||
|
||||
LLView* getOwner() const { return mOwner; }
|
||||
void setOwner(LLView* owner) { mOwner = owner; }
|
||||
void stopUsingPipette();
|
||||
PermissionMask getFilterPermMask();
|
||||
|
||||
void updateFilterPermMask();
|
||||
void commitIfImmediateSet();
|
||||
void commitCancel();
|
||||
|
||||
void onFilterEdit(const std::string& search_string);
|
||||
|
||||
void setCanApply(bool can_preview, bool can_apply);
|
||||
void setTextureSelectedCallback(const texture_selected_callback& cb) { mTextureSelectedCallback = cb; }
|
||||
void setOnFloaterCloseCallback(const floater_close_callback& cb) { mOnFloaterCloseCallback = cb; }
|
||||
void setOnFloaterCommitCallback(const floater_commit_callback& cb) { mOnFloaterCommitCallback = cb; }
|
||||
void setSetImageAssetIDCallback(const set_image_asset_id_callback& cb) { mSetImageAssetIDCallback = cb; }
|
||||
void setOnUpdateImageStatsCallback(const set_on_update_image_stats_callback& cb) { mOnUpdateImageStatsCallback = cb; }
|
||||
const LLUUID& getDefaultImageAssetID() { return mDefaultImageAssetID; }
|
||||
const LLUUID& getBlankImageAssetID() { return mBlankImageAssetID; }
|
||||
|
||||
static void onBtnSetToDefault(void* userdata);
|
||||
static void onBtnSelect(void* userdata);
|
||||
static void onBtnCancel(void* userdata);
|
||||
void onBtnPipette();
|
||||
//static void onBtnRevert( void* userdata );
|
||||
static void onBtnBlank(void* userdata);
|
||||
static void onBtnNone(void* userdata);
|
||||
static void onBtnClear(void* userdata);
|
||||
void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action);
|
||||
static void onShowFolders(LLUICtrl* ctrl, void* userdata);
|
||||
static void onApplyImmediateCheck(LLUICtrl* ctrl, void* userdata);
|
||||
void onTextureSelect(const LLTextureEntry& te);
|
||||
|
||||
static void onModeSelect(LLUICtrl* ctrl, void *userdata);
|
||||
static void onBtnAdd(void* userdata);
|
||||
static void onBtnRemove(void* userdata);
|
||||
static void onBtnUpload(void* userdata);
|
||||
static void onLocalScrollCommit(LLUICtrl* ctrl, void* userdata);
|
||||
|
||||
void setLocalTextureEnabled(BOOL enabled);
|
||||
|
||||
protected:
|
||||
LLPointer<LLViewerTexture> mTexturep;
|
||||
LLView* mOwner;
|
||||
|
||||
LLUUID mImageAssetID; // Currently selected texture
|
||||
LLUIImagePtr mFallbackImage; // What to show if currently selected texture is null.
|
||||
LLUUID mDefaultImageAssetID;
|
||||
LLUUID mBlankImageAssetID;
|
||||
BOOL mTentative;
|
||||
BOOL mAllowNoTexture;
|
||||
LLUUID mSpecialCurrentImageAssetID; // Used when the asset id has no corresponding texture in the user's inventory.
|
||||
LLUUID mOriginalImageAssetID;
|
||||
|
||||
std::string mLabel;
|
||||
|
||||
LLTextBox* mTentativeLabel;
|
||||
LLTextBox* mResolutionLabel;
|
||||
|
||||
std::string mPendingName;
|
||||
BOOL mActive;
|
||||
|
||||
LLFilterEditor* mFilterEdit;
|
||||
LLInventoryPanel* mInventoryPanel;
|
||||
PermissionMask mImmediateFilterPermMask;
|
||||
PermissionMask mDnDFilterPermMask;
|
||||
PermissionMask mNonImmediateFilterPermMask;
|
||||
BOOL mCanApplyImmediately;
|
||||
BOOL mNoCopyTextureSelected;
|
||||
F32 mContextConeOpacity;
|
||||
LLSaveFolderState mSavedFolderState;
|
||||
BOOL mSelectedItemPinned;
|
||||
|
||||
LLRadioGroup* mModeSelector;
|
||||
LLScrollListCtrl* mLocalScrollCtrl;
|
||||
|
||||
private:
|
||||
bool mCanApply;
|
||||
bool mCanPreview;
|
||||
bool mPreviewSettingChanged;
|
||||
|
||||
texture_selected_callback mTextureSelectedCallback;
|
||||
floater_close_callback mOnFloaterCloseCallback;
|
||||
floater_commit_callback mOnFloaterCommitCallback;
|
||||
set_image_asset_id_callback mSetImageAssetIDCallback;
|
||||
set_on_update_image_stats_callback mOnUpdateImageStatsCallback;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif // LL_LLTEXTURECTRL_H
|
||||
|
|
|
|||
|
|
@ -273,6 +273,7 @@ void LLSettingsVOBase::onAssetDownloadComplete(LLVFS *vfs, const LLUUID &asset_i
|
|||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS("LAPRAS") << "Setting asset ID to " << asset_id << LL_ENDL;
|
||||
settings->setAssetId(asset_id);
|
||||
}
|
||||
}
|
||||
|
|
@ -1074,6 +1075,44 @@ LLSettingsDay::ptr_t LLSettingsVODay::buildFromEnvironmentMessage(LLSD settings)
|
|||
}
|
||||
|
||||
|
||||
void LLSettingsVODay::buildFromOtherSetting(LLSettingsBase::ptr_t settings, LLSettingsVODay::asset_built_fn cb)
|
||||
{
|
||||
if (settings->getSettingsType() == "daycycle")
|
||||
{
|
||||
if (cb)
|
||||
cb(std::static_pointer_cast<LLSettingsDay>(settings));
|
||||
}
|
||||
else
|
||||
{
|
||||
LLSettingsVOBase::getSettingsAsset(LLSettingsDay::GetDefaultAssetId(),
|
||||
[settings, cb](LLUUID, LLSettingsBase::ptr_t pday, S32, LLExtStat){ combineIntoDayCycle(std::static_pointer_cast<LLSettingsDay>(pday), settings, cb); });
|
||||
}
|
||||
}
|
||||
|
||||
void LLSettingsVODay::combineIntoDayCycle(LLSettingsDay::ptr_t pday, LLSettingsBase::ptr_t settings, asset_built_fn cb)
|
||||
{
|
||||
if (settings->getSettingsType() == "sky")
|
||||
{
|
||||
pday->setName("sky: " + settings->getName());
|
||||
pday->clearCycleTrack(1);
|
||||
pday->setSettingsAtKeyframe(settings, 0.0, 1);
|
||||
}
|
||||
else if (settings->getSettingsType() == "water")
|
||||
{
|
||||
pday->setName("water: " + settings->getName());
|
||||
pday->clearCycleTrack(0);
|
||||
pday->setSettingsAtKeyframe(settings, 0.0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
pday.reset();
|
||||
}
|
||||
|
||||
if (cb)
|
||||
cb(pday);
|
||||
}
|
||||
|
||||
|
||||
LLSettingsDay::ptr_t LLSettingsVODay::buildClone()
|
||||
{
|
||||
LLSD settings = cloneSettings();
|
||||
|
|
|
|||
|
|
@ -146,6 +146,8 @@ private:
|
|||
class LLSettingsVODay : public LLSettingsDay
|
||||
{
|
||||
public:
|
||||
typedef std::function<void(LLSettingsDay::ptr_t day)> asset_built_fn;
|
||||
|
||||
LLSettingsVODay(const LLSD &data);
|
||||
|
||||
static ptr_t buildDay(LLSD settings);
|
||||
|
|
@ -155,6 +157,7 @@ public:
|
|||
static ptr_t buildFromLegacyMessage(const LLUUID ®ionId, LLSD daycycle, LLSD skys, LLSD water);
|
||||
static ptr_t buildDefaultDayCycle();
|
||||
static ptr_t buildFromEnvironmentMessage(LLSD settings);
|
||||
static void buildFromOtherSetting(LLSettingsBase::ptr_t settings, asset_built_fn cb);
|
||||
virtual ptr_t buildClone() override;
|
||||
|
||||
static LLSD convertToLegacy(const ptr_t &);
|
||||
|
|
@ -166,6 +169,9 @@ public:
|
|||
|
||||
protected:
|
||||
LLSettingsVODay();
|
||||
|
||||
private:
|
||||
static void combineIntoDayCycle(LLSettingsDay::ptr_t, LLSettingsBase::ptr_t, asset_built_fn);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2106,7 +2106,7 @@ Only large parcels can be listed in search.
|
|||
top="0"
|
||||
help_topic="land_experiences_tab"
|
||||
name="land_experiences_panel"
|
||||
class="land_experiences_panel"
|
||||
class="land_experiences_panel"
|
||||
filename="panel_region_experiences.xml">
|
||||
</panel>
|
||||
<panel
|
||||
|
|
@ -2118,7 +2118,7 @@ Only large parcels can be listed in search.
|
|||
top="0"
|
||||
help_topic="land_environment_tab"
|
||||
name="land_environment_panel"
|
||||
class="land_environment_panel"
|
||||
class="land_environment_panel"
|
||||
filename="panel_region_environment.xml">
|
||||
</panel>
|
||||
</tab_container>
|
||||
|
|
|
|||
|
|
@ -1,82 +1,109 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
|
||||
<panel
|
||||
border="true"
|
||||
follows="top|left"
|
||||
height="300"
|
||||
label="Environment"
|
||||
layout="topleft"
|
||||
help_topic="panel_region_environment_tab"
|
||||
name="panel_env_info"
|
||||
width="530">
|
||||
border="true"
|
||||
follows="top|left"
|
||||
height="300"
|
||||
label="Environment"
|
||||
layout="topleft"
|
||||
help_topic="panel_region_environment_tab"
|
||||
name="panel_env_info"
|
||||
width="420">
|
||||
<string name="str_label_use_default">Use Default Settings</string>
|
||||
<string name="str_label_use_region">Use Region Settings</string>
|
||||
<string name="str_unknow_inventory">Unknown</string>
|
||||
|
||||
<layout_stack
|
||||
left_offset="0"
|
||||
top_offset="0"
|
||||
width="420"
|
||||
height="250"
|
||||
height="450"
|
||||
follows="left|right|top|bottom"
|
||||
orientation="vertical">
|
||||
<layout_panel
|
||||
auto_resize="false"
|
||||
user_resize="true"
|
||||
bg_alpha_color="red"
|
||||
min_height="130"
|
||||
background_visible="false">
|
||||
auto_resize="true"
|
||||
user_resize="false">
|
||||
<layout_stack
|
||||
left_offset="5"
|
||||
top_offset="5"
|
||||
right_offset="-5"
|
||||
left="5"
|
||||
top="5"
|
||||
right="-5"
|
||||
follows="left|right|top|bottom"
|
||||
orientation="horizontal">
|
||||
<layout_panel
|
||||
background_visible="true"
|
||||
border="true"
|
||||
bevel_style="in"
|
||||
auto_resize="false"
|
||||
auto_resize="true"
|
||||
user_resize="false"
|
||||
width="160"
|
||||
background_visible="true">
|
||||
width="260"
|
||||
min_width="260">
|
||||
<text follows="top|left"
|
||||
font="SansSerif"
|
||||
halign="left"
|
||||
text_color="white">Environment Source</text>
|
||||
text_color="white">Current Environment</text>
|
||||
<radio_group
|
||||
follows="top|left"
|
||||
height="45"
|
||||
height="90"
|
||||
layout="topleft"
|
||||
top_pad="5"
|
||||
left_delta="10"
|
||||
name="environment_select_radio_group"
|
||||
bottom_delta="50"
|
||||
max_width="200"
|
||||
width="200">
|
||||
name="rdg_environment_select">
|
||||
<radio_item
|
||||
label="Use Region Settings"
|
||||
label="[USEDEFAULT]"
|
||||
layout="topleft"
|
||||
name="use_region_setting"
|
||||
name="rdo_use_xxx_setting"
|
||||
height="20"/>
|
||||
<radio_item
|
||||
label="Settings From Inventory"
|
||||
layout="topleft"
|
||||
valign="top"
|
||||
name="rdo_use_inv_setting"
|
||||
height="20"/>
|
||||
<radio_item
|
||||
top_pad="25"
|
||||
label="Custom Environment"
|
||||
layout="topleft"
|
||||
height="20"
|
||||
name="use_custom_setting"/>
|
||||
name="rdo_use_custom_setting"/>
|
||||
</radio_group>
|
||||
<line_editor
|
||||
follows="top|left"
|
||||
enabled="false"
|
||||
left_delta="20"
|
||||
top_delta="50"
|
||||
height="20"
|
||||
layout="topleft"
|
||||
name="edt_inventory_name"
|
||||
width="200">
|
||||
Unknown
|
||||
</line_editor>
|
||||
<button
|
||||
follows="top|right"
|
||||
name="btn_select_inventory"
|
||||
follows="top|left"
|
||||
image_overlay="Command_Inventory_Icon"
|
||||
auto_resize="false"
|
||||
layout="topleft"
|
||||
height="20"
|
||||
width="20"
|
||||
left_delta="205"
|
||||
top_delta="0"/>
|
||||
<button
|
||||
follows="top|left"
|
||||
top_pad="25"
|
||||
left_delta="-205"
|
||||
layout="topleft"
|
||||
height="23"
|
||||
label="Edit Custom"
|
||||
right_offset="30"
|
||||
bottom_offset="30"
|
||||
width="100"
|
||||
name="edit_btn"/>
|
||||
label="Edit Environment"
|
||||
width="120"
|
||||
name="btn_edit"/>
|
||||
|
||||
</layout_panel>
|
||||
<layout_panel
|
||||
border="true"
|
||||
bevel_style="in"
|
||||
auto_resize="false"
|
||||
user_resize="true"
|
||||
height="11"
|
||||
width="220"
|
||||
auto_resize="true"
|
||||
user_resize="false"
|
||||
background_visible="true">
|
||||
<text follows="top|left|right"
|
||||
<text
|
||||
font="SansSerif"
|
||||
follows="top|left|right"
|
||||
halign="left"
|
||||
text_color="white">Day Settings</text>
|
||||
<text
|
||||
|
|
@ -101,10 +128,10 @@
|
|||
layout="topleft"
|
||||
left_delta="0"
|
||||
top_pad="6"
|
||||
name="day_length_sld"
|
||||
name="sld_day_length"
|
||||
min_val="4"
|
||||
max_val="178"
|
||||
width="200" />
|
||||
width="180" />
|
||||
<text
|
||||
type="string"
|
||||
length="1"
|
||||
|
|
@ -127,53 +154,44 @@
|
|||
layout="topleft"
|
||||
left_delta="0"
|
||||
top_pad="6"
|
||||
name="day_offset_sld"
|
||||
name="sld_day_offset"
|
||||
min_val="-12"
|
||||
max_val="12"
|
||||
width="200" />
|
||||
width="180" />
|
||||
|
||||
</layout_panel>
|
||||
<layout_panel name="flex"
|
||||
auto_resize="true"
|
||||
user_resize="true"
|
||||
visible="false"
|
||||
bg_alpha_color="blue"
|
||||
height="100"
|
||||
background_visible="true">
|
||||
</layout_panel>
|
||||
</layout_stack>
|
||||
</layout_panel>
|
||||
<layout_panel
|
||||
auto_resize="true"
|
||||
user_resize="true"
|
||||
user_resize="false"
|
||||
height="21"
|
||||
min_height="0"
|
||||
background_visible="false">
|
||||
<check_box
|
||||
height="16"
|
||||
label="Parcel Owners May Override"
|
||||
layout="topleft"
|
||||
left_offset="10"
|
||||
top_offset="10"
|
||||
name="allow_override_chk"
|
||||
width="200" />
|
||||
<button
|
||||
follows="top|left"
|
||||
height="23"
|
||||
label="Apply"
|
||||
left_offset="160"
|
||||
top_offset="60"
|
||||
name="apply_btn"
|
||||
width="100" />
|
||||
<button
|
||||
follows="top|left"
|
||||
height="23"
|
||||
label="Cancel"
|
||||
layout="topleft"
|
||||
left_pad="10"
|
||||
name="cancel_btn"
|
||||
width="100" />
|
||||
|
||||
min_height="0">
|
||||
<check_box
|
||||
height="20"
|
||||
label="Parcel Owners May Override Environment"
|
||||
layout="topleft"
|
||||
left="10"
|
||||
top="10"
|
||||
name="chk_allow_override"
|
||||
width="200" />
|
||||
<button
|
||||
follows="top|left"
|
||||
height="23"
|
||||
label="Apply"
|
||||
top_pad="10"
|
||||
name="btn_apply"
|
||||
width="100" />
|
||||
<button
|
||||
follows="top|left"
|
||||
height="23"
|
||||
label="Reset"
|
||||
layout="topleft"
|
||||
left_pad="10"
|
||||
top_delta="0"
|
||||
name="btn_cancel"
|
||||
width="100" />
|
||||
|
||||
</layout_panel>
|
||||
</layout_stack>
|
||||
</panel>
|
||||
|
|
|
|||
Loading…
Reference in New Issue