diff options
author | McCabe Maxsted | 2010-04-26 20:06:23 -0700 |
---|---|---|
committer | McCabe Maxsted | 2010-04-26 20:06:23 -0700 |
commit | e563e2c2cc66fa9f3b47c4814d70f9800d957026 (patch) | |
tree | a2a9ca5bfeaf747b76b744f007da061ad15110c2 /linden/indra/newview/llgivemoney.cpp | |
parent | Merge commit 'jacek/next' into next (diff) | |
download | meta-impy-e563e2c2cc66fa9f3b47c4814d70f9800d957026.zip meta-impy-e563e2c2cc66fa9f3b47c4814d70f9800d957026.tar.gz meta-impy-e563e2c2cc66fa9f3b47c4814d70f9800d957026.tar.bz2 meta-impy-e563e2c2cc66fa9f3b47c4814d70f9800d957026.tar.xz |
Ported currency changes from Hippo (#237) and fixed some labels Hippo missed (also fixed #200 in the process)
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llgivemoney.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/linden/indra/newview/llgivemoney.cpp b/linden/indra/newview/llgivemoney.cpp index 423357d..6c69334 100644 --- a/linden/indra/newview/llgivemoney.cpp +++ b/linden/indra/newview/llgivemoney.cpp | |||
@@ -52,6 +52,8 @@ | |||
52 | #include "lltransactiontypes.h" | 52 | #include "lltransactiontypes.h" |
53 | #include "lluictrlfactory.h" | 53 | #include "lluictrlfactory.h" |
54 | 54 | ||
55 | #include "hippoGridManager.h" | ||
56 | |||
55 | ///---------------------------------------------------------------------------- | 57 | ///---------------------------------------------------------------------------- |
56 | /// Local function declarations, constants, enums, and typedefs | 58 | /// Local function declarations, constants, enums, and typedefs |
57 | ///---------------------------------------------------------------------------- | 59 | ///---------------------------------------------------------------------------- |
@@ -111,6 +113,7 @@ LLFloaterPay::LLFloaterPay(const std::string& name, | |||
111 | 113 | ||
112 | childSetAction("fastpay 1",&LLFloaterPay::onGive,info); | 114 | childSetAction("fastpay 1",&LLFloaterPay::onGive,info); |
113 | childSetVisible("fastpay 1", FALSE); | 115 | childSetVisible("fastpay 1", FALSE); |
116 | childSetLabelArg("fastpay 1", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); | ||
114 | 117 | ||
115 | mQuickPayButton[i] = getChild<LLButton>("fastpay 1"); | 118 | mQuickPayButton[i] = getChild<LLButton>("fastpay 1"); |
116 | mQuickPayInfo[i] = info; | 119 | mQuickPayInfo[i] = info; |
@@ -121,6 +124,7 @@ LLFloaterPay::LLFloaterPay(const std::string& name, | |||
121 | 124 | ||
122 | childSetAction("fastpay 5",&LLFloaterPay::onGive,info); | 125 | childSetAction("fastpay 5",&LLFloaterPay::onGive,info); |
123 | childSetVisible("fastpay 5", FALSE); | 126 | childSetVisible("fastpay 5", FALSE); |
127 | childSetLabelArg("fastpay 5", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); | ||
124 | 128 | ||
125 | mQuickPayButton[i] = getChild<LLButton>("fastpay 5"); | 129 | mQuickPayButton[i] = getChild<LLButton>("fastpay 5"); |
126 | mQuickPayInfo[i] = info; | 130 | mQuickPayInfo[i] = info; |
@@ -131,6 +135,7 @@ LLFloaterPay::LLFloaterPay(const std::string& name, | |||
131 | 135 | ||
132 | childSetAction("fastpay 10",&LLFloaterPay::onGive,info); | 136 | childSetAction("fastpay 10",&LLFloaterPay::onGive,info); |
133 | childSetVisible("fastpay 10", FALSE); | 137 | childSetVisible("fastpay 10", FALSE); |
138 | childSetLabelArg("fastpay 10", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); | ||
134 | 139 | ||
135 | mQuickPayButton[i] = getChild<LLButton>("fastpay 10"); | 140 | mQuickPayButton[i] = getChild<LLButton>("fastpay 10"); |
136 | mQuickPayInfo[i] = info; | 141 | mQuickPayInfo[i] = info; |
@@ -141,6 +146,7 @@ LLFloaterPay::LLFloaterPay(const std::string& name, | |||
141 | 146 | ||
142 | childSetAction("fastpay 20",&LLFloaterPay::onGive,info); | 147 | childSetAction("fastpay 20",&LLFloaterPay::onGive,info); |
143 | childSetVisible("fastpay 20", FALSE); | 148 | childSetVisible("fastpay 20", FALSE); |
149 | childSetLabelArg("fastpay 20", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); | ||
144 | 150 | ||
145 | mQuickPayButton[i] = getChild<LLButton>("fastpay 20"); | 151 | mQuickPayButton[i] = getChild<LLButton>("fastpay 20"); |
146 | mQuickPayInfo[i] = info; | 152 | mQuickPayInfo[i] = info; |
@@ -149,7 +155,7 @@ LLFloaterPay::LLFloaterPay(const std::string& name, | |||
149 | 155 | ||
150 | childSetVisible("amount text", FALSE); | 156 | childSetVisible("amount text", FALSE); |
151 | childSetVisible("currency text", FALSE); | 157 | childSetVisible("currency text", FALSE); |
152 | 158 | childSetTextArg("currency text", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); | |
153 | 159 | ||
154 | std::string last_amount; | 160 | std::string last_amount; |
155 | if(sLastAmount > 0) | 161 | if(sLastAmount > 0) |
@@ -246,7 +252,7 @@ void LLFloaterPay::processPayPriceReply(LLMessageSystem* msg, void **userdata) | |||
246 | msg->getS32Fast(_PREHASH_ButtonData,_PREHASH_PayButton,pay_button,i); | 252 | msg->getS32Fast(_PREHASH_ButtonData,_PREHASH_PayButton,pay_button,i); |
247 | if (pay_button > 0) | 253 | if (pay_button > 0) |
248 | { | 254 | { |
249 | std::string button_str = "L$"; | 255 | std::string button_str = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); |
250 | button_str += LLResMgr::getInstance()->getMonetaryString( pay_button ); | 256 | button_str += LLResMgr::getInstance()->getMonetaryString( pay_button ); |
251 | 257 | ||
252 | self->mQuickPayButton[i]->setLabelSelected(button_str); | 258 | self->mQuickPayButton[i]->setLabelSelected(button_str); |
@@ -267,7 +273,7 @@ void LLFloaterPay::processPayPriceReply(LLMessageSystem* msg, void **userdata) | |||
267 | } | 273 | } |
268 | 274 | ||
269 | // build a string containing the maximum value and calc nerw button width from it. | 275 | // build a string containing the maximum value and calc nerw button width from it. |
270 | std::string balance_str = "L$"; | 276 | std::string balance_str = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); |
271 | balance_str += LLResMgr::getInstance()->getMonetaryString( max_pay_amount ); | 277 | balance_str += LLResMgr::getInstance()->getMonetaryString( max_pay_amount ); |
272 | const LLFontGL* font = LLResMgr::getInstance()->getRes(LLFONT_SANSSERIF); | 278 | const LLFontGL* font = LLResMgr::getInstance()->getRes(LLFONT_SANSSERIF); |
273 | S32 new_button_width = font->getWidth( std::string(balance_str)); | 279 | S32 new_button_width = font->getWidth( std::string(balance_str)); |
@@ -329,7 +335,9 @@ void LLFloaterPay::payViaObject(money_callback callback, const LLUUID& object_id | |||
329 | LLViewerObject* object = gObjectList.findObject(object_id); | 335 | LLViewerObject* object = gObjectList.findObject(object_id); |
330 | if (!object) return; | 336 | if (!object) return; |
331 | 337 | ||
332 | LLFloaterPay *floater = new LLFloaterPay("Give L$", callback, object_id, TRUE); | 338 | LLFloaterPay *floater = new LLFloaterPay( |
339 | "Give " + gHippoGridManager->getConnectedGrid()->getCurrencySymbol(), | ||
340 | callback, object_id, TRUE); | ||
333 | if (!floater) return; | 341 | if (!floater) return; |
334 | 342 | ||
335 | LLSelectNode* node = floater->mObjectSelection->getFirstRootNode(); | 343 | LLSelectNode* node = floater->mObjectSelection->getFirstRootNode(); |
@@ -362,7 +370,9 @@ void LLFloaterPay::payDirectly(money_callback callback, | |||
362 | const LLUUID& target_id, | 370 | const LLUUID& target_id, |
363 | BOOL is_group) | 371 | BOOL is_group) |
364 | { | 372 | { |
365 | LLFloaterPay *floater = new LLFloaterPay("Give L$", callback, target_id, FALSE); | 373 | LLFloaterPay *floater = new LLFloaterPay( |
374 | "Give " + gHippoGridManager->getConnectedGrid()->getCurrencySymbol(), | ||
375 | callback, target_id, FALSE); | ||
366 | if (!floater) return; | 376 | if (!floater) return; |
367 | 377 | ||
368 | floater->childSetVisible("amount", TRUE); | 378 | floater->childSetVisible("amount", TRUE); |