Пример #1
0
    private void OnResetPanel()
    {
        var  info       = moduleGlobal.system.resetPrice;
        bool isContains = false;

        for (int i = 0; i < info.Length; i++)
        {
            if (info[i].times == modulePlayer.roleInfo.resetTimes + 1)
            {
                isContains = true;
                break;
            }
        }
        diamondPay = isContains ? info[modulePlayer.roleInfo.resetTimes + 1].price : info[0].price;
        if (modulePlayer.roleInfo.diamond >= diamondPay)
        {
            Util.SetText(remainText, Util.Format(Util.GetString((int)TextForMatType.TravalShopUIText, 11), diamondPay, modulePlayer.roleInfo.diamond));
        }
        else
        {
            Util.SetText(remainText, GeneralConfigInfo.GetNoEnoughColorString(ConfigText.GetDefalutString(configID, 34)), diamondPay, modulePlayer.roleInfo.diamond);
        }
        int point = 0;

        if (!string.IsNullOrEmpty(m_Lv.text))
        {
            point = Util.Parse <int>(m_Lv.text) * 3 - 3;
        }
        if (totalPoint == point)
        {
            moduleGlobal.ShowMessage(ConfigText.GetDefalutString(TextForMatType.AttributeUIText, 21));
            return;
        }
        m_ResetPanel.SafeSetActive(true);
    }
Пример #2
0
    private void Refresh()
    {
        if (null == _chaseTask)
        {
            return;
        }

        int index = 0;

        index = _chaseTask.taskData.resetTimes >= _chaseTask.taskConfigInfo.dayRemainCount - 1 ? _chaseTask.taskConfigInfo.dayRemainCount - 1 : _chaseTask.taskData.resetTimes;
        if (index < 0 || index > _chaseTask.taskConfigInfo.cost.Length - 1)
        {
            return;
        }

        string[] str = _chaseTask.taskConfigInfo.cost[index].Split('-');
        if (str.Length < 2)
        {
            return;
        }
        var prop = ConfigManager.Get <PropItemInfo>(Util.Parse <int>(str[0]));

        contentTip.text = Util.Format(ConfigText.GetDefalutString(TextForMatType.ChaseUIText, 30), str[1], prop.itemName);
        int remainCount = _chaseTask.taskConfigInfo.dayRemainCount - _chaseTask.taskData.resetTimes;

        currentDayCount.text = Util.Format(ConfigText.GetDefalutString(TextForMatType.ChaseUIText, 31), remainCount >= 0 ? remainCount : 0);
        AtlasHelper.SetItemIcon(costIcon, prop);

        bool   canPay   = modulePlayer.roleInfo.diamond >= Util.Parse <int>(str[1]);
        string colorStr = GeneralConfigInfo.GetNoEnoughColorString(modulePlayer.roleInfo.diamond.ToString());

        Util.SetText(costCount, (int)TextForMatType.ChaseUIText, 32, str[1], canPay ? modulePlayer.roleInfo.diamond.ToString() : colorStr);

        sureBtn.interactable = canPay && remainCount > 0;
    }
Пример #3
0
    public override void RefreshPanel(PItem item, EquipType type)
    {
        base.RefreshPanel(item, type);

        int level = data.GetIntentyLevel();

        Util.SetText(m_levelText, (int)TextForMatType.EquipEvolveUI, 3, level.ToString());
        m_levelText.SafeSetActive(level > 0);

        level = data.GetEvolveLevel();
        //获取的是下一级的进阶显示
        EvolveEquipInfo info = moduleEquip.GetEvolveInfo(equipType, level + 1);

        if (info == null)
        {
            return;
        }

        List <PItem> currenProps = moduleEquip.GetBagProps(PropType.EvolveProp);

        RefreshMatItem(info.materials, currenProps);
        RefreshLevel();
        RefreshAttributes(info);
        bool moneyEnough = Module_Player.instance.roleInfo.coin > info.costNumber;

        Util.SetText(m_evoCostText, moneyEnough ? info.costNumber.ToString() : GeneralConfigInfo.GetNoEnoughColorString(info.costNumber.ToString()));

        bool materialEnough = Module_Equip.GetMaterialEnoughState(info.materials, currenProps);

        m_evoBtn.SetInteractable(moneyEnough && materialEnough && SendEvolve);
    }
