示例#1
0
    public void SetEquipIconFX(long equipID)
    {
        EquipSimpleInfo equipSimpleInfoByEquipID = EquipGlobal.GetEquipSimpleInfoByEquipID(equipID);

        if (equipSimpleInfoByEquipID == null)
        {
            return;
        }
        Transform transform = base.FindTransform("ItemIcon");

        if (transform == null)
        {
            return;
        }
        TaoZhuangDuanZhu equipForgeCfgData = EquipGlobal.GetEquipForgeCfgData(equipID);

        if (equipForgeCfgData != null && equipSimpleInfoByEquipID.suitId > 0)
        {
            this.equipFxID = FXSpineManager.Instance.PlaySpine(equipForgeCfgData.fxId, transform, "EquipPosItem", this.DepthValue, null, "UI", 0f, 0f, 1f, 1f, false, FXMaskLayer.MaskState.None);
        }
        else
        {
            int excellentAttrsCountByColor = EquipGlobal.GetExcellentAttrsCountByColor(equipID, 1f);
            this.equipFxID = EquipGlobal.GetEquipIconFX(this.ItemID, excellentAttrsCountByColor, transform, "EquipItemTipUI", this.DepthValue, false);
        }
    }
示例#2
0
    private void SetEquipPartBtn(EquipLibType.ELT type)
    {
        if (!this.equipPartTransDic.ContainsKey(type))
        {
            return;
        }
        if (EquipmentManager.Instance.equipmentData == null || EquipmentManager.Instance.equipmentData.equipLibs == null)
        {
            return;
        }
        EquipLib equipLib = EquipmentManager.Instance.equipmentData.equipLibs.Find((EquipLib a) => a.type == type);

        if (equipLib == null)
        {
            return;
        }
        EquipSimpleInfo wearingEquipSimpleInfoByPos = EquipGlobal.GetWearingEquipSimpleInfoByPos(type);

        if (wearingEquipSimpleInfoByPos == null)
        {
            return;
        }
        Dictionary <string, string> iconNamesByEquipPos = EquipGlobal.GetIconNamesByEquipPos(type, true);

        if (iconNamesByEquipPos == null)
        {
            return;
        }
        int       excellentAttrsCountByColor = EquipGlobal.GetExcellentAttrsCountByColor(wearingEquipSimpleInfoByPos.equipId, 1f);
        Transform transform = this.equipPartTransDic.get_Item(type).FindChild("ImageIcon");

        this.equipPartTransDic.get_Item(type).FindChild("Num").GetComponent <Text>().set_text((equipLib.lv <= 0) ? string.Empty : ("+" + equipLib.lv));
        this.equipPartTransDic.get_Item(type).FindChild("EquipStepText").GetComponent <Text>().set_text(iconNamesByEquipPos.get_Item("EquipStep"));
        ResourceManager.SetSprite(this.equipPartTransDic.get_Item(type).FindChild("ImageIcon").GetComponent <Image>(), ResourceManager.GetIconSprite(iconNamesByEquipPos.get_Item("IconName")));
        if (this.equipPartFxDic.ContainsKey(type))
        {
            FXSpineManager.Instance.DeleteSpine(this.equipPartFxDic.get_Item(type), true);
        }
        TaoZhuangDuanZhu equipForgeCfgData = EquipGlobal.GetEquipForgeCfgData(wearingEquipSimpleInfoByPos.equipId);
        int num;

        if (equipForgeCfgData != null && wearingEquipSimpleInfoByPos.suitId > 0)
        {
            ResourceManager.SetSprite(this.equipPartTransDic.get_Item(type).FindChild("ImageFrame").GetComponent <Image>(), ResourceManager.GetIconSprite(equipForgeCfgData.frame));
            num = FXSpineManager.Instance.PlaySpine(equipForgeCfgData.fxId, transform, "EquipDetailedUI", 2000, null, "UI", 0f, 0f, 1f, 1f, false, FXMaskLayer.MaskState.None);
        }
        else
        {
            ResourceManager.SetSprite(this.equipPartTransDic.get_Item(type).FindChild("ImageFrame").GetComponent <Image>(), ResourceManager.GetIconSprite(iconNamesByEquipPos.get_Item("IconFrameName")));
            num = EquipGlobal.GetEquipIconFX(wearingEquipSimpleInfoByPos.cfgId, excellentAttrsCountByColor, transform, "EquipPartBtns", 2000, false);
        }
        if (this.equipPartFxDic.ContainsKey(type))
        {
            this.equipPartFxDic.set_Item(type, num);
        }
        this.equipPartTransDic.get_Item(type).FindChild("ExcellentAttrIconList").FindChild("Image1").GetComponent <Image>().set_enabled(excellentAttrsCountByColor >= 1);
        this.equipPartTransDic.get_Item(type).FindChild("ExcellentAttrIconList").FindChild("Image2").GetComponent <Image>().set_enabled(excellentAttrsCountByColor >= 2);
        this.equipPartTransDic.get_Item(type).FindChild("ExcellentAttrIconList").FindChild("Image3").GetComponent <Image>().set_enabled(excellentAttrsCountByColor >= 3);
        this.equipPartTransDic.get_Item(type).FindChild("ImageBinding").get_gameObject().SetActive(false);
    }
