Example #1
0
 void OnEvent(int eventID, object data)
 {
     if (eventID == (int)GameEventID.SKILLSYSTEM_SETSKILLPOS)
     {
         stSetSkillPos sp = (stSetSkillPos)data;
         if (sp.pos == (uint)m_skillBtnIndex)
         {
             SkillDatabase db = GameTableManager.Instance.GetTableItem <SkillDatabase>(sp.skillid, 1);
             if (db != null)
             {
                 GuideDefine.FuncOpenShowData showData = new GuideDefine.FuncOpenShowData()
                 {
                     FOT       = GuideDefine.FuncOpenType.Skill,
                     Icon      = UIManager.BuildCircleIconName(db.iconPath),
                     TargetObj = this.gameObject,
                     Name      = db.strName,
                     Data      = data,
                 };
                 Engine.Utility.EventEngine.Instance().DispatchEvent((int)Client.GameEventID.UIEVENTNEWFUNCOPENADD, showData);
             }
         }
     }
 }
Example #2
0
    void OnUIEvent(int type, object data)
    {
        switch (type)
        {
        case (int)Client.GameEventID.UIEVENT_UPDATEITEM:
        {
            OnUpdateItemDataUI(data);        //快捷使用道具
        }
        break;

        case (int)Client.GameEventID.UIEVENTNEWFUNCCOMPLETE:
        {
            if (data is GuideDefine.FuncOpenShowData)
            {
                GuideDefine.FuncOpenShowData guideData = (GuideDefine.FuncOpenShowData)data;
                if (guideData.FOT == GuideDefine.FuncOpenType.Skill)
                {        //SetSkillIcon
                    stSetSkillPos pos = (stSetSkillPos)guideData.Data;
                    for (int i = 0; i < m_lstSkillBtns.Count; i++)
                    {
                        if (m_lstSkillBtns[i].SkillIndex == pos.pos)
                        {
                            m_lstSkillBtns[i].Refresh();
                        }
                    }
                }
            }
        }
        break;

        case (int)Client.GameEventID.UIEVENT_SHORTCUTITEMUI:
        {
            InitShortcutUIAndData();
        }
        break;
        }
    }
Example #3
0
 public void OnSetLocation(stSetUsePosSkillUserCmd_CS cmd)
 {
     if (cmd.ret == (uint)SkillRet.SkillRet_Success)
     {
         //Log.Info("技能设置成功 error code is " + cmd.ret);
         stSetSkillPos sp = new stSetSkillPos();
         sp.pos     = cmd.index;
         sp.skillid = cmd.skillid;
         uint level = GetUnLockLevelByLoc((uint)cmd.index);
         if (MainPlayerHelper.GetPlayerLevel() > level)
         {
             DataManager.Manager <UIPanelManager>().SendMsg(PanelID.MainPanel, UIMsgID.eSkillBtnRefresh, null);
         }
         else
         {
             EventEngine.Instance().DispatchEvent((int)GameEventID.SKILLSYSTEM_SETSKILLPOS, sp);
         }
     }
     else
     {
         SetAllSettingItem();
         Log.Error("技能设置错误 error code is " + cmd.ret);
     }
 }