hch
9 天以前 1f7675733af28f2cdf393956705de0d399e9be10
Main/Utility/UIHelper.cs
@@ -543,7 +543,7 @@
    public static readonly Color s_GrayDanLV5 = new Color32(255, 0, 0, 255); //ff0000
    public static readonly Color s_GrayDanLV6 = new Color32(240, 0, 255, 255); //f000ff
    // public static Color GetDanLVColor(int danLv, bool bright = false)
    // public static Color GetDanLVColor(int danLv, bool bright = true)
    // {
    //     var crossDanLVConfig = CrossServerArenaConfig.Get(danLv);
    //     if (crossDanLVConfig != null)
@@ -569,7 +569,7 @@
    //     return Color.white;
    // }
    // public static string AppendDanLVNameColor(int danLv, bool bright = false)
    // public static string AppendDanLVNameColor(int danLv, bool bright = true)
    // {
    //     var crossDanLVConfig = CrossServerArenaConfig.Get(danLv);
    //     if (crossDanLVConfig == null)
@@ -598,14 +598,14 @@
    // }
    //物品 各功能品质
    public static Color GetUIColorByFunc(int itemColor, bool bright = false)
    public static Color GetUIColorByFunc(int itemColor, bool bright = true)
    {
        return GetUIColor(itemColor + 1, bright);
    }
    //对应品质(树);物品 各功能品质从2开始 用GetUIColorByFunc
    public static Color GetUIColor(int itemColor, bool bright = false)
    public static Color GetUIColor(int itemColor, bool bright = true)
    {
        switch (itemColor)
        {
@@ -641,7 +641,7 @@
        return GetUIColor(TextColType.White, bright);
    }
    public static Color GetUIColor(TextColType type, bool bright = false)
    public static Color GetUIColor(TextColType type, bool bright = true)
    {
        //Bright 和 Dark指背景色系是明还是暗,暗底亮字,亮底暗字的规则
        switch (type)
@@ -776,7 +776,7 @@
    private static Regex m_TextColorRegex = new Regex("<color=#[0-9a-zA-Z]+>(.*)</color>", RegexOptions.Singleline);
    public static string AppendColor(TextColType type, string msg, bool bright = false)
    public static string AppendColor(TextColType type, string msg, bool bright = true)
    {
        // if (m_TextColorRegex.IsMatch(msg) && msg.ToLower().StartsWith("<color=#")
        //     && msg.ToLower().EndsWith("</color>"))
@@ -820,7 +820,7 @@
    }
    //needName 指官职0是否需要名称
    public static string GetRealmName(int realmLv, bool bright = false, bool needName = false)
    public static string GetRealmName(int realmLv, bool bright = true, bool needName = false)
    {
        if (realmLv <= 0 && !needName)
        {
@@ -850,7 +850,7 @@
    //     return GetRealmColorByLv(realmLv, string.Format(strFormat, config.Name), bright);
    // }
    public static string GetRealmColorByLv(int realmLv, string msg, bool bright = false)
    public static string GetRealmColorByLv(int realmLv, string msg, bool bright = true)
    {
        var config = RealmConfig.Get(realmLv);
        if (config == null)
@@ -876,7 +876,7 @@
        }
    }
    public static string AppendColor(int itemColor, string msg, bool bright = false)
    public static string AppendColor(int itemColor, string msg, bool bright = true)
    {
        switch (itemColor)
        {
@@ -1252,6 +1252,19 @@
        return (int)GetMoneyCnt(98) + (int)GetMoneyCnt(99);
    }
    //显示数量, 格式n/m, 足够绿色不足红色
    public static string ShowUseMoney(int moneyType, ulong useCnt, TextColType engoughColor = TextColType.Green)
    {
        ulong cnt = GetMoneyCnt(moneyType);
        return AppendColor(useCnt <= cnt ? engoughColor : TextColType.Red, $"{ReplaceLargeNum(useCnt)}/{ReplaceLargeNum(cnt)}");
    }
    public static string ShowUseItem(PackType type, int itemId, ulong useCnt, TextColType engoughColor = TextColType.Green)
    {
        ulong cnt = PackManager.Instance.GetItemCountByID(type, itemId);
        return AppendColor(useCnt <= cnt ? engoughColor : TextColType.Red, $"{ReplaceLargeNum(useCnt)}/{ReplaceLargeNum(cnt)}");
    }
    #endregion
    #region 得到装备位对应的部位名称
@@ -1371,7 +1384,7 @@
        return count;
    }
    // public static string GetEquipSuitName(int itemId, bool bright = false)
    // public static string GetEquipSuitName(int itemId, bool bright = true)
    // {
    //     if (ItemLogicUtility.Instance.IsSuitEquip(itemId))
    //     {
@@ -1381,7 +1394,7 @@
    //     return string.Empty;
    // }
    // public static string GetItemName(int itmeId, bool bright = false)
    // public static string GetItemName(int itmeId, bool bright = true)
    // {
    //     var itemConfig = ItemConfig.Get(itmeId);
    //     if (itemConfig == null)