summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterhoverheight.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2014-12-08 13:12:28 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2014-12-08 13:12:28 -0500
commitc9981ec59c4613531b2d5bb03f6ab8f6d914343c (patch)
tree59d1ea54466a26d54db61fb67f2d345187cf99e1 /indra/newview/llfloaterhoverheight.cpp
parent7c2915518978884823e74f8d4d29a1a3073eb39c (diff)
SL-92 WIP - hover height communicated via appearance messages.
Diffstat (limited to 'indra/newview/llfloaterhoverheight.cpp')
-rwxr-xr-xindra/newview/llfloaterhoverheight.cpp46
1 files changed, 40 insertions, 6 deletions
diff --git a/indra/newview/llfloaterhoverheight.cpp b/indra/newview/llfloaterhoverheight.cpp
index 6f7f8374d2..f25d491910 100755
--- a/indra/newview/llfloaterhoverheight.cpp
+++ b/indra/newview/llfloaterhoverheight.cpp
@@ -30,6 +30,28 @@
#include "llfloaterhoverheight.h"
#include "llsliderctrl.h"
#include "llviewercontrol.h"
+#include "llsdserialize.h"
+#include "llhttpclient.h"
+#include "llagent.h"
+#include "llviewerregion.h"
+#include "llvoavatarself.h"
+
+class LLHoverHeightResponder: public LLHTTPClient::Responder
+{
+public:
+ LLHoverHeightResponder(): LLHTTPClient::Responder() {}
+
+private:
+ void httpFailure()
+ {
+ LL_WARNS() << dumpResponse() << LL_ENDL;
+ }
+
+ void httpSuccess()
+ {
+ LL_INFOS() << dumpResponse() << LL_ENDL;
+ }
+};
LLFloaterHoverHeight::LLFloaterHoverHeight(const LLSD& key) : LLFloater(key)
{
@@ -53,12 +75,6 @@ BOOL LLFloaterHoverHeight::postBuild()
// static
void LLFloaterHoverHeight::onSliderMoved(LLUICtrl* ctrl, void* userData)
{
- LLSliderCtrl* sldrCtrl = static_cast<LLSliderCtrl*>(ctrl);
- F32 value = sldrCtrl->getValueF32();
-
- LLVector3 offset = gSavedSettings.getVector3("AvatarPosFinalOffset");
- offset[2] = value;
- gSavedSettings.setVector3("AvatarPosFinalOffset",offset);
}
// Do extra send-to-the-server work when slider drag completes, or new
@@ -66,4 +82,22 @@ void LLFloaterHoverHeight::onSliderMoved(LLUICtrl* ctrl, void* userData)
void LLFloaterHoverHeight::onFinalCommit()
{
LL_INFOS() << "FINAL FINAL!!!" << LL_ENDL;
+ sendHoverHeightUpdate();
+}
+
+void LLFloaterHoverHeight::sendHoverHeightUpdate()
+{
+ LLSliderCtrl* sldrCtrl = getChild<LLSliderCtrl>("HoverHeightSlider");
+ F32 value = sldrCtrl->getValueF32();
+
+ std::string url = gAgent.getRegion()->getCapability("AgentPreferences");
+
+ if (!url.empty())
+ {
+ LLSD update = LLSD::emptyMap();
+ update["hover_height"] = value;
+
+ LL_INFOS() << "updating hover height to " << value << LL_ENDL;
+ LLHTTPClient::post(url, update, new LLHoverHeightResponder);
+ }
}