| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222 | 
							- using FairyGUI;
 
- using ET;
 
- using System.Collections.Generic;
 
- using System;
 
- using UI.CommonGame;
 
- namespace GFGGame
 
- {
 
-     public class RoleInfoManager : SingletonBase<RoleInfoManager>
 
-     {
 
-         public void Clear()
 
-         {
 
-             _headDatas.Clear();
 
-             _headBorderDatas.Clear();
 
-             _newHeadDatas.Clear();
 
-             _newHeadBorderDatas.Clear();
 
-         }
 
-         private List<int> _headDatas = new List<int>();
 
-         public List<int> headDatas
 
-         {
 
-             get
 
-             {
 
-                 return _headDatas;
 
-             }
 
-         }
 
-         private List<int> _headBorderDatas = new List<int>();
 
-         public List<int> headBorderDatas
 
-         {
 
-             get
 
-             {
 
-                 return _headBorderDatas;
 
-             }
 
-         }
 
-         public void Add(int itemId)
 
-         {
 
-             ItemCfg cfg = ItemCfgArray.Instance.GetCfg(itemId);
 
-             if (cfg.subType == 0)
 
-             {
 
-                 if (_headDatas.IndexOf(itemId) < 0)
 
-                 {
 
-                     _headDatas.Add(itemId);
 
-                 }
 
-             }
 
-             else if (cfg.subType == 1)
 
-             {
 
-                 if (_headBorderDatas.IndexOf(itemId) < 0)
 
-                 {
 
-                     _headBorderDatas.Add(itemId);
 
-                 }
 
-             }
 
-         }
 
-         public void Remove(int itemId)
 
-         {
 
-             ItemCfg cfg = ItemCfgArray.Instance.GetCfg(itemId);
 
-             if (cfg.subType == 0)
 
-             {
 
-                 if (_headDatas.IndexOf(itemId) >= 0) _headDatas.Remove(itemId);
 
-             }
 
-             else if (cfg.subType == 1)
 
-             {
 
-                 if (_headBorderDatas.IndexOf(itemId) >= 0) _headBorderDatas.Remove(itemId);
 
-             }
 
-         }
 
-         private List<int> _newHeadDatas = new List<int>();
 
-         public List<int> newHeadDatas
 
-         {
 
-             get
 
-             {
 
-                 return _newHeadDatas;
 
-             }
 
-         }
 
-         private List<int> _newHeadBorderDatas = new List<int>();
 
-         public List<int> newHeadBorderDatas
 
-         {
 
-             get
 
-             {
 
-                 return _newHeadBorderDatas;
 
-             }
 
-         }
 
-         public void AddNew(int itemId)
 
-         {
 
-             ItemCfg cfg = ItemCfgArray.Instance.GetCfg(itemId);
 
-             if (cfg.subType == 0)
 
-             {
 
-                 if (_newHeadDatas.IndexOf(itemId) < 0) _newHeadDatas.Add(itemId);
 
-             }
 
-             else if (cfg.subType == 1)
 
-             {
 
-                 if (_newHeadBorderDatas.IndexOf(itemId) < 0) _newHeadBorderDatas.Add(itemId);
 
-             }
 
-         }
 
-         public void RemoveNew(int itemId)
 
-         {
 
-             ItemCfg cfg = ItemCfgArray.Instance.GetCfg(itemId);
 
-             if (cfg.subType == 0)
 
-             {
 
-                 if (_newHeadDatas.IndexOf(itemId) >= 0) _newHeadDatas.Remove(itemId);
 
-             }
 
-             else if (cfg.subType == 1)
 
-             {
 
-                 if (_newHeadBorderDatas.IndexOf(itemId) >= 0) _newHeadBorderDatas.Remove(itemId);
 
-             }
 
-         }
 
-         public bool isNewHead(int itemId)
 
-         {
 
-             return _newHeadDatas.IndexOf(itemId) >= 0;
 
-         }
 
-         public bool isNewHeadBorder(int itemId)
 
-         {
 
-             return _newHeadBorderDatas.IndexOf(itemId) >= 0;
 
-         }
 
-         public void SortHeadDatas()
 
-         {
 
-             _headDatas.Sort((int a, int b) =>
 
-             {
 
-                 if (_newHeadDatas.IndexOf(a) >= 0) return -1;
 
-                 if (_newHeadDatas.IndexOf(b) >= 0) return 1;
 
-                 if (a == RoleDataManager.headId) return -1;
 
-                 if (b == RoleDataManager.headId) return 1;
 
-                 return b - a;
 
-             });
 
-         }
 
-         public void SortHeadBorderDatas()
 
-         {
 
-             _headBorderDatas.Sort((int a, int b) =>
 
-             {
 
-                 if (_newHeadBorderDatas.IndexOf(a) >= 0) return -1;
 
-                 if (_newHeadBorderDatas.IndexOf(b) >= 0) return 1;
 
-                 if (a == RoleDataManager.headBorderId) return -1;
 
-                 if (b == RoleDataManager.headBorderId) return 1;
 
-                 return b - a;
 
-             });
 
-         }
 
-         public decimal GetGuideProgress()
 
-         {
 
-             int suitHaveCount = 0;
 
-             int suitTotalCount = 1;
 
-             DressUpMenuSuitDataManager.GetTotalProgress(out suitHaveCount, out suitTotalCount);
 
-             // int chapterItemHaveCount = 0;
 
-             // int chapterItemTotalCount = 1;
 
-             // InstanceZonesDataManager.GetTotalProgress(out chapterItemHaveCount, out chapterItemTotalCount);
 
-             // int travelHaveCount = 0;
 
-             // int travelTotalCount = 1;
 
-             // TravelDataManager.Instance.GetTotalTravelProgress(out travelHaveCount, out travelTotalCount);
 
-             // int haveCount = suitHaveCount + chapterItemHaveCount + travelHaveCount;
 
-             // int totalCount = suitTotalCount + chapterItemTotalCount + travelTotalCount;
 
-             decimal value = Math.Floor((decimal)100 * suitHaveCount / suitTotalCount);
 
-             return value;
 
-         }
 
-         public void UpdateHeadWithLv(GComponent component, int headId, int roleBorderId, int lv)
 
-         {
 
-             UI_ComHeadWithLv comHeadWithLv = UI_ComHeadWithLv.Proxy(component);
 
-             UpdateHead(comHeadWithLv.m_comHead.target, headId, roleBorderId);
 
-             UpdateLv(comHeadWithLv.m_comLv.target, lv);
 
-             UI_ComHeadWithLv.ProxyEnd();
 
-         }
 
-         public void UpdateHeadWithLv1(GComponent component, int headId, int roleBorderId, int lv)
 
-         {
 
-             UI_ComHeadWithLv1 comHeadWithLv = UI_ComHeadWithLv1.Proxy(component);
 
-             ItemCfg headCfg = ItemCfgArray.Instance.GetCfg(headId == 0 ? ConstItemID.HEADID : headId);
 
-             ItemCfg headBorderCfg = ItemCfgArray.Instance.GetCfg(roleBorderId == 0 ? ConstItemID.HEADBORDERID : roleBorderId);
 
-             comHeadWithLv.m_comHead.m_loaIcon.url = ResPathUtil.GetHeadPath(headCfg.res);
 
-             comHeadWithLv.m_loaHeadBorder.url = ResPathUtil.GetHeadBorderPath(headBorderCfg.res);
 
-             comHeadWithLv.m_txtLv.text = lv > 0 ? lv.ToString() : "--";
 
-             UI_ComHeadWithLv1.ProxyEnd();
 
-         }
 
-         public void UpdateHead(GComponent component, int headId, int roleBorderId)
 
-         {
 
-             ItemCfg headCfg = ItemCfgArray.Instance.GetCfg(headId == 0 ? ConstItemID.HEADID : headId);
 
-             ItemCfg headBorderCfg = ItemCfgArray.Instance.GetCfg(roleBorderId == 0 ? ConstItemID.HEADBORDERID : roleBorderId);
 
-             UI_ComHead comHead = UI_ComHead.Proxy(component);
 
-             comHead.m_comHead.m_loaIcon.url = ResPathUtil.GetHeadPath(headCfg.res);
 
-             comHead.m_loaBorder.url = ResPathUtil.GetHeadBorderPath(headBorderCfg.res);
 
-             UI_ComHead.ProxyEnd();
 
-         }
 
-         public void UpdateNpcHead(GComponent component, string res)
 
-         {
 
-             UI_ComHead comHead = UI_ComHead.Proxy(component);
 
-             if (string.IsNullOrEmpty(res))
 
-             {
 
-                 comHead.m_comHead.m_loaIcon.url = res;
 
-             }
 
-             else
 
-             {
 
-                 comHead.m_comHead.m_loaIcon.url = ResPathUtil.GetNpcHeadPath(res);
 
-             }
 
-             UI_ComHead.ProxyEnd();
 
-         }
 
-         public void UpdateLv(GComponent component, int lv)
 
-         {
 
-             UI_ComHeadLv comLv = UI_ComHeadLv.Proxy(component);
 
-             comLv.m_txtLvl.text = lv > 0 ? lv.ToString() : "--";
 
-             UI_ComHeadLv.ProxyEnd();
 
-         }
 
-     }
 
- }
 
 
  |