Beispiel #1
0
    /// <summary>
    ///  更新价格
    /// </summary>
    private void UpdateCost()
    {
        MallDefine.MallLocalData current = CurrentMallData;
        string costIconName = "";
        uint   totalCost    = 0;

        if (null != current)
        {
            costIconName = MallDefine.GetCurrencyIconNameByType((GameCmd.MoneyType)current.LocalMall.moneyType);
            totalCost    = (uint)((current.IsInDiscount) ? current.LocalMall.offPrice * purchaseNum
                : current.LocalMall.buyPrice * purchaseNum);
        }
        if (null != m_sprite_CostIcon)
        {
            UIManager.GetAtlasAsyn(costIconName,
                                   ref m_costIconCASD, () =>
            {
                if (null != m_sprite_CostIcon)
                {
                    m_sprite_CostIcon.atlas = null;
                }
            }
                                   , m_sprite_CostIcon, false);
        }

        if (null != m_label_CostNum)
        {
            m_label_CostNum.text = totalCost.ToString();;
        }
    }
Beispiel #2
0
    /// <summary>
    /// 设置合成消耗钱币
    /// </summary>
    private void SetCompoundCost()
    {
        Equip data = Data;

        if (null == data)
        {
            return;
        }
        bool canCompound = data.CanCompound;

        if (null != m_btn_BtnCompound && m_btn_BtnCompound.gameObject.activeSelf != canCompound)
        {
            m_btn_BtnCompound.gameObject.SetActive(canCompound);
        }
        if (canCompound && null != m_trans_UICGCompoundCost)
        {
            UICurrencyGrid currencyGrid = m_trans_UICGCompoundCost.GetComponent <UICurrencyGrid>();
            if (null == currencyGrid)
            {
                currencyGrid = m_trans_UICGCompoundCost.gameObject.AddComponent <UICurrencyGrid>();
            }
            currencyGrid.SetGridData(new UICurrencyGrid.UICurrencyGridData(
                                         MallDefine.GetCurrencyIconNameByType(GameCmd.MoneyType.MoneyType_Gold), data.CompCost));
        }
    }
Beispiel #3
0
    private void UpdateOwer()
    {
        MallDefine.MallLocalData current = CurrentMallData;
        string costIconName = "";
        int    ownerNum     = 0;

        if (null != current)
        {
            costIconName = MallDefine.GetCurrencyIconNameByType((GameCmd.MoneyType)current.LocalMall.moneyType);
            ownerNum     = UIPlayerProprty.GetNum((ClientMoneyType)current.LocalMall.moneyType);
        }
        if (null != m_sprite_CostIcon)
        {
            UIManager.GetAtlasAsyn(costIconName,
                                   ref m_ownIconCASD, () =>
            {
                if (null != m_sprite_OwnIcon)
                {
                    m_sprite_OwnIcon.atlas = null;
                }
            }
                                   , m_sprite_OwnIcon, false);
        }

        if (null != m_label_OwnNum)
        {
            m_label_OwnNum.text = TextManager.GetFormatNumText((uint)ownerNum);
        }
    }
Beispiel #4
0
    /// <summary>
    /// 设置精炼消耗货币
    /// </summary>
    public void SetRefineCost()
    {
        Equip data = Data;

        if (null == data)
        {
            return;
        }

        bool isMax       = data.IsRefineMax;
        bool isCanRefine = data.CanRefine;
        bool needShow    = isCanRefine && !isMax;

        if (null != m_btn_BtnRefine && m_btn_BtnRefine.gameObject.activeSelf != needShow)
        {
            m_btn_BtnRefine.gameObject.SetActive(needShow);
        }

        if (needShow)
        {
            UICurrencyGrid currencyGrid = m_trans_UICGRefine.GetComponent <UICurrencyGrid>();
            if (null == currencyGrid)
            {
                currencyGrid = m_trans_UICGRefine.gameObject.AddComponent <UICurrencyGrid>();
            }
            currencyGrid.SetGridData(new UICurrencyGrid.UICurrencyGridData(
                                         MallDefine.GetCurrencyIconNameByType(GameCmd.MoneyType.MoneyType_Gold), data.NextRefineDataBase.costConey));
        }
    }
    protected override void OnShow(object data)
    {
        base.OnShow(data);
        if (null != data && data is BlackMarkeRefreshData)
        {
            BlackMarkeRefreshData rData = data as BlackMarkeRefreshData;
            if (null != m_trans_RefreshCost)
            {
                UICurrencyGrid cGrid = m_trans_RefreshCost.GetComponent <UICurrencyGrid>();
                if (null != cGrid)
                {
                    cGrid.SetGridData(new UICurrencyGrid.UICurrencyGridData(
                                          MallDefine.GetCurrencyIconNameByType(rData.Data.CType)
                                          , rData.Data.Num));
                }

                if (null != m_label_RefreshTimes)
                {
                    string text = "{0}/{1}";
                    m_label_RefreshTimes.text = string.Format(text
                                                              , (rData.LeftTimes > 0) ?

                                                              ColorManager.GetColorString(ColorType.Green, rData.LeftTimes.ToString())
                        : ColorManager.GetColorString(ColorType.Red, rData.LeftTimes.ToString())
                                                              , rData.TotalTimes);
                }
            }
        }
    }
Beispiel #6
0
    public void SetPrice(GameCmd.MoneyType moneyType, uint price, float changeRate, bool up)
    {
        if (null != this.m_spMoneyIcon && null != this.m_lblPrice)
        {
            string currencyIcon = MallDefine.GetCurrencyIconNameByType(moneyType);
            UIManager.GetAtlasAsyn(currencyIcon, ref iuiCurrencyCSAD, () =>
            {
                if (null != m_spMoneyIcon)
                {
                    m_spMoneyIcon.atlas = null;
                }
            }, m_spMoneyIcon);
            this.m_lblPrice.text = "" + price;
        }

        m_lblChangeNum.gameObject.SetActive(true);
        m_lblChangeNum.text = changeRate.ToString("P");//价格变化率
        if (up)
        {
            m_goAdd.SetActive(true);
            m_goLess.SetActive(false);
        }
        else
        {
            m_goLess.SetActive(true);
            m_goAdd.SetActive(false);
        }
    }
