示例#1
0
    private void RefreshTaskDesc()
    {
        var info = moduleAwakeMatch.CurrentTask.taskConfigInfo;

        if (info)
        {
            Util.SetText(tipText, ConfigText.GetDefalutString(9811, (int)info.teamType));
            ChaseTaskItem.ShowRewards(info, m_chaseRewardItems, true);
            Util.SetText(stageName, info.name);
            Util.SetText(energyCost, $"(     ×{info.fatigueCount})");
            Util.SetText(energyCost2, energyCost.text);
            Util.SetText(recommend, Util.Format(ConfigText.GetDefalutString(TextForMatType.AwakeStage, 50), info.recommend));
            recommend.color = ColorGroup.GetColor(ColorManagerType.Recommend, modulePlayer.roleInfo.fight >= info.recommend);
            recommend?.transform.parent.SafeSetActive(info.recommend > 0);
        }

        var task = moduleAwakeMatch.CurrentTask;

        if (task != null)
        {
            chaseStar?.RefreshPanel(task);
        }

        var t = moduleAwakeMatch.CurrentTask;

        for (var i = 0; i < stars.Length; i++)
        {
            stars[i].SafeSetActive(t != null && t.star >= i + 1);
        }
    }
示例#2
0
    public override bool Initialize(params object[] p)
    {
        if (base.Initialize(p))
        {
            var task = p[0] as ChaseTask;
            if (task == null)
            {
                return(true);
            }
            starPanel.RefreshPanel(task);

            icons.Clear();
            icons.AddRange(task.taskConfigInfo.bossID);
            data.SetItems(icons);
            view?.onProgress.AddListener(OnDirectionBtnState);
            view?.ScrollToPage(0);
            left_btn.SafeSetActive(view?.currentPage > 0);
            right_btn.SafeSetActive(view.currentPage < view.pageCount - 1);
            left_btn?.onClick.AddListener(() => OnSkipIcon(true));
            right_btn?.onClick.AddListener(() => OnSkipIcon(false));

            if (task.taskConfigInfo.cost.Length > 0)
            {
                string[] _cost = task.taskConfigInfo.cost[0].Split('-');
                cost = _cost != null && _cost.Length > 1 ? Util.Parse <int>(_cost[1]) : 0;
            }
            Util.SetText(stageName, task.taskConfigInfo.name);
            Util.SetText(stageDesc, task.taskConfigInfo.desc);
            Util.SetText(remainNum, "×" + moduleEquip.bloodCardNum);
            Util.SetText(expendNum, "×" + cost);
            if (cost <= moduleEquip.bloodCardNum)
            {
                expendNum.color = Color.green;
            }
            else
            {
                expendNum.color = notEnough;
            }

            Util.SetText(challengeLv, "Lv. " + task.taskConfigInfo.unlockLv);
            Util.SetText(recommend, Util.Format(ConfigText.GetDefalutString((int)TextForMatType.ChaseUIText, 66), task.taskConfigInfo.recommend));
            recommend.color = ColorGroup.GetColor(ColorManagerType.Recommend, modulePlayer.roleInfo.fight >= task.taskConfigInfo.recommend);
            recommend?.transform.parent.SafeSetActive(task.taskConfigInfo.recommend > 0);

            var gameObjects = ChaseTaskItem.InitRewardItem(rewardParent);
            ChaseTaskItem.ShowRewards(task.taskConfigInfo, gameObjects, true);

            fastMatch?.onClick.AddListener(() => EnterRoom(true, task));
            createTeam?.onClick.AddListener(() => EnterRoom(false, task));

            var prop = ConfigManager.Find <PropItemInfo>(item => item.itemType == PropType.UseableProp && item.subType == (int)UseablePropSubType.WantedWithBlood);
            int id   = prop != null ? prop.ID : 601;
            bloodCardBtn01?.onClick.AddListener(() => moduleGlobal.UpdateGlobalTip((ushort)id));
            bloodCardBtn02?.onClick.AddListener(() => moduleGlobal.UpdateGlobalTip((ushort)id));
        }
        return(true);
    }
