Browse Source

圣兵铭文

zouweichen 1 week ago
parent
commit
7654e25ba9

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


+ 6 - 5
Assets/Scripts/Business/Runtime/FGUI/Common/ItemBase/PartnerItemBase.cs

@@ -1,24 +1,25 @@
-using XGame.Database;
+
+using XGame.Database;
 
 namespace FL.Data.Items
 {
     public class PartnerItemBase : IItemBase
     {
         private PartnerTable _table;
-        private ItemTable _itemTable;
+        //private ItemTable _itemTable;
         private PartnerAttributes _attributes;
 
         public int TableId => _table.Id;
 
-        public EQualityLevel Quality => _itemTable.Quality;
+        public EQualityLevel Quality => _table.Quality;
 
-        public string Icon => _itemTable.Icon;
+        public string Icon => _table.SkillIcon;
         public int Level => _attributes.Level;
 
         public void Init(int id)
         {
             _table = PartnerTableRepo.Get(id);
-            _itemTable = ItemTableRepo.Get(id);
+            //_itemTable = ItemTableRepo.Get(id);
             _attributes = PartnersData.Instance.GetPartnerAttrByTableId(id);
         }
     }

+ 46 - 43
Assets/Scripts/Business/Runtime/FGUI/Partner/EpiMainPanel/PartnerEpiMainPanelCtrl.cs

@@ -289,7 +289,8 @@ namespace FL.FGUI
         public void ShowOwnerAttr()
         {
             var list = EpigraphData.Instance.EpiList;
-            var map = new Dictionary<int, int>();
+            //var map = new Dictionary<int, int>();
+            var val = 0;
             foreach (var epigraph in list)
             {
                 var starTable = epigraphUpTableRepo.GetEpiragphUp(
@@ -305,51 +306,53 @@ namespace FL.FGUI
 
                 if (attrsArray?.Length > 0)
                 {
-                    for (int i = 0; i < attrsArray.Length; i += 2)
-                    {
-                        if (map.TryGetValue(attrsArray[i], out var attr))
-                        {
-                            map.Remove(attrsArray[i]);
-                            map.Add(attrsArray[i], attr + attrsArray[i + 1]);
-                        }
-                        else
-                        {
-                            map.Add(attrsArray[i], attrsArray[i + 1]);
-                        }
-                    }
+                    //for (int i = 0; i < attrsArray.Length; i += 2)
+                    //{
+                    //    if (map.TryGetValue(attrsArray[i], out var attr))
+                    //    {
+                    //        map.Remove(attrsArray[i]);
+                    //        map.Add(attrsArray[i], attr + attrsArray[i + 1]);
+                    //    }
+                    //    else
+                    //    {
+                    //        map.Add(attrsArray[i], attrsArray[i + 1]);
+                    //    }
+                    //}
+                    val += attrsArray[1];
                 }
             }
-            if (map.Count > 0)
-            {
-                var desc = StringBuilderUtils.Acquire();
-                int index = 0;
-                foreach (var pair in map)
-                {
-                    if (index > 0)
-                    {
-                        desc.Append(",");
-                        index++;
-                    }
-                    GetAttributeDesc(pair.Key, pair.Value, ref desc);
-                }
-                VM.AttrLabel.text = desc.ToString();
-                VM.HaveLabel.visible = true;
-                VM.AttrLabel.visible = true;
-            }
-            else
-            {
-                VM.HaveLabel.visible = false;
-                VM.AttrLabel.visible = false;
-            }
+            VM.AttrLabel.SetVar("val", (val / 100).ToString()).FlushVars();
+            //if (map.Count > 0)
+            //{
+            //    var desc = StringBuilderUtils.Acquire();
+            //    int index = 0;
+            //    foreach (var pair in map)
+            //    {
+            //        if (index > 0)
+            //        {
+            //            desc.Append(",");
+            //            index++;
+            //        }
+            //        GetAttributeDesc(pair.Key, pair.Value, ref desc);
+            //    }
+            //    VM.AttrLabel.text = desc.ToString();
+            //    VM.HaveLabel.visible = true;
+            //    VM.AttrLabel.visible = true;
+            //}
+            //else
+            //{
+            //    VM.HaveLabel.visible = false;
+            //    VM.AttrLabel.visible = false;
+            //}
         }
 
-        private void GetAttributeDesc(int attrType, int attrValue, ref StringBuilder desc)
-        {
-            var attributeInfo = AttrDescTableRepo.Get(attrType);
-            string valStr = attrValue > 0 ? TableUtils.ToRealDouble(attrValue).ToString("F2") : "0";
-            desc.Append(attributeInfo?.ShowName);
-            desc.Append(valStr);
-            desc.Append("%");
-        }
+        //private void GetAttributeDesc(int attrType, int attrValue, ref StringBuilder desc)
+        //{
+        //    var attributeInfo = AttrDescTableRepo.Get(attrType);
+        //    string valStr = attrValue > 0 ? TableUtils.ToRealDouble(attrValue).ToString("F2") : "0";
+        //    desc.Append(attributeInfo?.ShowName);
+        //    desc.Append(valStr);
+        //    desc.Append("%");
+        //}
     }
 }

+ 1 - 1
fl-fgui-project/assets/Partner/Epigraph/EpiMainPanel.xml

@@ -41,7 +41,7 @@
       <item/>
     </list>
     <text id="n7_vl6j" name="HaveLabel" xy="211,508" pivot="1,0" size="104,34" group="n35_v4ke" fontSize="24" color="#ffffff" vAlign="middle" bold="true" text="拥有效果"/>
-    <text id="n8_vl6j" name="AttrLabel" xy="314,508" size="240,32" group="n35_v4ke" fontSize="22" color="#33cc00" vAlign="middle" bold="true" strokeColor="#000000" strokeSize="2" autoClearText="true" text="生命\防御\攻击+150%"/>
+    <text id="n8_vl6j" name="AttrLabel" xy="314,508" size="240,32" group="n35_v4ke" fontSize="22" color="#33cc00" vAlign="middle" vars="true" bold="true" strokeColor="#000000" strokeSize="2" text="生命\防御\攻击+{val=150}%"/>
     <component id="n10_vl6j" name="OneUpBtn" src="sfx62x" fileName="Components/ComButtons/ComBlueBtn.xml" pkg="gt6q23qw" xy="87,1081" group="n12_vl6j" scale="0.9,0.9">
       <Button title="一键上阵"/>
     </component>