示例#3
0
    public static BackpackObservableItem GetBackpackObservableItem(Goods good, Action <BackpackObservableItem> action2ClickItem, int mode = 1)
    {
        BackpackObservableItem backpackObservableItem = new BackpackObservableItem();

        if (good != null)
        {
            backpackObservableItem.ItemRootNullOn = false;
            backpackObservableItem.ItemRootOn     = true;
            backpackObservableItem.SetSelectedMode(mode);
            backpackObservableItem.OnClickItemAction = action2ClickItem;
            backpackObservableItem.ItemFlag          = false;
            backpackObservableItem.SetIsSelected(false);
            backpackObservableItem.id          = good.GetLongId();
            backpackObservableItem.ItemId      = good.LocalItem.id;
            backpackObservableItem.ItemIcon    = GameDataUtils.GetIcon(good.LocalItem.icon);
            backpackObservableItem.ItemNum     = BackpackManager.Instance.OnGetGoodCount(good.GetLongId()).ToString();
            backpackObservableItem.ItemStepOn  = (good.GetItem().step > 0);
            backpackObservableItem.ItemStepNum = string.Format(GameDataUtils.GetChineseContent(505023, false), good.GetItem().step);
            bool redPointOn = false;
            if ((good.LocalItem.function == 1 || good.LocalItem.function == 2 || good.LocalItem.function == 3) && good.LocalItem.secondType == 11 && EntityWorld.Instance.EntSelf != null && good.LocalItem.minLv <= EntityWorld.Instance.EntSelf.Lv)
            {
                redPointOn = true;
            }
            backpackObservableItem.RedPointOn     = redPointOn;
            backpackObservableItem.EquipIsBinding = false;
            EquipSimpleInfo equipSimpleInfoByEquipID = EquipGlobal.GetEquipSimpleInfoByEquipID(good.GetLongId());
            if (equipSimpleInfoByEquipID != null && equipSimpleInfoByEquipID.suitId > 0)
            {
                TaoZhuangDuanZhu equipForgeCfgData = EquipGlobal.GetEquipForgeCfgData(equipSimpleInfoByEquipID.equipId);
                if (equipForgeCfgData != null)
                {
                    backpackObservableItem.ItemFrame = ResourceManager.GetIconSprite(equipForgeCfgData.frame);
                }
            }
            if (equipSimpleInfoByEquipID != null)
            {
                backpackObservableItem.EquipIsBinding = equipSimpleInfoByEquipID.binding;
            }
            int excellentCount;
            if (good.GetItem().tab == 2)
            {
                excellentCount = EquipGlobal.GetExcellentAttrsCountByColor(good.GetLongId(), 1f);
            }
            else
            {
                excellentCount = good.GetItem().gogok;
            }
            backpackObservableItem.ExcellentCount = excellentCount;
        }
        else
        {
            backpackObservableItem.ItemRootNullOn = true;
            backpackObservableItem.ItemRootOn     = false;
            backpackObservableItem.SetSelectedMode(mode);
            backpackObservableItem.OnClickItemAction = action2ClickItem;
        }
        return(backpackObservableItem);
    }