Beispiel #7
0
    /// <summary>
    /// 刷新剩余钱币爽
    /// </summary>
    private void UpdateCurrencyLeft()
    {
        GameCmd.CommonStore activeStore = DataManager.Manager <MallManager>().BlackMarketActiveStore;
        bool visible = (activeStore == GameCmd.CommonStore.CommonStore_HundredThree)? false : true;

        if (null != m_trans_LeftCurrencyContent &&
            m_trans_LeftCurrencyContent.gameObject.activeSelf != visible)
        {
            m_trans_LeftCurrencyContent.gameObject.SetActive(visible);
        }
        if (!visible)
        {
            return;
        }
        Client.IPlayer player = DataManager.Instance.MainPlayer;
        if (null == player)
        {
            return;
        }
        uint   num      = 0;
        string iconName = "";

        switch (activeStore)
        {
        case GameCmd.CommonStore.CommonStore_HundredOne:
            iconName = MallDefine.GetCurrencyIconNameByType(GameCmd.MoneyType.MoneyType_Reputation);
            num      = (uint)player.GetProp((int)Client.PlayerProp.Reputation);
            break;

        case GameCmd.CommonStore.CommonStore_HundredTwo:
            iconName = MallDefine.GetCurrencyIconNameByType(GameCmd.MoneyType.MoneyType_Score);
            num      = (uint)player.GetProp((int)Client.PlayerProp.Score);
            break;

        case GameCmd.CommonStore.CommonStore_HundredFour:
            iconName = MallDefine.GetCurrencyIconNameByType(GameCmd.MoneyType.MoneyType_CampCoin);
            num      = (uint)player.GetProp((int)Client.PlayerProp.CampCoin);
            break;

        case GameCmd.CommonStore.CommonStore_HundredFive:
            iconName = MallDefine.GetCurrencyIconNameByType(GameCmd.MoneyType.MoneyType_HuntingCoin);
            num      = (uint)player.GetProp((int)Client.PlayerProp.ShouLieScore);
            break;
        }
        if (null != m_sprite_CurrncyIcon)
        {
            UIManager.GetAtlasAsyn(iconName, ref m_currencyCASD, () =>
            {
                if (null != m_sprite_CurrncyIcon)
                {
                    m_sprite_CurrncyIcon.atlas = null;
                }
            }, m_sprite_CurrncyIcon);
        }
        if (null != m_label_CurrncyNum)
        {
            m_label_CurrncyNum.text = num.ToString();
        }
    }
Beispiel #8
0
    /// <summary>
    /// 更新按钮状态
    /// </summary>
    /// <param name="composeNum"></param>
    /// <param name="costType"></param>
    /// <param name="composeCost"></param>
    private void UpdateCompseoBtnStatus(uint composeNum, uint costType, uint composeCost)
    {
        bool enableCompose = (composeNum >= 1) ? true : false;
        //拥有金钱数量
        uint currencyHold = (uint)DataManager.Instance.GetCurrencyNumByType((GameCmd.MoneyType)costType);
        //是否足够
        uint composeNeedCost = (composeNum > 0) ? composeCost : 0;
        bool currencyEnough  = (composeNeedCost < currencyHold);

        enableCompose  = true;
        currencyEnough = true;
        if (null != m_btn_SingleCompound)
        {
            //m_btn_SingleCompound.isEnabled = enableCompose && currencyEnough;
            UILabel btnName = m_btn_SingleCompound.transform.Find("Label").GetComponent <UILabel>();
            //if (null != btnName)
            //{
            //    //ColorType cT = ColorType.JZRY_Txt_Black;
            //    //if (!enableCompose)
            //    //    cT = ColorType.Gray;
            //    //btnName.text = ColorManager.GetColorString(cT, "单次合成");
            //}
        }
        UICurrencyGrid currencyGird = m_trans_SingleCompoundCurrency.GetComponent <UICurrencyGrid>();

        if (null != currencyGird)
        {
            currencyGird.SetGridData(new UICurrencyGrid.UICurrencyGridData(
                                         MallDefine.GetCurrencyIconNameByType((GameCmd.MoneyType)costType),
                                         composeNeedCost
                                         , (enableCompose && !currencyEnough) ? ColorType.Red : ColorType.JZRY_Txt_Black));
        }

        composeNeedCost = composeCost * composeNum;
        currencyEnough  = (composeNeedCost < currencyHold);
        if (null != m_btn_CompounAll)
        {
            //m_btn_CompounAll.isEnabled = enableCompose && currencyEnough;
            UILabel btnName = m_btn_CompounAll.transform.Find("Label").GetComponent <UILabel>();
            //if (null != btnName)
            //{
            //    ColorType cT = ColorType.JZRY_Txt_Black;
            //    //if (!enableCompose)
            //    //    cT = ColorType.Gray;
            //    btnName.text = ColorManager.GetColorString(cT, "全部合成");
            //}
        }

        currencyGird = m_trans_CompoundAllCurrency.GetComponent <UICurrencyGrid>();
        if (null != currencyGird)
        {
            currencyGird.SetGridData(new UICurrencyGrid.UICurrencyGridData(
                                         MallDefine.GetCurrencyIconNameByType((GameCmd.MoneyType)costType)
                                         , composeNeedCost
                                         , (enableCompose && !currencyEnough) ? ColorType.Red : ColorType.JZRY_Txt_Black));
        }
    }
