summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterwater.cpp
diff options
context:
space:
mode:
authorNyx (Neal Orman) <nyx@lindenlab.com>2010-09-30 23:21:23 -0400
committerNyx (Neal Orman) <nyx@lindenlab.com>2010-09-30 23:21:23 -0400
commit2fb337bc12984f9abecfbc7f3918c372a7b5ac6c (patch)
tree9be20d7e6953269766bdb408325e952140880ef1 /indra/newview/llfloaterwater.cpp
parente045d212d35354d679c2d2e05c6d4689f9f8ac95 (diff)
STORM-1126 WIP Windlight Estate Settings port from 1.23: second pass at getting windlight ported to V2.
Lots of cleanup in the floater classes. Not sure every decision was correct but it compiles now. Doesn't link yet. (resubmitted by Vadim ProductEngine)
Diffstat (limited to 'indra/newview/llfloaterwater.cpp')
-rw-r--r--indra/newview/llfloaterwater.cpp44
1 files changed, 43 insertions, 1 deletions
diff --git a/indra/newview/llfloaterwater.cpp b/indra/newview/llfloaterwater.cpp
index a443b788fb..4bc8523d0a 100644
--- a/indra/newview/llfloaterwater.cpp
+++ b/indra/newview/llfloaterwater.cpp
@@ -45,6 +45,7 @@
#include "llfloaterdaycycle.h"
#include "llboost.h"
#include "llmultisliderctrl.h"
+#include "llnotifications.h"
#include "v4math.h"
#include "llviewerdisplay.h"
@@ -104,6 +105,47 @@ BOOL LLFloaterWater::postBuild()
syncMenu();
return TRUE;
}
+
+//static
+LLFloaterWater* LLFloaterWater::instance()
+{
+ if (!sWater)
+ {
+ sWater = new LLFloaterWater(LLSD());
+ }
+ return sWater;
+}
+
+void LLFloaterWater::show(LLEnvKey::EScope scope)
+{
+ LLFloaterWater* water = instance();
+
+ if(scope != sScope && ((LLView*)water)->getVisible())
+ {
+ LLNotifications::instance().add("EnvOtherScopeAlreadyOpen", LLSD(), LLSD());
+ return;
+ }
+ sScope = scope;
+ std::string scope_str = "";
+ switch(sScope)
+ {
+ case LLEnvKey::SCOPE_LOCAL:
+ scope_str = LLTrans::getString("LocalSettings");
+ break;
+ case LLEnvKey::SCOPE_REGION:
+ scope_str = LLTrans::getString("RegionSettings");
+ break;
+ }
+ std::string title = sOriginalTitle + " (" + scope_str + ")";
+ water->setTitle(title);
+ water->syncMenu();
+
+ LLEnvManager::instance().startEditingScope(scope);
+
+ water->openFloater();
+
+}
+
void LLFloaterWater::initCallbacks(void) {
LLWaterParamManager * param_mgr = LLWaterParamManager::getInstance();
@@ -620,7 +662,7 @@ void LLFloaterWater::onChangePresetName(LLUICtrl* ctrl)
std::string data = ctrl->getValue().asString();
if(!data.empty())
{
- LLWaterParamManager::instance()->loadPreset(data);
+ LLWaterParamManager::instance().loadPreset(data);
syncMenu();
}
}