Parcourir la source

商店valueBar

zhaoyang il y a 2 ans
Parent
commit
2a77a04104

+ 3 - 2
FGUIProject/assets/CommonGame/ItemExchangeUI.xml

@@ -32,8 +32,9 @@
     <text id="n22_si5z" name="txtCostCount" xy="343,624" pivot="0.5,0" size="43,54" group="n19_si5z" fontSize="40" color="#816e57" text="50"/>
     <group id="n19_si5z" name="n19" xy="175,616" size="612,70" group="n34_l500"/>
     <text id="n24_si5z" name="txtTips" xy="319,706" pivot="0.5,0" size="323,51" group="n26_si5z" fontSize="38" color="#8e7c6b" align="center" text="是否使用1个道具?"/>
-    <component id="n25_si5z" name="comCost" src="n3xha1" fileName="components/ComCostCurrency.xml" xy="416,797" pivot="0.5,0" group="n26_si5z" controller="c1,0"/>
-    <group id="n26_si5z" name="n26" xy="318,706" size="326,137" group="n34_l500" advanced="true" layout="vt" lineGap="40" excludeInvisibles="true"/>
+    <component id="n25_si5z" name="comCost" src="n3xha1" fileName="components/ComCostCurrency.xml" xy="416,797" pivot="0.5,0" group="n26_si5z" scale="1.2,1.2" visible="false" controller="c1,1"/>
+    <text id="n36_l500" name="txtRmbCost" xy="450,787" pivot="0.5,0" size="62,54" group="n26_si5z" fontSize="40" color="#716b59" align="center" text="999"/>
+    <group id="n26_si5z" name="n26" xy="319,706" size="323,135" group="n34_l500" advanced="true" layout="vt" lineGap="30" excludeInvisibles="true"/>
     <component id="n14_si5z" name="btnCancle" src="si5ztim" fileName="components/Button1.xml" xy="124,863" group="n20_si5z">
       <Button icon="ui://eg2y0ldps5s9tim"/>
     </component>

+ 3 - 3
FGUIProject/assets/CommonGame/components/ComponentValueBar.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="1080,70" opaque="false">
-  <controller name="c1" exported="true" pages="0,,1,,3,,4,,5,,6,,7,,8,,9,,10,,12,,13,,14," selected="11">
+  <controller name="c1" exported="true" pages="0,,1,,3,,4,,5,,6,,7,,8,,9,,10,,12,,13,,14," selected="12">
     <remark page="0" value="体力金币马蹄珍珠"/>
     <remark page="1" value="体力金币马蹄"/>
     <remark page="2" value="抽卡兑换"/>
@@ -66,12 +66,12 @@
       <gearXY controller="c1" pages="0,1,3,5,6,8,10,12" values="814,0|814,2|1207,5|814,0|814,2|688,5|814,0|814,0" default="688,5"/>
       <Button title="100" icon="ui://eg2y0ldpkztethq"/>
     </component>
-    <component id="n50_pvb4" name="btnLeagueContribuation" src="r9gf5z" fileName="components/ButtonInValueBar.xml" xy="814,1">
+    <component id="n50_pvb4" name="btnLeagueContribuation" src="r9gf5z" fileName="components/ButtonInValueBar.xml" xy="688,5">
       <gearDisplay controller="c1" pages="13"/>
       <gearXY controller="c1" pages="0,1,3,5,6,8,10,12,13" values="814,0|814,2|1207,5|814,0|814,2|688,5|814,0|814,0|814,1" default="688,5"/>
       <Button title="100" icon="ui://eg2y0ldpkztethq"/>
     </component>
-    <list id="n51_l500" name="list" xy="24,0" size="1031,70" layout="row" overflow="scroll" colGap="30" defaultItem="ui://eg2y0ldpr9gf5z" align="right">
+    <list id="n51_l500" name="list" xy="232,0" size="821,70" layout="row" colGap="30" defaultItem="ui://eg2y0ldpr9gf5z" align="right">
       <gearDisplay controller="c1" pages="14"/>
       <item/>
       <item/>

+ 10 - 9
GameClient/Assets/Game/HotUpdate/Data/ShopViewManager.cs

@@ -126,15 +126,16 @@ namespace GFGGame
                 return;
             }
 
-            if (cfg.costType == CostType.RMB)
-            {
-                if (!AntiAddictionController.CheckAntiAddictionRecharge(cfg.price))
-                {
-                    ShopSProxy.ReqShopBuy(cfg.id, 1).Coroutine();
-                    LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.SHANG_CHENG, 2);
-                }
-            }
-            else if (cfg.costType == CostType.FREE)
+            // if (cfg.costType == CostType.RMB)
+            // {
+            //     if (!AntiAddictionController.CheckAntiAddictionRecharge(cfg.price))
+            //     {
+            //         ShopSProxy.ReqShopBuy(cfg.id, 1).Coroutine();
+            //         LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.SHANG_CHENG, 2);
+            //     }
+            // }
+            // else 
+            if (cfg.costType == CostType.FREE)
             {
                 ShopSProxy.ReqShopBuy(cfg.id, 1).Coroutine();
                 LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.SHANG_CHENG, 2);

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/CommonGame/UI_ItemExchangeUI.cs

