|  |  |  | 
|---|
|  |  |  | public static void SetIconWithMoneyType(this Image _image, int moneyType) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | if (_image == null) return; | 
|---|
|  |  |  | string iconKey = StringUtility.Contact("Money_Type_", moneyType); | 
|---|
|  |  |  | _image.SetSprite(iconKey); | 
|---|
|  |  |  | if (GeneralDefine.MoneyDisplayModel.ContainsKey(moneyType)) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | _image.SetOrgSprite(ItemConfig.Get(GeneralDefine.MoneyDisplayModel[moneyType]).IconKey); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else | 
|---|
|  |  |  | { | 
|---|
|  |  |  | // 不需要物品的情况补充 | 
|---|
|  |  |  | // string iconKey = StringUtility.Contact("Money_Type_", moneyType); | 
|---|
|  |  |  | Debug.LogError("MoneyDisplayModel 未配置货币类型:" + moneyType); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static void SetSmallIconWithMoneyType(this Image _image, int moneyType) | 
|---|
|  |  |  | public static string GetIconNameWithMoneyType(int moneyType) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | if (_image == null) return; | 
|---|
|  |  |  | string iconKey = StringUtility.Contact("SmallMoney", moneyType); | 
|---|
|  |  |  | _image.SetSprite(iconKey); | 
|---|
|  |  |  | if (GeneralDefine.MoneyDisplayModel.ContainsKey(moneyType)) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return ItemConfig.Get(GeneralDefine.MoneyDisplayModel[moneyType]).IconKey; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else | 
|---|
|  |  |  | { | 
|---|
|  |  |  | Debug.LogError("MoneyDisplayModel 未配置货币类型:" + moneyType); | 
|---|
|  |  |  | return ""; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 基于itemColor 下,ColorEx做二级区分 | 
|---|
|  |  |  | public static void SetItemBackGround(this Image _image, int itemColor, int ColorEx = 0) | 
|---|
|  |  |  | public static void SetItemBackGround(this Image _image, int itemColor) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | if (_image == null) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | _image.SetSprite(string.Format("Common_Public_ItemColor{0}{1}", itemColor, ColorEx)); | 
|---|
|  |  |  | _image.SetSprite($"ItemBG{itemColor}"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// 剩余时间 | 
|---|
|  |  |  | 
|---|
|  |  |  | else if (span.TotalMinutes > 1) return Math.Floor(span.TotalMinutes) + Language.Get("L1073"); | 
|---|
|  |  |  | else return 1 + Language.Get("L1073"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// 根据属性获取玩家数据 | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | /// <param name="type"></param> | 
|---|
|  |  |  | /// <returns></returns> | 
|---|
|  |  |  | public static ulong GetPropertyValue(PropertyType type) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | switch (type) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | case PropertyType.LV: | 
|---|
|  |  |  | return PlayerDatas.Instance.baseData.LV; | 
|---|
|  |  |  | case PropertyType.POWER: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.STR; | 
|---|
|  |  |  | case PropertyType.AGILITY: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.PHY; | 
|---|
|  |  |  | case PropertyType.PHYSIQUE: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.CON; | 
|---|
|  |  |  | case PropertyType.MENTALITY: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.PNE; | 
|---|
|  |  |  | case PropertyType.HP: | 
|---|
|  |  |  | return PlayerDatas.Instance.extersion.MaxHP; | 
|---|
|  |  |  | case PropertyType.ATK: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.MAXATK; | 
|---|
|  |  |  | case PropertyType.DEF: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.DEF; | 
|---|
|  |  |  | case PropertyType.HIT: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.HIT; | 
|---|
|  |  |  | case PropertyType.MISS: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.Miss; | 
|---|
|  |  |  | case PropertyType.ATKSPEED: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.battleValEx1; | 
|---|
|  |  |  | case PropertyType.CritChance: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.SuperHitRate; | 
|---|
|  |  |  | case PropertyType.CritHurt: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.SuperHit; | 
|---|
|  |  |  | case PropertyType.CritResis: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.SuperHitReduce; | 
|---|
|  |  |  | case PropertyType.HeartHit: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.luckHitRate; | 
|---|
|  |  |  | case PropertyType.HeartHurt: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.luckHitVal; | 
|---|
|  |  |  | case PropertyType.HeartResis: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.LuckyHitRateReduce; | 
|---|
|  |  |  | case PropertyType.SkillHurt: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.SkillAtkRate; | 
|---|
|  |  |  | case PropertyType.PVPAddHurt: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.DamagePVP; | 
|---|
|  |  |  | case PropertyType.PVPReduceHurt: | 
|---|
|  |  |  | return PlayerDatas.Instance.GetPlayerDataByType((PlayerDataType)191); | 
|---|
|  |  |  | case PropertyType.LifeReply: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.HPRestorePer; | 
|---|
|  |  |  | case PropertyType.HurtReflect: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.DamageBackRate; | 
|---|
|  |  |  | case PropertyType.MoveSpeed: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.SpeedValue; | 
|---|
|  |  |  | case PropertyType.PetAddHurt: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.PetDamPer; | 
|---|
|  |  |  | case PropertyType.RealHurt: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.realATK; | 
|---|
|  |  |  | case PropertyType.RealResis: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.realDEF; | 
|---|
|  |  |  | case PropertyType.DefyDef: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.IgnoreDefRate; | 
|---|
|  |  |  | case PropertyType.DefyDefResis: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.IgnoreDefRateReduce; | 
|---|
|  |  |  | case PropertyType.DefChance: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.DamChanceDef; | 
|---|
|  |  |  | case PropertyType.BloodHurt: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.BleedDamage; | 
|---|
|  |  |  | case PropertyType.AktReplyBlood: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.BattleValEx2; | 
|---|
|  |  |  | case PropertyType.Stun: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.FaintRate; | 
|---|
|  |  |  | case PropertyType.CtrlResis: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.FaintDefRate; | 
|---|
|  |  |  | case PropertyType.AddFinalHurt: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.FinalHurt; | 
|---|
|  |  |  | case PropertyType.ReduceFinalHurt: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.FinalHurtReduce; | 
|---|
|  |  |  | case PropertyType.PVPAddHurtPer: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.DamagePerPVP; | 
|---|
|  |  |  | case PropertyType.PVPReduceHurtPer: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.DamagePerPVPReduce; | 
|---|
|  |  |  | case PropertyType.DleHitChance: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.ComboDamPerRate; | 
|---|
|  |  |  | case PropertyType.DleHurt: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.ComboDamPer; | 
|---|
|  |  |  | case PropertyType.ReduceSkillHurtPercent: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.skillAtkRateReduce; | 
|---|
|  |  |  | case PropertyType.NpcHurtAddPer: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.NpcHurtAddPer; | 
|---|
|  |  |  | case PropertyType.Luck: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.luckValue; | 
|---|
|  |  |  | case PropertyType.Mater: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.mater; | 
|---|
|  |  |  | case PropertyType.Wood: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.wood; | 
|---|
|  |  |  | case PropertyType.Water: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.water; | 
|---|
|  |  |  | case PropertyType.Fire: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.fire; | 
|---|
|  |  |  | case PropertyType.Earth: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.earth; | 
|---|
|  |  |  | case PropertyType.ReduceCrit: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.reduceCrit; | 
|---|
|  |  |  | case PropertyType.ReduceHeartHurtPer: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.reduceHeartHurt; | 
|---|
|  |  |  | case PropertyType.ReduceFinalHurtPer: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.reduceFinalHurt; | 
|---|
|  |  |  | case PropertyType.AtkPercent: | 
|---|
|  |  |  | case PropertyType.CritHurtPercent: | 
|---|
|  |  |  | case PropertyType.DodgePercent: | 
|---|
|  |  |  | // return (ulong)ModelCenter.Instance.GetModel<ReikiRootModel>().GetReikiPropertyValue((int)type); | 
|---|
|  |  |  | // TODO YYL | 
|---|
|  |  |  | return 0ul; | 
|---|
|  |  |  | case PropertyType.SkillAddPerA: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.skillAddPerA; | 
|---|
|  |  |  | case PropertyType.SkillAddPerB: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.skillAddPerB; | 
|---|
|  |  |  | case PropertyType.SkillAddPerC: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.skillAddPerC; | 
|---|
|  |  |  | case PropertyType.SkillAddPerD: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.skillAddPerD; | 
|---|
|  |  |  | case PropertyType.SkillAddPerE: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.skillAddPerE; | 
|---|
|  |  |  | case PropertyType.SkillAddPerF: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.skillAddPerF; | 
|---|
|  |  |  | case PropertyType.SkillAddPerG: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.skillAddPerG; | 
|---|
|  |  |  | case PropertyType.SkillReducePerA: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.skillReducePerA; | 
|---|
|  |  |  | case PropertyType.SkillReducePerB: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.skillReducePerB; | 
|---|
|  |  |  | case PropertyType.SkillReducePerC: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.skillReducePerC; | 
|---|
|  |  |  | case PropertyType.SkillReducePerD: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.skillReducePerD; | 
|---|
|  |  |  | case PropertyType.SkillReducePerE: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.skillReducePerE; | 
|---|
|  |  |  | case PropertyType.SkillReducePerF: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.skillReducePerF; | 
|---|
|  |  |  | case PropertyType.SkillReducePerG: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.skillReducePerG; | 
|---|
|  |  |  | case PropertyType.ReduceSkillCDPer: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.battleValEx3; | 
|---|
|  |  |  | case PropertyType.AddFinalHurtPer: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.FunalHurtPer; | 
|---|
|  |  |  | case PropertyType.AddNormalHurt: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.NormalHurt; | 
|---|
|  |  |  | case PropertyType.AddNormalHurtPer: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.NormalHurtPer; | 
|---|
|  |  |  | case PropertyType.AddSkillHurt: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.FabaoHurt; | 
|---|
|  |  |  | case PropertyType.AddSkillHurtPer: | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.baseData.FabaoHurtPer; | 
|---|
|  |  |  | case PropertyType.AddPVEHurt: | 
|---|
|  |  |  | return PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.DamagePVE); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return 0; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (num >= T) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return  StringUtility.Contact(numto2Decimals(num / T).ToString("0.##"), Language.Get("L1070_0")); | 
|---|
|  |  |  | return StringUtility.Contact(numto2Decimals(num / T).ToString("0.##"), Language.Get("L1070_0")); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else if (num >= B) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 
|---|
|  |  |  | public static readonly Color s_BrightPurpleColor = new Color32(218, 72, 213, 255); | 
|---|
|  |  |  | public static readonly Color s_BrightBlueColor = new Color32(0, 107, 227, 255); //006BE3FF | 
|---|
|  |  |  | public static readonly Color s_BrightOrangeColor = new Color32(255, 103, 1, 255); //FF6701FF | 
|---|
|  |  |  | public static readonly Color s_BrightWhiteColor = new Color32(104, 104, 104, 255); //686868 | 
|---|
|  |  |  | public static readonly Color s_BrightWhiteColor = new Color32(255, 255, 255, 255);    //ffffff //new Color32(104, 104, 104, 255); //686868 | 
|---|
|  |  |  | public static readonly Color s_BrightGreenColor = new Color32(36, 139, 18, 255); //248b12 | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static readonly Color s_DarkPinkColor = new Color32(255, 124, 124, 255); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static readonly Color s_NavyBrown = new Color32(110, 76, 49, 255);//6e4c31 | 
|---|
|  |  |  | public static readonly Color s_Black = new Color32(0, 0, 0, 255); | 
|---|
|  |  |  | public static readonly Color s_NavyYellow = new Color32(255, 239, 71, 255); | 
|---|
|  |  |  | public static readonly Color s_NavyYellow = new Color32(242, 238, 2, 255); //f2ee02 | 
|---|
|  |  |  | public static readonly Color s_LightGreen = new Color32(42, 227, 55, 255);//2ae337 | 
|---|
|  |  |  | public static readonly Color s_LightWhite = new Color32(245, 246, 230, 255); //f5f6e6 | 
|---|
|  |  |  | public static readonly Color s_Gray = new Color32(187, 187, 187, 255);  //bbbbbb | 
|---|
|  |  |  | public static readonly Color s_Gray = new Color32(187, 187, 187, 255); //bbbbbb | 
|---|
|  |  |  | public static readonly Color s_Gold = new Color32(255, 239, 71, 255);//ffef47 | 
|---|
|  |  |  | public static readonly Color s_EarthYellow = new Color32(248, 152, 59, 255);//f8983b | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | 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) | 
|---|
|  |  |  | 
|---|
|  |  |  | //     return name; | 
|---|
|  |  |  | // } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //物品 各功能品质 | 
|---|
|  |  |  | public static Color GetUIColorByFunc(int itemColor, bool bright = false) | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //物品 各功能品质 从精良1品质 对应 3开始 | 
|---|
|  |  |  | public static Color GetUIColorByFunc(int itemColor, bool bright = true) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return GetUIColor(itemColor + 1, bright); | 
|---|
|  |  |  | return GetUIColor(itemColor + 2, bright); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //对应品质(树);物品 各功能品质从2开始 用GetUIColorByFunc | 
|---|
|  |  |  | public static Color GetUIColor(int itemColor, bool bright = false) | 
|---|
|  |  |  | //对应品质(树);物品 各功能品质 用GetUIColorByFunc | 
|---|
|  |  |  | public static Color GetUIColor(int itemColor, bool bright = true) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | switch (itemColor) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | case 0: | 
|---|
|  |  |  | return GetUIColor(TextColType.Gray, bright); | 
|---|
|  |  |  | case 1: | 
|---|
|  |  |  | return GetUIColor(TextColType.White, bright); | 
|---|
|  |  |  | return GetUIColor(TextColType.Gray, bright); | 
|---|
|  |  |  | case 2: | 
|---|
|  |  |  | return GetUIColor(TextColType.itemjingliang, bright); | 
|---|
|  |  |  | return GetUIColor(TextColType.White, bright); | 
|---|
|  |  |  | case 3: | 
|---|
|  |  |  | return GetUIColor(TextColType.itemxiyou, bright); | 
|---|
|  |  |  | return GetUIColor(TextColType.itemjingliang, bright); | 
|---|
|  |  |  | case 4: | 
|---|
|  |  |  | return GetUIColor(TextColType.itemshishi, bright); | 
|---|
|  |  |  | return GetUIColor(TextColType.itemxiyou, bright); | 
|---|
|  |  |  | case 5: | 
|---|
|  |  |  | return GetUIColor(TextColType.itemchuanqi, bright); | 
|---|
|  |  |  | return GetUIColor(TextColType.itemshishi, bright); | 
|---|
|  |  |  | case 6: | 
|---|
|  |  |  | return GetUIColor(TextColType.itemshenhua, bright); | 
|---|
|  |  |  | return GetUIColor(TextColType.itemchuanqi, bright); | 
|---|
|  |  |  | case 7: | 
|---|
|  |  |  | return GetUIColor(TextColType.itemwuxia, bright); | 
|---|
|  |  |  | return GetUIColor(TextColType.itemshenhua, bright); | 
|---|
|  |  |  | case 8: | 
|---|
|  |  |  | return GetUIColor(TextColType.itemanjin, bright); | 
|---|
|  |  |  | return GetUIColor(TextColType.itemwuxia, bright); | 
|---|
|  |  |  | case 9: | 
|---|
|  |  |  | return GetUIColor(TextColType.itemjueyi, bright); | 
|---|
|  |  |  | return GetUIColor(TextColType.itemanjin, bright); | 
|---|
|  |  |  | case 10: | 
|---|
|  |  |  | return GetUIColor(TextColType.itemyuanzu, bright); | 
|---|
|  |  |  | case 11: | 
|---|
|  |  |  | return GetUIColor(TextColType.itembuxiu, bright); | 
|---|
|  |  |  | case 12: | 
|---|
|  |  |  | case 13: | 
|---|
|  |  |  | case 14: | 
|---|
|  |  |  | return GetUIColor(TextColType.itemjueyi, bright); | 
|---|
|  |  |  | case 15: | 
|---|
|  |  |  | case 16: | 
|---|
|  |  |  | case 17: | 
|---|
|  |  |  | case 18: | 
|---|
|  |  |  | case 19: | 
|---|
|  |  |  | return GetUIColor(TextColType.itemyuanzu, bright); | 
|---|
|  |  |  | case 20: | 
|---|
|  |  |  | case 21: | 
|---|
|  |  |  | case 22: | 
|---|
|  |  |  | case 23: | 
|---|
|  |  |  | case 24: | 
|---|
|  |  |  | return GetUIColor(TextColType.itembuxiu, bright); | 
|---|
|  |  |  | case 25: | 
|---|
|  |  |  | case 26: | 
|---|
|  |  |  | case 27: | 
|---|
|  |  |  | case 28: | 
|---|
|  |  |  | case 29: | 
|---|
|  |  |  | return GetUIColor(TextColType.itemyonghen, bright); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | 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) | 
|---|
|  |  |  | 
|---|
|  |  |  | case TextColType.None: | 
|---|
|  |  |  | case TextColType.White: | 
|---|
|  |  |  | return bright ? s_BrightWhiteColor : s_DarkWhiteColor;  // s_BrightWhiteColor 是亮底灰色 | 
|---|
|  |  |  | case TextColType.Blue: | 
|---|
|  |  |  | return bright ? s_BrightBlueColor : s_DarkBlueColor; | 
|---|
|  |  |  | case TextColType.Purple: | 
|---|
|  |  |  | return bright ? s_BrightPurpleColor : s_DarkPurpleColor; | 
|---|
|  |  |  | case TextColType.Orange: | 
|---|
|  |  |  | return bright ? s_BrightOrangeColor : s_DarkOrangeColor; | 
|---|
|  |  |  | case TextColType.titleSelectColor: | 
|---|
|  |  |  | return new Color32(127, 65, 57, 255); | 
|---|
|  |  |  | case TextColType.titleUnSelectColor: | 
|---|
|  |  |  | return new Color32(110, 92, 96, 255); | 
|---|
|  |  |  | case TextColType.Red: | 
|---|
|  |  |  | return bright ? s_BrightRedColor : s_DarkRedColor; | 
|---|
|  |  |  | case TextColType.Pink: | 
|---|
|  |  |  | 
|---|
|  |  |  | return s_BrightGreenColor; | 
|---|
|  |  |  | case TextColType.Black: | 
|---|
|  |  |  | return s_Black; | 
|---|
|  |  |  | case TextColType.lightYellow:   //浅黄色 | 
|---|
|  |  |  | return new Color32(252, 237, 185, 255); | 
|---|
|  |  |  | case TextColType.NavyYellow: | 
|---|
|  |  |  | return s_NavyYellow; | 
|---|
|  |  |  | case TextColType.LightGreen: | 
|---|
|  |  |  | 
|---|
|  |  |  | return s_LightWhite; | 
|---|
|  |  |  | case TextColType.Gray: | 
|---|
|  |  |  | return s_Gray; | 
|---|
|  |  |  | case TextColType.NavyGray: | 
|---|
|  |  |  | return new Color32(121, 121, 121, 255); | 
|---|
|  |  |  | case TextColType.itemjingliang: | 
|---|
|  |  |  | // 729de4 精良 | 
|---|
|  |  |  | return new Color32(114, 157, 228, 255); | 
|---|
|  |  |  | 
|---|
|  |  |  | return bright ? s_BrightWhiteColor : s_DarkWhiteColor; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //对应品质(树);物品 各功能品质从2开始 用GetUIOutlineColorByFunc | 
|---|
|  |  |  | //对应品质(树);物品 各功能品质 用GetUIOutlineColorByFunc | 
|---|
|  |  |  | public static Color GetUIOutlineColor(int quality) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return GetUIOutlineColor((QualityTextColType)quality); | 
|---|
|  |  |  | switch (quality) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | case 1: | 
|---|
|  |  |  | case 2: | 
|---|
|  |  |  | case 3: | 
|---|
|  |  |  | case 4: | 
|---|
|  |  |  | case 5: | 
|---|
|  |  |  | case 6: | 
|---|
|  |  |  | case 7: | 
|---|
|  |  |  | case 8: | 
|---|
|  |  |  | case 9: | 
|---|
|  |  |  | return GetUIOutlineColor((QualityTextColType)quality); | 
|---|
|  |  |  | case 10: | 
|---|
|  |  |  | case 11: | 
|---|
|  |  |  | case 12: | 
|---|
|  |  |  | case 13: | 
|---|
|  |  |  | case 14: | 
|---|
|  |  |  | return GetUIOutlineColor(QualityTextColType.itemjueyi); | 
|---|
|  |  |  | case 15: | 
|---|
|  |  |  | case 16: | 
|---|
|  |  |  | case 17: | 
|---|
|  |  |  | case 18: | 
|---|
|  |  |  | case 19: | 
|---|
|  |  |  | return GetUIOutlineColor(QualityTextColType.itemyuanzu); | 
|---|
|  |  |  | case 20: | 
|---|
|  |  |  | case 21: | 
|---|
|  |  |  | case 22: | 
|---|
|  |  |  | case 23: | 
|---|
|  |  |  | case 24: | 
|---|
|  |  |  | return GetUIOutlineColor(QualityTextColType.itembuxiu); | 
|---|
|  |  |  | case 25: | 
|---|
|  |  |  | case 26: | 
|---|
|  |  |  | case 27: | 
|---|
|  |  |  | case 28: | 
|---|
|  |  |  | case 29: | 
|---|
|  |  |  | return GetUIOutlineColor(QualityTextColType.itemyonghen); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return GetUIOutlineColor(QualityTextColType.itemputong); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //物品 各功能品质 | 
|---|
|  |  |  | //物品 各功能品质  从精良1品质 对应 3开始 | 
|---|
|  |  |  | public static Color GetUIOutlineColorByFunc(int quality) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return GetUIOutlineColor((QualityTextColType)(quality + 1)); | 
|---|
|  |  |  | return GetUIOutlineColor((QualityTextColType)(quality + 2)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //描边颜色,对应品质(树) | 
|---|
|  |  |  | 
|---|
|  |  |  | // 5d1d52 永恒 | 
|---|
|  |  |  | return new Color32(93, 29, 82, 128); | 
|---|
|  |  |  | case QualityTextColType.red: | 
|---|
|  |  |  | return s_BrightRedColor; | 
|---|
|  |  |  | return s_DarkRedColor; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return new Color32(0, 0, 0, 128); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private static Regex m_TextColorRegex = new Regex("<color=#[0-9a-zA-Z]+>(.*)</color>", RegexOptions.Singleline); | 
|---|
|  |  |  | // 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>")) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | Match match = m_TextColorRegex.Match(msg); | 
|---|
|  |  |  | msg = match.Groups[1].Value; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // if (m_TextColorRegex.IsMatch(msg) && msg.ToLower().StartsWith("<color=#") | 
|---|
|  |  |  | //     && msg.ToLower().EndsWith("</color>")) | 
|---|
|  |  |  | // { | 
|---|
|  |  |  | //     Match match = m_TextColorRegex.Match(msg); | 
|---|
|  |  |  | //     msg = match.Groups[1].Value; | 
|---|
|  |  |  | // } | 
|---|
|  |  |  | switch (type) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | case TextColType.None: | 
|---|
|  |  |  | case TextColType.White: | 
|---|
|  |  |  | return StringUtility.Contact("<color=#", bright ? "686868" : "f7f7f7", ">", msg, "</color>"); | 
|---|
|  |  |  | case TextColType.Blue: | 
|---|
|  |  |  | return StringUtility.Contact("<color=#", bright ? "006be3" : "31cefb", ">", msg, "</color>"); | 
|---|
|  |  |  | case TextColType.Purple: | 
|---|
|  |  |  | return StringUtility.Contact("<color=#", bright ? "da48d5" : "ec4bf6", ">", msg, "</color>"); | 
|---|
|  |  |  | case TextColType.Orange: | 
|---|
|  |  |  | return StringUtility.Contact("<color=#", bright ? "ff6701" : "f8983b", ">", msg, "</color>"); | 
|---|
|  |  |  | return StringUtility.Contact("<color=#", bright ? "ffffff" : "ffffff", ">", msg, "</color>"); | 
|---|
|  |  |  | case TextColType.titleSelectColor: | 
|---|
|  |  |  | return StringUtility.Contact("<color=#7F4139>", msg, "</color>"); | 
|---|
|  |  |  | case TextColType.titleUnSelectColor: | 
|---|
|  |  |  | return StringUtility.Contact("<color=#6E5C60>", msg, "</color>"); | 
|---|
|  |  |  | case TextColType.Red: | 
|---|
|  |  |  | return StringUtility.Contact("<color=#", bright ? "ea261e" : "ea261e", ">", msg, "</color>"); | 
|---|
|  |  |  | case TextColType.Pink: | 
|---|
|  |  |  | return StringUtility.Contact("<color=#", bright ? "f6408d" : "ff7c7c", ">", msg, "</color>"); | 
|---|
|  |  |  | case TextColType.Green: | 
|---|
|  |  |  | return StringUtility.Contact("<color=#", bright ? "109d06" : "35e122", ">", msg, "</color>"); | 
|---|
|  |  |  | return StringUtility.Contact("<color=#", bright ? "248B12" : "2ae337", ">", msg, "</color>"); | 
|---|
|  |  |  | case TextColType.NavyBrown: | 
|---|
|  |  |  | return StringUtility.Contact("<color=#", "6e4c31", ">", msg, "</color>"); | 
|---|
|  |  |  | return StringUtility.Contact("<color=#6e4c31>", msg, "</color>"); | 
|---|
|  |  |  | case TextColType.DarkGreen: | 
|---|
|  |  |  | return StringUtility.Contact("<color=#", "109d06", ">", msg, "</color>"); | 
|---|
|  |  |  | return StringUtility.Contact("<color=#248B12>", msg, "</color>"); | 
|---|
|  |  |  | case TextColType.Black: | 
|---|
|  |  |  | return StringUtility.Contact("<color=#", "000000", ">", msg, "</color>"); | 
|---|
|  |  |  | return StringUtility.Contact("<color=#000000>", msg, "</color>"); | 
|---|
|  |  |  | case TextColType.LightWhite: | 
|---|
|  |  |  | return StringUtility.Contact("<color=#", "f5f646", ">", msg, "</color>"); | 
|---|
|  |  |  | return StringUtility.Contact("<color=f5f646>", msg, "</color>"); | 
|---|
|  |  |  | case TextColType.LightGreen: | 
|---|
|  |  |  | return StringUtility.Contact("<color=#", "8ddc11", ">", msg, "</color>"); | 
|---|
|  |  |  | return StringUtility.Contact("<color=#8ddc11>", msg, "</color>"); | 
|---|
|  |  |  | case TextColType.Gray: | 
|---|
|  |  |  | return StringUtility.Contact("<color=#", "686868", ">", msg, "</color>"); | 
|---|
|  |  |  | return StringUtility.Contact("<color=#bbbbbb>", msg, "</color>"); | 
|---|
|  |  |  | case TextColType.NavyGray: | 
|---|
|  |  |  | return StringUtility.Contact("<color=#797979>", msg, "</color>"); | 
|---|
|  |  |  | case TextColType.lightYellow: | 
|---|
|  |  |  | return StringUtility.Contact("<color=#fcedb9>", msg, "</color>"); | 
|---|
|  |  |  | case TextColType.NavyYellow: | 
|---|
|  |  |  | return StringUtility.Contact("<color=#f2ee02>", msg, "</color>"); | 
|---|
|  |  |  | case TextColType.itemjingliang: | 
|---|
|  |  |  | // 729de4 精良 | 
|---|
|  |  |  | return StringUtility.Contact("<color=#729de4>", msg, "</color>"); | 
|---|
|  |  |  | case TextColType.itemxiyou: | 
|---|
|  |  |  | // c87bfa稀有 | 
|---|
|  |  |  | return StringUtility.Contact("<color=#c87bfa>", msg, "</color>"); | 
|---|
|  |  |  | case TextColType.itemshishi: | 
|---|
|  |  |  | // f6de56 史诗 | 
|---|
|  |  |  | return StringUtility.Contact("<color=#f6de56>", msg, "</color>"); | 
|---|
|  |  |  | case TextColType.itemchuanqi: | 
|---|
|  |  |  | // fe8534 传奇 | 
|---|
|  |  |  | return StringUtility.Contact("<color=#fe8534>", msg, "</color>"); | 
|---|
|  |  |  | case TextColType.itemshenhua: | 
|---|
|  |  |  | // fe4a47 神话 | 
|---|
|  |  |  | return StringUtility.Contact("<color=#fe4a47>", msg, "</color>"); | 
|---|
|  |  |  | case TextColType.itemwuxia: | 
|---|
|  |  |  | // eb5ce9 无瑕 | 
|---|
|  |  |  | return StringUtility.Contact("<color=#eb5ce9>", msg, "</color>"); | 
|---|
|  |  |  | case TextColType.itemanjin: | 
|---|
|  |  |  | // f9e29f 暗金 | 
|---|
|  |  |  | return StringUtility.Contact("<color=#f9e29f>", msg, "</color>"); | 
|---|
|  |  |  | case TextColType.itemjueyi: | 
|---|
|  |  |  | // cdfef2 绝艺 | 
|---|
|  |  |  | return StringUtility.Contact("<color=#cdfef2>", msg, "</color>"); | 
|---|
|  |  |  | case TextColType.itemyuanzu: | 
|---|
|  |  |  | // dfbbed 元祖 | 
|---|
|  |  |  | return StringUtility.Contact("<color=#dfbbed>", msg, "</color>"); | 
|---|
|  |  |  | case TextColType.itembuxiu: | 
|---|
|  |  |  | // 5eeff2 不朽 | 
|---|
|  |  |  | return StringUtility.Contact("<color=#5eeff2>", msg, "</color>"); | 
|---|
|  |  |  | case TextColType.itemyonghen: | 
|---|
|  |  |  | // f5b4ea 永恒 | 
|---|
|  |  |  | return StringUtility.Contact("<color=#f5b4ea>", msg, "</color>"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return msg; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static string AppendColor(Color color, string msg) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return StringUtility.Contact("<color=#", ColorToHexWithHash(color), ">", msg, "</color>"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static string ColorToHexWithHash(Color color, bool includeAlpha = false) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | int r = Mathf.RoundToInt(color.r * 255); | 
|---|
|  |  |  | int g = Mathf.RoundToInt(color.g * 255); | 
|---|
|  |  |  | int b = Mathf.RoundToInt(color.b * 255); | 
|---|
|  |  |  | if (includeAlpha) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | int a = Mathf.RoundToInt(color.a * 255); | 
|---|
|  |  |  | return string.Format("{0:X2}{1:X2}{2:X2}{3:X2}", r, g, b, a); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return string.Format("{0:X2}{1:X2}{2:X2}", r, g, b); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //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 string.Empty; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return GetRealmColorByLv(realmLv, config.Name, bright); | 
|---|
|  |  |  | return AppendColor(realmLv, config.Name, bright); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //strFormat附加 境界名以外的文字 | 
|---|
|  |  |  | 
|---|
|  |  |  | //     return GetRealmColorByLv(realmLv, string.Format(strFormat, config.Name), bright); | 
|---|
|  |  |  | // } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static string GetRealmColorByLv(int realmLv, string msg, bool bright = false) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | var config = RealmConfig.Get(realmLv); | 
|---|
|  |  |  | if (config == null) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return string.Empty; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | switch (config.Quality) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | case 1: | 
|---|
|  |  |  | return StringUtility.Contact("<color=#", bright ? "666666" : "dddddd", ">", msg, "</color>"); | 
|---|
|  |  |  | case 2: | 
|---|
|  |  |  | return StringUtility.Contact("<color=#", bright ? "00b337" : "66ff00", ">", msg, "</color>"); | 
|---|
|  |  |  | case 3: | 
|---|
|  |  |  | return StringUtility.Contact("<color=#", bright ? "0066ff" : "00c6ff", ">", msg, "</color>"); | 
|---|
|  |  |  | case 4: | 
|---|
|  |  |  | return StringUtility.Contact("<color=#", bright ? "ff00f6" : "f000ff", ">", msg, "</color>"); | 
|---|
|  |  |  | case 5: | 
|---|
|  |  |  | return StringUtility.Contact("<color=#", bright ? "ff6600" : "ff9000", ">", msg, "</color>"); | 
|---|
|  |  |  | case 6: | 
|---|
|  |  |  | return StringUtility.Contact("<color=#", bright ? "ff0000" : "ff0000", ">", msg, "</color>"); | 
|---|
|  |  |  | default: | 
|---|
|  |  |  | return msg; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // public static string GetRealmColorByLv(int realmLv, string msg, bool bright = true) | 
|---|
|  |  |  | // { | 
|---|
|  |  |  | //     var config = RealmConfig.Get(realmLv); | 
|---|
|  |  |  | //     if (config == null) | 
|---|
|  |  |  | //     { | 
|---|
|  |  |  | //         return string.Empty; | 
|---|
|  |  |  | //     } | 
|---|
|  |  |  | //     switch (config.Quality) | 
|---|
|  |  |  | //     { | 
|---|
|  |  |  | //         case 1: | 
|---|
|  |  |  | //             return StringUtility.Contact("<color=#", bright ? "666666" : "dddddd", ">", msg, "</color>"); | 
|---|
|  |  |  | //         case 2: | 
|---|
|  |  |  | //             return StringUtility.Contact("<color=#", bright ? "00b337" : "66ff00", ">", msg, "</color>"); | 
|---|
|  |  |  | //         case 3: | 
|---|
|  |  |  | //             return StringUtility.Contact("<color=#", bright ? "0066ff" : "00c6ff", ">", msg, "</color>"); | 
|---|
|  |  |  | //         case 4: | 
|---|
|  |  |  | //             return StringUtility.Contact("<color=#", bright ? "ff00f6" : "f000ff", ">", msg, "</color>"); | 
|---|
|  |  |  | //         case 5: | 
|---|
|  |  |  | //             return StringUtility.Contact("<color=#", bright ? "ff6600" : "ff9000", ">", msg, "</color>"); | 
|---|
|  |  |  | //         case 6: | 
|---|
|  |  |  | //             return StringUtility.Contact("<color=#", bright ? "ff0000" : "ff0000", ">", msg, "</color>"); | 
|---|
|  |  |  | //         default: | 
|---|
|  |  |  | //             return msg; | 
|---|
|  |  |  | //     } | 
|---|
|  |  |  | // } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static string AppendColor(int itemColor, string msg, bool bright = false) | 
|---|
|  |  |  | //物品 各功能品质  从精良1品质 对应 3开始 | 
|---|
|  |  |  | /// <summary> | 
|---|
|  |  |  | /// 颜色定义根据分组处理,如普通物品的颜色精良是1开始,树和装备也是粗糙1开始,需要调整匹配 | 
|---|
|  |  |  | /// </summary> | 
|---|
|  |  |  | /// <param name="itemColor"></param> | 
|---|
|  |  |  | /// <param name="msg"></param> | 
|---|
|  |  |  | /// <param name="bright"></param> | 
|---|
|  |  |  | /// <param name="colorGroupType">0 通用功能品质分组精良到神话</param> | 
|---|
|  |  |  | /// <returns></returns> | 
|---|
|  |  |  | public static string AppendColor(int itemColor, string msg, bool bright = true, int colorGroupType = 0) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | if (colorGroupType == 0) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | itemColor = itemColor + 2; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | switch (itemColor) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | case 0: | 
|---|
|  |  |  |  | 
|---|
|  |  |  | case 1: | 
|---|
|  |  |  | return AppendColor(TextColType.White, msg, bright); | 
|---|
|  |  |  | return AppendColor(TextColType.Gray, msg, bright); | 
|---|
|  |  |  | case 2: | 
|---|
|  |  |  | return AppendColor(TextColType.Blue, msg, bright); | 
|---|
|  |  |  | return AppendColor(TextColType.White, msg, bright); | 
|---|
|  |  |  | case 3: | 
|---|
|  |  |  | return AppendColor(TextColType.Purple, msg, bright); | 
|---|
|  |  |  | return AppendColor(TextColType.itemjingliang, msg, bright); | 
|---|
|  |  |  | case 4: | 
|---|
|  |  |  | return AppendColor(TextColType.Orange, msg, bright); | 
|---|
|  |  |  | return AppendColor(TextColType.itemxiyou, msg, bright); | 
|---|
|  |  |  | case 5: | 
|---|
|  |  |  | return AppendColor(TextColType.Red, msg, bright); | 
|---|
|  |  |  | return AppendColor(TextColType.itemshishi, msg, bright); | 
|---|
|  |  |  | case 6: | 
|---|
|  |  |  | return AppendColor(TextColType.itemchuanqi, msg, bright); | 
|---|
|  |  |  | case 7: | 
|---|
|  |  |  | return AppendColor(TextColType.itemshenhua, msg, bright); | 
|---|
|  |  |  | case 8: | 
|---|
|  |  |  | return AppendColor(TextColType.Pink, msg, bright); | 
|---|
|  |  |  | return AppendColor(TextColType.itemwuxia, msg, bright); | 
|---|
|  |  |  | case 9: | 
|---|
|  |  |  | return AppendColor(TextColType.Green, msg, bright); | 
|---|
|  |  |  | return AppendColor(TextColType.itemanjin, msg, bright); | 
|---|
|  |  |  | case 10: | 
|---|
|  |  |  | case 11: | 
|---|
|  |  |  | case 12: | 
|---|
|  |  |  | case 13: | 
|---|
|  |  |  | case 14: | 
|---|
|  |  |  | return AppendColor(TextColType.itemjueyi, msg, bright); | 
|---|
|  |  |  | case 15: | 
|---|
|  |  |  | case 16: | 
|---|
|  |  |  | case 17: | 
|---|
|  |  |  | case 18: | 
|---|
|  |  |  | case 19: | 
|---|
|  |  |  | return AppendColor(TextColType.itemyuanzu, msg, bright); | 
|---|
|  |  |  | case 20: | 
|---|
|  |  |  | case 21: | 
|---|
|  |  |  | case 22: | 
|---|
|  |  |  | case 23: | 
|---|
|  |  |  | case 24: | 
|---|
|  |  |  | return AppendColor(TextColType.itembuxiu, msg, bright); | 
|---|
|  |  |  | case 25: | 
|---|
|  |  |  | case 26: | 
|---|
|  |  |  | case 27: | 
|---|
|  |  |  | case 28: | 
|---|
|  |  |  | case 29: | 
|---|
|  |  |  | return AppendColor(TextColType.itemyonghen, msg, bright); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return msg; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static Color GetPropertyColor(int property) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #endregion | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #region 计算战斗力 | 
|---|
|  |  |  | public static readonly string FightPowerFormula = "FightpowerFormula"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // public static int GetFightPower(Dictionary<int, int> _propertyDict) | 
|---|
|  |  |  | // { | 
|---|
|  |  |  | //     Equation.Instance.Clear(); | 
|---|
|  |  |  | //     if (_propertyDict == null || _propertyDict.Count == 0) | 
|---|
|  |  |  | //     { | 
|---|
|  |  |  | //         return 0; | 
|---|
|  |  |  | //     } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //     foreach (var _key in _propertyDict.Keys) | 
|---|
|  |  |  | //     { | 
|---|
|  |  |  | //         PlayerPropertyConfig cfg = PlayerPropertyConfig.Get(_key); | 
|---|
|  |  |  | //         if (cfg != null) | 
|---|
|  |  |  | //         { | 
|---|
|  |  |  | //             if (_key == 7) | 
|---|
|  |  |  | //             { | 
|---|
|  |  |  | //                 Equation.Instance.AddKeyValue("MinAtk", _propertyDict[_key]); | 
|---|
|  |  |  | //                 Equation.Instance.AddKeyValue("MaxAtk", _propertyDict[_key]); | 
|---|
|  |  |  | //             } | 
|---|
|  |  |  | //             else if (_key == 24) | 
|---|
|  |  |  | //             { | 
|---|
|  |  |  | //                 Equation.Instance.AddKeyValue("PetMinAtk", _propertyDict[_key]); | 
|---|
|  |  |  | //                 Equation.Instance.AddKeyValue("PetMaxAtk", _propertyDict[_key]); | 
|---|
|  |  |  | //             } | 
|---|
|  |  |  | //             else | 
|---|
|  |  |  | //             { | 
|---|
|  |  |  | //                 ulong attrValue = (ulong)_propertyDict[_key]; | 
|---|
|  |  |  | //                 var fightParm = GetFightPowerParmByAttrId(_key); | 
|---|
|  |  |  | //                 if (_key == 11) | 
|---|
|  |  |  | //                 { | 
|---|
|  |  |  | //                     var playerLv = PlayerDatas.Instance.baseData.LV; | 
|---|
|  |  |  | //                     var paramConfig = FightPowerParamConfig.Get(playerLv); | 
|---|
|  |  |  | //                     Equation.Instance.AddKeyValue("AtkSpeedParameter", paramConfig.AtkSpeedParameter); | 
|---|
|  |  |  | //                 } | 
|---|
|  |  |  | //                 else | 
|---|
|  |  |  | //                 { | 
|---|
|  |  |  | //                     if (fightParm != 0) | 
|---|
|  |  |  | //                     { | 
|---|
|  |  |  | //                         attrValue = attrValue * (ulong)fightParm; | 
|---|
|  |  |  | //                     } | 
|---|
|  |  |  | //                 } | 
|---|
|  |  |  | //                 Equation.Instance.AddKeyValue(cfg.Parameter, attrValue); | 
|---|
|  |  |  | //             } | 
|---|
|  |  |  | //         } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //     } | 
|---|
|  |  |  | //     FuncConfigConfig funcCfg = FuncConfigConfig.Get(FightPowerFormula); | 
|---|
|  |  |  | //     return Equation.Instance.Eval<int>(funcCfg.Numerical1); | 
|---|
|  |  |  | // } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // public static int GetFightPowerParmByAttrId(int attrId) | 
|---|
|  |  |  | // { | 
|---|
|  |  |  | //     int playerLv = PlayerDatas.Instance.baseData.LV; | 
|---|
|  |  |  | //     FightPowerParamConfig paramConfig = FightPowerParamConfig.Get(playerLv); | 
|---|
|  |  |  | //     PlayerPropertyConfig cfg = PlayerPropertyConfig.Get(attrId); | 
|---|
|  |  |  | //     if (paramConfig == null || cfg == null) return 0; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //     switch (cfg.Parameter) | 
|---|
|  |  |  | //     { | 
|---|
|  |  |  | //         case "Hit": | 
|---|
|  |  |  | //             return paramConfig.Hit; | 
|---|
|  |  |  | //         case "Miss": | 
|---|
|  |  |  | //             return paramConfig.Miss; | 
|---|
|  |  |  | //         case "IgnoreDefRate": | 
|---|
|  |  |  | //             return paramConfig.IgnoreDefRate; | 
|---|
|  |  |  | //         case "DamChanceDef": | 
|---|
|  |  |  | //             return paramConfig.DamChanceDef; | 
|---|
|  |  |  | //         case "FaintRate": | 
|---|
|  |  |  | //             return paramConfig.FaintRate; | 
|---|
|  |  |  | //         case "LuckyHitRateReduce": | 
|---|
|  |  |  | //             return paramConfig.LuckyHitRateReduce; | 
|---|
|  |  |  | //         case "SkillAtkRate": | 
|---|
|  |  |  | //             return paramConfig.SkillAtkRate; | 
|---|
|  |  |  | //         case "SkillAtkRateReduce": | 
|---|
|  |  |  | //             return paramConfig.SkillAtkRateReduce; | 
|---|
|  |  |  | //         case "DamagePerPVP": | 
|---|
|  |  |  | //             return paramConfig.DamagePerPVP; | 
|---|
|  |  |  | //         case "DamagePerPVPReduce": | 
|---|
|  |  |  | //             return paramConfig.DamagePerPVPReduce; | 
|---|
|  |  |  | //         case "DamBackPer": | 
|---|
|  |  |  | //             return paramConfig.DamBackPer; | 
|---|
|  |  |  | //         case "IgnoreDefRateReduce": | 
|---|
|  |  |  | //             return paramConfig.IgnoreDefRateReduce; | 
|---|
|  |  |  | //         case "FaintDefRate": | 
|---|
|  |  |  | //             return paramConfig.FaintDefRate; | 
|---|
|  |  |  | //         case "AtkSpeedParameter": | 
|---|
|  |  |  | //             return paramConfig.AtkSpeedParameter; | 
|---|
|  |  |  | //         case "JobAHurtAddPer": | 
|---|
|  |  |  | //             return paramConfig.JobAHurtAddPer; | 
|---|
|  |  |  | //         case "JobBHurtAddPer": | 
|---|
|  |  |  | //             return paramConfig.JobBHurtAddPer; | 
|---|
|  |  |  | //         case "JobCHurtAddPer": | 
|---|
|  |  |  | //             return paramConfig.JobCHurtAddPer; | 
|---|
|  |  |  | //         case "JobAAtkReducePer": | 
|---|
|  |  |  | //             return paramConfig.JobAAtkReducePer; | 
|---|
|  |  |  | //         case "JobBAtkReducePer": | 
|---|
|  |  |  | //             return paramConfig.JobBAtkReducePer; | 
|---|
|  |  |  | //         case "JobCAtkReducePer": | 
|---|
|  |  |  | //             return paramConfig.JobCAtkReducePer; | 
|---|
|  |  |  | //         case "SuperHitRate": | 
|---|
|  |  |  | //             return paramConfig.SuperHitRate; | 
|---|
|  |  |  | //         case "LuckyHitRate": | 
|---|
|  |  |  | //             return paramConfig.LuckyHitRate; | 
|---|
|  |  |  | //         case "SuperHitRateReduce": | 
|---|
|  |  |  | //             return paramConfig.SuperHitRateReduce; | 
|---|
|  |  |  | //         case "FinalHurtPer": | 
|---|
|  |  |  | //             return paramConfig.FinalHurtPer; | 
|---|
|  |  |  | //         case "FinalHurtReducePer": | 
|---|
|  |  |  | //             return paramConfig.FinalHurtReducePer; | 
|---|
|  |  |  | //         case "NPCHurtAddPer": | 
|---|
|  |  |  | //             return paramConfig.NPCHurtAddPer; | 
|---|
|  |  |  | //         case "NormalHurtPer": | 
|---|
|  |  |  | //             return paramConfig.NormalHurtPer; | 
|---|
|  |  |  | //         case "FabaoHurtPer": | 
|---|
|  |  |  | //             return paramConfig.FabaoHurtPer; | 
|---|
|  |  |  | //         case "AffairSpeedPer": | 
|---|
|  |  |  | //             return paramConfig.AffairSpeedPer; | 
|---|
|  |  |  | //         case "FamilyBossHurtPer": | 
|---|
|  |  |  | //             return paramConfig.FamilyBossHurtPer; | 
|---|
|  |  |  | //         case "FamilyWarHPPer": | 
|---|
|  |  |  | //             return paramConfig.FamilyWarHPPer; | 
|---|
|  |  |  | //         case "FamilyWarAtkPer": | 
|---|
|  |  |  | //             return paramConfig.FamilyWarAtkPer; | 
|---|
|  |  |  | //         case "FamilySitExpPer": | 
|---|
|  |  |  | //             return paramConfig.FamilySitExpPer; | 
|---|
|  |  |  | //         case "BossFinalHurtPer": | 
|---|
|  |  |  | //             return paramConfig.BossFinalHurtPer; | 
|---|
|  |  |  | //     } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //     return 0; | 
|---|
|  |  |  | // } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #endregion | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #region 得到金钱数量根据金钱类型 | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | return 0; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //货币对应0418类型 | 
|---|
|  |  |  | public static Dictionary<int, PlayerDataType> moneyTypeToPlayerDataType = new Dictionary<int, PlayerDataType>() | 
|---|
|  |  |  | { | 
|---|
|  |  |  | {1, PlayerDataType.Gold}, | 
|---|
|  |  |  | {2, PlayerDataType.GoldPaper}, | 
|---|
|  |  |  | {3, PlayerDataType.Silver}, | 
|---|
|  |  |  | {41, PlayerDataType.default26}, | 
|---|
|  |  |  | {42, PlayerDataType.default33}, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static ulong GetMoneyCnt(int moneyType) | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static long GetMoneyCnt(int moneyType) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | switch (moneyType) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | case 18: | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.honorValue; | 
|---|
|  |  |  | return PlayerDatas.Instance.extersion.honorValue; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | case 25: | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | case 24: | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return (ulong)PlayerDatas.Instance.extersion.runeChip; | 
|---|
|  |  |  | return PlayerDatas.Instance.extersion.runeChip; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | case 15: | 
|---|
|  |  |  | { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | case 42: | 
|---|
|  |  |  | { | 
|---|
|  |  |  | //结晶 | 
|---|
|  |  |  | //将星玉髓 | 
|---|
|  |  |  | return PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.default33); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | case 43: | 
|---|
|  |  |  | 
|---|
|  |  |  | //武将招募积分 | 
|---|
|  |  |  | return PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.default44); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | case 52: | 
|---|
|  |  |  | { | 
|---|
|  |  |  | //淘金令 | 
|---|
|  |  |  | return PlayerDatas.Instance.GetPlayerDataByType(PlayerDataType.GoldRush); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | case 98: | 
|---|
|  |  |  | { | 
|---|
|  |  |  | //过期型代金券 | 
|---|
|  |  |  | 
|---|
|  |  |  | return 0; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static int GetAllVourcher() | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return (int)GetMoneyCnt(98) + (int)GetMoneyCnt(99); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //显示数量, 格式n/m, 足够绿色不足红色 | 
|---|
|  |  |  | public static string ShowUseMoney(int moneyType, long useCnt, TextColType engoughColor = TextColType.Green) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | long cnt = GetMoneyCnt(moneyType); | 
|---|
|  |  |  | return AppendColor(useCnt <= cnt ? engoughColor : TextColType.Red, $"{ReplaceLargeNum(cnt)}/{ReplaceLargeNum(useCnt)}"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static string ShowUseItem(PackType type, int itemId, long useCnt, TextColType engoughColor = TextColType.Green) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | long cnt = PackManager.Instance.GetItemCountByID(type, itemId); | 
|---|
|  |  |  | return AppendColor(useCnt <= cnt ? engoughColor : TextColType.Red, $"{ReplaceLargeNum(cnt)}/{ReplaceLargeNum(useCnt)}"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /// <param name="needTips">0 不响应 1 弹提示 2 弹获取途径tips</param> | 
|---|
|  |  |  | public static bool CheckMoneyCount(int moneyType, long needCount, int needTips = 0) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | if (needCount <= 0) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return true; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | long haveCount = GetMoneyCnt(moneyType); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | bool isEnough = haveCount >= needCount; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (!isEnough) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | if (needTips == 1) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | SysNotifyMgr.Instance.ShowTip("LackMoney", moneyType); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | else if (needTips == 2) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | ItemTipUtility.ShowMoneyTip(moneyType); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return isEnough; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #endregion | 
|---|
|  |  |  |  | 
|---|
|  |  |  | #region 得到装备位对应的部位名称 | 
|---|
|  |  |  | public static string GetEquipPlaceName(int place) | 
|---|
|  |  |  | #region 得到装备位或者祝福树品质名称 带颜色 | 
|---|
|  |  |  | public static string GetQualityNameWithColor(int quality, string format = "{0}") | 
|---|
|  |  |  | { | 
|---|
|  |  |  | if (GeneralDefine.equipPlaceNameDict.ContainsKey(place)) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | return GeneralDefine.equipPlaceNameDict[place]; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ""; | 
|---|
|  |  |  | return AppendColor(quality, string.Format(format, Language.Get("equipQuality" + quality)), true, 1); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | #endregion | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | 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) | 
|---|
|  |  |  | 
|---|
|  |  |  | return money / scale; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static string RemoveColor(string content) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | content = WordAnalysis.Color_Start_Regex.Replace(content, string.Empty); | 
|---|
|  |  |  | content = WordAnalysis.Color_End_Regex.Replace(content, string.Empty); | 
|---|
|  |  |  | return content; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|