Beispiel #1
0
    public void RefreshProgress(int acId, float curSize, float allSize)
    {
        UpdateGiftItem itemById = this.GetItemById(acId);

        if (itemById != null)
        {
            itemById.SetProgressAndSpeed(curSize, allSize);
        }
    }
Beispiel #2
0
    private void OnClickButton(string type, UpdateGiftItem item)
    {
        if (item == null)
        {
            return;
        }
        if (type == "ClickButton")
        {
            if (item.Status == UpdateAcInfo.AcStep.STEP.Ready && OperateActivityManager.Instance.DownloadPackID > 0)
            {
                UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(513151, false));
                return;
            }
            switch (item.Status)
            {
            case UpdateAcInfo.AcStep.STEP.Ready:
                if (item.Data.FinishPar - 1 > OperateActivityManager.Instance.CurrentVersion)
                {
                    UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(513153, false));
                }
                else if (!OperateActivityManager.Instance.IsWifi)
                {
                    UIManagerControl.Instance.OpenUI("DialogBoxUI", UINodesManager.T3RootOfSpecial, false, UIType.NonPush);
                    DialogBoxUIViewModel.Instance.ShowAsOKCancel(GameDataUtils.GetChineseContent(621264, false), string.Format(GameDataUtils.GetChineseContent(513148, false), item.Pack.SizeMbit), null, delegate
                    {
                        OperateActivityManager.Instance.StartDownloadPackageById(item.Data.Id, true);
                        item.Status = UpdateAcInfo.AcStep.STEP.Start;
                    }, GameDataUtils.GetChineseContent(500012, false), GameDataUtils.GetChineseContent(500011, false), "button_orange_1", "button_yellow_1", UINodesManager.T4RootOfSpecial, true, true);
                }
                else
                {
                    OperateActivityManager.Instance.StartDownloadPackageById(item.Data.Id, false);
                    item.Status = UpdateAcInfo.AcStep.STEP.Start;
                }
                break;

            case UpdateAcInfo.AcStep.STEP.Finish:
                this.mLastReward = item.Data;
                OperateActivityManager.Instance.SendGetUpdateAwardReq(item.Data.Id);
                break;
            }
        }
        else if (type == "ClickReward")
        {
            this.mLastReward = item.Data;
            this.RewardPreView(true);
        }
    }
Beispiel #3
0
    private void CreateItemList(List <GengXinYouLi> list)
    {
        if (list == null)
        {
            Debug.Log("<color=red>Error:</color>[更新有礼]说好的配置表呢???");
            return;
        }
        for (int i = 0; i < list.get_Count(); i++)
        {
            GameObject instantiate2Prefab = ResourceManager.GetInstantiate2Prefab("UpdateGiftItem");
            UGUITools.SetParent(this.mListGrid, instantiate2Prefab, false);
            UpdateGiftItem component = instantiate2Prefab.GetComponent <UpdateGiftItem>();
            component.UpdateItem(list.get_Item(i));
            component.EventHandler = new Action <string, UpdateGiftItem>(this.OnClickButton);
            component.get_gameObject().SetActive(false);
            this.mItems.Add(list.get_Item(i).Id, component);
        }
        int currentVersion = OperateActivityManager.Instance.CurrentVersion;
        List <UpdateAcInfo> localUpdateGiftInfos = OperateActivityManager.Instance.LocalUpdateGiftInfos;

        using (List <UpdateAcInfo> .Enumerator enumerator = localUpdateGiftInfos.GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                UpdateAcInfo current = enumerator.get_Current();
                if (this.mItems.ContainsKey(current.acId) && this.mItems.get_Item(current.acId).Data.FinishPar <= currentVersion && current.status == UpdateAcInfo.AcStep.STEP.Ready)
                {
                    if (this.reqIds == null)
                    {
                        this.reqIds = new List <int>();
                    }
                    OperateActivityManager.Instance.SendUpdateAwardReq(current.acId);
                    this.reqIds.Add(current.acId);
                }
            }
        }
    }