meow-7.2.2
Arrehn 2011-04-13 16:11:52 -07:00
commit 5d82a7e8e3
10 changed files with 185 additions and 18 deletions

View File

@ -45,6 +45,7 @@ typedef enum e_chat_type
CHAT_TYPE_WHISPER = 0,
CHAT_TYPE_NORMAL = 1,
CHAT_TYPE_SHOUT = 2,
CHAT_TYPE_OOC = 3,
CHAT_TYPE_START = 4,
CHAT_TYPE_STOP = 5,
CHAT_TYPE_DEBUG_MSG = 6,

View File

@ -2,6 +2,43 @@
<llsd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="llsd.xsd">
<map>
<key>PhoenixOOCPrefix</key>
<map>
<key>Comment</key>
<string>Prefix to mark OOC chat</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>((</string>
</map>
<key>PhoenixOOCPostfix</key>
<map>
<key>Comment</key>
<string>Postfix to mark OOC chat</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>))</string>
</map>
<key>PhoenixPlayChatAnimation</key>
<map>
<key>Comment</key>
<string>Play the avatar chat animations, e.g. shouting</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<string>1</string>
</map>
<key>ShowScriptDialogsTopRight</key>
<map>
<key>Comment</key>

View File

@ -137,6 +137,9 @@ BOOL LLChatBar::postBuild()
mIsBuilt = TRUE;
PhoenixPlayChatAnimation = gSavedSettings.getBOOL("PhoenixPlayChatAnimation");
gSavedSettings.getControl("PhoenixPlayChatAnimation")->getSignal()->connect(boost::bind(&LLChatBar::updatePhoenixPlayChatAnimation, this, _2));
return TRUE;
}
@ -157,6 +160,18 @@ BOOL LLChatBar::handleKeyHere( KEY key, MASK mask )
sendChat(CHAT_TYPE_SHOUT);
handled = TRUE;
}
else if (mask == MASK_SHIFT)
{
// whisper
sendChat(CHAT_TYPE_WHISPER);
handled = TRUE;
}
else if (mask == MASK_ALT)
{
// OOC
sendChat(CHAT_TYPE_OOC);
handled = TRUE;
}
else if (mask == MASK_NONE)
{
// say
@ -356,6 +371,10 @@ LLWString LLChatBar::stripChannelNumber(const LLWString &mesg, S32* channel)
}
}
void LLChatBar::updatePhoenixPlayChatAnimation(const LLSD &data)
{
PhoenixPlayChatAnimation = data.asBoolean();
}
void LLChatBar::sendChat( EChatType type )
{
@ -364,6 +383,14 @@ void LLChatBar::sendChat( EChatType type )
LLWString text = mInputEditor->getConvertedText();
if (!text.empty())
{
if(type == CHAT_TYPE_OOC)
{
std::string tempText = mInputEditor->getText();
tempText = gSavedSettings.getString("PhoenixOOCPrefix") + " " + tempText + " " + gSavedSettings.getString("PhoenixOOCPostfix");
mInputEditor->setText(tempText);
text = utf8str_to_wstring(tempText);
}
// store sent line in history, duplicates will get filtered
if (mInputEditor) mInputEditor->updateHistory();
// Check if this is destined for another channel
@ -437,10 +464,16 @@ void LLChatBar::sendChat( EChatType type )
utf8_revised_text = utf8str_trim(utf8_revised_text);
EChatType nType;
if(type == CHAT_TYPE_OOC)
nType = CHAT_TYPE_NORMAL;
else
nType = type;
if (!utf8_revised_text.empty())
{
// Chat with animation
sendChatFromViewer(utf8_revised_text, type, TRUE);
sendChatFromViewer(utf8_revised_text, nType, PhoenixPlayChatAnimation);
}
}
}

View File

