diff options
Diffstat (limited to 'linden/indra/newview/llfloaterchat.cpp')
-rw-r--r-- | linden/indra/newview/llfloaterchat.cpp | 64 |
1 files changed, 33 insertions, 31 deletions
diff --git a/linden/indra/newview/llfloaterchat.cpp b/linden/indra/newview/llfloaterchat.cpp index 5e416d4..dd79afd 100644 --- a/linden/indra/newview/llfloaterchat.cpp +++ b/linden/indra/newview/llfloaterchat.cpp | |||
@@ -187,22 +187,22 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file) | |||
187 | // could flash the chat button in the status bar here. JC | 187 | // could flash the chat button in the status bar here. JC |
188 | if (!gFloaterChat) return; | 188 | if (!gFloaterChat) return; |
189 | 189 | ||
190 | LLViewerTextEditor* HistoryEditor = (LLViewerTextEditor*)gFloaterChat->getChildByName("Chat History Editor"); | 190 | LLViewerTextEditor* history_editor = (LLViewerTextEditor*)gFloaterChat->getChildByName("Chat History Editor"); |
191 | LLViewerTextEditor* HistoryEditorWithMute = (LLViewerTextEditor*)gFloaterChat->getChildByName("Chat History Editor with mute"); | 191 | LLViewerTextEditor* history_editor_with_mute = (LLViewerTextEditor*)gFloaterChat->getChildByName("Chat History Editor with mute"); |
192 | 192 | ||
193 | HistoryEditor->setParseHTML(TRUE); | 193 | history_editor->setParseHTML(TRUE); |
194 | HistoryEditorWithMute->setParseHTML(TRUE); | 194 | history_editor_with_mute->setParseHTML(TRUE); |
195 | 195 | ||
196 | if (!chat.mMuted) | 196 | if (!chat.mMuted) |
197 | { | 197 | { |
198 | add_timestamped_line(HistoryEditor, chat.mText, color); | 198 | add_timestamped_line(history_editor, chat.mText, color); |
199 | add_timestamped_line(HistoryEditorWithMute, chat.mText, color); | 199 | add_timestamped_line(history_editor_with_mute, chat.mText, color); |
200 | } | 200 | } |
201 | else | 201 | else |
202 | { | 202 | { |
203 | // desaturate muted chat | 203 | // desaturate muted chat |
204 | LLColor4 muted_color = lerp(color, LLColor4::grey, 0.5f); | 204 | LLColor4 muted_color = lerp(color, LLColor4::grey, 0.5f); |
205 | add_timestamped_line(HistoryEditorWithMute, chat.mText, color); | 205 | add_timestamped_line(history_editor_with_mute, chat.mText, color); |
206 | } | 206 | } |
207 | 207 | ||
208 | if (!chat.mMuted | 208 | if (!chat.mMuted |
@@ -211,17 +211,19 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file) | |||
211 | && chat.mFromID != gAgent.getID()) | 211 | && chat.mFromID != gAgent.getID()) |
212 | { | 212 | { |
213 | 213 | ||
214 | LLComboBox* ChatterCombo = LLUICtrlFactory::getComboBoxByName(gFloaterChat,"chatter combobox"); | 214 | LLComboBox* chatter_combo = LLUICtrlFactory::getComboBoxByName(gFloaterChat,"chatter combobox"); |
215 | 215 | ||
216 | if(!ChatterCombo) | 216 | if(!chatter_combo) |
217 | return; | 217 | { |
218 | return; | ||
219 | } | ||
218 | 220 | ||
219 | if (!ChatterCombo->setCurrentByID(chat.mFromID)) | 221 | if (!chatter_combo->setCurrentByID(chat.mFromID)) |
220 | { | 222 | { |
221 | // if we have too many items... | 223 | // if we have too many items... |
222 | if (ChatterCombo->getItemCount() >= MAX_CHATTER_COUNT) | 224 | if (chatter_combo->getItemCount() >= MAX_CHATTER_COUNT) |
223 | { | 225 | { |
224 | ChatterCombo->remove(0); | 226 | chatter_combo->remove(0); |
225 | } | 227 | } |
226 | 228 | ||
227 | LLMute mute(chat.mFromID, chat.mFromName); | 229 | LLMute mute(chat.mFromID, chat.mFromName); |
@@ -234,8 +236,8 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file) | |||
234 | mute.mType = LLMute::AGENT; | 236 | mute.mType = LLMute::AGENT; |
235 | } | 237 | } |
236 | LLString item = mute.getDisplayName(); | 238 | LLString item = mute.getDisplayName(); |
237 | ChatterCombo->add(item, chat.mFromID); | 239 | chatter_combo->add(item, chat.mFromID); |
238 | ChatterCombo->setCurrentByIndex(ChatterCombo->getItemCount() - 1); | 240 | chatter_combo->setCurrentByIndex(chatter_combo->getItemCount() - 1); |
239 | gFloaterChat->childSetEnabled("Mute resident",TRUE); | 241 | gFloaterChat->childSetEnabled("Mute resident",TRUE); |
240 | } | 242 | } |
241 | } | 243 | } |
@@ -246,11 +248,11 @@ void LLFloaterChat::setHistoryCursorAndScrollToEnd() | |||
246 | { | 248 | { |
247 | if (gFloaterChat) | 249 | if (gFloaterChat) |
248 | { | 250 | { |
249 | LLViewerTextEditor* HistoryEditor = (LLViewerTextEditor*)gFloaterChat->getChildByName("Chat History Editor"); | 251 | LLViewerTextEditor* history_editor = (LLViewerTextEditor*)gFloaterChat->getChildByName("Chat History Editor"); |
250 | LLViewerTextEditor* HistoryEditorWithMute = (LLViewerTextEditor*)gFloaterChat->getChildByName("Chat History Editor with mute"); | 252 | LLViewerTextEditor* history_editor_with_mute = (LLViewerTextEditor*)gFloaterChat->getChildByName("Chat History Editor with mute"); |
251 | 253 | ||
252 | HistoryEditor->setCursorAndScrollToEnd(); | 254 | history_editor->setCursorAndScrollToEnd(); |
253 | HistoryEditorWithMute->setCursorAndScrollToEnd(); | 255 | history_editor_with_mute->setCursorAndScrollToEnd(); |
254 | } | 256 | } |
255 | } | 257 | } |
256 | 258 | ||
@@ -279,10 +281,10 @@ void LLFloaterChat::onClickMute(void *data) | |||
279 | { | 281 | { |
280 | LLFloaterChat* self = (LLFloaterChat*)data; | 282 | LLFloaterChat* self = (LLFloaterChat*)data; |
281 | 283 | ||
282 | LLComboBox* ChatterCombo = LLUICtrlFactory::getComboBoxByName(self,"chatter combobox"); | 284 | LLComboBox* chatter_combo = LLUICtrlFactory::getComboBoxByName(self,"chatter combobox"); |
283 | 285 | ||
284 | const LLString& name = ChatterCombo->getSimple(); | 286 | const LLString& name = chatter_combo->getSimple(); |
285 | LLUUID id = ChatterCombo->getCurrentID(); | 287 | LLUUID id = chatter_combo->getCurrentID(); |
286 | 288 | ||
287 | if (name.empty()) return; | 289 | if (name.empty()) return; |
288 | 290 | ||
@@ -328,24 +330,24 @@ void LLFloaterChat::onClickToggleShowMute(LLUICtrl* caller, void *data) | |||
328 | 330 | ||
329 | //LLCheckBoxCtrl* | 331 | //LLCheckBoxCtrl* |
330 | BOOL show_mute = LLUICtrlFactory::getCheckBoxByName(floater,"show mutes")->get(); | 332 | BOOL show_mute = LLUICtrlFactory::getCheckBoxByName(floater,"show mutes")->get(); |
331 | LLViewerTextEditor* HistoryEditor = (LLViewerTextEditor*)floater->getChildByName("Chat History Editor"); | 333 | LLViewerTextEditor* history_editor = (LLViewerTextEditor*)floater->getChildByName("Chat History Editor"); |
332 | LLViewerTextEditor* HistoryEditorWithMute = (LLViewerTextEditor*)floater->getChildByName("Chat History Editor with mute"); | 334 | LLViewerTextEditor* history_editor_with_mute = (LLViewerTextEditor*)floater->getChildByName("Chat History Editor with mute"); |
333 | 335 | ||
334 | if (!HistoryEditor || !HistoryEditorWithMute) | 336 | if (!history_editor || !history_editor_with_mute) |
335 | return; | 337 | return; |
336 | 338 | ||
337 | //BOOL show_mute = floater->mShowMuteCheckBox->get(); | 339 | //BOOL show_mute = floater->mShowMuteCheckBox->get(); |
338 | if (show_mute) | 340 | if (show_mute) |
339 | { | 341 | { |
340 | HistoryEditor->setVisible(FALSE); | 342 | history_editor->setVisible(FALSE); |
341 | HistoryEditorWithMute->setVisible(TRUE); | 343 | history_editor_with_mute->setVisible(TRUE); |
342 | HistoryEditorWithMute->setCursorAndScrollToEnd(); | 344 | history_editor_with_mute->setCursorAndScrollToEnd(); |
343 | } | 345 | } |
344 | else | 346 | else |
345 | { | 347 | { |
346 | HistoryEditor->setVisible(TRUE); | 348 | history_editor->setVisible(TRUE); |
347 | HistoryEditorWithMute->setVisible(FALSE); | 349 | history_editor_with_mute->setVisible(FALSE); |
348 | HistoryEditor->setCursorAndScrollToEnd(); | 350 | history_editor->setCursorAndScrollToEnd(); |
349 | } | 351 | } |
350 | } | 352 | } |
351 | 353 | ||