@@ -22,6 +22,7 @@ namespace UI.CommonGame
         public GTextField m_txtCostCount;
         public GTextField m_txtTips;
         public UI_ComCostCurrency m_comCost;
+        public GTextField m_txtRmbCost;
         public GButton m_btnCancle;
         public GButton m_btnConfirm;
         public const string URL = "ui://eg2y0ldps5s9tik";
@@ -86,6 +87,7 @@ namespace UI.CommonGame
             m_txtCostCount = (GTextField)comp.GetChild("txtCostCount");
             m_txtTips = (GTextField)comp.GetChild("txtTips");
             m_comCost = (UI_ComCostCurrency)UI_ComCostCurrency.Create(comp.GetChild("comCost"));
+            m_txtRmbCost = (GTextField)comp.GetChild("txtRmbCost");
             m_btnCancle = (GButton)comp.GetChild("btnCancle");
             m_btnConfirm = (GButton)comp.GetChild("btnConfirm");
         }
@@ -110,6 +112,7 @@ namespace UI.CommonGame
             m_txtTips = null;
             m_comCost.Dispose();
             m_comCost = null;
+            m_txtRmbCost = null;
             m_btnCancle = null;
             m_btnConfirm = null;
             if(disposeTarget && target != null)

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Views/Common/Controller/ValueBarController.cs

@@ -152,6 +152,7 @@ namespace GFGGame
 
         public void UpdateList(List<int> itemIds)
         {
+            itemIds.Sort((x, y) => -x.CompareTo(y));
             if (_valueBar.m_list.data == null)
             {
                 _valueBar.m_list.itemRenderer = RenderListItem;

+ 18 - 6
GameClient/Assets/Game/HotUpdate/Views/Store/ItemExchangeView.cs

@@ -114,14 +114,26 @@ namespace GFGGame
             _ui.m_btnMinus.m_c1.selectedIndex = _buyCount == 1 ? 1 : 0;
             _ui.m_btnMinus.target.touchable = _buyCount == 1 ? false : true;
             // int hasCount = ItemDataManager.GetItemNum(cfg.itemId);
-            _ui.m_btnAdd.m_c1.selectedIndex = _buyCount == _maxCanBuy ? 1 : 0;
-            _ui.m_btnAdd.target.touchable = _buyCount == _maxCanBuy ? false : true;
-            _ui.m_btnMax.m_c1.selectedIndex = _buyCount == _maxCanBuy ? 1 : 0;
-            _ui.m_btnMax.target.touchable = _buyCount == _maxCanBuy ? false : true;
+            _ui.m_btnAdd.m_c1.selectedIndex = _shopCfg.costType == CostType.RMB || _buyCount == _maxCanBuy ? 1 : 0;
+            _ui.m_btnAdd.target.touchable = _shopCfg.costType == CostType.RMB || _buyCount == _maxCanBuy ? false : true;
+            _ui.m_btnMax.m_c1.selectedIndex = _shopCfg.costType == CostType.RMB || _buyCount == _maxCanBuy ? 1 : 0;
+            _ui.m_btnMax.target.touchable = _shopCfg.costType == CostType.RMB || _buyCount == _maxCanBuy ? false : true;
 
             _ui.m_txtShow.text = "选择购买数量";
             _ui.m_txtTips.text = string.Format("确定购买{0}个{1}?", _buyCount, itemCfg.name);
-            ItemUtil.UpdateItemNeedNum(_ui.m_comCost.target, _shopCfg.costId, (int)_buyCount * _shopCfg.price);
+            if (_shopCfg.costType == CostType.RMB)
+            {
+                _ui.m_comCost.target.visible = false;
+                _ui.m_txtRmbCost.visible = true;
+                _ui.m_txtRmbCost.text = string.Format("¥ {0}", _shopCfg.price);
+                // _ui.m_txtRmbCost.SetVar("value", _shopCfg.price.ToString()).FlushVars();
+            }
+            else
+            {
+                _ui.m_comCost.target.visible = true;
+                _ui.m_txtRmbCost.visible = false;
+                ItemUtil.UpdateItemNeedNum(_ui.m_comCost.target, _shopCfg.costId, (int)_buyCount * _shopCfg.price);
+            }
         }
 
 
@@ -153,7 +165,7 @@ namespace GFGGame
         private async void OnBtnExchangeClick()
         {
             ShopCfg cfg = ShopCfgArray.Instance.GetCfg(_goodIds);
-            if (ItemDataManager.GetItemNum(cfg.costId) < cfg.price)
+            if (cfg.costType != CostType.RMB && ItemDataManager.GetItemNum(cfg.costId) < cfg.price)
             {
                 PromptController.Instance.ShowFloatTextPrompt("道具不足");
                 return;

BIN
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_fui.bytes