Пример #4
0
    public void RefreshDisselectableExpItem(EvolveMaterial item, uint totalCount)
    {
        InitComponent();
        m_propInfo = ConfigManager.Get <PropItemInfo>(item.propId);
        if (m_propInfo == null)
        {
            return;
        }

        Util.SetItemInfo(m_itemObj, m_propInfo, 0, 0, false);
        bool   enough   = totalCount >= item.num;
        string totalStr = enough ? totalCount.ToString() : GeneralConfigInfo.GetNoEnoughColorString(totalCount.ToString());

        Util.SetText(m_countText, ConfigText.GetDefalutString(TextForMatType.EquipIntentyUI, 16), totalStr, item.num);
        if (m_icon)
        {
            EventTriggerListener.Get(m_icon.gameObject).onClick = (obj) => { if (m_propInfo)
                                                                             {
                                                                                 Module_Global.instance.SetTargetMatrial(m_propInfo.ID, (int)item.num);
                                                                             }
            }
        }
        ;
    }
}
Пример #5
0
    private void RefreshCoinCost(int totalExp)
    {
        int  totalNum    = Module_Equip.GetCoinCost(equipType, data.GetCurrentTotalExp(), totalExp, m_maxLimitIntentifyInfo);
        bool moneyEnough = Module_Player.instance.roleInfo.coin > totalNum;

        Util.SetText(m_intenCostText, moneyEnough ? totalNum.ToString() : GeneralConfigInfo.GetNoEnoughColorString(totalNum.ToString()));
        //m_intenBtn.SetInteractable();
        m_intenBtn.interactable = moneyEnough && !m_maxLevel && m_swallowExp > 0 && sendStreng;
    }
Пример #6
0
    private void OnUnLockFashion()
    {
        if (moduleShop.curClickItem == null || moduleShop.curShopMsg == null)
        {
            return;
        }

        unlockTip.SafeSetActive(true);
        var prop = ConfigManager.Get <PropItemInfo>(moduleShop.curClickItem.itemTypeId);

        Util.SetText(unlockInfo, (int)TextForMatType.GiftUIText, 17, prop ? prop.itemName : "");

        var s   = Util.GetString((int)TextForMatType.GiftUIText, 18, moduleShop.curClickItem.currencyNum, modulePlayer.gemCount);
        var str = moduleShop.curClickItem.currencyNum > modulePlayer.gemCount ? GeneralConfigInfo.GetNoEnoughColorString(s) : s;

        Util.SetText(costDiamond, str);
    }
Пример #7
0
    void RefreshCoin(uint exp = 0)
    {
        if (_type == RuneInWhichPanel.Intentify)
        {
            if (moduleGlobal.system == null || moduleGlobal.system.rune_upLv == null || moduleGlobal.system.rune_upLv.Length < 2)
            {
                return;
            }
            var coin = exp * moduleGlobal.system.rune_upLv[1];

            if (exp != 0)
            {
                RefreshBtnState(upBtn, modulePlayer.coinCount >= coin);
            }
            Util.SetText(costCoin, modulePlayer.coinCount < coin ? GeneralConfigInfo.GetNoEnoughColorString(coin.ToString()) : coin.ToString());

            return;
        }

        if (_type == RuneInWhichPanel.Evolve)
        {
            if (curItem == null || curItem.growAttr == null || curItem.growAttr.runeAttr == null)
            {
                return;
            }
            if (moduleGlobal.system.rune_upStar == null || moduleGlobal.system.rune_upStar.Length <= curItem.growAttr.runeAttr.star - 1)
            {
                return;
            }

            var price = moduleGlobal.system.rune_upStar[curItem.growAttr.runeAttr.star - 1];
            if (price == null)
            {
                return;
            }
            var prop = ConfigManager.Get <PropItemInfo>(price.itemTypeId);
            if (prop == null)
            {
                return;
            }
            var number = prop.itemType == PropType.Currency ? modulePlayer.GetMoneyCount((CurrencySubType)prop.subType) : (uint)moduleEquip.GetPropCount(prop.itemNameId);

            Util.SetText(_costCoin, number < price.price ? GeneralConfigInfo.GetNoEnoughColorString(price.price.ToString()) : price.price.ToString());
            RefreshBtnState(_evolveBtn, number >= price.price);
        }
    }
