diff options
author | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-07-01 20:05:49 +0300 |
---|---|---|
committer | Vadim ProductEngine <vsavchuk@productengine.com> | 2011-07-01 20:05:49 +0300 |
commit | 2fc65cae7b073077c29133dc4cfc438880163746 (patch) | |
tree | c86f0e59530911a2781a194dd971483355afb900 /indra/newview | |
parent | 3a552f5b8bdd425cad666d828d35199cb9b8a85d (diff) |
STORM-1464 FIXED Fixed inability to change terrain settings.
Reason:
The "setregionterrain" message missed estate/region sun info and thus was incomplete.
Fix:
Added missing fields back.
Note:
The fields' values are fake.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloaterregioninfo.cpp | 48 | ||||
-rw-r--r-- | indra/newview/llregioninfomodel.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llregioninfomodel.h | 2 |
3 files changed, 22 insertions, 34 deletions
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 0b66b05350..dfc5d1ec04 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -68,6 +68,7 @@ #include "llnamelistctrl.h" #include "llnotifications.h" #include "llnotificationsutil.h" +#include "llregioninfomodel.h" #include "llscrolllistitem.h" #include "llsliderctrl.h" #include "llslurl.h" @@ -1288,55 +1289,34 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate() // strings[7] = from estate, 'Y' fixed sun // strings[8] = from estate, float sun_hour + LLRegionInfoModel& region_info = LLRegionInfoModel::instance(); + bool region_use_estate_sun = region_info.mUseEstateSun; + bool region_use_fixed_sun = region_info.getUseFixedSun(); // *TODO: take into account region environment settings + F32 region_sun_hour = region_info.mSunHour; + + // *NOTE: this resets estate sun info. + BOOL estate_global_time = true; + BOOL estate_fixed_sun = false; + F32 estate_sun_hour = 0.f; + buffer = llformat("%f", (F32)getChild<LLUICtrl>("water_height_spin")->getValue().asReal()); strings.push_back(buffer); buffer = llformat("%f", (F32)getChild<LLUICtrl>("terrain_raise_spin")->getValue().asReal()); strings.push_back(buffer); buffer = llformat("%f", (F32)getChild<LLUICtrl>("terrain_lower_spin")->getValue().asReal()); strings.push_back(buffer); - -#ifndef TMP_DISABLE_WLES - /* - * This message is failing - * We need to fix how the following values are obtained - */ - buffer = llformat("%s", (getChild<LLUICtrl>("use_estate_sun_check")->getValue().asBoolean() ? "Y" : "N")); + buffer = llformat("%s", (region_use_estate_sun ? "Y" : "N")); strings.push_back(buffer); - buffer = llformat("%s", (getChild<LLUICtrl>("fixed_sun_check")->getValue().asBoolean() ? "Y" : "N")); + buffer = llformat("%s", (region_use_fixed_sun ? "Y" : "N")); strings.push_back(buffer); - buffer = llformat("%f", (F32)getChild<LLUICtrl>("sun_hour_slider")->getValue().asReal() ); + buffer = llformat("%f", region_sun_hour); strings.push_back(buffer); - - // Grab estate information in case the user decided to set the - // region back to estate time. - LLFloaterRegionInfo* floater = LLFloaterReg::getTypedInstance<LLFloaterRegionInfo>("region_info"); - if (!floater) return true; - - LLTabContainer* tab = floater->getChild<LLTabContainer>("region_panels"); - if (!tab) return true; - - LLPanelEstateInfo* panel = (LLPanelEstateInfo*)tab->getChild<LLPanel>("Estate"); - if (!panel) return true; - - BOOL estate_global_time = panel->getGlobalTime(); - BOOL estate_fixed_sun = panel->getFixedSun(); - F32 estate_sun_hour; - if (estate_global_time) - { - estate_sun_hour = 0.f; - } - else - { - estate_sun_hour = panel->getSunHour(); - } - buffer = llformat("%s", (estate_global_time ? "Y" : "N") ); strings.push_back(buffer); buffer = llformat("%s", (estate_fixed_sun ? "Y" : "N") ); strings.push_back(buffer); buffer = llformat("%f", estate_sun_hour); strings.push_back(buffer); -#endif // TMP_DISABLE_WLES sendEstateOwnerMessage(gMessageSystem, "setregionterrain", invoice, strings); strings.clear(); diff --git a/indra/newview/llregioninfomodel.cpp b/indra/newview/llregioninfomodel.cpp index a74fb81355..3a00bc7c32 100644 --- a/indra/newview/llregioninfomodel.cpp +++ b/indra/newview/llregioninfomodel.cpp @@ -30,6 +30,7 @@ // libs #include "message.h" +#include "llregionflags.h" // viewers @@ -69,6 +70,11 @@ boost::signals2::connection LLRegionInfoModel::setUpdateCallback(const update_si return mUpdateSignal.connect(cb); } +bool LLRegionInfoModel::getUseFixedSun() +{ + return mRegionFlags & REGION_FLAGS_SUN_FIXED; +} + void LLRegionInfoModel::update(LLMessageSystem* msg) { reset(); diff --git a/indra/newview/llregioninfomodel.h b/indra/newview/llregioninfomodel.h index 87e1b35ff8..7fb911dedd 100644 --- a/indra/newview/llregioninfomodel.h +++ b/indra/newview/llregioninfomodel.h @@ -42,6 +42,8 @@ public: typedef boost::signals2::signal<void()> update_signal_t; boost::signals2::connection setUpdateCallback(const update_signal_t::slot_type& cb); + bool getUseFixedSun(); + // *TODO: Add getters and make the data private. U8 mSimAccess; U8 mAgentLimit; |