Beispiel #9
0
    /// <summary>
    /// 设置辅助道具
    /// </summary>
    /// <param name="baseId">辅助道具id</param>
    /// <param name="needNum">辅助道具数量</param>
    /// <param name="growCost">完成操作所需货币数量</param>
    /// <param name="growCostType">完成操作所需货币类型</param>
    /// <param name="num">元宝代货币数量</param>
    /// <param name="moneyType"></param>
    private void SetCommonCost(uint baseId
                               , uint needNum
                               , uint growCost
                               , GameCmd.MoneyType growCostType
                               , uint num, GameCmd.MoneyType moneyType = GameCmd.MoneyType.MoneyType_Gold)
    {
        if (IsStatus(TabMode.ShengJi) || IsMuhonListEmpty() || null == Data)
        {
            return;
        }
        Muhon data = Data;

        if (null != m_itemGrowCostGrid)
        {
            m_itemGrowCostGrid.SetGridData(baseId, num: needNum, useDq: m_bool_autoUseDQ, costNum: num, mType: moneyType);
        }

        if (null != m_btn_AutoUseDQ)
        {
            m_btn_AutoUseDQ.GetComponent <UIToggle>().value = m_bool_autoUseDQ;
        }
        bool cansee = IsStatus(TabMode.JiHuo) && !data.IsActive;

        if (null != m_btn_ActiveBtn && m_btn_ActiveBtn.gameObject.activeSelf != cansee)
        {
            m_btn_ActiveBtn.gameObject.SetActive(cansee);
        }
        cansee = IsStatus(TabMode.JiHuo) && data.IsActive;
        if (null != m_btn_RemoveBtn && m_btn_RemoveBtn.gameObject.activeSelf != cansee)
        {
            m_btn_RemoveBtn.gameObject.SetActive(cansee);
        }
        cansee = IsStatus(TabMode.JinHua);
        if (null != m_btn_EvolveBtn && m_btn_EvolveBtn.gameObject.activeSelf != cansee)
        {
            m_btn_EvolveBtn.gameObject.SetActive(cansee);
        }

        cansee = IsStatus(TabMode.RongHe);
        if (null != m_btn_BlendBtn && m_btn_BlendBtn.gameObject.activeSelf != cansee)
        {
            m_btn_BlendBtn.gameObject.SetActive(cansee);
        }

        if (null != m_trans_OPCost)
        {
            UICurrencyGrid currencyGrid = m_trans_OPCost.GetComponent <UICurrencyGrid>();
            if (null == currencyGrid)
            {
                currencyGrid = m_trans_OPCost.gameObject.AddComponent <UICurrencyGrid>();
            }
            currencyGrid.SetGridData(new UICurrencyGrid.UICurrencyGridData(
                                         MallDefine.GetCurrencyIconNameByType(GameCmd.MoneyType.MoneyType_Gold), growCost));
        }
    }
Beispiel #10
0
 /// <summary>
 /// 价格
 /// </summary>
 /// <param name="moneyType"></param>
 /// <param name="price"></param>
 private void SetPrice(GameCmd.MoneyType moneyType, string priceTxt)
 {
     if (null != this.costIcon && null != this.cost)
     {
         string currencyIcon = MallDefine.GetCurrencyIconNameByType(moneyType);
         UIManager.GetAtlasAsyn(currencyIcon, ref m_priceAsynSeed, () =>
         {
             if (null != costIcon)
             {
                 costIcon.atlas = null;
             }
         }, costIcon);
         this.cost.text = priceTxt;
     }
 }
Beispiel #11
0
    /// <summary>
    /// 价格
    /// </summary>
    /// <param name="moneyType"></param>
    /// <param name="price"></param>
    public void SetPrice(GameCmd.MoneyType moneyType, uint price)
    {
        if (null != this.costIcon && null != this.cost)
        {
            string currencyIcon = MallDefine.GetCurrencyIconNameByType(moneyType);
            UIManager.GetAtlasAsyn(currencyIcon, ref m_BgaCASD, () =>
            {
                if (null != costIcon)
                {
                    costIcon.atlas = null;
                }
            }, costIcon);

            this.cost.text = "" + price;
        }
    }
    private void SetStrengthenCost()
    {
        bool isStrengthMax = emgr.IsGridStrengthenMax(m_emSelectInlayPos);

        EquipDefine.LocalGridStrengthenData next = emgr.GetNextStrengthDataByPos(m_emSelectInlayPos);
        if (null != m_trans_StrengthenBtns && m_trans_StrengthenBtns.gameObject.activeSelf == isStrengthMax)
        {
            m_trans_StrengthenBtns.gameObject.SetActive(!isStrengthMax);
        }

        if (!isStrengthMax)
        {
            UICurrencyGrid currencyGrid = m_trans_SingleStrengthenCurrency.GetComponent <UICurrencyGrid>();
            if (null == currencyGrid)
            {
                currencyGrid = m_trans_UICGRefine.gameObject.AddComponent <UICurrencyGrid>();
            }
            currencyGrid.SetGridData(new UICurrencyGrid.UICurrencyGridData(
                                         MallDefine.GetCurrencyIconNameByType((GameCmd.MoneyType)next.MoneyCostData.ID), next.MoneyCostData.Num));
        }
    }
Beispiel #13
0
 /// <summary>
 ///  更新价格
 /// </summary>
 private void UpdateCost()
 {
     MallDefine.MallLocalData current = CurrentMallData;
     if (null != m_trans_PurchaseCostGrid)
     {
         UICurrencyGrid currencyGrid = m_trans_PurchaseCostGrid.GetComponent <UICurrencyGrid>();
         if (null != currencyGrid)
         {
             GameCmd.MoneyType moneyType = GameCmd.MoneyType.MoneyType_Coin;
             uint totalCost = 0;
             if (null != current)
             {
                 moneyType = (GameCmd.MoneyType)current.LocalMall.moneyType;
                 totalCost = (uint)((current.IsInDiscount) ? current.LocalMall.offPrice * purchaseNum
                     : current.LocalMall.buyPrice * purchaseNum);
             }
             currencyGrid.SetGridData(new UICurrencyGrid.UICurrencyGridData(
                                          MallDefine.GetCurrencyIconNameByType((GameCmd.MoneyType)moneyType), totalCost));
         }
     }
 }