Пример #8
0
        private void RefreshText()
        {
            m_detectBtn.interactable = false;
            m_restNumText.text       = Util.Format(m_restNumTip, moduleBordlands.detectCostDic.Count - moduleBordlands.currentDetectTimes);

            uint remian = modulePlayer.GetMoneyCount(CurrencySubType.Diamond);

            m_remainText.text = Util.Format(m_remainTip, remian);

            PItem2 cost = moduleBordlands.detectCostDic.Get(moduleBordlands.currentDetectTimes);

            //次数满了
            if (cost == null)
            {
                //读取上一条数据
                PItem2 lastCost = moduleBordlands.detectCostDic.Get(moduleBordlands.currentDetectTimes - 1);
                if (lastCost != null)
                {
                    string ss = Util.Format(ConfigText.GetDefalutString(TextForMatType.BorderlandUIText, 13), lastCost.num);
                    Util.SetText(m_costNumText, lastCost.num <= remian ? ss : GeneralConfigInfo.GetNoEnoughColorString(ss));
                    m_detectBtn.interactable = false;
                }
                return;
            }

            PropItemInfo prop = ConfigManager.Get <PropItemInfo>(cost.itemTypeId);

            if (prop == null)
            {
                Logger.LogError("detect cost type error,id = {0}", cost.itemTypeId);
                return;
            }

            AtlasHelper.SetCurrencyIcon(m_costImage, (CurrencySubType)prop.subType);
            remian = modulePlayer.GetMoneyCount((CurrencySubType)prop.subType);
            Util.SetText(m_remainText, m_remainTip, remian);
            bool detectBtnVisible = cost.num <= remian && !moduleBordlands.isHasAnyBoss;

            m_detectBtn.interactable = detectBtnVisible;
            string str = Util.Format(ConfigText.GetDefalutString(TextForMatType.BorderlandUIText, 13), cost.num);

            Util.SetText(m_costNumText, cost.num <= remian ? str : GeneralConfigInfo.GetNoEnoughColorString(str));
        }
Пример #9
0
    private void SetExpsendText(UpSkillInfo info)
    {
        spParent.gameObject.SetActive(modulePlayer.roleInfo.level >= info.needLv);
        coinParent.gameObject.SetActive(modulePlayer.roleInfo.level >= info.needLv);
        lvParent.gameObject.SetActive(modulePlayer.roleInfo.level < info.needLv);

        if (modulePlayer.roleInfo.level < info.needLv)
        {
            string lv = Util.Format(ConfigText.GetDefalutString(TextForMatType.SkillUIText, 36), info.needLv);
            Util.SetText(needLvText, modulePlayer.roleInfo.level >= info.needLv ? lv : GeneralConfigInfo.GetNoEnoughColorString(lv));
            var needStr = Util.GetString((int)TextForMatType.SkillUIText, 34);
            Util.SetText(needLvText01, GeneralConfigInfo.GetNoEnoughColorString(needStr));
        }
        else
        {
            if (moduleSkill.skillInfo == null)
            {
                return;
            }
            string str = Util.Format(ConfigText.GetDefalutString(TextForMatType.SkillUIText, 30), info.expendSp);
            Util.SetText(expendSkillPoint, moduleSkill.skillInfo.skillPoint >= info.expendSp ? str : GeneralConfigInfo.GetNoEnoughColorString(str));
            Util.SetText(expendCoin, modulePlayer.roleInfo.coin >= info.expendGold ? info.expendGold.ToString() : GeneralConfigInfo.GetNoEnoughColorString(info.expendGold.ToString()));
        }
    }
