aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llstatusbar.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:27 -0500
committerJacek Antonelli2008-08-15 23:45:27 -0500
commita8a62201ba762e98dff92cf49033e577fc34d8d4 (patch)
tree11f8513c5cdc222f2fac0c93eb724c089803c200 /linden/indra/newview/llstatusbar.cpp
parentSecond Life viewer sources 1.18.6.4-RC (diff)
downloadmeta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.zip
meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.gz
meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.bz2
meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.xz
Second Life viewer sources 1.19.0.0
Diffstat (limited to 'linden/indra/newview/llstatusbar.cpp')
-rw-r--r--linden/indra/newview/llstatusbar.cpp94
1 files changed, 59 insertions, 35 deletions
diff --git a/linden/indra/newview/llstatusbar.cpp b/linden/indra/newview/llstatusbar.cpp
index d7b60d9..29335d9 100644
--- a/linden/indra/newview/llstatusbar.cpp
+++ b/linden/indra/newview/llstatusbar.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -100,7 +100,6 @@ const LLColor4 SIM_WARN_COLOR(1.f, 1.f, 0.f, 1.f);
100const LLColor4 SIM_FULL_COLOR(1.f, 0.f, 0.f, 1.f); 100const LLColor4 SIM_FULL_COLOR(1.f, 0.f, 0.f, 1.f);
101const F32 ICON_TIMER_EXPIRY = 3.f; // How long the balance and health icons should flash after a change. 101const F32 ICON_TIMER_EXPIRY = 3.f; // How long the balance and health icons should flash after a change.
102const F32 ICON_FLASH_FREQUENCY = 2.f; 102const F32 ICON_FLASH_FREQUENCY = 2.f;
103const S32 GRAPHIC_FUDGE = 4;
104const S32 TEXT_HEIGHT = 18; 103const S32 TEXT_HEIGHT = 18;
105 104
106static void onClickParcelInfo(void*); 105static void onClickParcelInfo(void*);
@@ -153,13 +152,13 @@ LLStatusBar::LLStatusBar(const std::string& name, const LLRect& rect)
153 152
154 childSetAction("scriptout", onClickScriptDebug, this); 153 childSetAction("scriptout", onClickScriptDebug, this);
155 childSetAction("health", onClickHealth, this); 154 childSetAction("health", onClickHealth, this);
156 childSetAction("fly", onClickFly, this); 155 childSetAction("no_fly", onClickFly, this);
157 childSetAction("buyland", onClickBuyLand, this ); 156 childSetAction("buyland", onClickBuyLand, this );
158 childSetAction("buycurrency", onClickBuyCurrency, this ); 157 childSetAction("buycurrency", onClickBuyCurrency, this );
159 childSetAction("build", onClickBuild, this ); 158 childSetAction("no_build", onClickBuild, this );
160 childSetAction("scripts", onClickScripts, this ); 159 childSetAction("no_scripts", onClickScripts, this );
161 childSetAction("restrictpush", onClickPush, this ); 160 childSetAction("restrictpush", onClickPush, this );
162 childSetAction("status_voice", onClickVoice, this ); 161 childSetAction("status_no_voice", onClickVoice, this );
163 162
164 childSetCommitCallback("search_editor", onCommitSearch, this); 163 childSetCommitCallback("search_editor", onCommitSearch, this);
165 childSetAction("search_btn", onClickSearch, this); 164 childSetAction("search_btn", onClickSearch, this);
@@ -304,7 +303,7 @@ void LLStatusBar::refresh()
304 303
305 // Health 304 // Health
306 childGetRect( "health", buttonRect ); 305 childGetRect( "health", buttonRect );
307 r.setOriginAndSize( x, y-GRAPHIC_FUDGE, buttonRect.getWidth(), buttonRect.getHeight()); 306 r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight());
308 childSetRect("health", r); 307 childSetRect("health", r);
309 x += buttonRect.getWidth(); 308 x += buttonRect.getWidth();
310 309
@@ -324,27 +323,32 @@ void LLStatusBar::refresh()
324 (parcel && !parcel->getAllowFly()) ) 323 (parcel && !parcel->getAllowFly()) )
325 { 324 {
326 // No Fly Zone 325 // No Fly Zone
327 childGetRect( "fly", buttonRect ); 326 childGetRect( "no_fly", buttonRect );
328 childSetVisible( "fly", true ); 327 childSetVisible( "no_fly", true );
329 r.setOriginAndSize( x, y-GRAPHIC_FUDGE, buttonRect.getWidth(), buttonRect.getHeight()); 328 r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight());
330 childSetRect( "fly", r ); 329 childSetRect( "no_fly", r );
331 x += buttonRect.getWidth(); 330 x += buttonRect.getWidth();
332 } 331 }
333 else 332 else
334 { 333 {
335 childSetVisible("fly", false); 334 // Fly Zone
335 childSetVisible("no_fly", false);
336 } 336 }
337 337
338 BOOL no_build = parcel && !parcel->getAllowModify(); 338 BOOL no_build = parcel && !parcel->getAllowModify();
339 childSetVisible("build", no_build);
340 if (no_build) 339 if (no_build)
341 { 340 {
342 childGetRect( "build", buttonRect ); 341 childSetVisible("no_build", TRUE);
342 childGetRect( "no_build", buttonRect );
343 // No Build Zone 343 // No Build Zone
344 r.setOriginAndSize( x, y-GRAPHIC_FUDGE, buttonRect.getWidth(), buttonRect.getHeight()); 344 r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight());
345 childSetRect( "build", r ); 345 childSetRect( "no_build", r );
346 x += buttonRect.getWidth(); 346 x += buttonRect.getWidth();
347 } 347 }
348 else
349 {
350 childSetVisible("no_build", FALSE);
351 }
348 352
349 BOOL no_scripts = FALSE; 353 BOOL no_scripts = FALSE;
350 if((region 354 if((region
@@ -354,35 +358,56 @@ void LLStatusBar::refresh()
354 { 358 {
355 no_scripts = TRUE; 359 no_scripts = TRUE;
356 } 360 }
357 childSetVisible("scripts", no_scripts);
358 if (no_scripts) 361 if (no_scripts)
359 { 362 {
360 // No scripts 363 // No scripts
361 childGetRect( "scripts", buttonRect ); 364 childSetVisible("no_scripts", TRUE);
362 r.setOriginAndSize( x, y-GRAPHIC_FUDGE, buttonRect.getWidth(), buttonRect.getHeight()); 365 childGetRect( "no_scripts", buttonRect );
363 childSetRect( "scripts", r ); 366 r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight());
367 childSetRect( "no_scripts", r );
364 x += buttonRect.getWidth(); 368 x += buttonRect.getWidth();
365 } 369 }
370 else
371 {
372 // Yes scripts
373 childSetVisible("no_scripts", FALSE);
374 }
366 375
367 BOOL no_region_push = (region && region->getRestrictPushObject()); 376 BOOL no_region_push = (region && region->getRestrictPushObject());
368 BOOL no_push = no_region_push || (parcel && parcel->getRestrictPushObject()); 377 BOOL no_push = no_region_push || (parcel && parcel->getRestrictPushObject());
369 childSetVisible("restrictpush", no_push);
370 if (no_push) 378 if (no_push)
371 { 379 {
380 childSetVisible("restrictpush", TRUE);
372 childGetRect( "restrictpush", buttonRect ); 381 childGetRect( "restrictpush", buttonRect );
373 r.setOriginAndSize( x, y-GRAPHIC_FUDGE, buttonRect.getWidth(), buttonRect.getHeight()); 382 r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight());
374 childSetRect( "restrictpush", r ); 383 childSetRect( "restrictpush", r );
375 x += buttonRect.getWidth(); 384 x += buttonRect.getWidth();
376 } 385 }
386 else
387 {
388 childSetVisible("restrictpush", FALSE);
389 }
377 390
378 BOOL have_voice = gVoiceClient->getAreaVoiceDisabled() ? FALSE : TRUE; 391 BOOL voice_enabled = gVoiceClient->voiceEnabled();
379 childSetVisible("status_voice", have_voice); 392 BOOL have_voice = parcel && parcel->getVoiceEnabled();
380 if (have_voice) 393 if (!voice_enabled)
381 { 394 {
382 childGetRect( "status_voice", buttonRect ); 395 childSetVisible("status_no_voice", FALSE);
383 r.setOriginAndSize( x, y-GRAPHIC_FUDGE, buttonRect.getWidth(), buttonRect.getHeight()); 396 }
384 childSetRect( "status_voice", r ); 397 else
385 x += buttonRect.getWidth(); 398 {
399 if (have_voice)
400 {
401 childSetVisible("status_no_voice", FALSE);
402 }
403 else if (!have_voice)
404 {
405 childSetVisible("status_no_voice", TRUE);
406 childGetRect( "status_no_voice", buttonRect );
407 r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight());
408 childSetRect( "status_no_voice", r );
409 x += buttonRect.getWidth();
410 }
386 } 411 }
387 412
388 BOOL canBuyLand = parcel 413 BOOL canBuyLand = parcel
@@ -512,7 +537,7 @@ void LLStatusBar::refresh()
512 mTextParcelName->setText(location_name); 537 mTextParcelName->setText(location_name);
513 538
514 // Adjust region name and parcel name 539 // Adjust region name and parcel name
515 x += 4; 540 x += 8;
516 541
517 const S32 PARCEL_RIGHT = llmin(mTextTime->getRect().mLeft, mTextParcelName->getTextPixelWidth() + x + 5); 542 const S32 PARCEL_RIGHT = llmin(mTextTime->getRect().mLeft, mTextParcelName->getTextPixelWidth() + x + 5);
518 r.set(x+4, mRect.getHeight() - 2, PARCEL_RIGHT, 0); 543 r.set(x+4, mRect.getHeight() - 2, PARCEL_RIGHT, 0);
@@ -672,8 +697,7 @@ static void onClickPush(void* )
672 697
673static void onClickVoice(void* ) 698static void onClickVoice(void* )
674{ 699{
675 LLNotifyBox::showXml("VoiceAvailablity"); 700 LLNotifyBox::showXml("NoVoice");
676 //LLFirstUse::useVoice();
677} 701}
678 702
679static void onClickBuild(void*) 703static void onClickBuild(void*)
@@ -708,7 +732,7 @@ static void onClickBuyLand(void*)
708void LLStatusBar::setupDate() 732void LLStatusBar::setupDate()
709{ 733{
710 // fill the day array with what's in the xui 734 // fill the day array with what's in the xui
711 LLString day_list = childGetText("StatBarDaysOfWeek"); 735 LLString day_list = getFormattedUIString("StatBarDaysOfWeek");
712 size_t length = day_list.size(); 736 size_t length = day_list.size();
713 737
714 // quick input check 738 // quick input check
@@ -732,7 +756,7 @@ void LLStatusBar::setupDate()
732 } 756 }
733 757
734 // fill the day array with what's in the xui 758 // fill the day array with what's in the xui
735 LLString month_list = childGetText( "StatBarMonthsOfYear" ); 759 LLString month_list = getFormattedUIString( "StatBarMonthsOfYear" );
736 length = month_list.size(); 760 length = month_list.size();
737 761
738 // quick input check 762 // quick input check