Example #1
0
    public bool NumRequire(SkillType skill)
    {
        if (PlayerRole.Instance.ItemManager.GetAllItemMap() == null)//背包没数据
        {
            return(false);
        }

        if (PlayerRole.Instance.ItemManager.GetItemSum(SkillSetting.SkillDataList[(byte)skill].ItemId, false) < ConsumeCount(skill))//个数不够
        {
            FishSkillToShop pSkillShop = FishConfig.Instance.m_FishScriptMap.GetSkillToShopInfoByID((byte)skill, 0);
            if (pSkillShop != null)
            {
                byte          shopID  = pSkillShop.ShopID;
                byte          OnlyID  = pSkillShop.ShopOnlyID;
                uint          itemSum = ConsumeCount(skill) - PlayerRole.Instance.ItemManager.GetItemSum(SkillSetting.SkillDataList[(byte)skill].ItemId, false);
                tagShopConfig pShop   = new tagShopConfig();
                FishConfig.Instance.m_ShopInfo.ShopMap.TryGetValue(shopID, out pShop);
                if (pShop != null)
                {
                    if (pShop.ShopItemMap.ContainsKey(OnlyID))
                    {
                        GlobalHallUIMgr.Instance.ShowConfirmBuyWnd(OnlyID, shopID, itemSum);
                    }
                }
            }
            //  GlobalHallUIMgr.Instance.ShowSystemTipsUI(StringTable.GetString("Skill_Tip_count"), 1, false);
            return(false);
        }
        return(true);
    }
Example #2
0
        private void InitItemPanel()
        {
            ClearGird();
            int  num        = 0;
            byte propertyID = (byte)(Shop_Type.Shop_Property + 1);

            if (FishConfig.Instance.m_ShopInfo.ShopMap.ContainsKey(propertyID) == false)
            {
                return;
            }
            tagShopConfig shopItemMap = FishConfig.Instance.m_ShopInfo.ShopMap[propertyID];

            if (shopItemMap == null)
            {
                return;
            }
            foreach (KeyValuePair <byte, tagShopItemConfig> map in shopItemMap.ShopItemMap)
            {
                PropertyItem item = new PropertyItem();
                item.Init(itemTemp);
                item.ShowGoodsInfo(map.Key, map.Value, shopItemMap.ShopItemStrMap[map.Key]);
                item.m_BaseTrans.parent = gridItem.transform;
                num++;
                item.ResetLocalScale();
            }
            RectTransform rectTransform = gridItem.GetComponent <RectTransform>();

            rectTransform.sizeDelta     = new Vector2(1100, 240 * num);
            rectTransform.localPosition = Vector3.zero;
            itemTemp.SetActive(false);
            isInitGoods = true;
        }
Example #3
0
    public void UpdatePropertyDate()
    {
        ClearGird();
        m_ShopID = (byte)(Shop_Type.Shop_Property + 1);
        if (FishConfig.Instance.m_ShopInfo.ShopMap.ContainsKey(m_ShopID) == false)
        {
            return;
        }
        tagShopConfig shopItemMap = FishConfig.Instance.m_ShopInfo.ShopMap[m_ShopID];

        if (shopItemMap == null)
        {
            return;
        }
        byte Idx = 0;

        foreach (KeyValuePair <byte, tagShopItemConfig> map in shopItemMap.ShopItemMap)
        {
            if (JBPSetting.ShowJBP(map.Value.ItemInfo.ItemID) == false)
            {
                continue;
            }

            ShopItemInfoUI item = new ShopItemInfoUI();
            item.Init(m_ScrollView.m_BaseChild);
            item.InitItemSum();
            item.SetShopItemInfo(m_ShopID, map.Value, shopItemMap.ShopItemStrMap[map.Key]);
            m_ScrollView.m_Grid[Idx % 5].AddChild(item.m_BaseTrans);
            item.ResetLocalScale();
            Idx++;
        }
    }
Example #4
0
    public void UpateMaterailDate()
    {
        ClearGird();
        m_ShopID = (byte)(Shop_Type.Shop_Material + 1);

        if (FishConfig.Instance.m_ShopInfo.ShopMap.ContainsKey(m_ShopID) == false)
        {
            return;
        }
        tagShopConfig shopItemMap = FishConfig.Instance.m_ShopInfo.ShopMap[m_ShopID];

        if (shopItemMap == null)
        {
            return;
        }
        byte Idx = 0;

        foreach (KeyValuePair <byte, tagShopItemConfig> map in shopItemMap.ShopItemMap)
        {
            //对聚宝盆特殊处理
            //IsOfficialVersion true 官网
            if (JBPSetting.ShowJBP(map.Value.ItemInfo.ItemID) == false)
            {
                continue;
            }

            //if (SDKMgr.Instance.IsOfficialVersion == false && map.Value.ItemInfo.ItemID == 1700) //为渠道版
            //{
            //    continue;
            //}
            //else if (SDKMgr.Instance.IsOfficialVersion && PlayerRole.Instance.RoleInfo.RoleMe.GetVipLevel() < 3)    //VIP等级小于3不显示
            //    continue;
            ShopItemInfoUI item = new ShopItemInfoUI();
            item.Init(m_ScrollView.m_BaseChild);
            item.InitItemSum();
            item.SetShopItemInfo(m_ShopID, map.Value, shopItemMap.ShopItemStrMap[map.Key]);
            m_ScrollView.m_Grid[Idx % 3].AddChild(item.m_BaseTrans);
            item.ResetLocalScale();
            Idx++;
        }
        tagRoleAddressInfo pEntity = PlayerRole.Instance.EntityManager.GetRoleEntityInfo();//获取一次实体数据

        UpdateNoticeDate();
    }
Example #5
0
    public void UpdateDaPaoDate()
    {
        if (m_BaseWndObject == null || m_BaseWndObject.activeSelf == false)
        {
            return;
        }
        if (PlayerRole.Instance.ItemManager.GetAllItemMap() == null)
        {
            return;
        }
        ClearGird();
        m_ShopID = (byte)(Shop_Type.Shop_Launcher + 1);
        if (FishConfig.Instance.m_ShopInfo.ShopMap.ContainsKey(m_ShopID) == false)
        {
            return;
        }
        tagShopConfig shopItemMap = FishConfig.Instance.m_ShopInfo.ShopMap[m_ShopID];

        if (shopItemMap == null)
        {
            return;
        }
        foreach (KeyValuePair <byte, tagShopItemConfig> map in shopItemMap.ShopItemMap)
        {
            if (JBPSetting.ShowJBP(map.Value.ItemInfo.ItemID) == false)
            {
                continue;
            }

            ShopItemInfoUI item = new ShopItemInfoUI();
            item.Init(m_ScrollView.m_BaseChild);
            item.InitItemDesc();
            item.InitItemGetFlag();
            item.SetShopItemInfo(m_ShopID, map.Value, shopItemMap.ShopItemStrMap[map.Key]);
            if (IsAlreadyGetLauncher(map.Value.ItemInfo.ItemID, map.Value.ItemInfo.ItemSum))
            {
                item.SetIsGetLauncher();
            }
            m_ScrollView.m_Grid[0].AddChild(item.m_BaseTrans);
            item.ResetLocalScale();
        }
    }