Exemple #1
0
    /// <summary>
    /// 设置格子参数
    /// </summary>
    /// <param name="empty">是否为空</param>
    /// <param name="isCost">是否为消耗样式</param>
    /// <param name="baseId">表格id</param>
    /// <param name="num">数量 : (isCost为true消耗数量,反之表示合成数量)</param>
    public void SetGridViewData(bool empty, bool isCost = true, uint baseId = 0, uint num = 0)
    {
        ResetInfoGrid(!empty);
        this.m_uint_baseGrid = baseId;

        bool bottomVisible = !empty && isCost;

        if (null != m_labBottomNum)
        {
            if (m_labBottomNum.gameObject.activeSelf != bottomVisible)
            {
                m_labBottomNum.gameObject.SetActive(bottomVisible);
            }
        }
        if (null != m_ts_infoRoot)
        {
            if (m_ts_infoRoot.gameObject.activeSelf == empty)
            {
                m_ts_infoRoot.gameObject.SetActive(!empty);
            }
            if (!empty)
            {
                BaseItem baseItem          = DataManager.Manager <ItemManager>().GetTempBaseItemByBaseID <BaseItem>(baseId);
                int      holdNum           = DataManager.Manager <ItemManager>().GetItemNumByBaseId(baseItem.BaseId);
                bool     needShowNotEnough = isCost && (holdNum < num);
                string   showText          = num.ToString();
                if (!isCost)
                {
                    SetNum(true, showText);
                }
                if (null != m_labBottomNum)
                {
                    if (isCost)
                    {
                        showText            = ItemDefine.BuilderStringByHoldAndNeedNum((uint)holdNum, num);
                        m_labBottomNum.text = showText;
                    }
                }

                SetNotEnoughGet(needShowNotEnough);
                SetIcon(true, baseItem.Icon);
                SetBorder(true, baseItem.BorderIcon);
                SetBindMask(baseItem.IsBind);

                if (baseItem.IsMuhon)
                {
                    SetMuhonMask(true, Muhon.GetMuhonStarLevel(baseItem.BaseId));
                    SetMuhonLv(true, Muhon.GetMuhonLv(baseItem));
                }
                else if (baseItem.IsRuneStone)
                {
                    SetRuneStoneMask(true, (uint)baseItem.Grade);
                }
                else if (baseItem.IsChips)
                {
                    SetChips(true);
                }
            }
        }
    }
Exemple #2
0
    /// <summary>
    /// 设置
    /// </summary>
    /// <param name="num"></param>
    public void Set(uint baseId, string num)
    {
        ResetInfoGrid();
        this.baseId = baseId;
        BaseItem baseItem = DataManager.Manager <ItemManager>().GetTempBaseItemByBaseID <BaseItem>(baseId);

        if (null != m_lab_name)
        {
            m_lab_name.text = (baseItem.IsBaseReady) ? baseItem.Name : "金币";
        }

        if (null != m_lab_num)
        {
            m_lab_num.text = num;
        }

        SetIcon(true, ((baseItem.IsBaseReady) ? baseItem.Icon : "1"));
        SetBorder(true, baseItem.BorderIcon);
        //SetBindMask(false);
        //SetTimeLimitMask(false);
        //SetFightUp(false);
        if (baseItem.IsBaseReady)
        {
            if (baseItem.IsMuhon)
            {
                SetMuhonMask(true, Muhon.GetMuhonStarLevel(baseItem.BaseId));
                SetMuhonLv(true, Muhon.GetMuhonLv(baseItem));
            }
            else if (baseItem.IsRuneStone)
            {
                SetRuneStoneMask(true, (uint)baseItem.Grade);
            }
        }
    }