示例#4
0
    private void UpdateEquipItemData()
    {
        EquipLib equipLib = EquipmentManager.Instance.equipmentData.equipLibs.Find((EquipLib a) => a.type == this.EquipPos);

        if (equipLib == null)
        {
            return;
        }
        EquipSimpleInfo equipSimpleInfo = equipLib.equips.Find((EquipSimpleInfo a) => a.equipId == equipLib.wearingId);

        if (equipSimpleInfo == null)
        {
            return;
        }
        Dictionary <string, string> iconNamesByEquipPos = EquipGlobal.GetIconNamesByEquipPos(this.EquipPos, false);

        this.equipIconRegionTrans.FindChild("TextName").GetComponent <Text>().set_text(EquipGlobal.GetEquipSuitMarkName(equipSimpleInfo.suitId) + iconNamesByEquipPos.get_Item("ItemName"));
        ResourceManager.SetSprite(this.equipIconImg, ResourceManager.GetIconSprite(iconNamesByEquipPos.get_Item("IconName")));
        int lv = equipLib.lv;

        this.equipIconRegionTrans.FindChild("TextLv").GetComponent <Text>().set_text(string.Empty);
        if (lv > 0)
        {
            this.equipIconRegionTrans.FindChild("TextLv").GetComponent <Text>().set_text("+" + lv);
        }
        this.equipIconRegionTrans.FindChild("ItemStepText").GetComponent <Text>().set_text(iconNamesByEquipPos.get_Item("EquipStep"));
        int excellentAttrsCountByColor = EquipGlobal.GetExcellentAttrsCountByColor(equipSimpleInfo.equipId, 1f);

        this.equipIconRegionTrans.FindChild("ExcellentAttrIconList").FindChild("Image1").GetComponent <Image>().set_enabled(excellentAttrsCountByColor >= 1);
        this.equipIconRegionTrans.FindChild("ExcellentAttrIconList").FindChild("Image2").GetComponent <Image>().set_enabled(excellentAttrsCountByColor >= 2);
        this.equipIconRegionTrans.FindChild("ExcellentAttrIconList").FindChild("Image3").GetComponent <Image>().set_enabled(excellentAttrsCountByColor >= 3);
        TaoZhuangDuanZhu equipForgeCfgData = EquipGlobal.GetEquipForgeCfgData(equipSimpleInfo.equipId);

        if (equipForgeCfgData != null && equipSimpleInfo.suitId > 0)
        {
            ResourceManager.SetSprite(this.equipFrameImg, ResourceManager.GetIconSprite(equipForgeCfgData.frame));
            FXSpineManager.Instance.DeleteSpine(this.equip_fxID, true);
            if (this.equipIconImg != null)
            {
                this.equip_fxID = FXSpineManager.Instance.PlaySpine(equipForgeCfgData.fxId, this.equipIconImg.get_transform(), "EquipPosItem", 2001, null, "UI", 0f, 0f, 1f, 1f, true, FXMaskLayer.MaskState.None);
            }
        }
        else
        {
            ResourceManager.SetSprite(this.equipFrameImg, ResourceManager.GetIconSprite(iconNamesByEquipPos.get_Item("IconFrameName")));
            this.equip_fxID = EquipGlobal.GetEquipIconFX(equipSimpleInfo.cfgId, excellentAttrsCountByColor, this.equipIconImg.get_transform(), "EquipPosItem", 2001, true);
        }
        if (this.equipBindingImg != null)
        {
            this.equipBindingImg.get_gameObject().SetActive(equipSimpleInfo.binding);
        }
    }
示例#5
0
    public void SetRewardItem(int itemId, long num = -1L, long uid = 0L)
    {
        this.m_itemId = itemId;
        this.m_uId    = uid;
        Image component = base.get_transform().FindChild("RewardItemIcon").GetComponent <Image>();

        ResourceManager.SetSprite(component, GameDataUtils.GetItemIcon(this.m_itemId));
        ResourceManager.SetSprite(base.get_transform().FindChild("RewardItemFrame").GetComponent <Image>(), GameDataUtils.GetItemFrame(this.m_itemId));
        if (num <= 0L)
        {
            base.get_transform().FindChild("RewardItemText").GetComponent <Text>().set_text(string.Empty);
        }
        else
        {
            base.get_transform().FindChild("RewardItemText").GetComponent <Text>().set_text(Utils.GetItemNum(itemId, num));
        }
        Items items = DataReader <Items> .Get(itemId);

        if (items == null || items.step <= 0)
        {
            base.get_transform().FindChild("ItemStep").get_gameObject().SetActive(false);
        }
        else
        {
            base.get_transform().FindChild("ItemStep").get_gameObject().SetActive(true);
            base.get_transform().FindChild("ItemStep").FindChild("ItemStepText").GetComponent <Text>().set_text(string.Format(GameDataUtils.GetChineseContent(505023, false), items.step));
        }
        if (items == null || items.gogok <= 0)
        {
            base.get_transform().FindChild("ItemExcellentAttrIconList").get_gameObject().SetActive(false);
        }
        else
        {
            base.get_transform().FindChild("ItemExcellentAttrIconList").get_gameObject().SetActive(true);
            base.get_transform().FindChild("ItemExcellentAttrIconList").FindChild("Image1").GetComponent <Image>().set_enabled(items.gogok >= 1);
            base.get_transform().FindChild("ItemExcellentAttrIconList").FindChild("Image2").GetComponent <Image>().set_enabled(items.gogok >= 2);
            base.get_transform().FindChild("ItemExcellentAttrIconList").FindChild("Image3").GetComponent <Image>().set_enabled(items.gogok >= 3);
        }
        if (items != null && items.tab == 2)
        {
            int excellentAttrsCountByColor = EquipGlobal.GetExcellentAttrsCountByColor(uid, 1f);
            if (excellentAttrsCountByColor > 0)
            {
                base.get_transform().FindChild("ItemExcellentAttrIconList").get_gameObject().SetActive(true);
                base.get_transform().FindChild("ItemExcellentAttrIconList").FindChild("Image1").GetComponent <Image>().set_enabled(excellentAttrsCountByColor >= 1);
                base.get_transform().FindChild("ItemExcellentAttrIconList").FindChild("Image2").GetComponent <Image>().set_enabled(excellentAttrsCountByColor >= 2);
                base.get_transform().FindChild("ItemExcellentAttrIconList").FindChild("Image3").GetComponent <Image>().set_enabled(excellentAttrsCountByColor >= 3);
            }
        }
    }
