소스 검색

卡牌点开升技能后返回升等级,消耗金币数量不变

zhaoyang 3 년 전
부모
커밋
00186e1e03

+ 5 - 5
FGUIProject/assets/CommonGame/components/ComCostCurrencyWithHas.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="280,42">
   <displayList>
-    <image id="n4_a713" name="n4" src="a71377" fileName="imagesExport/kp_dikuang_3.png" xy="60,3"/>
+    <image id="n4_a713" name="n4" src="a71377" fileName="imagesExport/kp_dikuang_3.png" xy="60,3" size="247,36"/>
     <text id="n2_ojlz" name="n2" xy="0,0" size="65,42" fontSize="30" color="#7d634a" autoSize="none" text="消耗"/>
     <loader id="n1_ojlz" name="loaIcon" xy="70,-9" size="60,60" url="ui://eg2y0ldpq08x3" autoSize="true"/>
-    <text id="n7_j5a5" name="txtHas" xy="142,0" size="39,39" group="n9_l4ui" fontSize="28" color="#ffffff" align="center" vAlign="middle" ubb="true" autoClearText="true" text="99"/>
-    <text id="n8_j5a5" name="txtLine" xy="181,1" size="21,39" group="n9_l4ui" fontSize="28" color="#ffffff" text="/"/>
-    <text id="n6_j5a5" name="txtNeed" xy="202,1" size="73,39" group="n9_l4ui" fontSize="28" color="#ffffff" align="center" vAlign="middle" ubb="true" autoClearText="true" text="9993"/>
-    <group id="n9_l4ui" name="n9" xy="142,0" size="133,40" advanced="true" layout="hz" excludeInvisibles="true"/>
+    <text id="n7_j5a5" name="txtHas" xy="142,0" size="91,39" group="n9_l4ui" fontSize="28" color="#ffffff" align="center" vAlign="middle" ubb="true" autoClearText="true" text="10000"/>
+    <text id="n8_j5a5" name="txtLine" xy="233,1" size="21,39" group="n9_l4ui" fontSize="28" color="#ffffff" text="/"/>
+    <text id="n6_j5a5" name="txtNeed" xy="254,1" size="56,39" group="n9_l4ui" fontSize="28" color="#ffffff" align="center" vAlign="middle" ubb="true" autoClearText="true" text="999"/>
+    <group id="n9_l4ui" name="n9" xy="142,0" size="168,40" advanced="true" layout="hz" excludeInvisibles="true"/>
   </displayList>
 </component>

+ 1 - 1
FGUIProject/assets/CommonGame/package.xml

@@ -129,7 +129,7 @@
     <image id="ih7564" name="fzd_bqbq_3.png" path="/imagesExport/" exported="true"/>
     <image id="ih7565" name="fzd_bqbq_4.png" path="/imagesExport/" exported="true"/>
     <image id="ih7561" name="fzd_bqbq_5.png" path="/imagesExport/" exported="true"/>
-    <image id="a71377" name="kp_dikuang_3.png" path="/imagesExport/" exported="true"/>
+    <image id="a71377" name="kp_dikuang_3.png" path="/imagesExport/" exported="true" scale="9grid" scale9grid="171,9,26,18"/>
     <image id="ai2z9c" name="hb_anniu_3.png" path="/imagesExport/"/>
     <image id="ai2z9d" name="hb_kuangdi_1.png" path="/imagesExport/"/>
     <image id="ai2z9e" name="hb_kuangdi_2.png" path="/imagesExport/"/>

+ 18 - 12
GameClient/Assets/Game/HotUpdate/Views/Card/CardFosterView.cs

@@ -103,8 +103,6 @@ namespace GFGGame
 
             EventAgent.AddEventListener(ConstMessage.CARD_UP_SKILL, UpdateUpSkillView);
             // EventAgent.AddEventListener(ConstMessage.ITEM_CHANGED, OnItemChangeListener);
-            _comLvConsumeGold = UI_ComCostCurrency.Proxy(_comFosterBottom.m_ComLvConsumeGold);
-            _comStarCousumeGold = UI_ComCostCurrencyWithHas.Proxy(_comFosterBottom.m_comStarCousumeGold);
 
         }
 
@@ -112,8 +110,10 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
-            _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("hc_bj_1");
+            _comLvConsumeGold = UI_ComCostCurrency.Proxy(_comFosterBottom.m_ComLvConsumeGold);
+            _comStarCousumeGold = UI_ComCostCurrencyWithHas.Proxy(_comFosterBottom.m_comStarCousumeGold);
 
+            _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("hc_bj_1");
             _cardData = CardDataManager.GetCardDataById((this.viewData as CardData).id);
 
             playAni = false;