Exemple #3
0
 public void UpdateItemInfo(ItemPageInfo info, ItemSerialize data = null)
 {
     itemPageInfo = info;
     ResetInfoGrid(true);
     if (itemPageInfo != null)
     {
         marked_id = info.market_id;
         BaseItem baseItem = new BaseItem(itemPageInfo.item_base_id, data);
         itemName.text  = baseItem.Name;
         itemLevel.text = baseItem.UseLv.ToString();
         itemPrice.text = itemPageInfo.money.ToString();
         SetIcon(true, baseItem.Icon);
         bool enable = (itemPageInfo.item_num > 1) ? true : false;
         SetNum(enable, itemPageInfo.item_num.ToString());
         SetBorder(true, baseItem.BorderIcon);
         if (baseItem.IsMuhon)
         {
             SetMuhonMask(true, Muhon.GetMuhonStarLevel(baseItem.BaseId));
             SetMuhonLv(true, Muhon.GetMuhonLv(baseItem));
         }
         else if (baseItem.IsRuneStone)
         {
             SetRuneStoneMask(true, (uint)baseItem.Grade);
         }
         HadStard = DataManager.Manager <ConsignmentManager>().AllStarMarkedIDs.Contains(marked_id);
         SetStarValue(HadStard);
         m_l_leftSeconds      = (uint)((itemPageInfo.show_time - DateTimeHelper.Instance.Now) > 0 ? (itemPageInfo.show_time - DateTimeHelper.Instance.Now) :0);
         moneyIcon.spriteName = itemPageInfo.great ? CurrencyIconData.GetCurrencyIconByMoneyType(ClientMoneyType.YuanBao).smallIconName
                                                : CurrencyIconData.GetCurrencyIconByMoneyType(ClientMoneyType.YinLiang).smallIconName;
         IsGongShi.gameObject.SetActive(itemPageInfo.great);
     }
 }
Exemple #4
0
    public void SetGridData(BaseItem baseItem)
    {
        this.baseItem = baseItem;
        bool empty = (null == baseItem);

        if (null != m_ts_none && m_ts_none.gameObject.activeSelf != empty)
        {
            m_ts_none.gameObject.SetActive(empty);
        }

        if (null != mtsInfoRoot && mtsInfoRoot.gameObject.activeSelf == empty)
        {
            mtsInfoRoot.gameObject.SetActive(!empty);
        }
        if (!empty)
        {
            ResetInfoGrid();
            SetBg(true);
            bool visible = baseItem.Num > 1;
            if (visible)
            {
                SetNum(true, baseItem.Num.ToString());
            }
            //bool isMatchJob = DataManager.IsMatchPalyerJob((int)baseItem.BaseData.useRole);
            //bool fightPowerUp = false;
            //if (isMatchJob
            //    && DataManager.Manager<EquipManager>().IsEquipNeedFightPowerMask(baseItem.QWThisID, out fightPowerUp))
            //{
            //    SetFightPower(true, fightPowerUp);
            //}

            //if (!DataManager.IsMatchPalyerLv((int)baseItem.BaseData.useLevel)
            //    || !isMatchJob)
            //{
            //    SetWarningMask(true);
            //}

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

            SetBindMask(baseItem.IsBind);
        }
    }
    /// <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 cansee = false;

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

        int holdNum = 0;

        holdNum = DataManager.Manager <ItemManager>().GetItemNumByBaseId(baseId);
        //cansee = !useDq || (style != ItemGrowCostStyle.NameNumRight);

        //if (null != tempLabel)
        //{
        //    holdNum = DataManager.Manager<ItemManager>().GetItemNumByBaseId(baseId);
        //    cansee = !useDq || (style != ItemGrowCostStyle.NameNumRight);
        //    if (tempLabel.gameObject.activeSelf != cansee)
        //        tempLabel.gameObject.SetActive(cansee);
        //    if (cansee)
        //    {
        //        tempLabel.text = ItemDefine.BuilderStringByHoldAndNeedNum(
        //            (uint)holdNum, num);
        //    }
        //}

        ResetInfoGrid();
        SetIcon(true, baseItem.Icon);
        SetBorder(true, baseItem.BorderIcon);
        SetBindMask(baseItem.IsBind);
        cansee = 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);
        }
    }
