Beispiel #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);
                }
            }
        }
    }
Beispiel #2
0
 /// <summary>
 /// 更新升级
 /// </summary>
 private void UpdateUpgrade()
 {
     if (m_mgr.IsJoinClan && m_mgr.IsJoinFormal)
     {
         ClanDefine.LocalClanInfo claninfo = ClanInfo;
         if (null == claninfo)
         {
             Engine.Utility.Log.Error("ClanInfo Error");
             return;
         }
         bool isMax = m_mgr.IsMaxClanLv(claninfo.Lv);
         if (null != m_trans_UpgradeNormal && m_trans_UpgradeNormal.gameObject.activeSelf == isMax)
         {
             m_trans_UpgradeNormal.gameObject.SetActive(!isMax);
         }
         if (null != m_trans_UpgradeMax && m_trans_UpgradeMax.gameObject.activeSelf != isMax)
         {
             m_trans_UpgradeMax.gameObject.SetActive(isMax);
         }
         if (ClanInfo != null)
         {
             m_label_clanlevelnum.text = claninfo.Lv.ToString();
         }
         if (isMax)
         {
             if (null != m_label_ClanMaxLv)
             {
                 m_label_ClanMaxLv.text = string.Format("氏族等级{0}", claninfo.Lv);
             }
             if (null != m_label_UpgradeMaxInfo)
             {
                 m_label_UpgradeMaxInfo.text = string.Format("成员上限 {0}", m_mgr.GetClanMemberMaxLimit(claninfo.Lv));
             }
         }
         else
         {
             if (null != m_trans_UpgradeCur)
             {
                 m_trans_UpgradeCur.Find("Title").GetComponent <UILabel>().text   = string.Format("氏族等级{0}", claninfo.Lv);
                 m_trans_UpgradeCur.Find("Content").GetComponent <UILabel>().text = string.Format("成员上限 {0}", m_mgr.GetClanMemberMaxLimit(claninfo.Lv));
             }
             if (null != m_trans_UpgradeNext)
             {
                 m_trans_UpgradeNext.Find("Title").GetComponent <UILabel>().text   = string.Format("氏族等级{0}", claninfo.Lv + 1);
                 m_trans_UpgradeNext.Find("Content").GetComponent <UILabel>().text = string.Format("成员上限 {0}", m_mgr.GetClanMemberMaxLimit(claninfo.Lv + 1));
             }
             table.ClanUpgradeDataBase upDB = GameTableManager.Instance.GetTableItem <table.ClanUpgradeDataBase>(claninfo.Lv + 1);
             if (null != m_label_ClanUpgradeCostZG)
             {
                 m_label_ClanUpgradeCostZG.text = ItemDefine.BuilderStringByHoldAndNeedNum(claninfo.TotalZG, ((null != upDB)? upDB.buildLv:0));
             }
             if (null != m_label_ClanUpgradeCostZJ)
             {
                 m_label_ClanUpgradeCostZJ.text = ItemDefine.BuilderStringByHoldAndNeedNum(claninfo.Money, ((null != upDB)? upDB.clanMoney : 0));
             }
         }
     }
 }
Beispiel #3
0
    /// <summary>
    /// 设置格子
    /// </summary>
    /// <param name="attr">属性</param>
    /// <param name="totalProtectAttrNum">保护属性总条数</param>
    /// <param name="selectNum">选择数量</param>
    /// <param name="callback"></param>
    public void SetGridView(GameCmd.PairNumber attr, bool select, int fillNum = 0, int needNum = 0
                            , Action <uint> callback = null)
    {
        ResetInfoGrid();
        RuneStone rs = null;
        uint      runeStoneBaseId = 0;

        AttrId = attr.id;
        EquipManager emgr = DataManager.Manager <EquipManager>();

        if (emgr.TryGetRuneStoneIdByEffectId(emgr.TransformAttrToEffectId(attr), out runeStoneBaseId))
        {
            rs = DataManager.Manager <ItemManager>().GetTempBaseItemByBaseID <RuneStone>(runeStoneBaseId, ItemDefine.ItemDataType.RuneStone);
        }
        else
        {
            Engine.Utility.Log.Error("TryGetRuneStoneIdByEffectId failed attr pair = [id,{0}]-[value,{1}]", attr.id, attr.value);
        }
        m_uint_rsId = rs.BaseId;
        if (null != this.attrDes)
        {
            this.attrDes.text = emgr.GetAttrDes(attr);
        }

        if (null != this.m_labPortectDes)
        {
            this.m_labPortectDes.text = string.Format("消耗符石档次:{0}档", rs.Grade);
        }
        if (null != m_toggle)
        {
            m_toggle.value = select;
        }
        SetIcon(true, rs.Icon);
        SetBorder(true, rs.BorderIcon);
        int holdNum = (int)DataManager.Manager <ItemManager>().GetItemNumByBaseId(runeStoneBaseId);

        SetRuneStoneMask(true, (uint)rs.Grade);
        if (select && fillNum < needNum)
        {
            SetNotEnoughGet(true);
        }
        if (null != m_labNum)
        {
            if (select)
            {
                this.m_labNum.text = ItemDefine.BuilderStringByHoldAndNeedNum((uint)fillNum, (uint)needNum);
            }
            else
            {
                this.m_labNum.text = holdNum.ToString();
            }
        }

        if (this.changeCallback != callback)
        {
            this.changeCallback = callback;
        }
    }
