EXT-1305 Hook up Script Error preferences -- reviewed by james

meow-7.2.2
angela 2009-10-24 07:58:31 +08:00
parent 2b69cb9e9c
commit f60314f227
6 changed files with 54 additions and 27 deletions

View File

@ -7340,17 +7340,6 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>ScriptErrorsAsChat</key>
<map>
<key>Comment</key>
<string>Display script errors and warning in chat history</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ScriptHelpFollowsCursor</key>
<map>
<key>Comment</key>
@ -7664,6 +7653,28 @@
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>ShowScriptErrors</key>
<map>
<key>Comment</key>
<string>Show script errors</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>ShowScriptErrorsLocation</key>
<map>
<key>Comment</key>
<string>Show script error in chat or window</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>ShowSnapshotButton</key>
<map>

View File

@ -204,12 +204,14 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file)
if (chat.mChatType == CHAT_TYPE_DEBUG_MSG)
{
LLFloaterScriptDebug::addScriptLine(chat.mText,
chat.mFromName,
color,
chat.mFromID);
if (!gSavedSettings.getBOOL("ScriptErrorsAsChat"))
if(gSavedSettings.getBOOL("ShowScriptErrors") == FALSE)
return;
if (gSavedSettings.getS32("ShowScriptErrorsLocation") == 1)
{
LLFloaterScriptDebug::addScriptLine(chat.mText,
chat.mFromName,
color,
chat.mFromID);
return;
}
}
@ -315,9 +317,9 @@ void LLFloaterChat::addChat(const LLChat& chat,
{
LLColor4 text_color = get_text_color(chat);
BOOL invisible_script_debug_chat =
chat.mChatType == CHAT_TYPE_DEBUG_MSG
&& !gSavedSettings.getBOOL("ScriptErrorsAsChat");
BOOL invisible_script_debug_chat = ((gSavedSettings.getBOOL("ShowScriptErrors") == FALSE) ||
(chat.mChatType == CHAT_TYPE_DEBUG_MSG
&& (gSavedSettings.getS32("ShowScriptErrorsLocation") == 1)));
if (!invisible_script_debug_chat
&& !chat.mMuted

View File

@ -222,12 +222,14 @@ void LLNearbyChat::addMessage(const LLChat& chat)
if (chat.mChatType == CHAT_TYPE_DEBUG_MSG)
{
LLFloaterScriptDebug::addScriptLine(chat.mText,
chat.mFromName,
color,
chat.mFromID);
if (!gSavedSettings.getBOOL("ScriptErrorsAsChat"))
if(gSavedSettings.getBOOL("ShowScriptErrors") == FALSE)
return;
if (gSavedSettings.getS32("ShowScriptErrorsLocation")== 1)// show error in window //("ScriptErrorsAsChat"))
{
LLFloaterScriptDebug::addScriptLine(chat.mText,
chat.mFromName,
color,
chat.mFromID);
return;
}
}

View File

@ -188,6 +188,17 @@ void LLNearbyChatScreenChannel::addNotification(LLSD& notification)
return;
}
int chat_type = notification["chat_type"].asInteger();
if( ((EChatType)chat_type == CHAT_TYPE_DEBUG_MSG))
{
if(gSavedSettings.getBOOL("ShowScriptErrors") == FALSE)
return;
if(gSavedSettings.getS32("ShowScriptErrorsLocation")== 1)
return;
}
//take 1st element from pool, (re)initialize it, put it in active toasts
LLToast* toast = m_toast_pool.back();
@ -330,6 +341,7 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg)
notification["from_id"] = chat_msg.mFromID;
notification["time"] = chat_msg.mTime;
notification["source"] = (S32)chat_msg.mSourceType;
notification["chat_type"] = (S32)chat_msg.mChatType;
channel->addNotification(notification);
}

View File

@ -235,7 +235,7 @@ Avatars:
width="237"
top_pad="0" />
<check_box
control_name="test"
control_name="ShowScriptErrors"
height="20"
label="Show script errors"
layout="topleft"
@ -244,7 +244,7 @@ Avatars:
width="256"
top_pad="10"/>
<radio_group
enabled_control="EnableShowScriptErrors"
enabled_control="ShowScriptErrors"
control_name="ShowScriptErrorsLocation"
draw_border="false"
height="40"

View File

@ -1819,7 +1819,7 @@ this texture in your inventory
<string name="broken_link" value=" (broken_link)" />
<string name="LoadingContents">Loading contents...</string>
<string name="NoContents">No contents</string>
<string name="WornOnAttachmentPoint"> (worn on [ATTACHMENT_POINT])</string>
<string name="WornOnAttachmentPoint" value=" (worn on [ATTACHMENT_POINT])" />
<!-- Gestures labels -->
<!-- use value="" because they have preceding spaces -->