public override void Validate()
        {
            ListView <ActivityPhase> phaseList = base.view.activity.PhaseList;

            if (phaseList.Count > 0)
            {
                this._tips.set_text(base.view.activity.Tips);
                int target = base.view.activity.Target;
                int num    = base.view.activity.Current;
                if (num > target)
                {
                    num = target;
                }
                float         width     = this._back.GetComponent <RectTransform>().rect.width;
                float         num2      = (float)num / (float)target;
                RectTransform component = this._fore.GetComponent <RectTransform>();
                component.sizeDelta = new Vector2(num2 * width, component.rect.height);
                for (int i = 0; i < phaseList.Count; i++)
                {
                    ActivityPhase         activityPhase = phaseList[i];
                    float                 num3          = (float)activityPhase.Target / (float)target;
                    ProgressWidget.Cursor cursor        = this._cursorArray[i];
                    cursor.root.transform.localPosition = new Vector3(num3 * width, 0f, 0f);
                    cursor.root.transform.localScale    = Vector3.one;
                    cursor.root.transform.localRotation = Quaternion.identity;
                    bool flag = num >= activityPhase.Target;
                    cursor.valTxt.set_text(activityPhase.Target.ToString());
                    cursor.valTxt.set_color(flag ? Color.white : Color.gray);
                    cursor.arrow.set_color(flag ? Color.white : Color.gray);
                }
            }
        }
Exemplo n.º 2
0
        public override void Validate()
        {
            ListView <ActivityPhase> phaseList = base.view.activity.PhaseList;

            if (phaseList.Count > 0)
            {
                this._tips.text = base.view.activity.Tips;
                int target  = base.view.activity.Target;
                int current = base.view.activity.Current;
                if (current > target)
                {
                    current = target;
                }
                float         width     = this._back.GetComponent <RectTransform>().rect.width;
                float         num4      = ((float)current) / ((float)target);
                RectTransform component = this._fore.GetComponent <RectTransform>();
                component.sizeDelta = new Vector2(num4 * width, component.rect.height);
                for (int i = 0; i < phaseList.Count; i++)
                {
                    ActivityPhase phase  = phaseList[i];
                    float         num6   = ((float)phase.Target) / ((float)target);
                    Cursor        cursor = this._cursorArray[i];
                    cursor.root.transform.localPosition = new Vector3(num6 * width, 0f, 0f);
                    cursor.root.transform.localScale    = Vector3.one;
                    cursor.root.transform.localRotation = Quaternion.identity;
                    bool flag = current >= phase.Target;
                    cursor.valTxt.text  = phase.Target.ToString();
                    cursor.valTxt.color = !flag ? Color.gray : Color.white;
                    cursor.arrow.color  = !flag ? Color.gray : Color.white;
                }
            }
        }
        private void OnClickGet(CUIEvent uiEvent)
        {
            ActivityPhase curPhase = base.view.activity.CurPhase;

            if (curPhase != null)
            {
                curPhase.DrawReward();
            }
        }
        private static int APSort(ActivityPhase x, ActivityPhase y)
        {
            bool readyForGet  = x.ReadyForGet;
            bool readyForGet2 = y.ReadyForGet;

            if (readyForGet == readyForGet2)
            {
                return((int)((x.Marked == y.Marked) ? (x.ID - y.ID) : (x.Marked ? 1u : 4294967295u)));
            }
            return(readyForGet ? -1 : 1);
        }
Exemplo n.º 5
0
        private static int APSort(ActivityPhase x, ActivityPhase y)
        {
            bool readyForGet = x.ReadyForGet;
            bool flag2       = y.ReadyForGet;

            if (readyForGet == flag2)
            {
                return((x.Marked != y.Marked) ? (!x.Marked ? -1 : 1) : ((int)(x.ID - y.ID)));
            }
            return(!readyForGet ? 1 : -1);
        }
Exemplo n.º 6
0
        private static int APSort(ActivityPhase x, ActivityPhase y)
        {
            bool readyForGet  = x.ReadyForGet;
            bool readyForGet2 = y.ReadyForGet;

            if (readyForGet == readyForGet2)
            {
                return((int)((x.Marked != y.Marked) ? ((!x.Marked) ? 4294967295u : 1u) : (x.ID - y.ID)));
            }
            return((!readyForGet) ? 1 : -1);
        }
 public RewardListItem(GameObject node, RewardWidget ownWgt, ActivityPhase ap)
 {
     this.root      = node;
     this.ownerWgt  = ownWgt;
     this.actvPhase = ap;
     this.cellList  = new GameObject[4];
     for (int i = 0; i < 4; i++)
     {
         this.cellList[i] = Utility.FindChild(node, "Items/Item" + i);
     }
     this.getBtn    = Utility.FindChild(node, "GetAward");
     this.getBtnTxt = Utility.GetComponetInChild <Text>(this.getBtn, "Text");
     this.tips      = Utility.GetComponetInChild <Text>(node, "Tips");
     this.flag      = Utility.GetComponetInChild <Image>(node, "Flag");
     this.actvPhase.OnMaskStateChange += new ActivityPhase.ActivityPhaseEvent(this.OnStateChange);
     this.actvPhase.OnTimeStateChange += new ActivityPhase.ActivityPhaseEvent(this.OnStateChange);
 }