Exemple #6
0
    public void SetGridData(uint baseID, uint num)
    {
        this.baseID = baseID;
        BaseItem baseItem = null;

        if (baseID != 0)
        {
            baseItem = new BaseItem(baseID);
        }
        bool empty = (null == baseItem);

        if (null != m_ts_none && m_ts_none.gameObject.activeSelf != empty)
        {
            m_ts_none.gameObject.SetActive(empty);
        }

        if (null != mtsInfoRoot && mtsInfoRoot.gameObject.activeSelf == empty)
        {
            mtsInfoRoot.gameObject.SetActive(!empty);
        }
        if (!empty)
        {
            ResetInfoGrid();
            SetBg(true);
            bool visible = num > 1;
            if (visible)
            {
                SetNum(true, num.ToString());
            }
            SetIcon(true, baseItem.Icon);
            SetBorder(true, baseItem.BorderIcon);
            if (baseItem.IsMuhon)
            {
                SetMuhonMask(true, Muhon.GetMuhonStarLevel(baseItem.BaseId));
                SetMuhonLv(true, Muhon.GetMuhonLv(baseItem));
            }
            else if (baseItem.IsRuneStone)
            {
                SetRuneStoneMask(true, (uint)baseItem.Grade);
            }

            SetBindMask(baseItem.IsBind);
        }
    }
Exemple #7
0
 public void InitGrid(uint itemId, int num, int depth, Vector3 sourceWPos, Vector3 targetWPos, Action <uint, int, UIItemGetAnimGrid> animOutCallback)
 {
     ResetInfoGrid();
     if (null != m_panel)
     {
         m_panel.depth = depth;
     }
     m_bAnimOut = false;
     m_tsContent.localPosition = Vector3.zero;
     m_tsContent.localScale    = Vector3.one;
     if (null != m_ts && null != m_tp && null != m_playTween)
     {
         m_uitemId    = itemId;
         m_ts.enabled = false;
         //m_ts.ResetToBeginning();
         m_tp.enabled = false;
         //m_tp.ResetToBeginning();
         m_inum = num;
         BaseItem baseItem = DataManager.Manager <ItemManager>().GetTempBaseItemByBaseID <BaseItem>(itemId);
         SetIcon(true, baseItem.Icon);
         SetBorder(true, baseItem.BorderIcon);
         bool enable = baseItem.Num > 1;
         SetNum(enable, baseItem.Num.ToString());
         //SetBindMask(baseItem.IsBind);
         if (baseItem.IsMuhon)
         {
             SetMuhonMask(true, Muhon.GetMuhonStarLevel(baseItem.BaseId));
             SetMuhonLv(true, Muhon.GetMuhonLv(baseItem));
         }
         else if (baseItem.IsRuneStone)
         {
             SetRuneStoneMask(true, (uint)baseItem.Grade);
         }
         this.m_animOut = animOutCallback;
         if (null != m_tp)
         {
             m_tp.from = sourceWPos;
             m_tp.to   = targetWPos;
         }
     }
 }
