private void SetType(RankDataUnite data)
    {
        string text = string.Empty;
        long   num  = 0L;

        switch (data.rankingType)
        {
        case RankingType.ENUM.Lv:
            this.SetHideHeadAndPetHead(false);
            text = "主角等级";
            num  = data.num;
            ResourceManager.SetSprite(this.m_headIcon, UIUtils.GetRoleSmallIcon((int)data.career));
            if (this.m_headBgImg != null)
            {
                ResourceManager.SetSprite(this.m_headBgImg, GameDataUtils.GetItemFrameByColor(1));
            }
            if (this.m_headBgImg2 != null)
            {
                this.m_headBgImg2.set_enabled(false);
            }
            break;

        case RankingType.ENUM.Fighting:
            this.SetHideHeadAndPetHead(false);
            text = "综合战斗力";
            num  = data.num;
            ResourceManager.SetSprite(this.m_headIcon, UIUtils.GetRoleSmallIcon((int)data.career));
            if (this.m_headBgImg != null)
            {
                ResourceManager.SetSprite(this.m_headBgImg, GameDataUtils.GetItemFrameByColor(1));
            }
            if (this.m_headBgImg2 != null)
            {
                this.m_headBgImg2.set_enabled(false);
            }
            break;

        case RankingType.ENUM.PetFighting:
            this.SetHideHeadAndPetHead(true);
            text = "宠物战斗力";
            num  = data.num;
            if (this.m_headIcon != null)
            {
                ResourceManager.SetSprite(this.m_headIcon, PetManagerBase.GetPlayerPetIcon2((int)data.petId, data.petStar));
            }
            if (this.m_headBgImg != null)
            {
                ResourceManager.SetSprite(this.m_headBgImg, PetManager.GetPetFrame01(data.petStar));
            }
            if (this.m_headBgImg2 != null)
            {
                this.m_headBgImg2.set_enabled(true);
                ResourceManager.SetSprite(this.m_headBgImg2, PetManager.GetPetFrame02(data.petStar));
            }
            break;
        }
        this.roleName.set_text(data.roleName);
        this.roleLevelName.set_text(text + ":");
        this.level.set_text(num.ToString());
    }
Exemple #2
0
    private void SetGemIcon(int typeId)
    {
        Items items = DataReader <Items> .Get(typeId);

        if (items == null)
        {
            return;
        }
        Image component = this.imgIcon.GetComponent <Image>();

        ResourceManager.SetSprite(component, GameDataUtils.GetItemFrameByColor(items.color));
        Image component2 = this.imgIcon.get_transform().FindChild("imgItem").GetComponent <Image>();

        ResourceManager.SetSprite(component2, GameDataUtils.GetIcon(items.icon));
        Text component3 = this.imgIcon.get_transform().FindChild("texName").GetComponent <Text>();

        component3.set_text(GameDataUtils.GetItemName(items, true));
        Dictionary <string, Color> textColorByQuality = GameDataUtils.GetTextColorByQuality(items.color);

        component3.set_color(textColorByQuality.get_Item("TextColor"));
        this.imgIcon.get_transform().FindChild("texName").GetComponent <Outline>().set_effectColor(textColorByQuality.get_Item("TextOutlineColor"));
        Text component4 = this.imgIcon.get_transform().FindChild("texLv").GetComponent <Text>();

        component4.set_text(string.Empty);
        if (!GemGlobal.IsGemEnoughLv(typeId))
        {
            int roleLvRequire = GemGlobal.GetRoleLvRequire(typeId);
            component4.set_text(string.Format(GameDataUtils.GetChineseContent(509011, false), roleLvRequire));
        }
        base.FindTransform("texDesc").GetComponent <Text>().set_text(GameDataUtils.GetChineseContent(items.describeId1, false));
    }
Exemple #3
0
 public static SpriteRenderer GetItemFrame(Items dataItem)
 {
     if (dataItem != null)
     {
         return(GameDataUtils.GetItemFrameByColor(dataItem.color));
     }
     return(ResourceManagerBase.GetNullSprite());
 }
    public void SetItemToPet(int petId, int star = 1)
    {
        this.m_petId = petId;
        Pet dataPet = DataReader <Pet> .Get(petId);

        this.m_spImageFramePet.set_enabled(true);
        ResourceManager.SetSprite(this.m_spImageFrame, GameDataUtils.GetItemFrameByColor(1));
        ResourceManager.SetSprite(this.m_spImageFramePet, PetManager.GetPetFrame02(star));
        ResourceManager.SetSprite(this.m_spImageIcon, PetManager.Instance.GetSelfPetIcon2(dataPet));
    }
Exemple #5
0
    public void SetItemData(int itemID)
    {
        this.ItemID = itemID;
        Items items = DataReader <Items> .Get(itemID);

        if (items == null)
        {
            return;
        }
        int num = items.color;

        if (num == 0)
        {
            num = 1;
        }
        if (this.m_spImageFrame == null)
        {
            return;
        }
        if (this.m_spImageFramePet == null)
        {
            return;
        }
        ResourceManager.SetSprite(this.m_spImageFrame, GameDataUtils.GetItemFrameByColor(num));
        ResourceManager.SetSprite(this.m_spImageFramePet, ResourceManagerBase.GetNullSprite());
        ResourceManager.SetSprite(this.m_spImageIcon, GameDataUtils.GetIcon(items.icon));
        long num2 = BackpackManager.Instance.OnGetGoodCount(itemID);

        if (num2 < 0L)
        {
            this.m_numTxt.get_gameObject().SetActive(false);
        }
        else
        {
            this.m_numTxt.get_gameObject().SetActive(true);
            this.m_numTxt.set_text(num2.ToString());
        }
        if (items != null && items.step > 0)
        {
            base.FindTransform("ItemStep").get_gameObject().SetActive(true);
            this.m_itemStepTxt.set_text(string.Format(GameDataUtils.GetChineseContent(505023, false), items.step));
        }
    }