Beispiel #14
0
    /// <summary>
    /// 刷新加工消费
    /// </summary>
    private void UpdateProccessCost()
    {
        if (null != m_trans_ProccessCost)
        {
            uint proccessCost = 0;
            if (IsProccessMode(ForgingProccessMode.Fetch))
            {
                proccessCost = emgr.RuneStoneActivationCost;
            }
            else
            {
                GameCmd.PairNumber selectAttrPair = GetEquipAttrByIndex((int)m_em_selectEquipAttrIndex);
                if (null != selectAttrPair)
                {
                    uint      matchRunestoneID = emgr.GetMatchAttrRuneStone(selectAttrPair);
                    RuneStone rs = imgr.GetTempBaseItemByBaseID <RuneStone>(matchRunestoneID, ItemDefine.ItemDataType.RuneStone);
                    if (IsProccessMode(ForgingProccessMode.Remove))
                    {
                        proccessCost = (null != rs) ? rs.RemoveCost : 0;
                    }
                    else if (IsProccessMode(ForgingProccessMode.Promote))
                    {
                        proccessCost = (null != rs) ? rs.PromoteCost : 0;
                    }
                }
            }

            UICurrencyGrid currencyGrid = m_trans_ProccessCost.GetComponent <UICurrencyGrid>();
            if (null == currencyGrid)
            {
                currencyGrid = m_trans_ProccessCost.gameObject.AddComponent <UICurrencyGrid>();
            }
            currencyGrid.SetGridData(new UICurrencyGrid.UICurrencyGridData(
                                         MallDefine.GetCurrencyIconNameByType(GameCmd.MoneyType.MoneyType_Gold), proccessCost));
        }
    }
Beispiel #15
0
    /// <summary>
    /// 刷新
    /// </summary>
    /// <param name="inspireType"></param>
    private void RefreshInspireData(GameCmd.InspireType inspireType)
    {
        string tempText     = "";
        string costTypeIcon = "";
        int    count        = 0;

        JvBaoBossWorldManager.LocalInspireData localData = null;
        string leftText     = "";
        bool   inpireEnable = false;

        if (m_mgr.TryGetInspirePlayerData(inspireType, out localData))
        {
            if (localData.LeftTimes > 0)
            {
                leftText = DataManager.Manager <TextManager>().GetLocalFormatText(LocalTextType.HuntingBoss_InspireLeftTimesEnough
                                                                                  , localData.LeftTimes, localData.MaxTimes);
            }
            else
            {
                leftText = DataManager.Manager <TextManager>().GetLocalFormatText(LocalTextType.HuntingBoss_InspireLeftTimesNotEnough
                                                                                  , localData.LeftTimes, localData.MaxTimes);
            }
            count = (int)localData.MaxTimes - (int)localData.LeftTimes;
            if (localData.LeftTimes != 0)
            {
                inpireEnable = true;
            }
            if (count == 0)
            {
                count = 1;
            }
        }

        table.InspireDataBase db = null;
        if (m_mgr.TryGetInspireDB(inspireType, count, out db))
        {
            tempText = DataManager.Manager <TextManager>().GetLocalFormatText(LocalTextType.HuntingBoss_InspireFormatTxt
                                                                              , db.addBufferDes);
            costTypeIcon = MallDefine.GetCurrencyIconNameByType((GameCmd.MoneyType)db.costType);
        }

        if (inspireType == GameCmd.InspireType.InspireType_Coin)
        {
            if (null != m_label_GoldInspEffect)
            {
                m_label_GoldInspEffect.text = tempText;
            }

            if (null != m_label_GoldInspLeft)
            {
                m_label_GoldInspLeft.text = leftText;
            }
            if (null != db)
            {
                if (null != m_label_GoldInspireCostNum)
                {
                    m_label_GoldInspireCostNum.text = db.costNum.ToString();
                }

                if (null != m_sprite_GoldInspireCostIcon && !string.IsNullOrEmpty(costTypeIcon))
                {
                    UIManager.GetAtlasAsyn(costTypeIcon
                                           , ref m_goldAsynSeed, () =>
                    {
                        if (null != m_sprite_GoldInspireCostIcon)
                        {
                            m_sprite_GoldInspireCostIcon.atlas = null;
                        }
                    }, m_sprite_GoldInspireCostIcon);
                }
            }

            if (null != m_btn_BtnGoldInspire && m_btn_BtnGoldInspire.isEnabled != inpireEnable)
            {
                m_btn_BtnGoldInspire.isEnabled = inpireEnable;
            }
        }
        else if (inspireType == GameCmd.InspireType.InspireType_Money)
        {
            if (null != m_label_BYuanInspEffect)
            {
                m_label_BYuanInspEffect.text = tempText;
            }

            if (null != m_label_BYuanInspLeft)
            {
                m_label_BYuanInspLeft.text = leftText;
            }

            if (null != db && null != m_label_BYuanInspireCostNum)
            {
                m_label_BYuanInspireCostNum.text = db.costNum.ToString();
            }

            if (null != m_sprite_BYuanInspireCostIcon && !string.IsNullOrEmpty(costTypeIcon))
            {
                UIManager.GetAtlasAsyn(costTypeIcon, ref m_BYuanAsynSeed, () =>
                {
                    if (null != m_sprite_BYuanInspireCostIcon)
                    {
                        m_sprite_BYuanInspireCostIcon.atlas = null;
                    }
                }, m_sprite_BYuanInspireCostIcon);
            }

            if (null != m_btn_BtnBYuanInspire && m_btn_BtnBYuanInspire.isEnabled != inpireEnable)
            {
                m_btn_BtnBYuanInspire.isEnabled = inpireEnable;
            }
        }
    }