Exemplo n.º 8
0
 protected void AddPhase(ActivityPhase ap)
 {
     this._phaseList.Add(ap);
 }
 private void OnStateChange(ActivityPhase ap)
 {
     this.Validate();
 }
        public override void Validate()
        {
            ActivityPhase curPhase = base.view.activity.CurPhase;

            if (curPhase == null)
            {
                return;
            }
            if (curPhase.RewardDesc.get_Length() > 0)
            {
                this._awardDesc.set_text(curPhase.RewardDesc);
            }
            else
            {
                CUseable useable = curPhase.GetUseable(0);
                if (useable != null)
                {
                    this._awardDesc.set_text(useable.m_name + ":" + curPhase.GetDropCount(0));
                }
            }
            if (curPhase.ReadyForGet)
            {
                this._getBtn.GetComponent <CUIEventScript>().enabled = true;
                this._getBtn.GetComponent <Button>().set_interactable(true);
                this._getBtnText.set_color(Color.white);
                this._awardTitle.set_text(Singleton <CTextManager> .GetInstance().GetText("awardToday"));
                this._getBtnText.set_text(Singleton <CTextManager> .GetInstance().GetText("get"));
                this._remainSeconds = 0u;
                this._timeRemain.set_text(Singleton <CTextManager> .GetInstance().GetText("timeCountDown").Replace("{0}", Utility.SecondsToTimeText(0u)));
            }
            else
            {
                this._getBtn.GetComponent <CUIEventScript>().enabled = false;
                this._getBtn.GetComponent <Button>().set_interactable(false);
                this._getBtnText.set_color(Color.gray);
                if (base.view.activity.Completed)
                {
                    this._awardTitle.set_text(Singleton <CTextManager> .GetInstance().GetText("awardToday"));
                    this._getBtnText.set_text(Singleton <CTextManager> .GetInstance().GetText("finished"));
                    this._remainSeconds = 0u;
                    this._timeRemain.set_text(Singleton <CTextManager> .GetInstance().GetText("congraduFinish"));
                }
                else
                {
                    this._awardTitle.set_text(Singleton <CTextManager> .GetInstance().GetText("awardTomorrow"));
                    this._getBtnText.set_text(Singleton <CTextManager> .GetInstance().GetText("notInTime"));
                    DateTime dateTime  = Utility.ToUtcTime2Local((long)CRoleInfo.GetCurrentUTCTime());
                    DateTime dateTime2 = dateTime.AddDays(1.0);
                    dateTime2           = new DateTime(dateTime2.get_Year(), dateTime2.get_Month(), dateTime2.get_Day(), 0, 0, 0);
                    this._remainSeconds = (uint)(dateTime2 - dateTime).get_TotalSeconds();
                    this._timeRemain.set_text(Singleton <CTextManager> .GetInstance().GetText("timeCountDown").Replace("{0}", Utility.SecondsToTimeText(this._remainSeconds)));
                }
            }
            Text   progLabel = this._progLabel;
            string text      = Singleton <CTextManager> .GetInstance().GetText("CheckInProgress");

            string text2   = "{0}";
            int    current = base.view.activity.Current;

            progLabel.set_text(text.Replace(text2, current.ToString()).Replace("{1}", base.view.activity.Target.ToString()));
        }
Exemplo n.º 11
0
        public override void Validate()
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo != null)
            {
                ActivityPhase curPhase = base.view.activity.CurPhase;
                if (curPhase != null)
                {
                    if (curPhase.RewardDesc.Length > 0)
                    {
                        this._awardDesc.text = curPhase.RewardDesc;
                    }
                    else
                    {
                        CUseable useable = curPhase.GetUseable(0);
                        if (useable != null)
                        {
                            this._awardDesc.text = useable.m_name + ":" + curPhase.GetDropCount(0);
                        }
                    }
                    if (curPhase.ReadyForGet)
                    {
                        this._getBtn.GetComponent <CUIEventScript>().enabled = true;
                        this._getBtn.GetComponent <Button>().interactable    = true;
                        this._getBtnText.color = Color.white;
                        this._awardTitle.text  = Singleton <CTextManager> .GetInstance().GetText("awardToday");

                        this._getBtnText.text = Singleton <CTextManager> .GetInstance().GetText("get");

                        this._remainSeconds   = 0;
                        this._timeRemain.text = Singleton <CTextManager> .GetInstance().GetText("timeCountDown").Replace("{0}", Utility.SecondsToTimeText(0));
                    }
                    else
                    {
                        this._getBtn.GetComponent <CUIEventScript>().enabled = false;
                        this._getBtn.GetComponent <Button>().interactable    = false;
                        this._getBtnText.color = Color.gray;
                        if (base.view.activity.Completed)
                        {
                            this._awardTitle.text = Singleton <CTextManager> .GetInstance().GetText("awardToday");

                            this._getBtnText.text = Singleton <CTextManager> .GetInstance().GetText("finished");

                            this._remainSeconds   = 0;
                            this._timeRemain.text = Singleton <CTextManager> .GetInstance().GetText("congraduFinish");
                        }
                        else
                        {
                            this._awardTitle.text = Singleton <CTextManager> .GetInstance().GetText("awardTomorrow");

                            this._getBtnText.text = Singleton <CTextManager> .GetInstance().GetText("notInTime");

                            DateTime time  = Utility.ToUtcTime2Local((long)masterRoleInfo.getCurrentTimeSinceLogin());
                            DateTime time2 = time.AddDays(1.0);
                            time2 = new DateTime(time2.Year, time2.Month, time2.Day, 0, 0, 0);
                            TimeSpan span = (TimeSpan)(time2 - time);
                            this._remainSeconds   = (uint)span.TotalSeconds;
                            this._timeRemain.text = Singleton <CTextManager> .GetInstance().GetText("timeCountDown").Replace("{0}", Utility.SecondsToTimeText(this._remainSeconds));
                        }
                    }
                    this._progLabel.text = Singleton <CTextManager> .GetInstance().GetText("CheckInProgress").Replace("{0}", base.view.activity.Current.ToString()).Replace("{1}", base.view.activity.Target.ToString());
                }
            }
        }