Exemple #1
0
    private void UpdateServerProperty()
    {
        uint bindMask = BindMask;

        m_bCanAuction         = ItemDefine.isBindMaskEnable(GameCmd.enumItemBindType.BindItemType_Shop, bindMask);
        m_bCanSell2NPC        = ItemDefine.isBindMaskEnable(GameCmd.enumItemBindType.BindItemType_Sell, bindMask);
        m_bCanStore2WareHouse = ItemDefine.isBindMaskEnable(GameCmd.enumItemBindType.BindItemType_Store, bindMask);
        m_bIsBind             = bindMask != 0 && ItemDefine.IsBind(bindMask);

        m_QulityType = ItemDefine.ItemQualityType.White;
        int quality = 0;

        if (IsEquip)
        {
            quality = AdditionAttrCount;
        }
        else
        {
            quality = (int)BaseData.quality;
        }
        if (quality > (int)ItemDefine.ItemQualityType.White &&
            quality < (int)ItemDefine.ItemQualityType.Max)
        {
            m_QulityType = (ItemDefine.ItemQualityType)quality;
        }

        m_strBorderIcon = ItemDefine.GetItemBorderIcon(QualityType);

        m_strName = GetNameNGUIColor() + LocalName;
        if (IsForgingEquip)
        {
            uint refineLevel = GetItemAttribute(GameCmd.eItemAttribute.Item_Attribute_RefineLevel);
            if (refineLevel > 0)
            {
                m_strName = m_strName + "+" + refineLevel;
            }
        }

        m_strNameForTips = GetNameNGUIColor(true) + LocalName;
        if (IsForgingEquip)
        {
            uint refineLevel = GetItemAttribute(GameCmd.eItemAttribute.Item_Attribute_RefineLevel);
            if (refineLevel > 0)
            {
                m_strNameForTips = m_strNameForTips + "+" + refineLevel;
            }
        }

        m_TipsTipIcon = ItemDefine.GetItemTipsTopIcon(QualityType);
        UpdateLocation();
    }
Exemple #2
0
    private void ShowResult()
    {
        GameCmd.stEquipComposeItemWorkUserCmd_CS compoundData = emgr.CompoundData;
        if (null == compoundData.index_info || compoundData.index_info.Count != cardArray.Length)
        {
            return;
        }

        table.EquipComposeDataBase equipComposeDB = DataManager.Manager <ItemManager>().GetLocalDataBase <table.EquipComposeDataBase>(compoundData.new_item);
        if (null == equipComposeDB)
        {
            return;
        }
        m_assistID      = equipComposeDB.assistId;
        m_assistNeedNum = equipComposeDB.assistNum;

        List <EquipManager.CompoudSelectAttrData> cardDatas = new List <EquipManager.CompoudSelectAttrData>();
        int replaceCoinNum = (int)DataManager.Manager <MallManager>().GetDQPriceByItem(m_assistID);

        List <GameCmd.PairNumber> attrs = null;
        bool isBind = false;

        GameCmd.PropIndexInfo tempIndexInfo = null;
        EquipManager.CompoudSelectAttrData tempSelectAttrData = null;;
        GameCmd.PairNumber             tempPair     = null;
        GameCmd.PropIndexInfo.PropPair tempPropPair = null;

        for (int i = 0, max = compoundData.index_info.Count; i < max; i++)
        {
            isBind                    = false;
            tempIndexInfo             = compoundData.index_info[i];
            tempSelectAttrData        = new EquipManager.CompoudSelectAttrData();
            tempSelectAttrData.Index  = tempIndexInfo.index;
            tempSelectAttrData.BaseID = compoundData.new_item;
            attrs = null;
            if (null != tempIndexInfo.value)
            {
                attrs = new List <GameCmd.PairNumber>();
                for (int j = 0, maxJ = tempIndexInfo.value.Count; j < maxJ; j++)
                {
                    tempPropPair = tempIndexInfo.value[j];
                    if (tempPropPair.key == (uint)GameCmd.eItemAttribute.Item_Attribute_FightPower)
                    {
                        continue;
                    }
                    if (tempPropPair.key == (uint)GameCmd.eItemAttribute.Item_Attribute_Bind)
                    {
                        if (ItemDefine.IsBind(tempPropPair.value))
                        {
                            isBind = true;
                        }
                        continue;
                    }
                    tempPair = new GameCmd.PairNumber()
                    {
                        id    = tempPropPair.key,
                        value = tempPropPair.value,
                    };
                    attrs.Add(tempPair);
                }
            }
            tempSelectAttrData.CostItemID           = equipComposeDB.assistId;
            tempSelectAttrData.CostItemNum          = (int)equipComposeDB.assistNum;
            tempSelectAttrData.ReplaceCostMoneyType = GameCmd.MoneyType.MoneyType_Coin;
            tempSelectAttrData.ReplaceCostMoneyNum  = replaceCoinNum;
            tempSelectAttrData.Attrs  = attrs;
            tempSelectAttrData.IsBind = isBind;
            cardDatas.Add(tempSelectAttrData);
        }
        bool isOpen  = false;
        bool freeGet = (emgr.CompoundSelectIndex == 0);
        bool select  = false;
        UICompoundSelectAttrGrid tempGrid = null;

        for (int i = 0, max = cardArray.Length; i < max; i++)
        {
            select   = false;
            isOpen   = false;
            tempGrid = cardArray[i];
            if (null == tempGrid)
            {
                continue;
            }
            tempSelectAttrData = cardDatas[i];
            if (!freeGet)
            {
                isOpen = emgr.IsEquipCompoundResultOpen(tempSelectAttrData.Index);
                if (isOpen)
                {
                    select = (emgr.CompoundSelectIndex == tempSelectAttrData.Index);
                }
            }

            tempGrid.SetData(isOpen, data: tempSelectAttrData, select: select, freeGet: freeGet);
        }
        UpdateAssistData();
    }