From 2fc65cae7b073077c29133dc4cfc438880163746 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Fri, 1 Jul 2011 20:05:49 +0300 Subject: 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. --- indra/newview/llfloaterregioninfo.cpp | 48 ++++++++++------------------------- indra/newview/llregioninfomodel.cpp | 6 +++++ indra/newview/llregioninfomodel.h | 2 ++ 3 files changed, 22 insertions(+), 34 deletions(-) (limited to 'indra/newview') 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("water_height_spin")->getValue().asReal()); strings.push_back(buffer); buffer = llformat("%f", (F32)getChild("terrain_raise_spin")->getValue().asReal()); strings.push_back(buffer); buffer = llformat("%f", (F32)getChild("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("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("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("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("region_info"); - if (!floater) return true; - - LLTabContainer* tab = floater->getChild("region_panels"); - if (!tab) return true; - - LLPanelEstateInfo* panel = (LLPanelEstateInfo*)tab->getChild("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 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; -- cgit v1.2.3