Exemple #8
0
    public void UpdateItemInfo(ItemPageInfo itemData, ItemSellTimeInfo timeInfo, ItemSerialize data = null)
    {
        this.itemData = itemData;
        this.timeInfo = timeInfo;
        ResetInfoGrid(true);
        if (itemData != null)
        {
            BaseItem baseItem = new BaseItem(itemData.item_base_id, data);
            itemName.text = baseItem.Name;

            SetIcon(true, baseItem.Icon);
            bool enable = (itemData.item_num > 1) ? true : false;
            SetNum(enable, itemData.item_num.ToString());
            SetBorder(true, baseItem.BorderIcon);
            if (baseItem.IsMuhon)
            {
                SetMuhonMask(true, Muhon.GetMuhonStarLevel(baseItem.BaseId));
            }
            else if (baseItem.IsRuneStone)
            {
                SetRuneStoneMask(true, (uint)baseItem.Grade);
            }
            yuanbaoicon.gameObject.SetActive(itemData.great);
            jinbiicon.gameObject.SetActive(!itemData.great);
            itemPrice.text = itemData.money.ToString();

            int showTime = 0;
            if (baseItem.IsTreasure)
            {
                showTime           = GameTableManager.Instance.GetGlobalConfig <int>("GreatShowTime");
                m_l_GongShiSeconds = (int)(timeInfo.sell_time + showTime - DateTimeHelper.Instance.Now);
            }
            int unSalingTime = GameTableManager.Instance.GetGlobalConfig <int>("SellItemUnSalingTime");
            m_l_XiaJiaSeconds = (int)(timeInfo.sell_time + showTime + unSalingTime - DateTimeHelper.Instance.Now);



            remainTime.gameObject.SetActive((itemData.great && m_l_GongShiSeconds > 0));
        }
    }
    public override void SetGridData(object data)
    {
        base.SetGridData(data);
        info = data as ItemPriceInfo;
        if (info != null)
        {
            if (money != null)
            {
                CurrencyIconData currency = CurrencyIconData.GetCurrencyIconByMoneyType((ClientMoneyType)info.money_type);
                if (currency != null)
                {
                    money.spriteName = currency.smallIconName;
                }
            }
            itData     = new ItemSerialize();
            itData     = ItemSerialize.Deserialize(info.item_data);
            price.text = info.price.ToString();
            if (itData != null)
            {
                ResetInfoGrid(true);

                BaseItem baseItem = new BaseItem(itData.dwObjectID, itData);
                name.text = baseItem.Name;

                SetIcon(true, baseItem.Icon);
                bool enable = (info.num > 1) ? true : false;
                SetNum(enable, info.num.ToString());
                SetBorder(true, baseItem.BorderIcon);
                if (baseItem.IsMuhon)
                {
                    SetMuhonMask(true, Muhon.GetMuhonStarLevel(baseItem.BaseId));
                }
                else if (baseItem.IsRuneStone)
                {
                    SetRuneStoneMask(true, (uint)baseItem.Grade);
                }
            }
        }
    }
Exemple #10
0
    public override void SetGridData(object data)
    {
        base.SetGridData(data);
        ResetInfoGrid();
        if (null == data)
        {
            return;
        }
        this.mallItemId = (uint)data;
        MallDefine.MallLocalData localData = DataManager.Manager <MallManager>().GetMallLocalDataByMallItemId(this.mallItemId);
        if (null == localData)
        {
            Engine.Utility.Log.Error("UIMallGrid SetGridData faield,mall data errir mall:{0}", this.mallItemId);
            return;
        }
        SetIcon(true, localData.LocalItem.Icon);
        SetName(localData.LocalItem.Name);
        bool enable = (localData.LocalMall.pileNum > 1) ? true : false;

        SetNum(enable, localData.LocalMall.pileNum.ToString());
        SetBorder(true, localData.LocalItem.BorderIcon);
        SetTag(localData);

        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);
        }
    }
Exemple #11
0
    public override void SetGridData(object data)
    {
        base.SetGridData(data);
        bool empty = (null == data);

        ResetInfoGrid(!empty);
        if (empty)
        {
            this.data = null;
            if (particle != null)
            {
                particle.ReleaseParticle();
            }
            return;
        }
        this.data = data as BaseEquip;
        SetIcon(true, this.data.Icon);
        SetBorder(true, this.data.BorderIcon);
        SetBindMask(this.data.IsBind);
        SetTimeLimitMask(false);
        if (this.data.IsMuhon)
        {
            SetMuhonMask(true, Muhon.GetMuhonStarLevel(this.data.BaseId));
            SetMuhonLv(true, Muhon.GetMuhonLv(this.data));
        }
        if (this.data.IsEquip)
        {
            Equip equip = DataManager.Manager <ItemManager>().GetBaseItemByQwThisId <Equip>(this.data.QWThisID);
            if (equip != null)
            {
                bool HaveDurable       = equip.HaveDurable;
                bool warningMaskEnable = !HaveDurable;
                SetDurableMask(!HaveDurable);
            }
        }
    }
Exemple #12
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));
            }
        }
    }
