Esempio n. 1
0
    /// <summary>
    /// 根据服务器信息 初始化设置面板
    /// </summary>
    /// <param name="cmd"></param>
    public void OnInitLocation(stSendUsePosListSkillUserCmd_S cmd)
    {
        List <SkillUsePos> posList = cmd.status_pos;

        //  if (CurState == SkillSettingState.None)
        {
            CurState = cmd.cur_status == 0 ? SkillSettingState.StateOne : SkillSettingState.StateTwo;
        }


        for (int i = 0; i < posList.Count; i++)
        {
            var  userpos = posList[i];
            uint status  = userpos.status;
            if (userpos.status == (uint)SkillSettingState.StateOne)
            {
                stateOneDic.Clear();

                for (int j = 0; j < userpos.skill_pos.Count; j++)
                {
                    var  skillpos = userpos.skill_pos[j];
                    uint totalid  = skillpos.skillid;
                    //ushort skillID = (ushort)( totalid >> 16 );
                    //ushort level = (ushort)totalid;
                    if (!stateOneDic.ContainsKey((int)skillpos.index))
                    {
                        stateOneDic.Add((int)skillpos.index, totalid);
                    }
                    else
                    {
                        stateOneDic[(int)skillpos.index] = totalid;
                    }
                }
            }
            else if (userpos.status == (uint)SkillSettingState.StateTwo)
            {
                stateTwoDic.Clear();
                for (int j = 0; j < userpos.skill_pos.Count; j++)
                {
                    var  skillpos = userpos.skill_pos[j];
                    uint totalid  = skillpos.skillid;
                    //ushort skillID = (ushort)( totalid >> 16 );
                    //ushort level = (ushort)totalid;
                    if (!stateTwoDic.ContainsKey((int)skillpos.index))
                    {
                        stateTwoDic.Add((int)skillpos.index, totalid);
                    }
                    else
                    {
                        stateTwoDic[(int)skillpos.index] = totalid;
                    }
                }
            }
        }
        SetCurStateSkillList();
        SetAllSettingItem();
        DataManager.Manager <UIPanelManager>().SendMsg(PanelID.MainPanel, UIMsgID.eSkillBtnRefresh, null);
    }
Esempio n. 2
0
 public void OnArenaSkillLocationInit(stSendUsePosListSkillUserCmd_S cmd)
 {
     DataManager.Manager <LearnSkillDataManager>().OnInitLocation(cmd);
 }