From 92257b55a405f3625cbbcf07357b3ca929a04882 Mon Sep 17 00:00:00 2001 From: "Matthew Breindel (Falcon)" Date: Fri, 26 Mar 2010 18:23:05 -0700 Subject: DEV-47845 Fix to work with TCP/LLSD message. This checkin is experimental, so if it breaks a build, just revert to the previous changeset. --- indra/newview/llpanelobject.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'indra/newview/llpanelobject.cpp') diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 30221da12a..991e97b767 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -137,6 +137,10 @@ BOOL LLPanelObject::postBuild() // Phantom checkbox mCheckPhantom = getChild("Phantom Checkbox Ctrl"); childSetCommitCallback("Phantom Checkbox Ctrl",onCommitPhantom,this); + + // PhysicsRep combobox + mComboPhysicsRep = getChild("Physics Rep Combo Ctrl"); + childSetCommitCallback("Physics Rep Combo Ctrl", onCommitPhysicsRep,this); // Position mLabelPosition = getChild("label position"); @@ -320,6 +324,7 @@ LLPanelObject::LLPanelObject() mIsPhysical(FALSE), mIsTemporary(FALSE), mIsPhantom(FALSE), + mPhysicsRep(0), mCastShadows(TRUE), mSelectedType(MI_BOX), mSculptTextureRevert(LLUUID::null), @@ -527,6 +532,10 @@ void LLPanelObject::getState( ) mCheckPhantom->set( mIsPhantom ); mCheckPhantom->setEnabled( roots_selected>0 && editable && !is_flexible ); + mPhysicsRep = objectp->getPhysicsRep(); + mComboPhysicsRep->setCurrentByIndex(mPhysicsRep); + mComboPhysicsRep->setEnabled(editable); + #if 0 // 1.9.2 mCastShadows = root_objectp->flagCastShadows(); mCheckCastShadows->set( mCastShadows ); @@ -1232,6 +1241,22 @@ void LLPanelObject::sendIsPhantom() } } +void LLPanelObject::sendPhysicsRep() +{ + U8 value = (U8)mComboPhysicsRep->getCurrentIndex(); + if (mPhysicsRep != value) + { + LLSelectMgr::getInstance()->selectionUpdatePhysicsRep(value); + mPhysicsRep = value; + + llinfos << "update physicsrep sent" << llendl; + } + else + { + llinfos << "update physicstep not changed" << llendl; + } +} + void LLPanelObject::sendCastShadows() { BOOL value = mCheckCastShadows->get(); @@ -1905,6 +1930,8 @@ void LLPanelObject::clearCtrls() mCheckTemporary ->setEnabled( FALSE ); mCheckPhantom ->set(FALSE); mCheckPhantom ->setEnabled( FALSE ); + mComboPhysicsRep->setCurrentByIndex(0); + mComboPhysicsRep->setEnabled(FALSE); #if 0 // 1.9.2 mCheckCastShadows->set(FALSE); mCheckCastShadows->setEnabled( FALSE ); @@ -1999,6 +2026,13 @@ void LLPanelObject::onCommitPhantom( LLUICtrl* ctrl, void* userdata ) self->sendIsPhantom(); } +// static +void LLPanelObject::onCommitPhysicsRep(LLUICtrl* ctrl, void* userdata ) +{ + LLPanelObject* self = (LLPanelObject*) userdata; + self->sendPhysicsRep(); +} + // static void LLPanelObject::onCommitCastShadows( LLUICtrl* ctrl, void* userdata ) { -- cgit v1.2.3 From b2381a039de7e0edbd643d198b85ba8e00524b6b Mon Sep 17 00:00:00 2001 From: "Matthew Breindel (Falcon)" Date: Wed, 31 Mar 2010 17:35:26 -0700 Subject: DEV-47845 Cleaned up names. --- indra/newview/llpanelobject.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'indra/newview/llpanelobject.cpp') diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 991e97b767..669ff3ffd6 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -138,9 +138,9 @@ BOOL LLPanelObject::postBuild() mCheckPhantom = getChild("Phantom Checkbox Ctrl"); childSetCommitCallback("Phantom Checkbox Ctrl",onCommitPhantom,this); - // PhysicsRep combobox - mComboPhysicsRep = getChild("Physics Rep Combo Ctrl"); - childSetCommitCallback("Physics Rep Combo Ctrl", onCommitPhysicsRep,this); + // PhysicsShapeType combobox + mComboPhysicsShapeType = getChild("Physics Shape Type Combo Ctrl"); + childSetCommitCallback("Physics Shape Type Combo Ctrl", onCommitPhysicsShapeType,this); // Position mLabelPosition = getChild("label position"); @@ -324,7 +324,7 @@ LLPanelObject::LLPanelObject() mIsPhysical(FALSE), mIsTemporary(FALSE), mIsPhantom(FALSE), - mPhysicsRep(0), + mPhysicsShapeType(0), mCastShadows(TRUE), mSelectedType(MI_BOX), mSculptTextureRevert(LLUUID::null), @@ -532,9 +532,9 @@ void LLPanelObject::getState( ) mCheckPhantom->set( mIsPhantom ); mCheckPhantom->setEnabled( roots_selected>0 && editable && !is_flexible ); - mPhysicsRep = objectp->getPhysicsRep(); - mComboPhysicsRep->setCurrentByIndex(mPhysicsRep); - mComboPhysicsRep->setEnabled(editable); + mPhysicsShapeType = objectp->getPhysicsShapeType(); + mComboPhysicsShapeType->setCurrentByIndex(mPhysicsShapeType); + mComboPhysicsShapeType->setEnabled(editable); #if 0 // 1.9.2 mCastShadows = root_objectp->flagCastShadows(); @@ -1241,19 +1241,19 @@ void LLPanelObject::sendIsPhantom() } } -void LLPanelObject::sendPhysicsRep() +void LLPanelObject::sendPhysicsShapeType() { - U8 value = (U8)mComboPhysicsRep->getCurrentIndex(); - if (mPhysicsRep != value) + U8 value = (U8)mComboPhysicsShapeType->getCurrentIndex(); + if (mPhysicsShapeType != value) { - LLSelectMgr::getInstance()->selectionUpdatePhysicsRep(value); - mPhysicsRep = value; + LLSelectMgr::getInstance()->selectionUpdatePhysicsShapeType(value); + mPhysicsShapeType = value; - llinfos << "update physicsrep sent" << llendl; + llinfos << "update physics shape type sent" << llendl; } else { - llinfos << "update physicstep not changed" << llendl; + llinfos << "update physics shape type not changed" << llendl; } } @@ -1930,8 +1930,8 @@ void LLPanelObject::clearCtrls() mCheckTemporary ->setEnabled( FALSE ); mCheckPhantom ->set(FALSE); mCheckPhantom ->setEnabled( FALSE ); - mComboPhysicsRep->setCurrentByIndex(0); - mComboPhysicsRep->setEnabled(FALSE); + mComboPhysicsShapeType->setCurrentByIndex(0); + mComboPhysicsShapeType->setEnabled(FALSE); #if 0 // 1.9.2 mCheckCastShadows->set(FALSE); mCheckCastShadows->setEnabled( FALSE ); @@ -2027,10 +2027,10 @@ void LLPanelObject::onCommitPhantom( LLUICtrl* ctrl, void* userdata ) } // static -void LLPanelObject::onCommitPhysicsRep(LLUICtrl* ctrl, void* userdata ) +void LLPanelObject::onCommitPhysicsShapeType(LLUICtrl* ctrl, void* userdata ) { LLPanelObject* self = (LLPanelObject*) userdata; - self->sendPhysicsRep(); + self->sendPhysicsShapeType(); } // static -- cgit v1.2.3 From a2eb86b00927439afcf27219e38e58eba421294f Mon Sep 17 00:00:00 2001 From: "Matthew Breindel (Falcon)" Date: Mon, 24 May 2010 13:37:59 -0700 Subject: Ack. Fixed a bunch of stupid type mistakes in llvector4a. --- indra/newview/llpanelobject.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'indra/newview/llpanelobject.cpp') diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 669ff3ffd6..77f3984ecb 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -1241,6 +1241,16 @@ void LLPanelObject::sendIsPhantom() } } +#include "llsdutil.h" +class CostResponder : public LLHTTPClient::Responder +{ +public: + CostResponder(U32 id) { mID = id; } + virtual void result(const LLSD& content) { llinfos << ll_pretty_print_sd(content) << llendl; } + + U32 mID; +}; + void LLPanelObject::sendPhysicsShapeType() { U8 value = (U8)mComboPhysicsShapeType->getCurrentIndex(); @@ -1255,6 +1265,13 @@ void LLPanelObject::sendPhysicsShapeType() { llinfos << "update physics shape type not changed" << llendl; } + + std::string url = gAgent.getRegion()->getCapability("GetObjectCost"); + LLSD body = LLSD::emptyArray(); + + body.append(LLSelectMgr::getInstance()->getSelection()->getFirstObject()->getID()); + + LLHTTPClient::post( url, body, new CostResponder(body[0].asInteger()) ); } void LLPanelObject::sendCastShadows() -- cgit v1.2.3