From 2c77f8d61876b9d36ad63620da0bf34bcd428450 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Wed, 12 May 2010 05:24:29 -0700 Subject: Added brandable buy currency button in the status bar (#273). Effectively reverts ad408085 and 2cb8d8b5 --- linden/indra/newview/llstatusbar.cpp | 44 ++++++++-------------- .../newview/skins/default/textures/textures.xml | 2 - .../skins/default/xui/en-us/panel_status_bar.xml | 10 ++--- 3 files changed, 21 insertions(+), 35 deletions(-) (limited to 'linden') diff --git a/linden/indra/newview/llstatusbar.cpp b/linden/indra/newview/llstatusbar.cpp index bdc04d6..558cf42 100644 --- a/linden/indra/newview/llstatusbar.cpp +++ b/linden/indra/newview/llstatusbar.cpp @@ -173,22 +173,14 @@ mSquareMetersCommitted(0) childSetVisible("search_btn", gSavedSettings.getBOOL("ShowSearchBar")); childSetVisible("menubar_search_bevel_bg", gSavedSettings.getBOOL("ShowSearchBar")); + childSetAction("buycurrency", onClickBuyCurrency, this ); + childSetActionTextbox("BalanceText", onClickBalance ); childSetActionTextbox("ParcelNameText", onClickParcelInfo ); - // Disable buying currency when connected to non-SL grids. - // TODO: Check whether the grid supports buying currency. - if( gHippoGridManager->getConnectedGrid()->isSecondLife() ) - { - childSetEnabled("buycurrency", true); - childSetVisible("buycurrency", true); - childSetAction("buycurrency", onClickBuyCurrency, this ); - childSetActionTextbox("BalanceText", onClickBalance ); - } - else - { - childSetEnabled("buycurrency", false); - childSetVisible("buycurrency", false); - } + // TODO: Disable buying currency when connected to non-SL grids + // that don't support currency yet -- MC + LLButton* buybtn = getChild("buycurrency"); + buybtn->setLabelArg("[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); // Adding Net Stat Graph S32 x = getRect().getWidth() - 2; @@ -462,6 +454,9 @@ void LLStatusBar::refresh() x += buttonRect.getWidth(); } + // TODO: disable buy land button when connected to non-SL grids + // that don't support currency. + // TODO: make this brandable -- MC BOOL canBuyLand = parcel && !parcel->isPublic() && LLViewerParcelMgr::getInstance()->canAgentBuyParcel(parcel, false); @@ -632,19 +627,14 @@ void LLStatusBar::refresh() childSetRect("BalanceText", r); new_right -= r.getWidth() - 18; + childGetRect("buycurrency", r); + r.translate( new_right - r.mRight, 0); + childSetRect("buycurrency", r); + new_right -= r.getWidth() + 6; + // Don't toggle this visibility while in mouselook -- MC if (!gAgent.cameraMouselook()) { - // Hide the buy currency button in non-Second Life grids -- MC - if (gHippoGridManager->getConnectedGrid()->isSecondLife()) - { - childGetRect("buycurrency", r); - r.translate( new_right - r.mRight, 0); - childSetRect("buycurrency", r); - new_right -= r.getWidth() + 6; - } - childSetVisible("buycurrency", gHippoGridManager->getConnectedGrid()->isSecondLife()); - // Set search bar visibility childSetVisible("search_editor", search_visible); childSetVisible("search_btn", search_visible); @@ -673,10 +663,8 @@ void LLStatusBar::setVisibleForMouselook(bool visible) { mTextBalance->setVisible(visible); mTextTime->setVisible(visible); - if (gHippoGridManager->getConnectedGrid()->isSecondLife()) - { - childSetVisible("buycurrency", visible); - } + childSetVisible("buycurrency", visible); + childSetVisible("buyland", visible); childSetVisible("search_editor", visible); childSetVisible("search_btn", visible); childSetVisible("menubar_search_bevel_bg", visible); diff --git a/linden/indra/newview/skins/default/textures/textures.xml b/linden/indra/newview/skins/default/textures/textures.xml index 0a3aee7..611ad46 100644 --- a/linden/indra/newview/skins/default/textures/textures.xml +++ b/linden/indra/newview/skins/default/textures/textures.xml @@ -204,8 +204,6 @@ - - diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_status_bar.xml b/linden/indra/newview/skins/default/xui/en-us/panel_status_bar.xml index 63d2ca3..5a40a3d 100644 --- a/linden/indra/newview/skins/default/xui/en-us/panel_status_bar.xml +++ b/linden/indra/newview/skins/default/xui/en-us/panel_status_bar.xml @@ -20,12 +20,12 @@ v_pad="2" width="76"> Loading... -