Ejemplo n.º 1
0
    void TaskItemCollect(Client.stTaskNpcItem stData)
    {
        if (DataManager.Manager <UIPanelManager>().IsShowPanel(PanelID.MainUsePanel))
        {
            return;
        }

        MainUsePanelData mainUsePanelData = new MainUsePanelData();

        mainUsePanelData.type    = stData.type;
        mainUsePanelData.Id      = stData.Id;
        mainUsePanelData.onClick = MainUsePanelItemOnClick;

        this.tempNpcId = stData.Id;

        bool enterCityWar = DataManager.Manager <CityWarManager>().EnterCityWar;
        bool enterCamp    = DataManager.Manager <CampCombatManager>().isEnterScene;

        //城战,阵营战不出采集,这两个副本是占领塔
        if (enterCityWar || enterCamp)
        {
            return;
        }

        DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.MainUsePanel, data: mainUsePanelData);
    }
Ejemplo n.º 2
0
    public void OnEvent(int eventid, object param)
    {
        if (eventid == (int)Client.GameEventID.TASK_VISITNPC)
        {
            m_currvisitNpc = (uint)param;
        }
        else if (eventid == (int)Client.GameEventID.TASK_ITEM_COLLECT_USE)
        {
            Client.stTaskNpcItem stData = (Client.stTaskNpcItem)param;
            TaskItemCollect(stData);
        }
        else if (eventid == (int)Client.GameEventID.SYSTEM_LOADUICOMPELETE)
        {
            if (!FirstLoginSuccess)
            {
                FirstLoginSuccess = true;

                if (m_nAcceptTaskId != 0)
                {
                    Engine.Utility.EventEngine.Instance().DispatchEvent((int)Client.GameEventID.TASK_ACCEPT, m_nAcceptTaskId);
                    m_nAcceptTaskId = 0;
                }
            }
        }
        else if ((int)Client.GameEventID.RECONNECT_SUCESS == eventid)
        {
            this.FirstLoginSuccess = true;

            //大重连  服务器会重发所有消息
            Client.stReconnectSucess rs = (Client.stReconnectSucess)param;
            if (rs.isLogin)
            {
                this.m_bReconnect = true;

                if (DataManager.Manager <UIPanelManager>().IsShowPanel(PanelID.NpcDialogPanel))
                {
                    DataManager.Manager <UIPanelManager>().HidePanel(PanelID.NpcDialogPanel);
                    DataManager.Manager <UIPanelManager>().ShowMain();
                }
                Engine.Utility.Log.Info("重连成功关闭任务追踪界面");
                //DataManager.Manager<UIPanelManager>().HidePanel(PanelID.MissionAndTeamPanel);
            }
        }
        else if ((int)Client.GameEventID.ENTITYSYSTEM_CREATEENTITY == eventid)
        {
            Client.stCreateEntity createEntity = (Client.stCreateEntity)param;
            AddEntityEffect(createEntity);
        }
        else if ((int)Client.GameEventID.ENTITYSYSTEM_REMOVEENTITY == eventid)
        {
            Client.stRemoveEntity removeEntity = (Client.stRemoveEntity)param;
            RemoveEntityEffect(removeEntity);
        }
        else if ((int)Client.GameEventID.TASK_CANSUBMIT == eventid)
        {
            Client.stTaskCanSubmit taskSubmit = (Client.stTaskCanSubmit)param;
            RemoveCollectNpcEffectByTaskId(taskSubmit.taskid);
        }
    }