Beispiel #16
0
    public override void SetGridData(object data)
    {
        base.SetGridData(data);
        ResetInfoGrid();
        if (null == data)
        {
            return;
        }
        this.mallInfo = (GameCmd.DynaStorePosInfo)data;
        MallDefine.MallLocalData localData = DataManager.Manager <MallManager>().GetMallLocalDataByMallItemId(mallInfo.baseid);
        if (null == localData)
        {
            Debug.LogError(string.Format("UIBlackMarketGrid SetGridData faield,localData errir baseId:{0}", mallInfo.baseid));
            return;
        }

        MallDefine.PurchaseLimitData limitData = null;
        string limitDes = "";

        if (DataManager.Manager <MallManager>().TryGetMallItemPurchaseLimitType(localData.MallId, out limitData, packageFullCheck: false) &&
            (limitData.limitType == MallDefine.PurchaseLimitType.CharacterLv ||
             limitData.limitType == MallDefine.PurchaseLimitType.Vip))
        {
            limitDes = limitData.limitDes;
        }
        if (null != m_labName)
        {
            m_labName.text = localData.LocalItem.Name;
        }

        //bool fightPowerUp = false;
        //if (localData.LocalItem.IsEquip
        //    && DataManager.Manager<EquipManager>().IsEquipNeedFightPowerMask(localData.LocalItem.BaseId, out fightPowerUp))
        //{
        //    SetFightPower(true, fightPowerUp);
        //}

        SetBorder(true, localData.LocalItem.BorderIcon);
        SetIcon(true, localData.LocalItem.Icon);
        bool enable = (localData.LocalMall.pileNum > 1) ? true : false;

        SetNum(enable, localData.LocalMall.pileNum.ToString());
        SetLimit(limitDes);
        SetSoldOut((mallInfo.buy_flag == 1) ? true : false);
        if (null != this.cost && null != this.costIcon)
        {
            MallDefine.CurrencyData cost
                = new MallDefine.CurrencyData((GameCmd.MoneyType)localData.LocalMall.moneyType, localData.LocalMall.buyPrice);
            string costIconName = (null != cost) ? MallDefine.GetCurrencyIconNameByType(cost.CType) : "";
            UIManager.GetAtlasAsyn(costIconName, ref m_costCASD, () =>
            {
                if (null != this.costIcon)
                {
                    this.costIcon.atlas = null;
                }
            }, this.costIcon);
            string costString = (null != cost) ? localData.LocalMall.buyPrice.ToString() : "0";
            this.cost.text = costString;
        }

        //SetFightUp(false);
        if (localData.LocalItem.IsMuhon)
        {
            SetMuhonMask(true, Muhon.GetMuhonStarLevel(localData.LocalItem.BaseId));
            SetMuhonLv(true, Muhon.GetMuhonLv(localData.LocalItem));
        }
        else if (localData.LocalItem.IsRuneStone)
        {
            SetRuneStoneMask(true, (uint)localData.LocalItem.Grade);
        }
        else if (localData.LocalItem.IsChips)
        {
            SetChips(true);
        }
    }
Beispiel #17
0
    public override void SetGridData(object data)
    {
        base.SetGridData(data);
        if (null != data)
        {
            this.m_data = data as ClanDefine.LocalClanDonateDB;
            if (null != m_lab_name)
            {
                m_lab_name.text = m_data.Name;
            }
            if (null != m_lab_sw)
            {
                m_lab_sw.text = m_data.SW + "";
            }
            if (null != m_lab_zg)
            {
                m_lab_zg.text = m_data.ZG + "";
            }
            if (null != m_lab_zj)
            {
                m_lab_zj.text = m_data.ZJ + "";
            }
            if (null != m_lab_leftTimes)
            {
                string leftText = (m_data.LeftTimes > 0) ? ColorManager.GetColorString(ColorType.Green, m_data.LeftTimes.ToString())
                    : ColorManager.GetColorString(ColorType.Red, m_data.LeftTimes.ToString());
                leftText            += "/" + m_data.TotalTimes;
                m_lab_leftTimes.text = string.Format("({0})"
                                                     , leftText);
            }
            if (null != m_icon)
            {
            }
            string iconName = MallDefine.GetCurrencyIconNameByType((GameCmd.MoneyType)m_data.DonateType);
            UIManager.GetAtlasAsyn(iconName, ref m_playerAvataCASD, () =>
            {
                if (null != m_sp_donateIcon)
                {
                    m_sp_donateIcon.atlas = null;
                }
            }, m_sp_donateIcon);

            if (null != m_lab_donateNum)
            {
                m_lab_donateNum.text = m_data.DonateNum + "";
            }
            if (null != headIcon)
            {
                list.Clear();
                CurrencyIconData curr = CurrencyIconData.GetCurrencyIconByMoneyType((ClientMoneyType)m_data.DonateType);
                if (curr != null)
                {
                    list.Add(new UIItemRewardData()
                    {
                        itemID = curr.itemID,
                        num    = 0,
                    });
                }
                m_ctor.CreateGrids(list.Count);
            }
        }
    }
Beispiel #18
0
    public void UpdateCloseCostStatus(bool freeGet)
    {
        if (null == compoundSelectData)
        {
            return;
        }
        SetTransformState(false);
        if (null != m_tsCostRoot)
        {
            if (m_tsCostRoot.gameObject.activeSelf == freeGet)
            {
                m_tsCostRoot.gameObject.SetActive(!freeGet);
            }
            if (!freeGet)
            {
                int    holdNum   = DataManager.Manager <ItemManager>().GetItemNumByBaseId(compoundSelectData.CostItemID);
                bool   isEnough  = holdNum >= compoundSelectData.CostItemNum;
                string numString = "";
                if (null != m_tsCostProp)
                {
                    if (m_tsCostProp.gameObject.activeSelf != isEnough)
                    {
                        m_tsCostProp.gameObject.SetActive(isEnough);
                    }
                    if (isEnough)
                    {
                        BaseItem baseItem = DataManager.Manager <ItemManager>().GetTempBaseItemByBaseID <BaseItem>(compoundSelectData.CostItemID);
                        if (null != m_propBorder)
                        {
                            UIManager.GetAtlasAsyn(baseItem.BorderIcon, ref m_propBorderCASD, () =>
                            {
                                if (null != m_propBorder)
                                {
                                    m_propBorder.atlas = null;
                                }
                            }, m_propBorder, false);
                        }

                        if (null != m_propIcon)
                        {
                            uint resID = DataManager.Manager <UIManager>().GetResIDByFileName(false, baseItem.Icon);
                            UIManager.GetTextureAsyn(resID, ref m_propIconCASD, () =>
                            {
                                if (null != m_propIcon)
                                {
                                    m_propIcon.mainTexture = null;
                                }
                            }, m_propIcon, false);
                        }
                        numString = string.Format("x{0}", compoundSelectData.CostItemNum);
                    }
                }

                if (null != m_tsCostMoney)
                {
                    if (m_tsCostMoney.gameObject.activeSelf == isEnough)
                    {
                        m_tsCostMoney.gameObject.SetActive(!isEnough);
                    }

                    if (!isEnough)
                    {
                        if (null != m_moneyIcon)
                        {
                            m_moneyIconCASD = new CMResAsynSeedData <CMAtlas>(() =>
                            {
                                if (null != m_moneyIcon)
                                {
                                    m_moneyIcon.atlas = null;
                                }
                            });
                            string iconName = MallDefine.GetCurrencyIconNameByType(compoundSelectData.ReplaceCostMoneyType);
                            UIManager.GetAtlasAsyn(iconName, ref m_moneyIconCASD, () =>
                            {
                                if (null != m_moneyIcon)
                                {
                                    m_moneyIcon.atlas = null;
                                }
                            }, m_moneyIcon, false);
                        }
                        numString = compoundSelectData.ReplaceCostMoneyNum.ToString();
                    }
                }

                if (null != m_costNum)
                {
                    m_costNum.text = numString;
                }
            }
        }

        if (null != m_tsFreeGet && m_tsFreeGet.gameObject.activeSelf != freeGet)
        {
            m_tsFreeGet.gameObject.SetActive(freeGet);
        }
    }