Exemple #13
0
    /// <summary>
    /// 刷新购买信息
    /// </summary>
    private void UpdatePurchaseInfo()
    {
        bool enable = IsSelectItemEnable();

        if (null != m_trans_PurchaseContent &&
            m_trans_PurchaseContent.gameObject.activeSelf != enable)
        {
            m_trans_PurchaseContent.gameObject.SetActive(enable);
        }
        if (!enable)
        {
            return;
        }
        MallDefine.MallLocalData current = CurrentMallData;
        bool mallInfoVisible             = (null != current) ? true : false;

        if (null != m_trans_MallItemInfo && m_trans_MallItemInfo.gameObject.activeSelf != mallInfoVisible)
        {
            m_trans_MallItemInfo.gameObject.SetActive(mallInfoVisible);
        }
        if (mallInfoVisible)
        {
            if (null != m_label_MallItemName)
            {
                m_label_MallItemName.text = current.LocalItem.Name;
            }
            if (null != m_label_MallItemUseLv)
            {
                ColorType color = (current.LocalItem.UseLv > DataManager.Instance.PlayerLv) ? ColorType.Red : ColorType.Green;
                m_label_MallItemUseLv.text = DataManager.Manager <TextManager>()
                                             .GetLocalFormatText(LocalTextType.Local_TXT_Mall_UselevelDescribe
                                                                 , ColorManager.GetNGUIColorOfType(color), current.LocalItem.UseLv);
            }

            if (null != m_label_MallItemDes)
            {
                m_label_MallItemDes.text = current.LocalItem.Des;
            }

            if (null != m_mallItemBaseGrid)
            {
                m_mallItemBaseGrid.Reset();
                m_mallItemBaseGrid.SetIcon(true, current.LocalItem.Icon);
                m_mallItemBaseGrid.SetBorder(true, current.LocalItem.BorderIcon);
                //m_mallItemBaseGrid.SetBindMask(current.LocalItem.IsBind);
                //SetTimeLimitMask(false);
                //SetFightUp(false);
                if (current.LocalItem.IsMuhon)
                {
                    m_mallItemBaseGrid.SetMuhonMask(enable
                                                    , Muhon.GetMuhonStarLevel(current.LocalItem.BaseId));
                    m_mallItemBaseGrid.SetMuhonLv(true, Muhon.GetMuhonLv(current.LocalItem));
                }
                else if (current.LocalItem.IsRuneStone)
                {
                    m_mallItemBaseGrid.SetRunestoneMask(enable, (uint)current.LocalItem.Grade);
                }
            }
        }
        if (null != m_label_ChooseMallItemNotice && m_label_ChooseMallItemNotice.gameObject.activeSelf == mallInfoVisible)
        {
            m_label_ChooseMallItemNotice.gameObject.SetActive(!mallInfoVisible);
        }

        UpdateLeftTimes();

        if (null != m_label_DiscountLeftTime)
        {
            bool visible = current.IsInDiscount && current.HasSchedule;
            if (m_label_DiscountLeftTime.gameObject.activeSelf != visible)
            {
                m_label_DiscountLeftTime.gameObject.SetActive(visible);
            }
        }

        UpdatePurchaseNum();
    }
Exemple #14
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);
        }
    }
Exemple #15
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));
            }
        }
    }
Exemple #16
0
    public override void SetGridData(object data)
    {
        base.SetGridData(data);
        if (null == data || !(data is uint))
        {
            return;
        }
        ResetInfoGrid();

        this.m_uint_id = (uint)data;
        bool none = (m_uint_id == 0);

        if (null != m_ts_none && m_ts_none.gameObject.activeSelf != none)
        {
            m_ts_none.gameObject.SetActive(none);
        }
        if (null != mtsInfoRoot && mtsInfoRoot.gameObject.activeSelf == none)
        {
            mtsInfoRoot.gameObject.SetActive(!none);
        }

        if (null != mlabName && mlabName.gameObject.activeSelf == none)
        {
            mlabName.gameObject.SetActive(!none);
        }
        if (!none)
        {
            BaseItem baseItem = DataManager.Manager <ItemManager>().GetBaseItemByQwThisId(m_uint_id);
            if (baseItem == null)
            {
                baseItem = DataManager.Manager <ItemManager>().GetTempBaseItemByBaseID <BaseItem>(m_uint_id);
            }

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

            bool isMatchJob   = DataManager.IsMatchPalyerJob((int)baseItem.BaseData.useRole);
            bool fightPowerUp = false;
            if (isMatchJob &&
                DataManager.Manager <EquipManager>().IsEquipNeedFightPowerMask(baseItem.QWThisID, out fightPowerUp))
            {
                SetFightPower(true, fightPowerUp);
            }

            if (!DataManager.IsMatchPalyerLv((int)baseItem.BaseData.useLevel) ||
                !isMatchJob)
            {
                SetWarningMask(true);
            }

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

            SetBindMask(baseItem.IsBind);
        }
    }
