From 28633bd159b072a0bc0ecfbb62b9f9d9c4cbe246 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Thu, 16 Jan 2020 14:45:26 +0000
Subject: [PATCH] SL-12569 - Fixed more places where texture upload cost was
 hardcoded in UI

---
 indra/newview/lloutfitgallery.cpp                             | 1 +
 indra/newview/lloutfitslist.cpp                               | 2 ++
 indra/newview/llpanelsnapshot.cpp                             | 3 +++
 .../newview/skins/default/xui/en/menu_gallery_outfit_tab.xml  | 2 +-
 indra/newview/skins/default/xui/en/menu_outfit_gear.xml       | 2 +-
 .../skins/default/xui/en/panel_outfit_snapshot_inventory.xml  | 4 ++--
 6 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp
index 6c3d385811e..53416036c95 100644
--- a/indra/newview/lloutfitgallery.cpp
+++ b/indra/newview/lloutfitgallery.cpp
@@ -910,6 +910,7 @@ bool LLOutfitGalleryContextMenu::onEnable(LLSD::String param)
 
 bool LLOutfitGalleryContextMenu::onVisible(LLSD::String param)
 {
+	mMenuHandle.get()->getChild<LLUICtrl>("upload_photo")->setLabelArg("[UPLOAD_COST]", std::to_string(LLAgentBenefitsMgr::current().getTextureUploadCost()));
     if ("remove_photo" == param)
     {
         LLOutfitGallery* gallery = dynamic_cast<LLOutfitGallery*>(mOutfitList);
diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp
index f2a284a5618..71ab826e1cf 100644
--- a/indra/newview/lloutfitslist.cpp
+++ b/indra/newview/lloutfitslist.cpp
@@ -35,6 +35,7 @@
 #include "llaccordionctrltab.h"
 #include "llagentwearables.h"
 #include "llappearancemgr.h"
+#include "llagentbenefits.h"
 #include "llfloatersidepanelcontainer.h"
 #include "llinventoryfunctions.h"
 #include "llinventorymodel.h"
@@ -1235,6 +1236,7 @@ bool LLOutfitListGearMenuBase::onEnable(LLSD::String param)
 
 bool LLOutfitListGearMenuBase::onVisible(LLSD::String param)
 {
+	getMenu()->getChild<LLUICtrl>("upload_photo")->setLabelArg("[UPLOAD_COST]", std::to_string(LLAgentBenefitsMgr::current().getTextureUploadCost()));
     const LLUUID& selected_outfit_id = getSelectedOutfitID();
     if (selected_outfit_id.isNull()) // no selection or invalid outfit selected
     {
diff --git a/indra/newview/llpanelsnapshot.cpp b/indra/newview/llpanelsnapshot.cpp
index a17e3f9e78a..c3524a8c879 100644
--- a/indra/newview/llpanelsnapshot.cpp
+++ b/indra/newview/llpanelsnapshot.cpp
@@ -39,6 +39,8 @@
 #include "llsidetraypanelcontainer.h"
 #include "llviewercontrol.h" // gSavedSettings
 
+#include "llagentbenefits.h"
+
 const S32 MAX_TEXTURE_SIZE = 512 ; //max upload texture size 512 * 512
 
 S32 power_of_two(S32 sz, S32 upper)
@@ -59,6 +61,7 @@ LLPanelSnapshot::LLPanelSnapshot()
 // virtual
 BOOL LLPanelSnapshot::postBuild()
 {
+	getChild<LLUICtrl>("save_btn")->setLabelArg("[UPLOAD_COST]", std::to_string(LLAgentBenefitsMgr::current().getTextureUploadCost()));
 	getChild<LLUICtrl>(getImageSizeComboName())->setCommitCallback(boost::bind(&LLPanelSnapshot::onResolutionComboCommit, this, _1));
     if (!getWidthSpinnerName().empty())
     {
diff --git a/indra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml b/indra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml
index 1b08767edc1..99ca910062c 100755
--- a/indra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml
+++ b/indra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml
@@ -42,7 +42,7 @@
         parameter="take_off" />
     </menu_item_call>
     <menu_item_call
-        label="Upload Photo (L$10)"
+        label="Upload Photo (L$[UPLOAD_COST])"
         layout="topleft"
         name="upload_photo">
         <on_click
diff --git a/indra/newview/skins/default/xui/en/menu_outfit_gear.xml b/indra/newview/skins/default/xui/en/menu_outfit_gear.xml
index 61cb74f2304..32d9d28434a 100644
--- a/indra/newview/skins/default/xui/en/menu_outfit_gear.xml
+++ b/indra/newview/skins/default/xui/en/menu_outfit_gear.xml
@@ -40,7 +40,7 @@
          parameter="take_off" />
     </menu_item_call>
     <menu_item_call
-     label="Upload Photo (L$10)"
+     label="Upload Photo (L$[UPLOAD_COST])"
      layout="topleft"
      name="upload_photo">
         <on_click
diff --git a/indra/newview/skins/default/xui/en/panel_outfit_snapshot_inventory.xml b/indra/newview/skins/default/xui/en/panel_outfit_snapshot_inventory.xml
index 800faabc2ab..ace0ee01e2b 100644
--- a/indra/newview/skins/default/xui/en/panel_outfit_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_outfit_snapshot_inventory.xml
@@ -67,7 +67,7 @@
     <button
      follows="left|bottom"
      height="23"
-     label="UPLOAD L$10"
+     label="UPLOAD L$[UPLOAD_COST]"
      layout="topleft"
      left="10"
      name="save_btn"
@@ -76,4 +76,4 @@
       <button.commit_callback
        function="Inventory.SaveOutfitPhoto" />
     </button>
-</panel>
\ No newline at end of file
+</panel>
-- 
GitLab