Beispiel #19
0
    /// <summary>
    /// 设置辅助道具数据
    /// </summary>
    /// <param name="baseId"></param>
    /// <param name="select"></param>
    /// <param name="num"></param>
    /// <param name="useDQ"></param>
    /// <param name="costNum"></param>
    /// <param name="mType"></param>
    public void SetGridData(uint baseId, bool select
                            , uint num     = 1, bool useDQ = false
                            , uint costNum = 0, GameCmd.MoneyType mType = GameCmd.MoneyType.MoneyType_Gold)
    {
        bool cansee = false;

        this.m_uint_baseId = baseId;
        BaseItem baseItem = DataManager.Manager <ItemManager>().GetTempBaseItemByBaseID <BaseItem>(baseId);

        if (null != m_lab_name)
        {
            m_lab_name.text = baseItem.Name;
        }

        if (null != m_lab_des)
        {
            m_lab_des.text = DataManager.Manager <EquipManager>().GetEquipAssistMaterialDes(baseItem.BaseId);
        }
        int holdNum = DataManager.Manager <ItemManager>().GetItemNumByBaseId(baseId);

        if (null != m_lab_num)
        {
            cansee = !useDQ || !select;
            if (m_lab_num.gameObject.activeSelf != cansee)
            {
                m_lab_num.gameObject.SetActive(cansee);
            }
            if (cansee)
            {
                m_lab_num.text = ItemDefine.BuilderStringByHoldAndNeedNum((uint)holdNum, num);
            }
        }
        ResetInfoGrid();
        SetIcon(true, baseItem.Icon);
        SetBorder(true, baseItem.BorderIcon);

        bool fightPowerUp = false;

        if (baseItem.IsEquip &&
            DataManager.Manager <EquipManager>().IsEquipNeedFightPowerMask(baseItem.BaseId, out fightPowerUp))
        {
            SetFightPower(true, fightPowerUp);
        }

        if (baseItem.IsMuhon)
        {
            SetMuhonMask(true, Muhon.GetMuhonStarLevel(baseItem.BaseId));
            SetMuhonLv(true, Muhon.GetMuhonLv(baseItem));
        }
        else if (baseItem.IsRuneStone)
        {
            SetRuneStoneMask(true, (uint)baseItem.Grade);
        }
        cansee = num > holdNum;
        SetNotEnoughGet(cansee);

        if (null != m_tg_select && m_tg_select.value != select)
        {
            m_tg_select.value = select;
        }

        if (null != m_ts_costDQ)
        {
            cansee = useDQ && select;
            if (m_ts_costDQ.gameObject.activeSelf != cansee)
            {
                m_ts_costDQ.gameObject.SetActive(cansee);
            }
            if (cansee)
            {
                UICurrencyGrid costGrid = m_ts_costDQ.GetComponent <UICurrencyGrid>();
                if (null == costGrid)
                {
                    costGrid = m_ts_costDQ.gameObject.AddComponent <UICurrencyGrid>();
                }
                costGrid.SetGridData(
                    new UICurrencyGrid.UICurrencyGridData(MallDefine.GetCurrencyIconNameByType(mType), costNum));
            }
        }
    }
Beispiel #20
0
    /// <summary>
    /// 设置标签
    /// </summary>
    /// <param name="tagTypeData">标签类型</param>
    private void SetTag(MallDefine.MallLocalData localData)
    {
        MallDefine.MallTagTypeData tagTypeData = localData.Tag;
        bool tagVisble = (tagTypeData.Tag != MallDefine.MallTagType.None) ? true : false;

        if (null != tagContent && tagContent.gameObject.activeSelf != tagVisble)
        {
            tagContent.gameObject.SetActive(tagVisble);
        }
        string pricetxt = localData.LocalMall.buyPrice.ToString();

        cost.color = defaultColor;
        if (tagVisble)
        {
            tagVisble = (tagTypeData.Tag == MallDefine.MallTagType.Discount);
            if (m_lab_discount.gameObject.activeSelf != tagVisble)
            {
                m_lab_discount.gameObject.SetActive(tagVisble);
            }
            string tagName = "";
            switch (tagTypeData.Tag)
            {
            case MallDefine.MallTagType.Discount:
            {
                tagName             = "打折";
                m_lab_discount.text = localData.LocalMall.offPrice.ToString();
                pricetxt            = MallDefine.GetDiscountString(localData.LocalMall.buyPrice.ToString());
                cost.color          = ColorManager.GetColor32OfType(ColorType.JZRY_Txt_White);
            }
            break;

            case MallDefine.MallTagType.Hot:
                tagName = "热卖";
                break;

            case MallDefine.MallTagType.VipNeed:
                tagName = string.Format("VIP{0}", tagTypeData.Value);
                break;

            case MallDefine.MallTagType.CharacterLv:
                tagName = string.Format("Lv.{0}", tagTypeData.Value);
                break;
            }
            bool visibleTagBg = (tagTypeData.Tag == MallDefine.MallTagType.VipNeed);
            if (null != mtsTagPurple && mtsTagPurple.gameObject.activeSelf != visibleTagBg)
            {
                mtsTagPurple.gameObject.SetActive(visibleTagBg);
            }

            visibleTagBg = (tagTypeData.Tag == MallDefine.MallTagType.CharacterLv ||
                            tagTypeData.Tag == MallDefine.MallTagType.Hot);
            if (null != mtsTagRed && mtsTagRed.gameObject.activeSelf != visibleTagBg)
            {
                mtsTagRed.gameObject.SetActive(visibleTagBg);
            }

            visibleTagBg = (tagTypeData.Tag == MallDefine.MallTagType.Discount);
            if (null != mtsTagYellow && mtsTagYellow.gameObject.activeSelf != visibleTagBg)
            {
                mtsTagYellow.gameObject.SetActive(visibleTagBg);
            }

            if (null != this.tagDes)
            {
                this.tagDes.text = tagName;
            }
        }
        SetPrice((GameCmd.MoneyType)localData.LocalMall.moneyType, pricetxt);
    }