Пример #10
0
    private void SetNewUpLoad(PItem item)
    {
        PropItemInfo debrInfos   = ConfigManager.Get <PropItemInfo>(weaponAttr.debrisId); // 武器碎片信息
        PropItemInfo weaponInfos = ConfigManager.Get <PropItemInfo>(item.itemTypeId);     // 武器信息

        if (debrInfos == null || weaponInfos == null)
        {
            return;
        }

        int lv = item.growAttr.equipAttr.star;

        if (lv < 1)
        {
            Logger.LogError("server weapon upload level is error {0},id {1}", lv, item.itemTypeId);
            return;
        }
        var attr = weaponAttr.quality[lv - 1];

        if (attr.attributes.Length < 0)
        {
            Logger.LogError("have no attr ");
            return;
        }

        Util.SetItemInfo(m_itemLeft, weaponInfos, 0, 0, false);
        var str = ((ConsumePercentSubType)attr.quality).ToString() + ConfigText.GetDefalutString(224, 23);

        Util.SetText(m_levelLeft, str);
        Util.SetText(m_hurtTxt, 299, attr.attributes[0].id);

        float nowhurt = attr.attributes[0].value;

        SetValue(m_hurtLeft, nowhurt);

        //设置是否满级
        m_levelNormal.SetActive(false);
        m_levelMax.SetActive(false);
        m_rightObj.gameObject.SetActive(false);
        m_itemRight.gameObject.SetActive(false);
        m_uploadBtn.interactable   = false;
        m_leftObj.anchoredPosition = new Vector3(-130, -90, 0);

        if (lv < weaponAttr.quality.Length)
        {
            m_rightObj.gameObject.SetActive(true);
            m_itemRight.SetActive(true);
            m_levelNormal.SetActive(true);

            Util.SetItemInfo(m_itemRight, weaponInfos, 0, 0, false);
            var str1 = ((ConsumePercentSubType)weaponAttr.quality[lv].quality).ToString() + ConfigText.GetDefalutString(224, 23);
            Util.SetText(m_levelRight, str1);

            if (weaponAttr.quality[lv].attributes.Length < 0)
            {
                Logger.LogError("have no attr ");
                return;
            }
            float nexthurt = weaponAttr.quality[lv].attributes[0].value;
            SetValue(m_hurtRight, nexthurt);
            float lerp = nexthurt - nowhurt;
            if (wType == 1)
            {
                Util.SetText(m_hurtGap, "[+{0}]", lerp);
            }
            else if (wType == 2)
            {
                lerp = lerp * 100;
                Util.SetText(m_hurtGap, ConfigText.GetDefalutString(224, 42), lerp);
            }

            Util.SetItemInfo(m_uploadProp.gameObject, debrInfos, 0, 0, false);
            int suipian = moduleEquip.GetPropCount(weaponAttr.debrisId);
            Util.SetText(m_propHave, GeneralConfigInfo.GetNoEnoughColorString(suipian.ToString()));
            m_propNeed.text = attr.debrisNum.ToString();

            if (suipian >= attr.debrisNum)
            {
                m_propHave.text          = suipian.ToString();
                m_propHave.color         = GeneralConfigInfo.defaultConfig.PropEnough;
                m_uploadBtn.interactable = true;
            }
            Util.SetText(m_ipLoadText, ConfigText.GetDefalutString(224, 5));
        }
        else
        {
            m_leftObj.anchoredPosition = new Vector3(0, -90, 0);
            m_levelMax.SetActive(true);
            Util.SetText(m_ipLoadText, ConfigText.GetDefalutString(224, 31));
        }
    }
Пример #11
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);
                }
            });
        }
    }