示例#6
0
    private void OnEquipWeapon(int equipCfgID)
    {
        if (this.roleModel == null)
        {
            return;
        }
        int             gogokNum = 0;
        EquipSimpleInfo wearingEquipSimpleInfoByPos = EquipGlobal.GetWearingEquipSimpleInfoByPos(EquipLibType.ELT.Weapon);

        if (wearingEquipSimpleInfoByPos != null)
        {
            long equipId = wearingEquipSimpleInfoByPos.equipId;
            gogokNum = EquipGlobal.GetExcellentAttrsCountByColor(equipId, 1f);
        }
        this.roleModel.EquipOn(equipCfgID, gogokNum);
    }
示例#7
0
    public void SetEquipItemData(int itemID, long equipID, SelectImgType selectType = SelectImgType.HighLight)
    {
        FXSpineManager.Instance.DeleteSpine(this.m_equipFXID, true);
        if (!this.isInit)
        {
            this.InitUI();
        }
        this.EquipID = equipID;
        this.ItemID  = itemID;
        Dictionary <string, string> equipIconNamesByEquipDataID = EquipGlobal.GetEquipIconNamesByEquipDataID(itemID, true);

        if (equipIconNamesByEquipDataID == null)
        {
            return;
        }
        if (this.m_spImageFrame == null)
        {
            return;
        }
        if (this.m_spImageFramePet == null)
        {
            return;
        }
        ResourceManager.SetSprite(this.m_spImageFrame, ResourceManager.GetIconSprite(equipIconNamesByEquipDataID.get_Item("IconFrameName")));
        ResourceManager.SetSprite(this.m_spImageFramePet, ResourceManagerBase.GetNullSprite());
        ResourceManager.SetSprite(this.m_spImageIcon, ResourceManager.GetIconSprite(equipIconNamesByEquipDataID.get_Item("IconName")));
        this.m_numTxt.set_text(string.Empty);
        this.currentSelectType = selectType;
        base.FindTransform("ItemStep").get_gameObject().SetActive(true);
        this.m_itemStepTxt.set_text(equipIconNamesByEquipDataID.get_Item("EquipStep"));
        this.ExcellentCount = EquipGlobal.GetExcellentAttrsCountByColor(equipID, 1f);
        EquipSimpleInfo  equipSimpleInfoByEquipID = EquipGlobal.GetEquipSimpleInfoByEquipID(equipID);
        TaoZhuangDuanZhu equipForgeCfgData        = EquipGlobal.GetEquipForgeCfgData(equipID);

        if (equipSimpleInfoByEquipID != null && equipForgeCfgData != null && equipSimpleInfoByEquipID.suitId > 0)
        {
            ResourceManager.SetSprite(this.m_spImageFrame, ResourceManager.GetIconSprite(equipForgeCfgData.frame));
        }
        this.SetImageBinding(equipSimpleInfoByEquipID != null && equipSimpleInfoByEquipID.binding);
    }
示例#8
0
    private void RefreshUI()
    {
        List <Goods> list = new List <Goods>();

        if (BackpackManager.Instance.EquimentGoods == null)
        {
            return;
        }
        for (int i = 0; i < BackpackManager.Instance.EquimentGoods.get_Count(); i++)
        {
            Goods           goods  = BackpackManager.Instance.EquimentGoods.get_Item(i);
            long            longId = goods.GetLongId();
            int             excellentAttrsCountByColor = EquipGlobal.GetExcellentAttrsCountByColor(longId, 1f);
            int             color = goods.LocalItem.color;
            EquipSimpleInfo equipSimpleInfoByEquipID = EquipGlobal.GetEquipSimpleInfoByEquipID(longId);
            if (equipSimpleInfoByEquipID != null && !equipSimpleInfoByEquipID.binding && excellentAttrsCountByColor >= 2 && color >= 5)
            {
                list.Add(goods);
            }
        }
        this.UpdateStorageBagList(list);
    }