| | |
| | | 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) |
| | |
| | | // 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) |
| | |
| | | // } |
| | | |
| | | //物品 各功能品质 |
| | | 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) |
| | | { |
| | |
| | | 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) |
| | |
| | | |
| | | 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>")) |
| | |
| | | } |
| | | |
| | | //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) |
| | | { |
| | |
| | | // 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) |
| | |
| | | } |
| | | } |
| | | |
| | | public static string AppendColor(int itemColor, string msg, bool bright = false) |
| | | public static string AppendColor(int itemColor, string msg, bool bright = true) |
| | | { |
| | | switch (itemColor) |
| | | { |
| | |
| | | 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 得到装备位对应的部位名称 |
| | |
| | | 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)) |
| | | // { |
| | |
| | | // 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) |