summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterdaycycle.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/llfloaterdaycycle.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/llfloaterdaycycle.cpp')
-rw-r--r--indra/newview/llfloaterdaycycle.cpp27
1 files changed, 13 insertions, 14 deletions
diff --git a/indra/newview/llfloaterdaycycle.cpp b/indra/newview/llfloaterdaycycle.cpp
index efaac5cfc5..48f91aa64a 100644
--- a/indra/newview/llfloaterdaycycle.cpp
+++ b/indra/newview/llfloaterdaycycle.cpp
@@ -47,6 +47,7 @@
#include "llcombobox.h"
#include "lllineeditor.h"
#include "llwlanimator.h"
+#include "llnotifications.h"
#include "v4math.h"
#include "llviewerdisplay.h"
@@ -59,6 +60,7 @@
#include "llfloaterwindlight.h"
#include "llwindlightscrubbers.h"
#include "llenvmanager.h"
+#include "llfloaterreg.h"
LLFloaterDayCycle* LLFloaterDayCycle::sDayCycle = NULL;
const F32 LLFloaterDayCycle::sHoursPerDay = 24.0f;
@@ -67,13 +69,12 @@ LLEnvKey::EScope LLFloaterDayCycle::sScope;
std::string LLFloaterDayCycle::sOriginalTitle;
LLWLAnimator::ETime LLFloaterDayCycle::sPreviousTimeType = LLWLAnimator::TIME_LINDEN;
-LLFloaterDayCycle::LLFloaterDayCycle() : LLFloater(std::string("Day Cycle Floater"))
+LLFloaterDayCycle::LLFloaterDayCycle(const LLSD &key) : LLFloater(key)
{
- LLUICtrlFactory::getInstance()->buildFloater(this, "floater_day_cycle_options.xml", NULL, FALSE);
sOriginalTitle = getTitle();
- llassert(MAX_LOCAL_KEY_FRAMES <= getChild<LLMultiSliderCtrl>("WLDayCycleKeys")->getMaxSliderCount() &&
- MAX_REGION_KEYFRAMES <= getChild<LLMultiSliderCtrl>("WLDayCycleKeys")->getMaxSliderCount());
+ llassert(LLWLPacketScrubber::MAX_LOCAL_KEY_FRAMES <= getChild<LLMultiSliderCtrl>("WLDayCycleKeys")->getMaxValue() &&
+ LLWLPacketScrubber::MAX_REGION_KEY_FRAMES <= getChild<LLMultiSliderCtrl>("WLDayCycleKeys")->getMaxValue());
// add the time slider
LLMultiSliderCtrl* sldr = getChild<LLMultiSliderCtrl>("WLTimeSlider");
@@ -90,10 +91,8 @@ LLFloaterDayCycle::~LLFloaterDayCycle()
void LLFloaterDayCycle::onClickHelp(void* data)
{
- LLFloaterDayCycle* self = LLFloaterDayCycle::instance();
-
std::string xml_alert = *(std::string *) data;
- LLNotifications::instance().add(self->contextualNotification(xml_alert));
+ LLNotifications::instance().add(xml_alert, LLSD(), LLSD());
}
void LLFloaterDayCycle::initHelpBtn(const std::string& name, const std::string& xml_alert)
@@ -244,7 +243,7 @@ LLFloaterDayCycle* LLFloaterDayCycle::instance()
{
if (!sDayCycle)
{
- sDayCycle = new LLFloaterDayCycle();
+ sDayCycle = new LLFloaterDayCycle("Day Cycle Floater");
// sDayCycle->open();
// sDayCycle->setFocus(TRUE);
}
@@ -265,7 +264,7 @@ void LLFloaterDayCycle::show(LLEnvKey::EScope scope)
LLFloaterDayCycle* dayCycle = instance();
if(scope != sScope && ((LLView*)dayCycle)->getVisible())
{
- LLNotifications::instance().add("EnvOtherScopeAlreadyOpen", LLSD());
+ LLNotifications::instance().add("EnvOtherScopeAlreadyOpen", LLSD(), LLSD());
return;
}
sScope = scope;
@@ -286,7 +285,7 @@ void LLFloaterDayCycle::show(LLEnvKey::EScope scope)
//LLUICtrlFactory::getInstance()->buildFloater(dayCycle, "floater_day_cycle_options.xml");
//dayCycle->initCallbacks();
- dayCycle->open();
+ dayCycle->openFloater();
}
// virtual
@@ -537,16 +536,16 @@ void LLFloaterDayCycle::onAddKey(void* userData)
max_sliders = LLWLPacketScrubber::MAX_REGION_KEY_FRAMES;
break;
default:
- max_sliders = kSldr->getMaxSliderCount();
+ max_sliders = (S32)kSldr->getMaxValue();
break;
}
- if(kSldr->getSliderCount() >= max_sliders)
+ if(kSldr->getValue().asInteger() >= max_sliders)
{
LLSD args;
args["SCOPE"] = LLEnvManager::getScopeString(sScope);
args["MAX"] = max_sliders;
- LLNotifications::instance().add("DayCycleTooManyKeyframes", args);
+ LLNotifications::instance().add("DayCycleTooManyKeyframes", LLSD(), args);
return;
}
@@ -608,7 +607,7 @@ void LLFloaterDayCycle::onDeleteKey(void* userData)
}
else if(sSliderToKey.size() == 1)
{
- LLNotifications::instance().add("EnvCannotDeleteLastDayCycleKey", LLSD());
+ LLNotifications::instance().add("EnvCannotDeleteLastDayCycleKey", LLSD(), LLSD());
return;
}