示例#3
0
    private void ShowNormalPVESettlement(PReward reward)
    {
        if (modulePVE.isSendWin && modulePVE.needShowStar)
        {
            bgBtn.interactable = true;

            if (modulePVE.settlementTask.taskStarDetails?.Length > 0)
            {
                chaseStarpanel.gameObject.SetActive(true);

                chaseStarpanel.RefreshPanel(modulePVE.settlementTask, modulePVE.settlementStar);

                bgBtn.onClick.RemoveAllListeners();
                bgBtn.onClick.AddListener(() =>
                {
                    OpenExceptChasePanel(reward);
                    chaseStarpanel.gameObject.SetActive(false);
                    bgBtn.interactable = false;
                    OnInComplete();
                });
            }
            else
            {
                OpenExceptChasePanel(reward);
                OnInComplete();
            }
        }
        else
        {
            OpenExceptChasePanel(reward);
            OnInComplete();
        }

        m_againBtn.SafeSetActive((modulePVE?.currrentStage?.again ?? false) && Module_Chase.CheckChaseCondition(moduleChase.lastStartChase));
        m_againBtn?.onClick.RemoveAllListeners();
        m_againBtn?.onClick.AddListener(() =>
        {
            moduleChase.SendStartChase(moduleChase.lastStartChase);
        });
    }
示例#4
0
    public void RefreshDetailPanel(ChaseTask info, Action <ChaseTask> chaseFunc)
    {
        IniteDetailPanel();
        if (info == null)
        {
            return;
        }
        this.gameObject.SetActive(true);
        awakePanel?.gameObject.SetActive(false);
        //描述
        Util.SetText(detail_DescriptionText, info.taskConfigInfo.desc);
        //name
        detail_taskName.text = info.taskConfigInfo.name;
        //map
        string[] str = info.stageInfo.icon.Split(';');
        if (str != null && str.Length >= 1)
        {
            UIDynamicImage.LoadImage(detail_Icon, str[0]);
        }
        //奖励
        ShowRewards(info.taskConfigInfo, detail_items, true);
        //星级
        for (int i = 0; i < detail_stars.Length; i++)
        {
            detail_stars[i].gameObject.SetActive(i < info.star);
        }
        //消耗体力
        var s = Module_Player.instance.roleInfo.fatigue < info.taskConfigInfo.fatigueCount ? GeneralConfigInfo.GetNoEnoughColorString("×" + info.taskConfigInfo.fatigueCount) : "×" + info.taskConfigInfo.fatigueCount;

        Util.SetText(fatigue_text, (int)TextForMatType.ChaseUIText, 50, s);
        if (toChaseBtn)
        {
            toChaseBtn.gameObject.SetActive(info.taskType != TaskType.Nightmare && info.taskType != TaskType.Awake);
            //追捕
            toChaseBtn.onClick.RemoveAllListeners();
            toChaseBtn.onClick.AddListener(() =>
            {
                if (info.taskType == TaskType.Active)
                {
                    var activeInfo = Module_Chase.instance.allActiveItems.Find((p) => p.taskLv == info.taskConfigInfo.level);
                    if (activeInfo == null)
                    {
                        return;
                    }

                    if (!Module_Chase.instance.activeChallengeCount.ContainsKey(activeInfo.taskLv))
                    {
                        return;
                    }

                    if (Module_Chase.instance.activeChallengeCount[activeInfo.taskLv] >= activeInfo.crossLimit)
                    {
                        Module_Global.instance.ShowMessage(ConfigText.GetDefalutString(TextForMatType.ChaseUIText, 39));
                        return;
                    }
                }

                this.gameObject.SetActive(false);
                chaseFunc?.Invoke(info);
            });
        }
        //关闭
        closeBtn?.onClick.RemoveAllListeners();
        closeBtn?.onClick.AddListener(() =>
        {
            if (Module_Chase.instance.targetTaskFromForge != null)
            {
                Module_Chase.instance.SetTargetTask(null);
            }
        });
        //刷新关卡星级奖励
        chaseStarPanel.RefreshPanel(info);

        int remainCount = info.taskConfigInfo.challengeCount - info.taskData.dailyOverTimes;

        //重置次数显示
        if (remainRestTime)
        {
            remainRestTime.transform.parent.gameObject.SetActive(info.taskType == TaskType.Difficult);
            remainRestTime.text = $"{(remainCount >= 0 ? remainCount : 0)}/{info.taskConfigInfo.challengeCount}";
        }

        if (resetBtn)
        {
            resetBtn.gameObject.SetActive(info.taskType == TaskType.Difficult && remainCount <= 0);
            resetBtn.onClick.RemoveAllListeners();
            resetBtn.onClick.AddListener(() =>
            {
                if (chaseFunc != null)
                {
                    chaseFunc(info);
                    this.gameObject.SetActive(false);
                }
            });
        }
    }