Ejemplo n.º 1
0
    //显示套装属性
    public void ShowEquipSetAttr(GameItem item)
    {
        ClearInfo();
        int setId = item.GetEquipSetId();

        if (setId >= 0)
        {
            Tab_EquipSet line = TableManager.GetEquipSetByID(setId, 0);
            if (line != null)
            {
                for (int index = 0; index < 8; index++)
                {
                    m_Attr[index].text = "[626262]";
                }
                GameItemContainer equipPack = GameManager.gameManager.PlayerDataPool.EquipPack;

                //显示套装名称
                int labelIndex = 0;
                m_Attr[labelIndex].text = "[FF9933]" + line.Name;
                m_AttrWhole[labelIndex].SetActive(true);
                labelIndex++;

                for (int index = 0; index < line.getEquipIdCount(); index++)
                {
                    int equipid = line.GetEquipIdbyIndex(index);
                    if (equipid != -1)
                    {
                        Tab_CommonItem lineCommonitem = TableManager.GetCommonItemByID(equipid, 0);
                        if (lineCommonitem != null)
                        {
                            int relatedId = ItemTool.GetEquipIdByTransferSetId(equipid);
                            if (equipPack.GetItemCountByDataId(equipid) > 0 ||
                                equipPack.GetItemCountByDataId(relatedId) > 0)
                            {
                                m_Attr[labelIndex].text += "[FF9933]";
                            }
                            else
                            {
                                m_Attr[labelIndex].text += "[626262]";
                            }
                            m_Attr[labelIndex].text += lineCommonitem.Name;
                            m_AttrWhole[labelIndex].SetActive(true);
                            labelIndex++;
                        }
                    }
                }

                //m_Attr[labelIndex].text = "[FF9933]套装属性:";
                m_Attr[labelIndex].text = StrDictionary.GetClientDictionaryString("#{2878}");
                m_AttrWhole[labelIndex].SetActive(true);
                labelIndex++;

                int    equipCount = equipPack.GetEquipCountBySetId(setId);
                string color      = "[626262]";
                //显示两件套效果
                if (line.GetEffectTypebyIndex(0) != -1)
                {
                    if (equipCount >= 2)
                    {
                        color += "[FF9933]";
                    }
                    m_Attr[labelIndex].text += color;
                    m_Attr[labelIndex].text += StrDictionary.GetClientDictionaryString("#{1448}");
                    m_AttrWhole[labelIndex].SetActive(true);
                    labelIndex++;
                    string text = string.Format("{0}+{1}", ItemTool.ConvertAttrToString((COMBATATTE)line.GetEffectTypebyIndex(0)), line.GetEffectValuebyIndex(0));
                    m_Attr[labelIndex].text += color;
                    m_Attr[labelIndex].text += "    " + text;
                    m_AttrWhole[labelIndex].SetActive(true);
                    labelIndex++;
                }
                color = "[626262]";
                //显示三件套效果
                if (line.GetEffectTypebyIndex(1) != -1)
                {
                    if (equipCount >= 3)
                    {
                        color += "[FF9933]";
                    }
                    m_Attr[labelIndex].text += color;
                    m_Attr[labelIndex].text += StrDictionary.GetClientDictionaryString("#{1449}");
                    m_AttrWhole[labelIndex].SetActive(true);
                    labelIndex++;
                    string text = string.Format("{0}+{1}", ItemTool.ConvertAttrToString((COMBATATTE)line.GetEffectTypebyIndex(1)), line.GetEffectValuebyIndex(1));
                    m_Attr[labelIndex].text += color;
                    m_Attr[labelIndex].text += "    " + text;
                    m_AttrWhole[labelIndex].SetActive(true);
                    labelIndex++;
                }
                color = "[626262]";
                //显示四件套效果
                if (line.GetEffectTypebyIndex(2) != -1)
                {
                    if (equipCount >= 4)
                    {
                        color += "[FF9933]";
                    }
                    m_Attr[labelIndex].text += color;
                    m_Attr[labelIndex].text += StrDictionary.GetClientDictionaryString("#{1450}");
                    m_AttrWhole[labelIndex].SetActive(true);
                    labelIndex++;
                    string text = string.Format("{0}+{1}", ItemTool.ConvertAttrToString((COMBATATTE)line.GetEffectTypebyIndex(2)), line.GetEffectValuebyIndex(2));
                    m_Attr[labelIndex].text += color;
                    m_Attr[labelIndex].text += "    " + text;
                    m_AttrWhole[labelIndex].SetActive(true);
                    labelIndex++;
                }
                //m_Grid.Reposition();
                // m_TopGrid.Recenter(true);
                m_Table.sorted          = true;
                m_Table.hideInactive    = true;
                m_Table.keepWithinPanel = true;
                m_Table.repositionNow   = true;
            }
        }
    }