Exemple #17
0
    public override void SetGridData(object data)
    {
        base.SetGridData(data);
        if (null != data && data is uint)
        {
            m_uint_id = (uint)data;
        }
        else
        {
            m_uint_id = 0;
        }
        bool     empty    = false;
        BaseItem baseItem = DataManager.Manager <ItemManager>().GetTempBaseItemByBaseID <BaseItem>(m_uint_id);

        empty = !baseItem.IsBaseReady;
        ResetInfoGrid(!empty);
        if (!empty)
        {
            m_uint_id = (uint)data;
            if (null != m_lab_name)
            {
                m_lab_name.text = baseItem.Name;
            }

            SetIcon(true, baseItem.Icon);
            SetBorder(true, baseItem.BorderIcon);
            SetBindMask(baseItem.IsBind);
            int num = DataManager.Manager <ItemManager>().GetItemNumByBaseId(baseItem.BaseId);
            //if (num >= 1)
            {
                SetNum(true, num.ToString());
            }
            if (baseItem.IsMuhon)
            {
                SetMuhonMask(true, Muhon.GetMuhonStarLevel(baseItem.BaseId));
                SetMuhonLv(true, Muhon.GetMuhonLv(baseItem));
            }
            else if (baseItem.IsRuneStone)
            {
                SetRuneStoneMask(true, (uint)baseItem.Grade);
            }
            else if (baseItem.IsChips)
            {
                SetChips(true);
            }

            ItemManager img = DataManager.Manager <ItemManager>();
            if (null != m_lab_des)
            {
                int composeNum = 0;
                table.ComposeDataBase
                    db = GameTableManager.Instance.GetTableItem <table.ComposeDataBase>(m_uint_id);
                if (null == db)
                {
                    Engine.Utility.Log.Error("UIComposeGrid error,get ComposeDataBase exception id = {0}", m_uint_id);
                }
                else
                {
                    int tempComposeNum = 0;
                    //材料1
                    if (db.costItem1 != 0 && db.costNum1 > 0)
                    {
                        tempComposeNum = (int)(img.GetItemNumByBaseId(db.costItem1) / db.costNum1);
                        composeNum     = tempComposeNum;
                    }
                    //材料2
                    if (db.costItem2 != 0 && db.costNum2 > 0)
                    {
                        tempComposeNum = (int)(img.GetItemNumByBaseId(db.costItem2) / db.costNum2);
                        if (tempComposeNum < composeNum)
                        {
                            composeNum = tempComposeNum;
                        }
                    }
                    //材料3
                    if (db.costItem3 != 0 && db.costNum3 > 0)
                    {
                        tempComposeNum = (int)(img.GetItemNumByBaseId(db.costItem3) / db.costNum3);
                        if (tempComposeNum < composeNum)
                        {
                            composeNum = tempComposeNum;
                        }
                    }
                    //材料4
                    if (db.costItem4 != 0 && db.costNum4 > 0)
                    {
                        tempComposeNum = (int)(img.GetItemNumByBaseId(db.costItem4) / db.costNum4);
                        if (tempComposeNum < composeNum)
                        {
                            composeNum = tempComposeNum;
                        }
                    }
                    //材料5
                    if (db.costItem5 != 0 && db.costNum5 > 0)
                    {
                        tempComposeNum = (int)(img.GetItemNumByBaseId(db.costItem1) / db.costNum1);
                        if (tempComposeNum < composeNum)
                        {
                            composeNum = tempComposeNum;
                        }
                    }
                }
                m_lab_des.text = string.Format("可合成:{0}", composeNum);
            }
        }
    }