Beispiel #4
0
    /// <summary>
    /// 设置格子数据
    /// </summary>
    /// <param name="baseId">消耗材料id</param>
    ///  <param name="costNum">消耗数量</param>
    public void SetGridData(uint baseId, uint costNum = 1, bool needUnload = false)
    {
        bool cansee = false;

        this.m_uint_baseId = baseId;
        bool empty = baseId == 0;

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

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

        bool visible = !empty && needUnload;

        if (null != m_ts_unload && m_ts_unload.gameObject.activeSelf != visible)
        {
            m_ts_unload.gameObject.SetActive(visible);
        }

        if (!empty)
        {
            BaseItem baseItem = DataManager.Manager <ItemManager>().GetTempBaseItemByBaseID <BaseItem>(baseId);
            if (null != mlabName)
            {
                mlabName.text = baseItem.Name;
            }

            int holdNum = DataManager.Manager <ItemManager>().GetItemNumByBaseId(baseId);
            if (null != mlabNum)
            {
                mlabNum.text = ItemDefine.BuilderStringByHoldAndNeedNum(
                    (uint)holdNum, costNum);
            }
            ResetInfoGrid();
            SetIcon(true, baseItem.Icon);
            SetBorder(true, baseItem.BorderIcon);
            SetBindMask(baseItem.IsBind);
            cansee = holdNum < costNum;
            SetNotEnoughGet(cansee);
            SetRuneStoneMask(true, (uint)baseItem.Grade);
        }
    }
Beispiel #5
0
 private void UpdateAssistData()
 {
     if (null != m_growCost)
     {
         BaseItem baseItem = DataManager.Manager <ItemManager>().GetTempBaseItemByBaseID <BaseItem>(m_assistID);
         m_growCost.SetGridData(m_assistID);
         if (null != m_label_AssistName)
         {
             m_label_AssistName.text = baseItem.Name;
         }
         if (null != m_label_AssistNum)
         {
             int holdNum = DataManager.Manager <ItemManager>().GetItemNumByBaseId(m_assistID);
             m_label_AssistNum.text = ItemDefine.BuilderStringByHoldAndNeedNum((uint)holdNum, m_assistNeedNum);;
         }
     }
 }
Beispiel #6
0
    public override void SetGridData(object data)
    {
        base.SetGridData(data);
        if (null == data || !(data is uint))
        {
            return;
        }
        this.m_uint_id = (uint)data;
        BaseItem baseItem = DataManager.Manager <ItemManager>().GetTempBaseItemByBaseID <BaseItem>(m_uint_id);
        bool     cansee   = false;
        int      holdNum  = DataManager.Manager <ItemManager>().GetItemNumByBaseId(m_uint_id);

        SetIcon(true, baseItem.Icon);
        SetBorder(true, baseItem.BorderIcon);
        SetBindMask(baseItem.IsBind);
        cansee = holdNum < 1;
        SetNotEnoughGet(cansee);
        SetNum(true, ItemDefine.BuilderStringByHoldAndNeedNum((uint)holdNum, 1));
        SetIcon(true, baseItem.Icon);
        SetBorder(true, baseItem.BorderIcon);
    }
Beispiel #7
0
    /// <summary>
    /// 设置格子数据
    /// </summary>
    /// <param name="baseId"></param>
    /// <param name="num"></param>
    public void SetGridData(uint baseId, uint num)
    {
        this.m_uint_baseId = baseId;
        BaseItem baseItem = DataManager.Manager <ItemManager>().GetTempBaseItemByBaseID <BaseItem>(baseId);

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

        if (null != mlabDes)
        {
            mlabDes.text = string.Format("经验+{0}", DataManager.Manager <EquipManager>().GetMuhonExpOfId(baseId));
        }

        int holdNum = DataManager.Manager <ItemManager>().GetItemNumByBaseId(baseId);

        ResetInfoGrid();
        SetNum(true, ItemDefine.BuilderStringByHoldAndNeedNum((uint)holdNum, 1));
        SetIcon(true, baseItem.Icon);
        SetBorder(true, baseItem.BorderIcon);
        SetBindMask(baseItem.IsBind);
        SetNotEnoughGet((holdNum < num));
    }
Beispiel #8
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 #9
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));
            }
        }
    }