فهرست منبع

圣兵铭文羁绊

zouweichen 3 روز پیش
والد
کامیت
af5a36b261

BIN
Assets/Res/Addressable/FGUI/Partner/Partner_fui.bytes


+ 5 - 0
Assets/Scripts/Business/Runtime/FGUI/Partner/BookAttrTextItem/PartnerBookAttrTextItemCtrl.cs

@@ -5,6 +5,7 @@
 /// created by cb 2024
 
 using FairyGUI;
+using XGame.Database;
 using XGame.Framework.UI;
 
 namespace FL.FGUI
@@ -34,5 +35,9 @@ namespace FL.FGUI
         }
 
         #endregion
+        public void OnRefresh(int index, int id)
+        {
+
+        }
     }
 }

+ 1 - 2
Assets/Scripts/Business/Runtime/FGUI/Partner/BookAttrTextItem/PartnerBookAttrTextItemView.ListItem.cs

@@ -14,8 +14,7 @@ namespace FL.FGUI
         void IGListItemHandle.OnRefresh(int index, object data)
         {
             ItemIndex = index;
-            //Ctrl.OnRefresh(index, data as GListData);
-            throw new System.NotImplementedException("业务需要实现: PartnerBookAttrTextItemViewCtrl.OnRefresh()");
+            Ctrl.OnRefresh(index, (int)data);
         }
     }
 }

+ 28 - 13
Assets/Scripts/Business/Runtime/FGUI/Partner/BookDetailListItem/PartnerBookDetailListItemCtrl.cs

@@ -4,7 +4,9 @@
 /// 该脚本由模板创建
 /// created by cb 2024
 
+using System.Collections.Generic;
 using FairyGUI;
+using FL.Data.Items;
 using XGame.Database;
 using XGame.Framework.UI;
 
@@ -20,36 +22,49 @@ namespace FL.FGUI
         {
             AddUIListenres();
         }
+
         protected override void OnDisable()
         {
             RemoveUIListenres();
         }
+
         #region UI事件
         private void AddUIListenres()
         {
             VM.GotoBtn.onClick.Add(OnClickGotoBtn);
             VM.GetBtn.onClick.Add(OnClickGetBtn);
-
         }
+
         private void RemoveUIListenres()
         {
             VM.GotoBtn.onClick.Remove(OnClickGotoBtn);
             VM.GetBtn.onClick.Remove(OnClickGetBtn);
-
-        }
-        private void OnClickGotoBtn(EventContext context)
-        {
-        }
-        private void OnClickGetBtn(EventContext context)
-        {
         }
 
+        private void OnClickGotoBtn(EventContext context) { }
+
+        private void OnClickGetBtn(EventContext context) { }
+
         #endregion
 
-        public void OnRefresh(int index, collect_rewardTable table)
-        {
-            VM.DescLabel.text = table.Name;
-
+        public void OnRefresh(int index, collect_rewardTable table)
+        {
+            VM.DescLabel.text = table.Name;
+            var item = new ItemBase();
+            item.Init(table.Reward[0], table.Reward[1]);
+            VM.ItemBtn.Ctrl.ShowUI(item);
+            var list = new List<PartnerBookTextParam>();
+            for (int i = 0; i < table.Attribute.Length; i += 2)
+            {
+                list.Add(
+                    new PartnerBookTextParam()
+                    {
+                        attrId = table.Attribute[i],
+                        val = table.Attribute[i + 1],
+                    }
+                );
+            }
+            VM.List.BindDatas(list);
         }
     }
-}
+}

+ 19 - 8
Assets/Scripts/Business/Runtime/FGUI/Partner/BookTextItem/PartnerBookTextItemCtrl.cs

@@ -5,6 +5,7 @@
 /// created by cb 2024
 
 using FairyGUI;
+using XGame.Database;
 using XGame.Framework.UI;
 
 namespace FL.FGUI
@@ -19,20 +20,30 @@ namespace FL.FGUI
         {
             AddUIListenres();
         }
+
         protected override void OnDisable()
         {
             RemoveUIListenres();
         }
-        #region UI事件
-        private void AddUIListenres()
-        {
 
-        }
-        private void RemoveUIListenres()
-        {
+        #region UI事件
+        private void AddUIListenres() { }
 
-        }
+        private void RemoveUIListenres() { }
 
         #endregion
+        public void OnRefresh(int index, PartnerBookTextParam param)
+        {
+            var attr = AttrDescTableRepo.Get(param.attrId);
+            XGame.Framework.Assert.IsNotNull(attr);
+            if (attr.Num_type > 0)
+            {
+                VM.TitleLabel.text = $"{attr.ShowName}+{param.val / 100}%";
+            }
+            else
+            {
+                VM.TitleLabel.text = $"{attr.ShowName}+{param.val}";
+            }
+        }
     }
-}
+}

+ 6 - 2
Assets/Scripts/Business/Runtime/FGUI/Partner/BookTextItem/PartnerBookTextItemView.ListItem.cs

@@ -14,8 +14,12 @@ namespace FL.FGUI
         void IGListItemHandle.OnRefresh(int index, object data)
         {
             ItemIndex = index;
-            //Ctrl.OnRefresh(index, data as GListData);
-            throw new System.NotImplementedException("业务需要实现: PartnerBookTextItemViewCtrl.OnRefresh()");
+            Ctrl.OnRefresh(index, data as PartnerBookTextParam);
         }
     }
+    public class PartnerBookTextParam
+    {
+        public int attrId;
+        public int val;
+    }
 }

+ 3 - 3
fl-fgui-project/assets/Partner/Book/item/BookDetailListItem.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="715,144" designImage="ui://2981jnh7kzs94q" designImageOffsetX="-58" designImageOffsetY="-488" designImageLayer="1">
-  <controller name="State" pages="0,,1,,2," selected="0">
+  <controller name="State" pages="0,,1,,2," selected="1">
     <remark page="0" value="未完成"/>
     <remark page="1" value="可领取"/>
     <remark page="2" value="已领取"/>
@@ -8,7 +8,7 @@
   <displayList>
     <image id="n57_kzs9" name="n57" src="kzs94x" fileName="Book/img/list01.png" xy="0,0" size="694,144"/>
     <image id="n58_kzs9" name="n58" src="kzs94y" fileName="Book/img/list02.png" xy="0,0" size="540,53"/>
-    <component id="n68_ifoa" name="ItemBtn" src="me3q0" fileName="ItemBase.xml" pkg="gt6q23qw" xy="14,17" scale="1.1,1.1"/>
+    <component id="n68_ifoa" name="ItemBtn" src="me3q0" fileName="ItemBase.xml" pkg="gt6q23qw" xy="13,16" scale="0.75,0.75"/>
     <image id="n67_ifoa" name="n67" src="ifoa59" fileName="Book/img/gou.png" xy="554,28">
       <gearDisplay controller="State" pages="2"/>
     </image>
@@ -21,7 +21,7 @@
       <Button title="可领取"/>
     </component>
     <text id="n61_kzs9" name="DescLabel" xy="131,16" size="320,36" fontSize="26" color="#2b2c31" align="center" ubb="true" autoClearText="true" text="羁绊内圣兵总星级达到[color=#1ef369]29[/color]星"/>
-    <list id="n63_kzs9" name="List" xy="132,60" size="376,71" defaultItem="ui://2981jnh7kzs950" autoClearItems="true">
+    <list id="n63_kzs9" name="List" xy="132,60" size="376,71" defaultItem="ui://2981jnh7kzs950" autoClearItems="true" scrollItemToViewOnClick="false">
       <item/>
       <item/>
     </list>