Exemple #6
0
    public void ShowEquipItem(WearEquipInfo equipData)
    {
        if (!this.isInit)
        {
            this.InitUI();
        }
        if (equipData == null)
        {
            return;
        }
        this.ItemID    = equipData.id;
        this.EquipData = equipData;
        this.EquipType = equipData.type;
        Items items = DataReader <Items> .Get(this.ItemID);

        if (items == null)
        {
            return;
        }
        this.ResetEquipPartText();
        ResourceManager.SetSprite(this.m_frameImg, GameDataUtils.GetItemFrameByColor(items.color));
        ResourceManager.SetSprite(this.m_iconImg, GameDataUtils.GetIcon(items.icon));
        if (equipData.lv > 0)
        {
            this.m_levelText.set_text("Lv." + equipData.lv);
        }
        this.m_itemStepText.set_text(string.Format(GameDataUtils.GetChineseContent(505023, false), items.step));
        int num = 0;

        for (int i = 0; i < equipData.excellentAttrs.get_Count(); i++)
        {
            if (equipData.excellentAttrs.get_Item(i).color >= 1f)
            {
                num++;
            }
        }
        base.FindTransform("ExcellentAttrIconList").FindChild("Image1").GetComponent <Image>().set_enabled(num >= 1);
        base.FindTransform("ExcellentAttrIconList").FindChild("Image2").GetComponent <Image>().set_enabled(num >= 2);
        base.FindTransform("ExcellentAttrIconList").FindChild("Image3").GetComponent <Image>().set_enabled(num >= 3);
        Transform transform = this.m_iconImg.get_transform();

        EquipGlobal.GetEquipIconFX(equipData.id, num, transform, "RoleShowItem", 2000, false);
    }
Exemple #7
0
    private void SetEnchantmentIcon(int typeId)
    {
        Items items = DataReader <Items> .Get(typeId);

        if (items == null)
        {
            return;
        }
        Transform transform = base.FindTransform("imgGrid0");
        Image     component = transform.GetComponent <Image>();

        ResourceManager.SetSprite(component, GameDataUtils.GetItemFrameByColor(items.color));
        Image component2 = transform.FindChild("imgItem").GetComponent <Image>();

        ResourceManager.SetSprite(component2, GameDataUtils.GetIcon(items.icon));
        Text component3 = transform.FindChild("texName").GetComponent <Text>();

        component3.set_text(GameDataUtils.GetItemName(typeId, true, 0L));
        Dictionary <string, Color> textColorByQuality = GameDataUtils.GetTextColorByQuality(items.color);

        component3.set_color(textColorByQuality.get_Item("TextColor"));
        transform.get_transform().FindChild("texName").GetComponent <Outline>().set_effectColor(textColorByQuality.get_Item("TextOutlineColor"));
        Text component4 = transform.FindChild("texLv").GetComponent <Text>();

        component4.set_text(string.Empty);
        Text component5 = base.FindTransform("texDesc").GetComponent <Text>();
        int  describeId = items.describeId1;

        component5.set_text(GameDataUtils.GetChineseContent(describeId, false));
        string canEnchantmentPosDesc = EquipGlobal.GetCanEnchantmentPosDesc(items.id);
        Text   expr_112 = component5;

        expr_112.set_text(expr_112.get_text() + "\n");
        Text expr_129 = component5;

        expr_129.set_text(expr_129.get_text() + "\n");
        Text expr_140 = component5;

        expr_140.set_text(expr_140.get_text() + "可用部位:" + canEnchantmentPosDesc);
    }
Exemple #8
0
    public void SetGemIcon(int itemID, int count)
    {
        this.ItemID = itemID;
        Items items = DataReader <Items> .Get(itemID);

        if (items == null)
        {
            return;
        }
        if (!this.isInit)
        {
            this.InitUI();
        }
        int num = items.color;

        if (num == 0)
        {
            num = 1;
        }
        if (this.m_spImageFrame == null)
        {
            return;
        }
        if (this.m_spImageFramePet == null)
        {
            return;
        }
        ResourceManager.SetSprite(this.m_spImageFrame, GameDataUtils.GetItemFrameByColor(num));
        ResourceManager.SetSprite(this.m_spImageFramePet, ResourceManagerBase.GetNullSprite());
        ResourceManager.SetSprite(this.m_spImageIcon, GameDataUtils.GetIcon(items.icon));
        this.m_numTxt.get_gameObject().SetActive(true);
        this.m_numTxt.set_text(count.ToString());
        this.currentSelectType = SelectImgType.HighLight;
        if (items != null && items.step > 0)
        {
            base.FindTransform("ItemStep").get_gameObject().SetActive(true);
            this.m_itemStepTxt.set_text(string.Format(GameDataUtils.GetChineseContent(505023, false), items.step));
        }
    }
 public void SetItemToMonster(int iconId)
 {
     this.m_spImageFramePet.set_enabled(false);
     ResourceManager.SetSprite(this.m_spImageFrame, GameDataUtils.GetItemFrameByColor(1));
     ResourceManager.SetSprite(this.m_spImageIcon, GameDataUtils.GetIcon(iconId));
 }