@@ -259,20 +259,25 @@ namespace GFGGame
             if (listItem.m_btnMinus.data == null)
             {
 
-                listItem.m_btnMinus.onTouchBegin.Add(() => OnClickItemConsumsBegin(obj, 0));
-                listItem.m_btnMinus.onTouchEnd.Add(() => OnClickItemLvConsumsEnd());
+                listItem.m_btnMinus.onTouchBegin.Add(OnClickItemConsumsBegin);
+                listItem.m_btnMinus.onTouchEnd.Add(OnClickItemLvConsumsEnd);
             }
             if (listItem.m_loaBg.data == null)
             {
-                listItem.m_loaBg.onTouchBegin.Add(() => OnClickItemConsumsBegin(obj, 1));
-                listItem.m_loaBg.onTouchEnd.Add(() => OnClickItemLvConsumsEnd());
+                listItem.m_loaBg.onTouchBegin.Add(OnClickItemConsumsBegin);
+                listItem.m_loaBg.onTouchEnd.Add(OnClickItemLvConsumsEnd);
             }
-            listItem.m_btnMinus.data = index;
-            listItem.m_loaBg.data = index;
+            listItem.m_btnMinus.data = 0;
+            listItem.m_loaBg.data = 1;
             UI_ComConsume.ProxyEnd();
         }
-        private void OnClickItemConsumsBegin(GObject obj, int type)
+        private void OnClickItemConsumsBegin(EventContext context)
         {
+            // GObject obj, int type
+            GObject sender = context.sender as GObject;
+            int type = (int)sender.data;
+            GObject obj = sender.parent;
+
             UI_ComConsume listItem = UI_ComConsume.Proxy(obj);
             int index = (int)listItem.target.data;
             int itemId = upgradeCardItemsArr[index];
@@ -749,6 +754,7 @@ namespace GFGGame
 
         private void OnChangeCtrlTab()
         {
+            _comLvConsumeGold = UI_ComCostCurrency.Proxy(_comFosterBottom.m_ComLvConsumeGold);
             this.UpdateCommon();
             if (_comFosterBottom.m_ctrlTab.selectedIndex == 0)
             {
@@ -790,8 +796,8 @@ namespace GFGGame
             EventAgent.RemoveEventListener(ConstMessage.NUMERIC_CHANGE, UpdateUpStarView);
             EventAgent.RemoveEventListener(ConstMessage.ITEM_CHANGED, OnItemChangeListener);
             Timers.inst.Remove(OnTimedEvent);
-
-            //_timer.Stop();
+            UI_ComCostCurrency.ProxyEnd();
+            UI_ComCostCurrencyWithHas.ProxyEnd();
             _comFosterBottom.m_listLvConsume.numItems = 0;
         }
         protected override void UpdateToCheckGuide(object param)

+ 2 - 0
GameClient/Assets/Game/HotUpdate/Views/Card/CardSkillView.cs

@@ -65,6 +65,8 @@ namespace GFGGame
             }
             UI_ComCostCurrency costCurrency = UI_ComCostCurrency.Proxy(_ui.m_comConsume);
             costCurrency.m_txtNeed.text = skillLvCfg.costNum.ToString();
+            UI_ComCostCurrency.ProxyEnd();
+
             UpdateComLv(_ui.m_comNextLv, skillLv + 1, "下一级");
             _ui.m_listConsume.numItems = skillLvCfg.materiarsArr.Length;
 

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Views/ClothingFoster/SuitFosterView.cs

@@ -60,6 +60,7 @@ namespace GFGGame
         protected override void OnHide()
         {
             base.OnHide();
+            UI_ComCostCurrency.ProxyEnd();
         }
 
         private void ListMaterialItemRender(int index, GObject obj)

+ 2 - 0
GameClient/Assets/Game/HotUpdate/Views/ClothingFoster/SuitView.cs

@@ -99,6 +99,8 @@ namespace GFGGame
         protected override void OnHide()
         {
             base.OnHide();
+            UI_ComCostCurrency.ProxyEnd();
+
         }
 
         private void OnClickBtnBack()

+ 3 - 3
GameClient/Assets/Game/HotUpdate/Views/ViewManager.cs

@@ -124,7 +124,6 @@ namespace GFGGame
                 if (!view.isShowing)
                 {
                     view.Show();
-                    Debug.Log("��ǰ�򿪣�" + name);
                 }
                 else
                 {
@@ -141,7 +140,8 @@ namespace GFGGame
                 {
                     _goBackDatas[name] = goBackParams;
                 }
-                // else 
+                Debug.Log("当前打开" + name);
+
             }
 
         }
@@ -193,7 +193,6 @@ namespace GFGGame
                 if (!view.isShowing)
                 {
                     view.Show();
-                    //Debug.Log("当前打开:" + name);
                 }
                 else
                 {
@@ -210,6 +209,7 @@ namespace GFGGame
                         _goBackDatas.Remove(name);
                     }
                 }
+                Debug.Log("当前打开:" + name);
             }
             return true;
         }