MAINT-8052: Parcel environments. Set, clear and get.
parent
536aeb54a6
commit
2d41de9007
|
|
@ -82,6 +82,7 @@
|
|||
#include "llexperiencecache.h"
|
||||
|
||||
#include "llgroupactions.h"
|
||||
#include "llenvironment.h"
|
||||
|
||||
const F64 COVENANT_REFRESH_TIME_SEC = 60.0f;
|
||||
|
||||
|
|
@ -144,17 +145,21 @@ class LLPanelLandEnvironment
|
|||
: public LLPanelEnvironmentInfo
|
||||
{
|
||||
public:
|
||||
LLPanelLandEnvironment(LLSafeHandle<LLParcelSelection>& parcelp);
|
||||
LLPanelLandEnvironment(LLSafeHandle<LLParcelSelection>& parcelp);
|
||||
|
||||
virtual BOOL postBuild();
|
||||
void refresh();
|
||||
virtual BOOL postBuild();
|
||||
virtual void refresh();
|
||||
|
||||
protected:
|
||||
|
||||
virtual void doApply();
|
||||
|
||||
|
||||
LLSafeHandle<LLParcelSelection>& mParcel;
|
||||
|
||||
};
|
||||
|
||||
|
||||
// inserts maturity info(icon and text) into target textbox
|
||||
// names_floater - pointer to floater which contains strings with maturity icons filenames
|
||||
// str_to_parse is string in format "txt1[MATURITY]txt2" where maturity icon and text will be inserted instead of [MATURITY]
|
||||
|
|
@ -3258,6 +3263,8 @@ BOOL LLPanelLandEnvironment::postBuild()
|
|||
|
||||
void LLPanelLandEnvironment::refresh()
|
||||
{
|
||||
/*TODO: if legacy don't do any of this.*/
|
||||
|
||||
LLParcel* parcel = mParcel->getParcel();
|
||||
if (!parcel)
|
||||
{
|
||||
|
|
@ -3299,3 +3306,35 @@ void LLPanelLandEnvironment::refresh()
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
void LLPanelLandEnvironment::doApply()
|
||||
{
|
||||
LLParcel* parcel = mParcel->getParcel();
|
||||
if (!parcel)
|
||||
{
|
||||
LL_WARNS("PARCEL") << "Could not get parcel." << LL_ENDL;
|
||||
}
|
||||
S32 parcel_id = parcel->getLocalID();
|
||||
|
||||
if (mRegionSettingsRadioGroup->getSelectedIndex() == 0)
|
||||
{
|
||||
LLEnvironment::instance().resetParcel(parcel_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
S64Seconds 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;
|
||||
}
|
||||
|
||||
S64Seconds dayoffset_s = dayoffset_h;
|
||||
|
||||
LLEnvironment::instance().updateParcel(parcel_id, mEditingDayCycle, daylength.value(), dayoffset_s.value());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
#include "llfloaterreg.h"
|
||||
#include "llfloatereditextdaycycle.h"
|
||||
|
||||
static LLPanelInjector<LLPanelEnvironmentInfo> register_environment_panel("environment_panel");
|
||||
//static LLPanelInjector<LLPanelEnvironmentInfo> register_environment_panel("environment_panel");
|
||||
|
||||
LLPanelEnvironmentInfo::LLPanelEnvironmentInfo():
|
||||
mEnableEditing(false),
|
||||
|
|
@ -348,10 +348,6 @@ void LLPanelEnvironmentInfo::onBtnApply()
|
|||
doApply();
|
||||
}
|
||||
|
||||
void LLPanelEnvironmentInfo::doApply()
|
||||
{
|
||||
}
|
||||
|
||||
void LLPanelEnvironmentInfo::onBtnCancel()
|
||||
{
|
||||
// Reload last saved region settings.
|
||||
|
|
|
|||
|
|
@ -37,8 +37,6 @@ class LLViewerRegion;
|
|||
|
||||
class LLPanelEnvironmentInfo : public LLPanel
|
||||
{
|
||||
LOG_CLASS(LLPanelEnvironmentInfo);
|
||||
|
||||
public:
|
||||
LLPanelEnvironmentInfo();
|
||||
|
||||
|
|
@ -53,6 +51,8 @@ public:
|
|||
virtual void refresh();
|
||||
|
||||
protected:
|
||||
LOG_CLASS(LLPanelEnvironmentInfo);
|
||||
|
||||
void setControlsEnabled(bool enabled);
|
||||
void setApplyProgress(bool started);
|
||||
void setDirty(bool dirty);
|
||||
|
|
@ -65,7 +65,7 @@ protected:
|
|||
|
||||
void onEditiCommited(LLSettingsDay::ptr_t newday);
|
||||
|
||||
virtual void doApply(); // = 0;
|
||||
virtual void doApply() = 0;
|
||||
virtual void doEditCommited(LLSettingsDay::ptr_t &newday);
|
||||
|
||||
/// New environment settings that are being applied to the region.
|
||||
|
|
|
|||
|
|
@ -520,7 +520,7 @@ LLSettingsDay::ptr_t LLSettingsVODay::buildFromLegacyMessage(const LLUUID ®io
|
|||
if (!results["success"].asBoolean())
|
||||
{
|
||||
LL_WARNS("SETTINGS") << "Day setting validation failed!:" << results << LL_ENDL;
|
||||
LLSettingsDay::ptr_t();
|
||||
return LLSettingsDay::ptr_t();
|
||||
}
|
||||
|
||||
LLSettingsDay::ptr_t dayp = boost::make_shared<LLSettingsVODay>(newsettings);
|
||||
|
|
|
|||
|
|
@ -104,6 +104,8 @@ void LLEnvironmentRequest::environmentRequestCoro(std::string url)
|
|||
|
||||
LLSD result = httpAdapter->getAndSuspend(httpRequest, url);
|
||||
|
||||
LL_WARNS("WindlightCaps") << "Using legacy Windlight caps." << LL_ENDL;
|
||||
|
||||
if (requestId != LLEnvironmentRequest::sLastRequest)
|
||||
{
|
||||
LL_INFOS("WindlightCaps") << "Got superseded by another responder; ignoring..." << LL_ENDL;
|
||||
|
|
@ -120,7 +122,7 @@ void LLEnvironmentRequest::environmentRequestCoro(std::string url)
|
|||
return;
|
||||
}
|
||||
result = result["content"];
|
||||
LL_INFOS("WindlightCaps") << "Received region windlight settings" << LL_ENDL;
|
||||
LL_INFOS("WindlightCaps") << "Received region legacy windlight settings" << LL_ENDL;
|
||||
|
||||
LLUUID regionId;
|
||||
if (gAgent.getRegion())
|
||||
|
|
|
|||
Loading…
Reference in New Issue