Przeglądaj źródła

套装养护添加卡牌星级限制

zhaoyang 2 lat temu
rodzic
commit
f8e5a07f0e

+ 18 - 11
FGUIProject/assets/ClothingFoster/ClothingFosterUI.xml

@@ -1,26 +1,33 @@
 <?xml version="1.0" encoding="utf-8"?>
-<component size="962,998">
+<component size="962,940">
   <displayList>
-    <component id="n11_bd1c" name="n11" src="si5ztih" fileName="components/ComBg.xml" pkg="mk0fwx0x" xy="0,0" size="962,998"/>
-    <text id="n12_bd1c" name="n12" xy="335,50" size="292,64" fontSize="48" color="#9b7853" text="属性提高比例"/>
-    <image id="n13_bd1c" name="n13" src="ehs99" fileName="images/yx_xiant_1.png" pkg="eg2y0ldp" xy="57,120"/>
-    <text id="n1_py5g" name="txtDiscribe" xy="80,179" size="254,56" fontSize="42" color="#9b7853" text="完成套装浆洗"/>
-    <list id="n4_py5g" name="listPropertyAdd" xy="17,287" size="927,126" layout="row" colGap="35" defaultItem="ui://uicwtr5bpy5gt" align="center">
+    <component id="n11_bd1c" name="n11" src="si5ztih" fileName="components/ComBg.xml" pkg="mk0fwx0x" xy="0,0" size="962,940">
+      <relation target="n15_t9yr" sidePair="height-height"/>
+    </component>
+    <text id="n12_bd1c" name="n12" xy="335,46" size="292,64" group="n16_t9yr" fontSize="48" color="#9b7853" text="属性提高比例"/>
+    <image id="n13_bd1c" name="n13" src="ehs99" fileName="images/yx_xiant_1.png" pkg="eg2y0ldp" xy="57,124" group="n16_t9yr"/>
+    <text id="n1_py5g" name="txtDiscribe" xy="80,148" size="254,56" group="n16_t9yr" fontSize="42" color="#9b7853" text="完成套装浆洗"/>
+    <group id="n16_t9yr" name="n16" xy="57,46" size="848,158" group="n15_t9yr" advanced="true" layout="vt" lineGap="14" excludeInvisibles="true"/>
+    <list id="n4_py5g" name="listPropertyAdd" xy="17,244" size="927,126" group="n17_t9yr" layout="row" colGap="35" defaultItem="ui://uicwtr5bpy5gt" align="center">
       <item/>
       <item/>
       <item/>
       <item/>
     </list>
-    <list id="n8_py5g" name="listMaterials" xy="70,491" size="821,289" layout="row" colGap="32" defaultItem="ui://uicwtr5bpy5gu" align="center">
+    <list id="n8_py5g" name="listMaterials" xy="70,402" size="821,198" group="n17_t9yr" layout="row" colGap="32" defaultItem="ui://uicwtr5bpy5gu" align="center">
       <item/>
       <item/>
       <item/>
     </list>
-    <component id="n9_py5g" name="btnFoster" src="wonody" fileName="components/Button19.xml" pkg="mk0fwx0x" xy="309,849">
-      <Button title="确定"/>
-    </component>
-    <component id="n10_j5a5" name="ComConsume" src="n3xha1" fileName="components/ComCostCurrency.xml" pkg="eg2y0ldp" xy="424,778" pivot="0.5,0">
+    <component id="n10_j5a5" name="ComConsume" src="n3xha1" fileName="components/ComCostCurrency.xml" pkg="eg2y0ldp" xy="424,632" pivot="0.5,0" group="n17_t9yr">
       <relation target="" sidePair="center-center"/>
     </component>
+    <text id="n14_t9yr" name="txtLock" xy="354,710" pivot="0.5,0" size="254,56" group="n17_t9yr" fontSize="42" color="#9b7853" align="center" autoClearText="true" text="完成套装浆洗"/>
+    <component id="n9_py5g" name="btnFoster" src="wonody" fileName="components/Button19.xml" pkg="mk0fwx0x" xy="309,798" group="n17_t9yr">
+      <Button title="确定"/>
+    </component>
+    <group id="n17_t9yr" name="n17" xy="17,244" size="927,651" group="n15_t9yr" advanced="true" layout="vt" lineGap="32" excludeInvisibles="true"/>
+    <group id="n15_t9yr" name="n15" xy="17,46" size="927,849" advanced="true" layout="vt" lineGap="40" excludeInvisibles="true"/>
   </displayList>