Exemple #18
0
    public void SetGridData(uint id, bool needUnload = false, bool circleStyle = false)
    {
        this.m_uint_id = id;
        bool empty = (id == 0);

        if (null != m_ts_none && m_ts_none.gameObject.activeSelf != empty)
        {
            m_ts_none.gameObject.SetActive(empty);
        }

        if (null != m_tsUnload && m_tsUnload.gameObject.activeSelf != needUnload)
        {
            if (needUnload && !empty)
            {
                m_tsUnload.gameObject.SetActive(needUnload);
            }
        }

        if (null != mtsInfoRoot && mtsInfoRoot.gameObject.activeSelf == empty)
        {
            mtsInfoRoot.gameObject.SetActive(!empty);
        }
        if (!empty)
        {
            BaseItem baseItem = DataManager.Manager <ItemManager>().GetBaseItemByQwThisId(m_uint_id);
            if (baseItem == null)
            {
                baseItem = DataManager.Manager <ItemManager>().GetTempBaseItemByBaseID <BaseItem>(m_uint_id);
            }

            ResetInfoGrid();
            SetBg(!circleStyle);
            bool isMatchJob   = DataManager.IsMatchPalyerJob((int)baseItem.BaseData.useRole);
            bool fightPowerUp = false;
            if (isMatchJob &&
                DataManager.Manager <EquipManager>().IsEquipNeedFightPowerMask(baseItem.QWThisID, out fightPowerUp))
            {
                SetFightPower(true, fightPowerUp);
            }

            if (!DataManager.IsMatchPalyerLv((int)baseItem.BaseData.useLevel) ||
                !isMatchJob)
            {
                SetWarningMask(true, circleStyle);
            }

            SetIcon(true, baseItem.Icon, circleStyle: circleStyle);
            SetBorder(true, baseItem.BorderIcon, circleStyle: circleStyle);
            if (baseItem.IsMuhon)
            {
                SetMuhonMask(true, Muhon.GetMuhonStarLevel(baseItem.BaseId));
                SetMuhonLv(true, Muhon.GetMuhonLv(baseItem));
            }
            else if (baseItem.IsRuneStone)
            {
                SetRuneStoneMask(true, (uint)baseItem.Grade);
            }

            SetBindMask(baseItem.IsBind);
        }
    }
Exemple #19
0
    public void SetGridData(UIItemInfoGridBase.InfoGridType infoGridType, BaseItem baseItem)
    {
        bool empty = (null == baseItem);

        ResetInfoGrid(!empty);
        SetTreasureVisible(false);
        if (empty)
        {
            this.data = null;
            return;
        }
        this.data = baseItem as BaseItem;
        SetIcon(true, this.data.Icon);
        SetBorder(true, this.data.BorderIcon);
        bool enable = this.data.Num > 1;

        SetNum(enable, TextManager.GetFormatNumText(this.data.Num));
        SetBindMask(this.data.IsBind);
        //SetTimeLimitMask(false);
        bool isMatchJob  = DataManager.IsMatchPalyerJob((int)this.data.BaseData.useRole);
        bool haveDurable = true;

        if (this.data.IsEquip)
        {
            bool fightPowerUp = false;
            if (isMatchJob &&
                DataManager.Manager <EquipManager>().IsEquipNeedFightPowerMask(this.data.QWThisID, out fightPowerUp))
            {
                SetFightPower(true, fightPowerUp);
            }
            Equip equip = DataManager.Manager <ItemManager>().GetBaseItemByQwThisId <Equip>(this.data.QWThisID);
            if (equip != null)
            {
                haveDurable = equip.HaveDurable;
            }
        }
        bool isMatchLv         = DataManager.IsMatchPalyerLv((int)this.data.BaseData.useLevel);
        bool warningMaskEnable = !(isMatchJob && isMatchLv);

        if (infoGridType == InfoGridType.Knapsack)
        {
            if (!empty)
            {
                //warningMaskEnable = !(isMatchJob && isMatchLv);
                DoGameEvent((int)Client.GameEventID.UIEVENT_USEITEMCD, new Client.stUseItemCD()
                {
                    itemBaseId = data.BaseId,
                });
            }
        }
        else if (infoGridType == InfoGridType.KnapsackSell)
        {
            //warningMaskEnable = !this.data.CanSell2NPC;
        }
        else if (infoGridType == InfoGridType.KnapsackSplit && baseItem.IsEquip)
        {
            //BaseEquip baseEquip = DataManager.Manager<ItemManager>().GetBaseItemByQwThisId<BaseEquip>(baseItem.QWThisID);
            //if (null != baseEquip && !baseEquip.CanSplit)
            //    warningMaskEnable = true;
        }
        else if (infoGridType == InfoGridType.KnapsackWareHouse)
        {
            //warningMaskEnable = !baseItem.CanStore2WareHouse;
        }
        if (warningMaskEnable)
        {
            SetWarningMask(true);
        }

        SetDurableMask(!haveDurable);

        if (this.data.IsMuhon)
        {
            SetMuhonMask(true, Muhon.GetMuhonStarLevel(this.data.BaseId));
            SetMuhonLv(true, Muhon.GetMuhonLv(this.data));
        }
        else if (this.data.IsRuneStone)
        {
            SetRuneStoneMask(true, (uint)this.data.Grade);
        }
        else if (this.data.IsChips)
        {
            SetChips(true);
        }
        SetTreasureVisible(data.IsTreasure && infoGridType == InfoGridType.Consignment);
    }
