diff options
author | McCabe Maxsted | 2009-09-22 22:23:51 -0700 |
---|---|---|
committer | McCabe Maxsted | 2009-09-22 22:23:51 -0700 |
commit | 4905d42add2de0d897591f136734b071650e70f8 (patch) | |
tree | 9ddf8c65e7b4799e711c698e5523ff3217843a89 /linden | |
parent | Clarifed Mini-Map menu option: 'Show Map' to 'Show World Map' (diff) | |
download | meta-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.xml | 11 | ||||
-rw-r--r-- | linden/indra/newview/llvoavatar.cpp | 65 | ||||
-rw-r--r-- | linden/indra/newview/llvoavatar.h | 3 |
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; | |||
295 | F32 LLVOAvatar::sUnbakedUpdateTime = 0.f; | 295 | F32 LLVOAvatar::sUnbakedUpdateTime = 0.f; |
296 | F32 LLVOAvatar::sGreyTime = 0.f; | 296 | F32 LLVOAvatar::sGreyTime = 0.f; |
297 | F32 LLVOAvatar::sGreyUpdateTime = 0.f; | 297 | F32 LLVOAvatar::sGreyUpdateTime = 0.f; |
298 | LLVector3d LLVOAvatar::sBeamLastAt; | ||
299 | int LLVOAvatar::sPartsNow; | ||
300 | |||
298 | 301 | ||
299 | struct LLAvatarTexData | 302 | struct 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 | //-------------------------------------------------------------------- |