diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llfloaterchat.cpp | 57 |
1 files changed, 54 insertions, 3 deletions
diff --git a/linden/indra/newview/llfloaterchat.cpp b/linden/indra/newview/llfloaterchat.cpp index 59f4d70..5f43406 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 | { |
@@ -573,7 +582,8 @@ void LLFloaterChat::addChat(const LLChat& chat, | |||
573 | // We display anything if it's not an IM. If it's an IM, check pref... | 582 | // We display anything if it's not an IM. If it's an IM, check pref... |
574 | if ( !from_instant_message || gSavedSettings.getBOOL("IMInChatConsole") ) | 583 | if ( !from_instant_message || gSavedSettings.getBOOL("IMInChatConsole") ) |
575 | { | 584 | { |
576 | gConsole->addLine(chat.mText, size, text_color); | 585 | gConsole->addConsoleLine(chat.mText, text_color); |
586 | |||
577 | } | 587 | } |
578 | } | 588 | } |
579 | 589 | ||
@@ -583,13 +593,54 @@ void LLFloaterChat::addChat(const LLChat& chat, | |||
583 | if(from_instant_message && gSavedSettings.getBOOL("IMInChatHistory")) | 593 | if(from_instant_message && gSavedSettings.getBOOL("IMInChatHistory")) |
584 | addChatHistory(chat,false); | 594 | addChatHistory(chat,false); |
585 | 595 | ||
586 | LLTextParser* highlight = LLTextParser::getInstance(); | 596 | triggerAlerts(chat.mText); |
587 | highlight->triggerAlerts(gAgent.getID(), gAgent.getPositionGlobal(), chat.mText, gViewerWindow->getWindow()); | ||
588 | 597 | ||
589 | if(!from_instant_message) | 598 | if(!from_instant_message) |
590 | addChatHistory(chat); | 599 | addChatHistory(chat); |
591 | } | 600 | } |
592 | 601 | ||
602 | // Moved from lltextparser.cpp to break llui/llaudio library dependency. | ||
603 | //static | ||
604 | void LLFloaterChat::triggerAlerts(const std::string& text) | ||
605 | { | ||
606 | LLTextParser* parser = LLTextParser::getInstance(); | ||
607 | // bool spoken=FALSE; | ||
608 | for (S32 i=0;i<parser->mHighlights.size();i++) | ||
609 | { | ||
610 | LLSD& highlight = parser->mHighlights[i]; | ||
611 | if (parser->findPattern(text,highlight) >= 0 ) | ||
612 | { | ||
613 | if(gAudiop) | ||
614 | { | ||
615 | if ((std::string)highlight["sound_lluuid"] != LLUUID::null.asString()) | ||
616 | { | ||
617 | gAudiop->triggerSound(highlight["sound_lluuid"].asUUID(), | ||
618 | gAgent.getID(), | ||
619 | 1.f, | ||
620 | LLAudioEngine::AUDIO_TYPE_UI, | ||
621 | gAgent.getPositionGlobal() ); | ||
622 | } | ||
623 | /* | ||
624 | if (!spoken) | ||
625 | { | ||
626 | LLTextToSpeech* text_to_speech = NULL; | ||
627 | text_to_speech = LLTextToSpeech::getInstance(); | ||
628 | spoken = text_to_speech->speak((LLString)highlight["voice"],text); | ||
629 | } | ||
630 | */ | ||
631 | } | ||
632 | if (highlight["flash"]) | ||
633 | { | ||
634 | LLWindow* viewer_window = gViewerWindow->getWindow(); | ||
635 | if (viewer_window && viewer_window->getMinimized()) | ||
636 | { | ||
637 | viewer_window->flashIcon(5.f); | ||
638 | } | ||
639 | } | ||
640 | } | ||
641 | } | ||
642 | } | ||
643 | |||
593 | LLColor4 get_text_color(const LLChat& chat) | 644 | LLColor4 get_text_color(const LLChat& chat) |
594 | { | 645 | { |
595 | LLColor4 text_color; | 646 | LLColor4 text_color; |