Exemple #20
0
    public void SetGridData(uint id, uint num, bool nameVisible = true, bool circleStyle = false, bool numVisible = true, ItemSerialize data = null, bool blockVisible = false, bool hasGot = false, bool GodWeapenType = false, uint GodWeapenDataID = 0)
    {
        this.m_uint_id = id;
        bool empty = (id == 0);

        ResetInfoGrid();
        IsGetGodWeapen = !blockVisible && !hasGot && GodWeapenType;
        WeapenDataID   = GodWeapenDataID;
        if (null != m_ts_none && m_ts_none.gameObject.activeSelf != empty)
        {
            m_ts_none.gameObject.SetActive(empty);
        }

        if (null != mtsInfoRoot && mtsInfoRoot.gameObject.activeSelf == empty)
        {
            mtsInfoRoot.gameObject.SetActive(!empty);
        }
        if (!empty)
        {
            baseItem = DataManager.Manager <ItemManager>().GetBaseItemByQwThisId(m_uint_id);
            if (baseItem == null)
            {
                if (data != null)
                {
                    baseItem = new BaseItem(m_uint_id, data);
                }
                else
                {
                    baseItem = DataManager.Manager <ItemManager>().GetTempBaseItemByBaseID <BaseItem>(m_uint_id);
                }
            }



            SetBg(!circleStyle);
            bool isMatchJob = false;
            if (baseItem.BaseData != null)
            {
                isMatchJob = DataManager.IsMatchPalyerJob((int)baseItem.BaseData.useRole);
                if (!DataManager.IsMatchPalyerLv((int)baseItem.BaseData.useLevel) ||
                    !isMatchJob)
                {
                    SetWarningMask(true);
                }
            }
            else
            {
                Engine.Utility.Log.Error("ID为{0}的奖励道具不存在,检查配置表格", m_uint_id);
            }

            bool fightPowerUp = false;
            if (isMatchJob &&
                DataManager.Manager <EquipManager>().IsEquipNeedFightPowerMask(baseItem.QWThisID, out fightPowerUp))
            {
                SetFightPower(true, fightPowerUp);
            }


            SetIcon(true, baseItem.Icon, circleStyle: circleStyle);
            SetBorder(true, baseItem.BorderIcon, circleStyle: circleStyle);
            if (baseItem.IsMuhon)
            {
                SetMuhonLv(true, Muhon.GetMuhonLv(baseItem));
                SetMuhonMask(true, Muhon.GetMuhonStarLevel(baseItem.BaseId));
            }
            else if (baseItem.IsRuneStone)
            {
                SetRuneStoneMask(true, (uint)baseItem.Grade);
            }

            SetBindMask(baseItem.IsBind);
            SetName(nameVisible, baseItem.Name);
            SetNum(numVisible, TextManager.GetFormatNumText(num));
            SetBlock(blockVisible);
            SetMark(hasGot);
            if (boc != null)
            {
                boc.enabled = true;
            }


            AddEffect(IsGetGodWeapen);
        }
    }