Beispiel #21
0
    /// <summary>
    /// 设置格子数据
    /// </summary>
    /// <param name="baseId">消耗材料id</param>
    /// <param name="num">(useDq为true代表替代点券数量,反之消耗数量)</param>
    /// <param name="useDq">是否使用货币代替</param>
    ///  <param name="mType">useDq 为true 有效</param>
    public void SetGridData(uint baseId, uint num
                            , bool useDq = false, uint costNum = 0
                            , GameCmd.MoneyType mType = GameCmd.MoneyType.MoneyType_Gold)
    {
        bool cansee = false;

        this.m_uint_baseId = baseId;
        BaseItem baseItem = DataManager.Manager <ItemManager>().GetTempBaseItemByBaseID <BaseItem>(baseId);

        if (null != mlabName)
        {
            mlabName.text = baseItem.Name;
        }

        int holdNum = 0;

        if (null != mlabNum)
        {
            holdNum = DataManager.Manager <ItemManager>().GetItemNumByBaseId(baseId);
            cansee  = !useDq;
            if (mlabNum.gameObject.activeSelf != cansee)
            {
                mlabNum.gameObject.SetActive(cansee);
            }
            if (cansee)
            {
                if (num != 0)
                {
                    mlabNum.text = ItemDefine.BuilderStringByHoldAndNeedNum(
                        (uint)holdNum, num);
                }
                else
                {
                    mlabNum.text = "0/0";
                }
            }
        }
        ResetInfoGrid();
        SetIcon(true, baseItem.Icon);
        SetBorder(true, baseItem.BorderIcon);
        SetBindMask(baseItem.IsBind);
        cansee = (holdNum < num || (num == 0 && holdNum == num));
        SetNotEnoughGet(cansee);

        bool fightPowerUp = false;

        if (baseItem.IsEquip &&
            DataManager.Manager <EquipManager>().IsEquipNeedFightPowerMask(baseItem.BaseId, out fightPowerUp))
        {
            SetFightPower(true, fightPowerUp);
        }

        if (baseItem.IsMuhon)
        {
            SetMuhonMask(true, Muhon.GetMuhonStarLevel(baseItem.BaseId));
            SetMuhonLv(true, Muhon.GetMuhonLv(baseItem));
        }
        else if (baseItem.IsRuneStone)
        {
            SetRuneStoneMask(true, (uint)baseItem.Grade);
        }

        if (null != m_ts_costDQ)
        {
            cansee = useDq;
            if (m_ts_costDQ.gameObject.activeSelf != cansee)
            {
                m_ts_costDQ.gameObject.SetActive(cansee);
            }
            if (cansee)
            {
                UICurrencyGrid costGrid = m_ts_costDQ.GetComponent <UICurrencyGrid>();
                if (null == costGrid)
                {
                    costGrid = m_ts_costDQ.gameObject.AddComponent <UICurrencyGrid>();
                }
                costGrid.SetGridData(
                    new UICurrencyGrid.UICurrencyGridData(MallDefine.GetCurrencyIconNameByType(mType), costNum));
            }
        }
    }
