Exemple #1
0
        public override void Init()
        {
            if (this.model == null)
            {
                this.model = new CTaskModel();
            }
            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Task_OpenForm, new CUIEventManager.OnUIEventHandler(this.OnOpenTaskForm));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Task_CloseForm, new CUIEventManager.OnUIEventHandler(this.OnCloseTaskForm));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Task_LinkPve, new CUIEventManager.OnUIEventHandler(this.OnLinkPveClick));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Task_TabChanged, new CUIEventManager.OnUIEventHandler(this.OnTaskChanged));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Task_AwardClose, new CUIEventManager.OnUIEventHandler(this.OnTaskAwardClose));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Task_List_ElementEnable, new CUIEventManager.OnUIEventHandler(this.On_Task_List_ElementEnable));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Task_Submit, new CUIEventManager.OnUIEventHandler(this.On_Task_Submit));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Task_Week_Reaward1, new CUIEventManager.OnUIEventHandler(this.OnTask_Week_Reaward1));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Task_Week_Reaward2, new CUIEventManager.OnUIEventHandler(this.OnTask_Week_Reaward2));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Task_Day_Reaward, new CUIEventManager.OnUIEventHandler(this.OnTask_Day_Reaward));

            Singleton <EventRouter> .instance.AddEventHandler("TASK_HUOYUEDU_Change", new Action(this, (IntPtr)this.On_TASK_HUOYUEDU_Change));

            this._monthCardTaskID     = 0;
            this._weekCardTaskID      = 0;
            this._monthCardExpireTime = 0;
            this._weekCardExpireTime  = 0;
            base.Init();
        }
Exemple #2
0
        private void OnTaskUpdate()
        {
            CTaskModel model = Singleton <CTaskSys> .instance.model;

            model.task_Data.Sort(RES_TASK_TYPE.RES_TASKTYPE_HEROWAKE);
            model.task_Data.Sort(RES_TASK_TYPE.RES_TASKTYPE_USUAL);
            model.task_Data.Sort(RES_TASK_TYPE.RES_TASKTYPE_MAIN);
            int count = Singleton <CTaskSys> .instance.model.task_Data.GetTask_Count(RES_TASK_TYPE.RES_TASKTYPE_MAIN, CTask.State.Have_Done) + Singleton <CTaskSys> .instance.model.task_Data.GetTask_Count(RES_TASK_TYPE.RES_TASKTYPE_USUAL, CTask.State.Have_Done);

            if (count > 0)
            {
                this.AddRedDot(enSysEntryID.TaskBtn, enRedDotPos.enTopRight, count);
            }
            else
            {
                this.DelRedDot(enSysEntryID.TaskBtn);
            }
        }