ソースを参照

道具数量
/// >=百万,以M结尾
/// >=万,以K结尾

zhenglijun 1 日 前
コミット
3bcfe7b9aa

BIN
Assets/Res/Addressable/FGUI/Common/Common_fui.bytes


+ 3 - 3
Assets/Scripts/Business/Runtime/FGUI/Common/ComCostNested/CommonComCostNestedCtrl.cs

@@ -40,15 +40,15 @@ namespace FL.FGUI
         {
             var itemInfo = ItemTableRepo.Get(itemId);
             if (itemInfo != null) VM.CostIcon.icon = itemInfo?.Icon;
-            VM.CostLabel.text = count.ToString();
+            VM.CostLabel.text = count.FormatNumber();
         }
         public void ShowCostUI(int costId, long costVal, long count = 0)
         {
             var costItemInfo = ItemTableRepo.Get(costId);
             if (costItemInfo != null) VM.CostIcon.icon = costItemInfo?.Icon;
             if (count == 0) count = ItemData.Instance.GetItemNum(costId);
-            var countStr = count < costVal ? $"[color=#f74b4b]{count}[/color]" : $"[color=#1ef369]{count}[/color]";
-            VM.CostLabel.text = $"{countStr}/{costVal}";
+            var countStr = count < costVal ? $"[color=#f74b4b]{count.FormatNumber()}[/color]" : $"[color=#1ef369]{count.FormatNumber()}[/color]";
+            VM.CostLabel.text = $"{countStr}/{costVal.FormatNumber()}";
         }
     }
 }

+ 2 - 2
Assets/Scripts/Business/Runtime/FGUI/Common/ComCurrencyNested/CommonComCurrencyNestedCtrl.cs

@@ -71,9 +71,9 @@ namespace FL.FGUI
                 Log.Error($"道具表不存在,id:{_id}");
                 return;
             }
-            var num = ItemData.Instance.GetItemNum(_id);
+            long num = ItemData.Instance.GetItemNum(_id);
             VM.IconLoader.icon = currencyInfo?.Icon;
-            VM.NumLabel.text = num.ToString();
+            VM.NumLabel.text = num.FormatNumber();
         }
     }
 }

+ 1 - 2
Assets/Scripts/Business/Runtime/FGUI/Common/ItemBase/CommonItemBaseCtrl.cs

@@ -6,7 +6,6 @@
 
 using FairyGUI;
 using FL.Data.Items;
-using XGame.Database;
 using XGame.Framework.UI;
 
 namespace FL.FGUI
@@ -83,7 +82,7 @@ namespace FL.FGUI
                 VM.LvLabel.visible = false;
                 if (itemBase.Count > 0)
                 {
-                    VM.CountLabel.text = itemBase.Count.ToString();
+                    VM.CountLabel.text = itemBase.Count.FormatNumber();
                     VM.CountLabel.visible = true;
                 }
                 else