| | |
| | | using System;
|
| | |
|
| | | using System.Text;
|
| | | using System.Linq;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
| | |
|
| | | Dictionary<int, Achievement> achievements = new Dictionary<int, Achievement>();
|
| | | Dictionary<int, List<int>> achievementCategorys = new Dictionary<int, List<int>>();//客户端必须按group分类
|
| | | public Dictionary<int, int> groupToType = new Dictionary<int, int>();
|
| | | public Dictionary<int, List<int>> typeToGroup = new Dictionary<int, List<int>>(); //所有的类型对应组别
|
| | | public Dictionary<int, int> typeToGroupBP = new Dictionary<int, int>(); //战令的类型对应组别
|
| | |
|
| | | VipModel vipModel { get { return ModelCenter.Instance.GetModel<VipModel>(); } }
|
| | | PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | |
| | | DailyQuestModel dailyQuestModel { get { return ModelCenter.Instance.GetModel<DailyQuestModel>(); } }
|
| | | Dictionary<int, int> equipQualityItemIdTables = new Dictionary<int, int>() { { 1, 2110 }, { 2, 2111 }, { 3, 2112 }, { 4, 2113 }, { 5, 2114 } };
|
| | | public Dictionary<int, Redpoint> SuccessBPRedPoint = new Dictionary<int, Redpoint>();
|
| | | public string[] SuccessBPArray;
|
| | | public int[] SuccessBPArray;
|
| | | LogicUpdate logicUpdate = new LogicUpdate(0.4f);
|
| | |
|
| | | public Redpoint redpoint = new Redpoint(201, 20111);
|
| | |
| | | //修行之路
|
| | | public event Action OnUpdateBPDataEvent;
|
| | | public int BPCTGID = 117;
|
| | | private int m_selectSuccessType = 0;
|
| | | private int m_selectSuccessType = 0; //记录的是group 不是type
|
| | | public event Action selectSuccessTypeRefresh;
|
| | | public int selectSuccessType
|
| | | {
|
| | |
| | | {
|
| | | return;
|
| | | }
|
| | | foreach (var succType in SuccessBPArray)
|
| | | foreach (var succGroup in SuccessBPArray)
|
| | | {
|
| | | UpdateSuccessBPRedpoint(0, int.Parse(succType));
|
| | | UpdateSuccessBPRedpoint(0, groupToType[succGroup]);
|
| | | }
|
| | | }
|
| | |
|
| | | public void InitRedPoint()
|
| | | {
|
| | | SuccessBPRedPoint.Clear();
|
| | | foreach (var ids in SuccessBPArray)
|
| | | foreach (var succGroup in SuccessBPArray)
|
| | | {
|
| | | int id = int.Parse(ids);
|
| | | //按类型分红点
|
| | | SuccessBPRedPoint[id] = new Redpoint(20111, 20111*1000 + id);
|
| | | SuccessBPRedPoint[succGroup] = new Redpoint(20111, 20111*1000 + succGroup);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | foreach (int successType in refreshType)
|
| | | {
|
| | | if (!SuccessBPRedPoint.ContainsKey(successType))
|
| | | if (!typeToGroupBP.ContainsKey(successType))
|
| | | continue;
|
| | | var idList = GetAchievementsByCategory(successType);
|
| | | var group = typeToGroupBP[successType];
|
| | | if (!SuccessBPRedPoint.ContainsKey(group))
|
| | | continue;
|
| | | var idList = GetAchievementsByCategory(group);
|
| | |
|
| | | bool state = false;
|
| | | foreach (var successID in idList)
|
| | |
| | | break;
|
| | | }
|
| | | }
|
| | | SuccessBPRedPoint[successType].state = state == true ? RedPointState.Simple : RedPointState.None;
|
| | | if (successType == selectSuccessType)
|
| | | SuccessBPRedPoint[group].state = state == true ? RedPointState.Simple : RedPointState.None;
|
| | | if (selectSuccessType != 0 && group == selectSuccessType)
|
| | | {
|
| | | if (OnUpdateBPDataEvent != null)
|
| | | OnUpdateBPDataEvent();
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public List<int> GetAchievementsByType(int type)
|
| | | {
|
| | | List<int> allID = new List<int>();
|
| | | if (!typeToGroup.ContainsKey(type))
|
| | | {
|
| | | return allID;
|
| | | }
|
| | | foreach (var group in typeToGroup[type])
|
| | | {
|
| | | allID = allID.Union(new List<int>(achievementCategorys[group])).ToList<int>();
|
| | | }
|
| | | return allID;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | private string GetHighestSorceEquipByPlace(List<int> _places)
|
| | | {
|
| | | var itemPackage = playerPack.GetSinglePack(PackType.Item);
|
| | |
| | | var allconfig = SuccessConfig.GetValues();
|
| | | foreach (var config in allconfig)
|
| | | {
|
| | | UpdateGroupType(config);
|
| | | this.achievements[config.ID] = new Achievement(config);
|
| | |
|
| | | List<int> achievements;
|
| | |
| | |
|
| | | }
|
| | |
|
| | | SuccessBPArray = FuncConfigConfig.Get("PracticeSuccess").Numerical1.Split('|');
|
| | | SuccessBPArray = GeneralDefine.GetIntArray("PracticeSuccess");
|
| | | for (int i = 0; i < SuccessBPArray.Length; i++)
|
| | | {
|
| | | typeToGroupBP[groupToType[SuccessBPArray[i]]] = SuccessBPArray[i];
|
| | | }
|
| | | SortAchievementCategorys();
|
| | | }
|
| | |
|
| | | void UpdateGroupType(SuccessConfig config)
|
| | | {
|
| | | groupToType[config.Group] = config.Type;
|
| | | if (!typeToGroup.ContainsKey(config.Type))
|
| | | {
|
| | | typeToGroup[config.Type] = new List<int>();
|
| | | }
|
| | | if (typeToGroup[config.Type].IndexOf(config.Group) == -1)
|
| | | {
|
| | | typeToGroup[config.Type].Add(config.Group);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | const string conditionPattern = "@Condition@";
|
| | | const string needCntPattern = "@NeedCnt@";
|
| | | const string skillPattern = "@SkillName@";
|