+  <relation target="n11_bd1c" sidePair="height-height"/>
 </component>

+ 6 - 3
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/ClothingFoster/UI_ClothingFosterUI.cs

@@ -10,8 +10,9 @@ namespace UI.ClothingFoster
         public GTextField m_txtDiscribe;
         public GList m_listPropertyAdd;
         public GList m_listMaterials;
-        public GButton m_btnFoster;
         public GComponent m_ComConsume;
+        public GTextField m_txtLock;
+        public GButton m_btnFoster;
         public const string URL = "ui://uicwtr5bpy5gp";
         public const string PACKAGE_NAME = "ClothingFoster";
         public const string RES_NAME = "ClothingFosterUI";
@@ -62,16 +63,18 @@ namespace UI.ClothingFoster
             m_txtDiscribe = (GTextField)comp.GetChild("txtDiscribe");
             m_listPropertyAdd = (GList)comp.GetChild("listPropertyAdd");
             m_listMaterials = (GList)comp.GetChild("listMaterials");
-            m_btnFoster = (GButton)comp.GetChild("btnFoster");
             m_ComConsume = (GComponent)comp.GetChild("ComConsume");
+            m_txtLock = (GTextField)comp.GetChild("txtLock");
+            m_btnFoster = (GButton)comp.GetChild("btnFoster");
         }
         public void Dispose(bool disposeTarget = false)
         {
             m_txtDiscribe = null;
             m_listPropertyAdd = null;
             m_listMaterials = null;
-            m_btnFoster = null;
             m_ComConsume = null;
+            m_txtLock = null;
+            m_btnFoster = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 18 - 4
GameClient/Assets/Game/HotUpdate/Views/ClothingFoster/ClothingFosterView.cs

@@ -58,12 +58,12 @@ namespace GFGGame
             _canFoster = true;
 
             cfg = SuitFosterCfgArray.Instance.GetCfgsBysuitId(_suitId)[_index];
+            ItemCfg cardItemCfg = ItemCfgArray.Instance.GetCfgBysuitId(cfg.suitId);
+            _ui.m_txtLock.text = cardItemCfg == null || cfg.cardStar == 0 ? "" : string.Format("卡牌【{0}】达到{1}星可养护", cardItemCfg.name, cfg.cardStar);
+            _ui.m_txtLock.visible = cardItemCfg != null && cfg.cardStar > 0;
             _ui.m_listMaterials.numItems = cfg.materialsArr.Length;
             long has = ItemDataManager.GetItemNum(cfg.costId);
             int need = cfg.costNum;
-            // UI_ComCostCurrency comConsume = UI_ComCostCurrency.Proxy(_ui.m_ComConsume);
-            // comConsume.m_txtNeed.text = need.ToString();
-            // UI_ComCostCurrency.ProxyEnd();
             ItemUtil.UpdateItemNeedNum(_ui.m_ComConsume, cfg.costId, cfg.costNum);
             if (_canFoster && has < need) _canFoster = false;
 
@@ -120,7 +120,21 @@ namespace GFGGame
         }
         private async void OnClickBtnFoster()
         {
-            SuitFosterCfg cfg = SuitFosterCfgArray.Instance.GetCfgsBysuitId(_suitId)[_index];
+            ItemCfg cardItemCfg = ItemCfgArray.Instance.GetCfgBysuitId(cfg.suitId);
+            if (cfg.cardStar > 0)
+            {
+                CardData cardData = CardDataManager.GetCardDataById(cardItemCfg.id);
+                if (cardData == null)
+                {
+                    PromptController.Instance.ShowFloatTextPrompt(string.Format("暂未获得卡牌【{0}】", cardItemCfg.name));
+                    return;
+                }
+                if (cardData.star < cfg.cardStar)
+                {
+                    PromptController.Instance.ShowFloatTextPrompt(string.Format("卡牌【{0}】星级不足", cardItemCfg.name));
+                    return;
+                }
+            }
 
             if (!ItemUtil.CheckItemEnough(cfg.costId, cfg.costNum))
             {

BIN
GameClient/Assets/ResIn/UI/ClothingFoster/ClothingFoster_fui.bytes