@ -89,6 +89,8 @@ public:
static void startChat(const char* line);
static void stopChat();
void updatePhoenixPlayChatAnimation(const LLSD &data);
protected:
void sendChat(EChatType type);
void updateChat();
@ -105,6 +107,8 @@ protected:
LLComboBox* mGestureCombo;
LLChatBarGestureObserver* mObserver;
BOOL PhoenixPlayChatAnimation;
};
extern LLChatBar *gChatBar;

View File

@ -471,10 +471,51 @@ void LLNearbyChat::onInputEditorKeystroke(LLLineEditor* caller, void* userdata)
void LLNearbyChat::onSendMsg( LLUICtrl* ctrl, void* userdata )
{
LLNearbyChat* self = (LLNearbyChat*)userdata;
LLNearbyChatBar::getInstance()->onChatBoxCommit();
LLNearbyChatBar::getInstance()->sendChat(CHAT_TYPE_NORMAL);
self->mInputEditor->setText(LLStringExplicit(""));
}
// virtual
BOOL LLNearbyChat::handleKeyHere( KEY key, MASK mask )
{
BOOL handled = FALSE;
if( KEY_RETURN == key )
{
if (mask == MASK_CONTROL)
{
// shout
LLNearbyChatBar::getInstance()->sendChat(CHAT_TYPE_SHOUT);
handled = TRUE;
}
else if (mask == MASK_SHIFT)
{
// whisper
LLNearbyChatBar::getInstance()->sendChat(CHAT_TYPE_WHISPER);
handled = TRUE;
}
else if (mask == MASK_ALT)
{
// OOC
LLNearbyChatBar::getInstance()->sendChat(CHAT_TYPE_OOC);
handled = TRUE;
}
// Ansariel: For some reason we don't get an unmasked return here.
// So we use the child commit callback that invokes
// LLNearbyChat::onSendMsg() to handle this case.
//else if (mask == MASK_NONE)
//{
// // say
// LLNearbyChatBar::getInstance()->sendChat(CHAT_TYPE_NORMAL);
// handled = TRUE;
//}
}
if (handled == TRUE) mInputEditor->setText(LLStringExplicit(""));
return handled;
}
BOOL LLNearbyChat::matchChatTypeTrigger(const std::string& in_str, std::string* out_str)
{
U32 in_len = in_str.length();

View File

@ -91,6 +91,8 @@ private:
static void onInputEditorKeystroke(LLLineEditor* caller, void* userdata);
static BOOL matchChatTypeTrigger(const std::string& in_str, std::string* out_str);
virtual BOOL handleKeyHere( KEY key, MASK mask );
private:
LLHandle<LLView> mPopupMenuHandle;
LLChatHistory* mChatHistory;

View File

@ -433,6 +433,9 @@ BOOL LLNearbyChatBar::postBuild()
mOutputMonitor = getChild<LLOutputMonitorCtrl>("chat_zone_indicator");
mOutputMonitor->setVisible(FALSE);
PhoenixPlayChatAnimation = gSavedSettings.getBOOL("PhoenixPlayChatAnimation");
gSavedSettings.getControl("PhoenixPlayChatAnimation")->getSignal()->connect(boost::bind(&LLNearbyChatBar::updatePhoenixPlayChatAnimation, this, _2));
return TRUE;
}
@ -464,20 +467,33 @@ BOOL LLNearbyChatBar::handleKeyHere( KEY key, MASK mask )
{
BOOL handled = FALSE;
if( KEY_RETURN == key && mask == MASK_CONTROL)
if( KEY_RETURN == key )
{
// shout
sendChat(CHAT_TYPE_SHOUT);
handled = TRUE;
if (mask == MASK_CONTROL)
{
// shout
sendChat(CHAT_TYPE_SHOUT);
handled = TRUE;
}
else if (mask == MASK_SHIFT)
{
// whisper
sendChat(CHAT_TYPE_WHISPER);
handled = TRUE;
}
else if (mask == MASK_ALT)
{
// OOC
sendChat(CHAT_TYPE_OOC);
handled = TRUE;
}
else if (mask == MASK_NONE)
{
// say
sendChat( CHAT_TYPE_NORMAL );
handled = TRUE;
}
}
//-TT Satomi Ahn - Patch MU_OOC
else if( KEY_RETURN == key && mask == MASK_SHIFT)
{
// whisper
sendChat(CHAT_TYPE_WHISPER);
handled = TRUE;
}
//-TT Satomi Ahn - Patch MU_OOC
return handled;
}
@ -626,6 +642,11 @@ EChatType LLNearbyChatBar::processChatTypeTriggers(EChatType type, std::string &
return type;
}
void LLNearbyChatBar::updatePhoenixPlayChatAnimation(const LLSD &data)
{
PhoenixPlayChatAnimation = data.asBoolean();
}
void LLNearbyChatBar::sendChat( EChatType type )
{
if (mChatBox)
@ -633,6 +654,14 @@ void LLNearbyChatBar::sendChat( EChatType type )
LLWString text = mChatBox->getConvertedText();
if (!text.empty())
{
if(type == CHAT_TYPE_OOC)
{
std::string tempText = mChatBox->getText();
tempText = gSavedSettings.getString("PhoenixOOCPrefix") + " " + tempText + " " + gSavedSettings.getString("PhoenixOOCPostfix");
mChatBox->setText(tempText);
text = utf8str_to_wstring(tempText);
}
// store sent line in history, duplicates will get filtered
mChatBox->updateHistory();
// Check if this is destined for another channel
@ -705,12 +734,18 @@ void LLNearbyChatBar::sendChat( EChatType type )
utf8_revised_text = utf8str_trim(utf8_revised_text);
type = processChatTypeTriggers(type, utf8_revised_text);
EChatType nType;
if(type == CHAT_TYPE_OOC)
nType = CHAT_TYPE_NORMAL;
else
nType = type;
type = processChatTypeTriggers(nType, utf8_revised_text);
if (!utf8_revised_text.empty() && cmd_line_chat(utf8_revised_text, type))
{
// Chat with animation
sendChatFromViewer(utf8_revised_text, type, TRUE);
sendChatFromViewer(utf8_revised_text, type, PhoenixPlayChatAnimation);
}
}

View File

@ -123,13 +123,14 @@ public:
void onChatBoxCommit();
void setText(const LLStringExplicit &new_text);
void sendChat( EChatType type );
void updatePhoenixPlayChatAnimation(const LLSD &data);
protected:
static BOOL matchChatTypeTrigger(const std::string& in_str, std::string* out_str);
static void onChatBoxKeystroke(LLLineEditor* caller, void* userdata);
void sendChat( EChatType type );
static LLWString stripChannelNumber(const LLWString &mesg, S32* channel);
EChatType processChatTypeTriggers(EChatType type, std::string &str);
@ -141,6 +142,8 @@ protected:
LLLineEditor* mChatBox;
LLOutputMonitorCtrl* mOutputMonitor;
LLLocalSpeakerMgr* mSpeakerMgr;
BOOL PhoenixPlayChatAnimation;
};
#endif

View File

@ -9,6 +9,7 @@
<radio_item label="Groß" name="radio3" value="2"/>
</radio_group>
<check_box initial_value="true" label="Beim Chatten Tippanimation abspielen" name="play_typing_animation"/>
<check_box label="Beim Chatten Avataranimation abspielen, z.B. für Rufen" name="play_avatar_animations"/>
<check_box label="IMs per Email zuschicken, wenn ich offline bin" name="send_im_to_email"/>
<check_box label="Kompakten IM- und Text-Chatverlauf aktivieren" name="plain_text_chat_history"/>
<check_box label="Blasen-Chat" name="bubble_text_chat"/>

View File

@ -77,6 +77,16 @@
name="play_typing_animation"
top_pad="5"
width="400" />
<check_box
control_name="PhoenixPlayChatAnimation"
follows="left|top"
height="16"
label="Play avatar animations, e.g. for shouting"
layout="topleft"
left_delta="0"
top_pad="5"
name="play_avatar_animations"
width="400" />
<check_box
control_name="ShowChatMiniIcons"
height="16"