Ejemplo n.º 2
0
    /// <summary>
    /// 显示装备Tooltips
    /// </summary>
    /// <param name="equip">装备</param>
    private void ShowTooltips(GameItem equip, ShowType type)
    {
        if (equip == null)
        {
            CloseWindow();
            return;
        }
        if (equip.IsValid() == false)
        {
            CloseWindow();
            return;
        }

        m_Equip = equip;
        m_Type  = type;

        HideAllButtons();
        // 装备图标
        ShowEquipIcon(equip);
        // 玩家是否可用
        ShowEquipDisableSprite(equip);
        // 装备颜色品质
        ShowEquipQualityGrid(equip);
        // 装备名
        ShowEquipName(equip);
        // 职业
        ShowEquipPro(equip);
        // 人物等级需求
        ShowEquipLevel(equip);
        // 绑定信息
        ShowEquipBind(equip);
        // 是否可出售
        SetEquipSellInfo(equip);
        // 星级
        ShowEquipStarLevel(equip);
        // 强化等级
        ShowEquipStrengthenLevel(equip);
        // 战斗力
        ShowEquipPower(equip);
        // 属性
        ShowEquipAttrInfo(equip);
        // 宝石,不显示宝石
        //ShowEquipGemInfo(equip);
        // 描述
        ShowEquipDesc(equip);
        // 售价
        ShowEquipPrice(equip);
        // 强化经验
        ShowEquipStrenExp(equip);
        // 战斗力箭头
        ShowPowerArrow(equip);
        // 显示剩余时间
        ShowRemainTime(equip);

        if (type == ShowType.Equiped)  //点击装备槽位弹出的tips
        {
            //脱下按钮 显示
            m_EquipTakeOffButton.gameObject.SetActive(true);

            //分享链接按钮 显示
            m_EquipShareLinkButton.gameObject.SetActive(true);

            //装备强化按钮 显示
            if (equip.IsBelt() == false)
            {
                m_EquipEnchanceButton.gameObject.SetActive(true);
            }

            //套装按钮 显示
            if (equip.GetEquipSetId() >= 0)
            {
                m_EquipSuitButton.gameObject.SetActive(true);
            }

            //隐藏战斗力箭头
            m_EquipPowerArrowUpSprite.gameObject.SetActive(false);
            m_EquipPowerArrowDownSprite.gameObject.SetActive(false);
        }
        else if (type == ShowType.UnEquiped)  //点击物品背包弹出的tips
        {
            //售出按钮 显示
            m_EquipSellButton.gameObject.SetActive(true);
            //装备按钮 显示
            m_EquipUseButton.gameObject.SetActive(true);
            //分享链接按钮 显示
            m_EquipShareLinkButton.gameObject.SetActive(true);
            //装备强化按钮 显示
            //m_EquipEnchanceButton.gameObject.SetActive(true);
            //套装按钮 显示
            if (equip.GetEquipSetId() >= 0)
            {
                m_EquipSuitButton.gameObject.SetActive(true);
            }
            //吸收按钮
            m_AbsorbButton.SetActive(!equip.IsBelt());

            m_OpButtonGrid.Reposition();

            //如果本装备位已经装备物品 弹出对比tips
            int      slotindex    = equip.GetEquipSlotIndex();
            GameItem CompareEquip = GameManager.gameManager.PlayerDataPool.EquipPack.GetItem(slotindex);
            if (CompareEquip != null && CompareEquip.IsValid())
            {
                OpenCompare(slotindex);
            }
        }
        else if (type == ShowType.QianKunDaiStuff)
        {
            m_PutInQianKunDaiButton.SetActive(true);

            //售出按钮 显示
            m_EquipSellButton.gameObject.SetActive(true);
            //装备按钮 显示
            m_EquipUseButton.gameObject.SetActive(true);
            //分享链接按钮 显示
            m_EquipShareLinkButton.gameObject.SetActive(true);
            //装备强化按钮 显示
            //m_EquipEnchanceButton.gameObject.SetActive(true);
            //套装按钮 显示
            if (equip.GetEquipSetId() >= 0)
            {
                m_EquipSuitButton.gameObject.SetActive(true);
            }

            m_OpButtonGrid.Reposition();
        }
        else if (type == ShowType.ShopBuy)
        {
            m_PutInQianKunDaiButton.SetActive(false);
            // 购买隐藏
            m_EquipBuyButton.gameObject.SetActive(true);

            //隐藏战斗力箭头
            m_EquipPowerArrowUpSprite.gameObject.SetActive(false);
            m_EquipPowerArrowDownSprite.gameObject.SetActive(false);
        }
        else if (type == ShowType.ShopBuyBatch)
        {
            // 批量购买隐藏
            m_EquipBuyBatchButton.gameObject.SetActive(true);
            // 购买隐藏
            m_EquipBuyButton.gameObject.SetActive(true);

            //隐藏战斗力箭头
            m_EquipPowerArrowUpSprite.gameObject.SetActive(false);
            m_EquipPowerArrowDownSprite.gameObject.SetActive(false);
        }
        else if (type == ShowType.Info)  //仅显示信息 没有操作按钮的tips
        {
            //隐藏战斗力箭头
            m_EquipPowerArrowUpSprite.gameObject.SetActive(false);
            m_EquipPowerArrowDownSprite.gameObject.SetActive(false);
            m_EquipUseButton.gameObject.SetActive(false);
        }
        else if (type == ShowType.InfoCompare)  //仅显示信息 没有操作按钮的tips 同时做对比
        {
            //隐藏战斗力箭头
            m_EquipPowerArrowUpSprite.gameObject.SetActive(false);
            m_EquipPowerArrowDownSprite.gameObject.SetActive(false);
            //如果本装备位已经装备物品 弹出对比tips
            int      slotindex    = equip.GetEquipSlotIndex();
            GameItem CompareEquip = GameManager.gameManager.PlayerDataPool.EquipPack.GetItem(slotindex);
            if (CompareEquip != null && CompareEquip.IsValid())
            {
                OpenCompare(slotindex);
            }
        }
        else if (type == ShowType.ChatLink)  //仅显示信息 没有操作按钮的tips
        {
            //隐藏战斗力箭头
            m_EquipPowerArrowUpSprite.gameObject.SetActive(false);
            m_EquipPowerArrowDownSprite.gameObject.SetActive(false);
            //根据是否可以上架 决定是否显示求购按钮
            if (ConsignSaleBag.isCanConsignSale(m_Equip, true))
            {
                m_ConsignSaleBuyButton.gameObject.SetActive(true);
            }
        }
        else if (type == ShowType.CangKu)  //仓库界面 仓库物品tips
        {
            //隐藏战斗力箭头
            m_EquipPowerArrowUpSprite.gameObject.SetActive(false);
            m_EquipPowerArrowDownSprite.gameObject.SetActive(false);

            //显示取回按钮
            m_CangKuOutButton.gameObject.SetActive(true);
        }
        else if (type == ShowType.CangKuBackPack)  //仓库界面 背包物品tips
        {
            //隐藏战斗力箭头
            m_EquipPowerArrowUpSprite.gameObject.SetActive(false);
            m_EquipPowerArrowDownSprite.gameObject.SetActive(false);

            //显示放入仓库按钮
            m_CangKuInButton.gameObject.SetActive(true);
        }

        m_EquipOpButtonGrid.repositionNow = true;

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