Added blink, and Hard Blink (See the comments in llpanelobject.cpp line2081

This commit is contained in:
SimmanFederal
2010-05-19 13:53:17 -05:00
parent 8480ed6f2c
commit 7bdc491473
3 changed files with 56 additions and 22 deletions

View File

@@ -121,6 +121,8 @@ BOOL LLPanelObject::postBuild()
//Blink [SimmanFederal] Inspired by VLife/Oynx
mClickBlink = getChild<LLButton>("button blink");
childSetAction("button blink",&onClickBlink,this);
mClickHardBlink = getChild<LLButton>("button blink hard");
childSetAction("button blink hard",&onClickHardBlink,this);
// Temporary checkbox
mCheckTemporary = getChild<LLCheckBoxCtrl>("Temporary Checkbox Ctrl");
@@ -388,6 +390,13 @@ void LLPanelObject::getState( )
BOOL enable_rotate = TRUE;
// </edit>
//[SimmanFederal]: Adding permission check to see if we can even BLINK anything not just atempting to blink even no mod sheit.
//Also a link check. (lol from the orginal enable_move bool <3)
BOOL sfBlinkOk = objectp->permMove() && !objectp->isAttachment() && (objectp->permModify() || !gSavedSettings.getBOOL("EditLinkedParts"));
childSetEnabled("button blink", sfBlinkOk);
childSetEnabled("button blink hard", sfBlinkOk);
//[/SimmanFederal]
S32 selected_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount();
BOOL single_volume = (LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ))
&& (selected_count == 1);
@@ -481,10 +490,6 @@ void LLPanelObject::getState( )
// </edit>
//<derp> Griefer Technology ~[SimmanFederal]
childSetEnabled("button blink", root_objectp->permModify());
//</derp>
// Select Single Message
childSetVisible("select_single", FALSE);
childSetVisible("edit_object", FALSE);
@@ -2027,19 +2032,6 @@ void LLPanelObject::onCommitPhysics( LLUICtrl* ctrl, void* userdata )
self->sendIsPhysical();
}
//[SimmanFederal] Blinking function. Inspired by VLife/Oynx.
void LLPanelObject::onClickBlink(void* data)
{
LLViewerObject* objpos = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject();
if(objpos)
{
LLVector3 pos = objpos->getPosition();
pos.mV[VZ] = 9001.0f;
objpos->setPositionParent(pos);
LLSelectMgr::getInstance()->sendMultipleUpdate(UPD_POSITION);
}
}
// static
void LLPanelObject::onCommitTemporary( LLUICtrl* ctrl, void* userdata )
{
@@ -2085,6 +2077,42 @@ void LLPanelObject::onCommitSculpt( LLUICtrl* ctrl, void* userdata )
self->sendSculpt();
}
//moved the Blink code below the Commit voids, Sorry about that. ~[SimmanFederal]
//[SimmanFederal] Blinking function. Inspired by VLife/Oynx.
void LLPanelObject::onClickBlink(void* data)
{
LLViewerObject* objpos = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject();
if(objpos)
{
//printchat("Blinking...");//yes I'm too lasy to add the system chat set up to a header
LLVector3 pos = objpos->getPosition();//get the x and the y
pos.mV[VZ] = 340282346638528859811704183484516925440.0f;//create the z
objpos->setPositionParent(pos);//set the x y z
LLSelectMgr::getInstance()->sendMultipleUpdate(UPD_POSITION);//send the data
}
}
//[SimmanFederal] HARD-Blinking function. I thought about it while fapping.
void LLPanelObject::onClickHardBlink(void* data)
{
LLViewerObject* objpos = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject();
if(objpos)
{
//printchat("Hard blinking...");//yes I'm too lasy to add the system chat set up to a header
/*
NOTE: Temporary objects, when thrown off world/put off world,
do not report back to the viewer, nor go to lost and found.
So we do selectionUpdateTemporary(1)
*/
LLSelectMgr::getInstance()->selectionUpdateTemporary(1);//set temp to TRUE
LLVector3 pos = objpos->getPosition();//get the x and the y
pos.mV[VZ] = 340282346638528859811704183484516925440.0f;//create the z
objpos->setPositionParent(pos);//set the x y z
LLSelectMgr::getInstance()->sendMultipleUpdate(UPD_POSITION);//send the data
}
}
// static
BOOL LLPanelObject::onDropSculpt(LLUICtrl*, LLInventoryItem* item, void* userdata)
{

View File

@@ -66,6 +66,7 @@ public:
static BOOL precommitValidate(LLUICtrl* ctrl,void* userdata);
static void onClickBlink(void* userdata);//[SimmanFederal] Blinking
static void onClickHardBlink(void* userdata);//[SimmanFederal] Griefer Blinking
static void onCommitLock(LLUICtrl *ctrl, void *data);
static void onCommitPosition( LLUICtrl* ctrl, void* userdata);
@@ -153,8 +154,9 @@ protected:
LLSpinCtrl* mCtrlPosX;
LLSpinCtrl* mCtrlPosY;
LLSpinCtrl* mCtrlPosZ;
//VLife/Oynx Inspriation. IT BLINKS PRIMS TO 9001.0 METERS. HERP.
//VLife/Oynx Inspriation. IT BLINKS PRIMS TO 340282346638528859811704183484516925440.0f METERS. HERP.
LLButton* mClickBlink;//[SimmanFederal]
LLButton* mClickHardBlink;//[SimmanFederal]
LLTextBox* mLabelSize;
LLSpinCtrl* mCtrlScaleX;

View File

@@ -910,10 +910,14 @@
<combo_item name="Cylinder" value="Cylinder">
Cylinder
</combo_item>
</combo_box><!-- [SimmanFederal] Blink Button -->
<button bottom="-360" follows="left|top" font="SansSerifSmall" halign="center"
height="20" label="Blink" label_selected="Blink" left="200"
mouse_opaque="true" name="button blink" scale_image="TRUE" width="60" />
</combo_box><!-- [SimmanFederal] Super-Blink Button -->
<button bottom="-25" follows="left|top" font="SansSerifSmall" halign="center"
height="20" label="Hard-Blink" label_selected="Hard-Blink" left="140"
mouse_opaque="true" name="button blink hard" scale_image="TRUE" width="65" />
<!-- [SimmanFederal] Blink Button -->
<button bottom="-25" follows="left|top" font="SansSerifSmall" halign="center"
height="20" label="Blink" label_selected="Blink" left="205"
mouse_opaque="true" name="button blink" scale_image="TRUE" width="55" />
</panel>
<!-- Features sub-tab -->