diff options
author | Armin Weatherwax | 2010-06-14 12:04:49 +0200 |
---|---|---|
committer | Armin Weatherwax | 2010-09-23 15:38:25 +0200 |
commit | 35df5441d3e2789663532c948731aff3a1e04728 (patch) | |
tree | ac7674289784a5f96106ea507637055a8dada78a /linden/indra/newview/llfloaterchat.cpp | |
parent | Changed version to Experimental 2010.09.18 (diff) | |
download | meta-impy-35df5441d3e2789663532c948731aff3a1e04728.zip meta-impy-35df5441d3e2789663532c948731aff3a1e04728.tar.gz meta-impy-35df5441d3e2789663532c948731aff3a1e04728.tar.bz2 meta-impy-35df5441d3e2789663532c948731aff3a1e04728.tar.xz |
llmediaplugins first step
Diffstat (limited to 'linden/indra/newview/llfloaterchat.cpp')
-rw-r--r-- | linden/indra/newview/llfloaterchat.cpp | 54 |
1 files changed, 52 insertions, 2 deletions
diff --git a/linden/indra/newview/llfloaterchat.cpp b/linden/indra/newview/llfloaterchat.cpp index 59f4d70..2daa5aa 100644 --- a/linden/indra/newview/llfloaterchat.cpp +++ b/linden/indra/newview/llfloaterchat.cpp | |||
@@ -190,6 +190,15 @@ void LLFloaterChat::setMinimized(BOOL minimized) | |||
190 | updateConsoleVisibility(); | 190 | updateConsoleVisibility(); |
191 | } | 191 | } |
192 | 192 | ||
193 | // linden library includes | ||
194 | #include "llaudioengine.h" | ||
195 | #include "llchat.h" | ||
196 | #include "llfontgl.h" | ||
197 | #include "llrect.h" | ||
198 | #include "llerror.h" | ||
199 | #include "llstring.h" | ||
200 | #include "llwindow.h" | ||
201 | #include "message.h" | ||
193 | 202 | ||
194 | void LLFloaterChat::updateConsoleVisibility() | 203 | void LLFloaterChat::updateConsoleVisibility() |
195 | { | 204 | { |
@@ -583,13 +592,54 @@ void LLFloaterChat::addChat(const LLChat& chat, | |||
583 | if(from_instant_message && gSavedSettings.getBOOL("IMInChatHistory")) | 592 | if(from_instant_message && gSavedSettings.getBOOL("IMInChatHistory")) |
584 | addChatHistory(chat,false); | 593 | addChatHistory(chat,false); |
585 | 594 | ||
586 | LLTextParser* highlight = LLTextParser::getInstance(); | 595 | triggerAlerts(chat.mText); |
587 | highlight->triggerAlerts(gAgent.getID(), gAgent.getPositionGlobal(), chat.mText, gViewerWindow->getWindow()); | ||
588 | 596 | ||
589 | if(!from_instant_message) | 597 | if(!from_instant_message) |
590 | addChatHistory(chat); | 598 | addChatHistory(chat); |
591 | } | 599 | } |
592 | 600 | ||
601 | // Moved from lltextparser.cpp to break llui/llaudio library dependency. | ||
602 | //static | ||
603 | void LLFloaterChat::triggerAlerts(const std::string& text) | ||
604 | { | ||
605 | LLTextParser* parser = LLTextParser::getInstance(); | ||
606 | // bool spoken=FALSE; | ||
607 | for (S32 i=0;i<parser->mHighlights.size();i++) | ||
608 | { | ||
609 | LLSD& highlight = parser->mHighlights[i]; | ||
610 | if (parser->findPattern(text,highlight) >= 0 ) | ||
611 | { | ||
612 | if(gAudiop) | ||
613 | { | ||
614 | if ((std::string)highlight["sound_lluuid"] != LLUUID::null.asString()) | ||
615 | { | ||
616 | gAudiop->triggerSound(highlight["sound_lluuid"].asUUID(), | ||
617 | gAgent.getID(), | ||
618 | 1.f, | ||
619 | LLAudioEngine::AUDIO_TYPE_UI, | ||
620 | gAgent.getPositionGlobal() ); | ||
621 | } | ||
622 | /* | ||
623 | if (!spoken) | ||
624 | { | ||
625 | LLTextToSpeech* text_to_speech = NULL; | ||
626 | text_to_speech = LLTextToSpeech::getInstance(); | ||
627 | spoken = text_to_speech->speak((LLString)highlight["voice"],text); | ||
628 | } | ||
629 | */ | ||
630 | } | ||
631 | if (highlight["flash"]) | ||
632 | { | ||
633 | LLWindow* viewer_window = gViewerWindow->getWindow(); | ||
634 | if (viewer_window && viewer_window->getMinimized()) | ||
635 | { | ||
636 | viewer_window->flashIcon(5.f); | ||
637 | } | ||
638 | } | ||
639 | } | ||
640 | } | ||
641 | } | ||
642 | |||
593 | LLColor4 get_text_color(const LLChat& chat) | 643 | LLColor4 get_text_color(const LLChat& chat) |
594 | { | 644 | { |
595 | LLColor4 text_color; | 645 | LLColor4 text_color; |