Beispiel #22
0
    /// <summary>
    /// 更新技能信息
    /// </summary>
    private void UpdateSkill()
    {
        if (!IsInitMode(ClanPanelMode.Skill))
        {
            return;
        }

        TextManager tmgr = DataManager.Manager <TextManager>();

        if (null != m_ctor_SkillScrollView)
        {
            m_ctor_SkillScrollView.UpdateActiveGridData();
        }
        bool isLearn = IsSkillMode(ClanSkillMode.Learn);

        //当前等级
        uint curLv = isLearn ? m_mgr.GetClanSkillLearnLv(m_uint_SelectSkillId)
            : m_mgr.GetClanSkillDevLv(m_uint_SelectSkillId);

        table.SkillDatabase skDBCur
            = GameTableManager.Instance.GetTableItem <table.SkillDatabase>(m_uint_SelectSkillId, (int)curLv);
        //技能最大等级
        uint maxLv = (null != skDBCur) ? skDBCur.dwMaxLevel : 1;
        //最大等级
        uint limitLv = isLearn ? m_mgr.GetClanSkillDevLv(m_uint_SelectSkillId)
            : ((null != skDBCur) ? skDBCur.dwMaxLevel : 0);
        bool isMaxLv = (curLv == maxLv);

        table.SkillDatabase skDBNext
            = (!isMaxLv) ? GameTableManager.Instance.GetTableItem <table.SkillDatabase>(m_uint_SelectSkillId, (int)curLv + 1) : null;
        //名称
        if (null != m_label_SkillName)
        {
            m_label_SkillName.text = (null != skDBCur) ? skDBCur.strName : "";
        }

        //等级
        if (null != m_label_SkillLv)
        {
            m_label_SkillLv.text = tmgr.GetLocalFormatText(LocalTextType.Local_TXT_FM_Lv, "", curLv);
        }

        //技能效果
        if (null != m_label_SkillEffectCur)
        {
            m_label_SkillEffectCur.text = (null != skDBCur) ? skDBCur.strDesc : "";
        }
        //技能下一级效果
        if (null != m_label_SkillEffectNext)
        {
            if (m_label_SkillEffectNext.gameObject.activeSelf == isMaxLv)
            {
                m_label_SkillEffectNext.gameObject.SetActive(!isMaxLv);
            }
            if (!isMaxLv)
            {
                m_label_SkillEffectNext.text = ColorManager.GetColorString(ColorType.Green
                                                                           , (null != skDBNext) ? skDBNext.strDesc : "");
            }
        }
        //tips
        if (null != m_label_SkillTips)
        {
            string tips = "";
            if (isMaxLv)
            {
                tips = ColorManager.GetColorString(ColorType.Red, tmgr.GetLocalText(LocalTextType.Local_TXT_UpgradeMax));
            }
            else
            {
                string name = (isLearn) ? tmgr.GetLocalText(LocalTextType.Local_TXT_Learn)
                    : tmgr.GetLocalText(LocalTextType.Local_TXT_Dev);
                string who = (isLearn) ? tmgr.GetLocalText(LocalTextType.Local_TXT_Person)
                    : tmgr.GetLocalText(LocalTextType.Local_TXT_Clan);
                table.ClanSkillDataBase sdbNext =
                    GameTableManager.Instance.GetTableItem <table.ClanSkillDataBase>(m_uint_SelectSkillId, (int)curLv + 1);
                ColorType cType = ColorType.Green;
                if ((isLearn && null != skDBNext && DataManager.Instance.PlayerLv < skDBNext.dwNeedLevel) ||
                    (!isLearn && null != sdbNext && null != ClanInfo && ClanInfo.Lv < sdbNext.needClanLv))
                {
                    cType = ColorType.Red;
                }
                uint lvuint = 0;
                if (isLearn)
                {
                    lvuint = (null != skDBNext) ? skDBNext.dwNeedLevel : 0;
                }
                else
                {
                    lvuint = (null != sdbNext) ? sdbNext.needClanLv : 0;
                }
                string lvStr = ColorManager.GetColorString(cType, tmgr.GetLocalFormatText(LocalTextType.Local_TXT_FM_Lv, who, lvuint));

                tips = tmgr.GetLocalFormatText(LocalTextType.Local_TXT_NextLvNeed, name, lvStr);
            }
            m_label_SkillTips.text = tips;
        }

        if (null != m_trans_Cost && m_trans_Cost.gameObject.activeSelf == isMaxLv)
        {
            m_trans_Cost.gameObject.SetActive(!isMaxLv);
        }
        if (!isMaxLv)
        {
            //消耗
            if (null != m_trans_SkillCost1 && null != m_trans_SkillCost2)
            {
                UICurrencyGrid cGrid1 = null;
                UICurrencyGrid cGrid2 = null;
                cGrid1 = m_trans_SkillCost1.GetComponent <UICurrencyGrid>();
                cGrid2 = m_trans_SkillCost2.GetComponent <UICurrencyGrid>();
                UICurrencyGrid.UICurrencyGridData d1 =
                    new UICurrencyGrid.UICurrencyGridData(ClanDefine.CONST_ICON_ZG_NAME, 0);
                UICurrencyGrid.UICurrencyGridData d2 =
                    new UICurrencyGrid.UICurrencyGridData(ClanDefine.CONST_ICON_ZG_NAME, 0);
                if (isLearn)
                {
                    d1 = new UICurrencyGrid.UICurrencyGridData(
                        MallDefine.GetCurrencyIconNameByType(GameCmd.MoneyType.MoneyType_Gold), skDBNext.dwMoney);
                    d2 = new UICurrencyGrid.UICurrencyGridData(
                        MallDefine.GetCurrencyIconNameByType(GameCmd.MoneyType.MoneyType_Reputation), skDBNext.dwNeedSW);

                    m_trans_SkillCost2.gameObject.SetActive(true);

                    m_label_SkillRemainNum.text = UserData.Reputation.ToString();
                    UIManager.GetAtlasAsyn(MallDefine.GetCurrencyIconNameByType(GameCmd.MoneyType.MoneyType_Reputation), ref m_priceAsynSeed, () =>
                    {
                        if (null != m_sprite_SkillRemainIcon)
                        {
                            m_sprite_SkillRemainIcon.atlas = null;
                        }
                    }, m_sprite_SkillRemainIcon);
                }
                else
                {
                    table.ClanSkillDataBase cskdbNext
                        = GameTableManager.Instance.GetTableItem <table.ClanSkillDataBase>(m_uint_SelectSkillId, (int)curLv + 1);
                    if (null != cskdbNext)
                    {
                        d1 = new UICurrencyGrid.UICurrencyGridData(ClanDefine.CONST_ICON_ZJ_NAME, cskdbNext.coseZJ);
                        //d2 = new UICurrencyGrid.UICurrencyGridData(ClanDefine.CONST_ICON_ZJ_NAME, cskdbNext.coseZJ);
                    }
                    m_trans_SkillCost2.gameObject.SetActive(false);
                    m_label_SkillRemainNum.text = DataManager.Manager <ClanManger>().ClanInfo.Money.ToString();

                    UIManager.GetAtlasAsyn(ClanDefine.CONST_ICON_ZJ_NAME, ref m_priceAsynSeed, () =>
                    {
                        if (null != m_sprite_SkillRemainIcon)
                        {
                            m_sprite_SkillRemainIcon.atlas = null;
                        }
                    }, m_sprite_SkillRemainIcon);
                }
                if (null != cGrid1)
                {
                    cGrid1.SetGridData(d1);
                }
                if (null != cGrid2)
                {
                    cGrid2.SetGridData(d2);
                }

                bool canSee = IsSkillMode(ClanSkillMode.Learn);
                if (null != m_btn_BtnLearn && m_btn_BtnLearn.gameObject.activeSelf != canSee)
                {
                    m_btn_BtnLearn.gameObject.SetActive(canSee);
                }
                canSee = !canSee;
                if (null != m_btn_BtnDev && m_btn_BtnDev.gameObject.activeSelf != canSee)
                {
                    m_btn_BtnDev.gameObject.SetActive(canSee);
                }
            }
        }
    }