Пример #12
0
    public static void BindItemInfo(RectTransform rt, PItem info)
    {
        if (info == null)
        {
            return;
        }
        var prop = ConfigManager.Get <PropItemInfo>(info.itemTypeId);

        if (prop == null)
        {
            return;
        }

        int  star     = 0;
        int  level    = 0;
        bool wearShow = false;
        bool maxShow  = false;

        RectTransform normal   = rt.Find("0").GetComponent <RectTransform>();
        RectTransform rune     = rt.Find("1").GetComponent <RectTransform>();
        var           ctNormal = normal.Find("numberdi/count").GetComponent <Text>();
        var           ctRune   = rune.Find("numberdi/count").GetComponent <Text>();

        if (prop.itemType == PropType.Rune)
        {
            if (info.growAttr != null)
            {
                level    = info.growAttr.runeAttr.level;
                star     = info.growAttr.runeAttr.star;
                maxShow  = moduleRune.IsMaxLv(info.growAttr.runeAttr.level);
                wearShow = moduleRune.currentEquip.Exists(a => a.itemId == info.itemId);
            }

            Util.SetItemInfo(rune, prop, level, 0, true, star);
            ctRune.gameObject.SetActive(false);
        }
        else if ((prop.attributes != null && prop.attributes.Length > 0) || prop.itemType == PropType.Weapon)
        {
            star  = prop.quality;
            level = info.GetIntentyLevel();

            var t = moduleEquip.GetPeiviewEuipeTypeByItem(info);
            if (t == PreviewEquipType.None || t == PreviewEquipType.Enchant)
            {
                maxShow = true;
            }
            wearShow = moduleEquip.currentDressClothes.Exists(a => a.itemId == info.itemId);
            if (moduleEquip.weapon != null && moduleEquip.offWeapon != null)
            {
                if (info.itemId == moduleEquip.weapon.itemId || info.itemId == moduleEquip.offWeapon.itemId)
                {
                    wearShow = true;
                }
            }

            Util.SetItemInfo(normal, prop, level, 0, true, star);
            ctNormal.gameObject.SetActive(false);
        }
        else
        {
            star = prop.quality;
            Util.SetItemInfo(normal, prop, 0, (int)info.num, false);
            ctNormal.gameObject.SetActive(true);
        }

        var rtChild = normal;

        normal.gameObject.SetActive(true);
        rune.gameObject.SetActive(false);
        if (prop.itemType == PropType.Rune)
        {
            rtChild = rune;
            rune.gameObject.SetActive(true);
            normal.gameObject.SetActive(false);
        }

        var wear = rtChild.Find("get");      //是否佩戴
        var hint = rtChild.Find("mark");     //是否可合成
        var mews = rtChild.Find("new");
        var max  = rtChild.Find("levelmax"); //最高级

        Image locks = rtChild.Find("lock").GetComponent <Image>();

        locks.gameObject.SetActive(info.isLock == 1);
        wear.SafeSetActive(wearShow);

        var equipText = rtChild.Find("get/Text")?.GetComponent <Text>();

        if (equipText)
        {
            equipText.color = moduleRune.GetCurQualityColor(GeneralConfigInfo.defaultConfig.qualitys, star);
        }
        Util.SetText(equipText, (int)TextForMatType.RuneUIText, 48);
        max.SafeSetActive(maxShow);
        mews.SafeSetActive(false);
        hint.SafeSetActive(false);
        ctNormal.color = GeneralConfigInfo.defaultConfig.WareHouse;
        if ((WareType)prop.lableType == WareType.Debris)
        {
            Compound compose = ConfigManager.Get <Compound>(prop.compose);//合成/分解信息
            if (compose == null)
            {
                return;
            }
            var fenmu = compose.sourceNum;
            var fenzi = info.num;
            var str   = fenzi.ToString() + "/" + fenmu.ToString();
            Util.SetText(ctNormal, str);
            if (fenzi < fenmu)
            {
                Util.SetText(ctNormal, GeneralConfigInfo.GetNoEnoughColorString(str));
            }
        }
        if (!m_decomBtn.isOn)
        {
            moduleCangku.GetCanCompse();
            var cPos = moduleCangku.AllCompse.Find(a => a.itemId == info.itemId);
            hint.SafeSetActive(cPos != null);
            var isNew = moduleCangku.newProp.Find(a => a.itemId == info.itemId);
            mews.SafeSetActive(isNew != null);
            var bt = rtChild.gameObject.GetComponentDefault <Button>();
            bt.onClick.RemoveAllListeners();
            bt.onClick.AddListener(delegate
            {
                SetItemClick(bt, info);
            });
        }
    }
Пример #13
0
    private void RefreshCoinCost(int totalExp)
    {
        int  totalNum    = Module_Equip.GetCoinCost(equipType, data.GetCurrentTotalExp(), totalExp, m_limitIntentifyInfo);
        bool moneyEnough = Module_Player.instance.roleInfo.coin >= totalNum;

        Util.SetText(m_cost, (int)TextForMatType.EquipIntentyUI, 14, moneyEnough ? totalNum.ToString() : GeneralConfigInfo.GetNoEnoughColorString(totalNum.ToString()));
    }