示例#1
0
    void SetItemDesc(GameItem item)
    {
        if (item != null && item.IsValid())
        {
            m_ItemDescLabel.text = string.Empty;
            if (null != TableManager.GetCommonItemByID(item.DataID, 0))
            {
                string strItemDesc = TableManager.GetCommonItemByID(item.DataID, 0).Tips;
                m_ItemDescLabel.text += strItemDesc;
            }

            if (item.DataID == GlobeVar.MARRY_RING_ITEMID)
            {
                m_ItemDescLabel.text += Utils.GetMarryRingString(item);
            }

            if (FriendChooseLogic.IsLoverFestivalItem(item.DataID))
            {
                if (item.DataID != FriendChooseLogic.RoseDataId1)
                {
                    m_ItemDescLabel.text += Utils.GetLoverString(item);
                }
            }

            m_ItemDescLabel.text = m_ItemDescLabel.text.Replace("#r", "\n");
        }
    }
示例#2
0
    private void ShowTooltips(GameItem item, ShowType type)
    {
        if (item == null)
        {
            CloseWindow();
            return;
        }
        if (item.IsValid() == false)
        {
            CloseWindow();
            return;
        }

        gameObject.SetActive(true);
        // 物品图标
        SetItemIcon(item);
        // 玩家是否可用
        SetItemDisableSprite(item);
        // 颜色品级
        SetItemQualityGrid(item);
        // 物品名 根据物品等级变颜色
        SetItemName(item);
        // 类别
        SetItemType(item);
        // 使用等级
        SetItemUseLevel(item);
        // 绑定信息
        SetItemBind(item);
        // 是否可出售
        SetItemSellInfo(item);
        // 售价
        SetItemPrice(item);
        // 叠加数量
        SetItemMaxNum(item);
        // 描述
        SetItemDesc(item);
        // 动态数据域
        SetItemDynamicDesc(item, type);
        // 显示剩余时间
        ShowRemainTime(item);

        int canuse      = TableManager.GetCommonItemByID(item.DataID, 0).CanUse;
        int cansell     = TableManager.GetCommonItemByID(item.DataID, 0).CanSell;
        int canthrow    = TableManager.GetCommonItemByID(item.DataID, 0).CanThrow;
        int canbatchuse = TableManager.GetCommonItemByID(item.DataID, 0).IsCanBatchUse;
        int cancompose  = TableManager.GetCommonItemByID(item.DataID, 0).IsCanQianKunDai;

        m_BuyButton.gameObject.SetActive(false);
        m_BuyBatchButton.gameObject.SetActive(false);

        m_SellButton.gameObject.SetActive(false);
        //丢弃按钮
        m_ThrowButton.gameObject.SetActive(false);
        //使用按钮
        m_UseButton.gameObject.SetActive(false);
        //批量使用按钮
        m_UseBatchButton.gameObject.SetActive(false);
        //链接按钮
        m_ShareLinkButton.gameObject.SetActive(false);
        //乾坤袋放入
        m_PutInQianKunDaiButton.SetActive(false);
        //寄售行求购信息
        m_ConsignSaleBuyButton.gameObject.SetActive(false);
        //仓库取回按钮
        m_CangKuOutButton.gameObject.SetActive(false);
        //仓库放入按钮
        m_CangKuInButton.gameObject.SetActive(false);
        //吸收按钮
        m_AbsorbButton.SetActive(false);
        //情人节道具使用按钮
        m_LoverFlowerUseButton.gameObject.SetActive(false);
        //合成按钮
        m_ComposeButton.SetActive(false);
        if (type == ShowType.Info)    //仅显示信息 没有操作按钮的tips
        {
            //出售按钮
        }
        else if (type == ShowType.ShopBuy)
        {
            m_BuyButton.gameObject.SetActive(true);
        }
        else if (type == ShowType.ShopBuyBatch)
        {
            m_BuyButton.gameObject.SetActive(true);
            m_BuyBatchButton.gameObject.SetActive(true);
        }
        else if (type == ShowType.ChatLink)
        {
            //根据是否可以上架 决定是否显示求购按钮
            if (ConsignSaleBag.isCanConsignSale(item, true))
            {
                m_ConsignSaleBuyButton.gameObject.SetActive(true);
            }
        }
        else if (type == ShowType.CangKu)  //仓库界面 仓库物品tips
        {
            //显示取回按钮
            m_CangKuOutButton.gameObject.SetActive(true);
        }
        else if (type == ShowType.CangKuBackPack)  //仓库界面 背包物品tips
        {
            //显示放入仓库按钮
            m_CangKuInButton.gameObject.SetActive(true);
        }
        else
        {
            if (type == ShowType.QianKunDaiStuff)
            {
                m_PutInQianKunDaiButton.SetActive(true);
            }
            else
            {
                m_PutInQianKunDaiButton.SetActive(false);
            }
            if (FriendChooseLogic.IsLoverFestivalItem(item.DataID)) //情人节道具使用按钮
            {
                if (item.DynamicData[7] == 0)                       //道具未使用
                {
                    m_LoverFlowerUseButton.gameObject.SetActive(true);
                }
            }
            else
            {
                m_LoverFlowerUseButton.gameObject.SetActive(false);
            }
            //出售按钮
            m_SellButton.gameObject.SetActive((cansell == 1) ? true : false);
            //使用按钮
            m_UseButton.gameObject.SetActive((canuse == 1) ? true : false);
            //批量使用按钮
            m_UseBatchButton.gameObject.SetActive((canuse == 1 && canbatchuse == 1 && item.StackCount > 1) ? true : false);
            //丢弃按钮
            m_ThrowButton.gameObject.SetActive((canthrow == 1) ? true : false);
            //链接按钮
            m_ShareLinkButton.gameObject.SetActive(true);
            //吸收按钮
            m_AbsorbButton.SetActive(item.IsEnchanceExpItem());
            //合成按钮
            m_ComposeButton.SetActive(cancompose == 1);

            m_OpButtonGrid.Reposition();
        }

        m_Item = item;

        //gameObject.SetActive(true);
        //UIManager.ShowUI(UIInfo.ItemTooltipsRoot);
    }