aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-09-22 22:23:51 -0700
committerMcCabe Maxsted2009-09-22 22:23:51 -0700
commit4905d42add2de0d897591f136734b071650e70f8 (patch)
tree9ddf8c65e7b4799e711c698e5523ff3217843a89 /linden
parentClarifed Mini-Map menu option: 'Show Map' to 'Show World Map' (diff)
downloadmeta-impy-4905d42add2de0d897591f136734b071650e70f8.zip
meta-impy-4905d42add2de0d897591f136734b071650e70f8.tar.gz
meta-impy-4905d42add2de0d897591f136734b071650e70f8.tar.bz2
meta-impy-4905d42add2de0d897591f136734b071650e70f8.tar.xz
Applied particle chat feature from Emerald viewer (tell an object it's selected on channel 9000)
Diffstat (limited to 'linden')
-rw-r--r--linden/indra/newview/app_settings/settings.xml11
-rw-r--r--linden/indra/newview/llvoavatar.cpp65
-rw-r--r--linden/indra/newview/llvoavatar.h3
3 files changed, 79 insertions, 0 deletions
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml
index 194e95e..087c92f 100644
--- a/linden/indra/newview/app_settings/settings.xml
+++ b/linden/indra/newview/app_settings/settings.xml
@@ -5559,6 +5559,17 @@
5559 <key>Value</key> 5559 <key>Value</key>
5560 <integer>0</integer> 5560 <integer>0</integer>
5561 </map> 5561 </map>
5562 <key>ParticleChat</key>
5563 <map>
5564 <key>Comment</key>
5565 <string>Chat target of effect beam to channel 9000</string>
5566 <key>Persist</key>
5567 <integer>1</integer>
5568 <key>Type</key>
5569 <string>Boolean</string>
5570 <key>Value</key>
5571 <integer>1</integer>
5572 </map>
5562 <key>PerAccountSettingsFile</key> 5573 <key>PerAccountSettingsFile</key>
5563 <map> 5574 <map>
5564 <key>Comment</key> 5575 <key>Comment</key>
diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp
index 24272d8..431ef96 100644
--- a/linden/indra/newview/llvoavatar.cpp
+++ b/linden/indra/newview/llvoavatar.cpp
@@ -295,6 +295,9 @@ F32 LLVOAvatar::sUnbakedTime = 0.f;
295F32 LLVOAvatar::sUnbakedUpdateTime = 0.f; 295F32 LLVOAvatar::sUnbakedUpdateTime = 0.f;
296F32 LLVOAvatar::sGreyTime = 0.f; 296F32 LLVOAvatar::sGreyTime = 0.f;
297F32 LLVOAvatar::sGreyUpdateTime = 0.f; 297F32 LLVOAvatar::sGreyUpdateTime = 0.f;
298LLVector3d LLVOAvatar::sBeamLastAt;
299int LLVOAvatar::sPartsNow;
300
298 301
299struct LLAvatarTexData 302struct LLAvatarTexData
300{ 303{
@@ -3445,6 +3448,26 @@ void LLVOAvatar::idleUpdateTractorBeam()
3445 if (!needsRenderBeam() || !mIsBuilt) 3448 if (!needsRenderBeam() || !mIsBuilt)
3446 { 3449 {
3447 mBeam = NULL; 3450 mBeam = NULL;
3451 if(gSavedSettings.getBOOL("ParticleChat"))
3452 {
3453 if(sPartsNow != FALSE)
3454 {
3455 sPartsNow = FALSE;
3456 LLMessageSystem* msg = gMessageSystem;
3457 msg->newMessageFast(_PREHASH_ChatFromViewer);
3458 msg->nextBlockFast(_PREHASH_AgentData);
3459 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
3460 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
3461 msg->nextBlockFast(_PREHASH_ChatData);
3462 msg->addStringFast(_PREHASH_Message, "stop");
3463 msg->addU8Fast(_PREHASH_Type, CHAT_TYPE_WHISPER);
3464 msg->addS32("Channel", 9000);
3465
3466 gAgent.sendReliableMessage();
3467 sBeamLastAt = LLVector3d::zero;
3468 LLViewerStats::getInstance()->incStat(LLViewerStats::ST_CHAT_COUNT);
3469 }
3470 }
3448 } 3471 }
3449 else if (!mBeam || mBeam->isDead()) 3472 else if (!mBeam || mBeam->isDead())
3450 { 3473 {
@@ -3463,6 +3486,48 @@ void LLVOAvatar::idleUpdateTractorBeam()
3463 { 3486 {
3464 // get point from pointat effect 3487 // get point from pointat effect
3465 mBeam->setPositionGlobal(gAgent.mPointAt->getPointAtPosGlobal()); 3488 mBeam->setPositionGlobal(gAgent.mPointAt->getPointAtPosGlobal());
3489
3490 if(gSavedSettings.getBOOL("ParticleChat"))
3491 {
3492 if(sPartsNow != TRUE)
3493 {
3494 sPartsNow = TRUE;
3495 LLMessageSystem* msg = gMessageSystem;
3496 msg->newMessageFast(_PREHASH_ChatFromViewer);
3497 msg->nextBlockFast(_PREHASH_AgentData);
3498 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
3499 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
3500 msg->nextBlockFast(_PREHASH_ChatData);
3501 msg->addStringFast(_PREHASH_Message, "start");
3502 msg->addU8Fast(_PREHASH_Type, CHAT_TYPE_WHISPER);
3503 msg->addS32("Channel", 9000);
3504
3505 gAgent.sendReliableMessage();
3506
3507 LLViewerStats::getInstance()->incStat(LLViewerStats::ST_CHAT_COUNT);
3508 }
3509 //LLVector3d a = sBeamLastAt-gAgent.mPointAt->getPointAtPosGlobal();
3510 //if(a.length > 2)
3511 if( (sBeamLastAt-gAgent.mPointAt->getPointAtPosGlobal()).length() > .2)
3512 //if(sBeamLastAt!=gAgent.mPointAt->getPointAtPosGlobal())
3513 {
3514 sBeamLastAt = gAgent.mPointAt->getPointAtPosGlobal();
3515
3516 LLMessageSystem* msg = gMessageSystem;
3517 msg->newMessageFast(_PREHASH_ChatFromViewer);
3518 msg->nextBlockFast(_PREHASH_AgentData);
3519 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
3520 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
3521 msg->nextBlockFast(_PREHASH_ChatData);
3522 msg->addStringFast(_PREHASH_Message, llformat("<%.6f, %.6f, %.6f>",(F32)(sBeamLastAt.mdV[VX]),(F32)(sBeamLastAt.mdV[VY]),(F32)(sBeamLastAt.mdV[VZ])));
3523 msg->addU8Fast(_PREHASH_Type, CHAT_TYPE_WHISPER);
3524 msg->addS32("Channel", 9000); // *TODO: make configurable
3525
3526 gAgent.sendReliableMessage();
3527 }
3528
3529 }
3530
3466 mBeam->triggerLocal(); 3531 mBeam->triggerLocal();
3467 } 3532 }
3468 else if (selection->getFirstRootObject() && 3533 else if (selection->getFirstRootObject() &&
diff --git a/linden/indra/newview/llvoavatar.h b/linden/indra/newview/llvoavatar.h
index 9806ceb..8607383 100644
--- a/linden/indra/newview/llvoavatar.h
+++ b/linden/indra/newview/llvoavatar.h
@@ -918,6 +918,9 @@ public:
918 static F32 sGreyTime; // Total seconds with >=1 grey avatars 918 static F32 sGreyTime; // Total seconds with >=1 grey avatars
919 static F32 sGreyUpdateTime; // Last time stats were updated (to prevent multiple updates per frame) 919 static F32 sGreyUpdateTime; // Last time stats were updated (to prevent multiple updates per frame)
920 920
921 static int sPartsNow;
922 static LLVector3d sBeamLastAt;
923
921 //-------------------------------------------------------------------- 924 //--------------------------------------------------------------------
922 // Texture Layer Sets and Global Colors 925 // Texture Layer Sets and Global Colors
923 //-------------------------------------------------------------------- 926 //--------------------------------------------------------------------