private void SetItem(int id)
    {
        if (ItemSprite == null)
        {
            return;
        }

        if (ItemObj == null)
        {
            return;
        }

        if (id == -1)
        {
            ItemObj.SetActive(false);
        }
        else
        {
            ItemObj.SetActive(true);
        }

        Tab_CommonItem commonItem = null;

        commonItem = TableManager.GetCommonItemByID(id, 0);
        if (commonItem == null)
        {
            return;
        }

        ItemSprite.spriteName = commonItem.Icon;
    }
Beispiel #2
0
    public void Init(int skillbookid, int defaultcount = 0)
    {
        Tab_CommonItem tabItem = TableManager.GetCommonItemByID(skillbookid, 0);

        if (tabItem == null)
        {
            return;
        }

        Tab_CabalFellowTallentSkillBook tabBook = TableManager.GetCabalFellowTallentSkillBookByID(skillbookid, 0);

        if (tabBook == null)
        {
            return;
        }

        m_ItemSlot.InitInfo_Item(skillbookid, ItemSlotLogic.OnClickOpenTips);
        m_NameLabel.text     = tabItem.Name;
        m_OwnCountLabel.text = GameManager.gameManager.PlayerDataPool.BackPack.GetItemCountByDataId(skillbookid).ToString();
        m_UseCountLabel.text = defaultcount.ToString();

        m_MinusButton.SetActive(true);
        m_AddButton.SetActive(true);
        if (defaultcount <= 0)
        {
            m_MinusButton.SetActive(false);
        }
        else if (defaultcount >= GameManager.gameManager.PlayerDataPool.BackPack.GetItemCountByDataId(skillbookid))
        {
            m_AddButton.SetActive(false);
        }

        m_SkillBookId = skillbookid;
        m_UseCount    = defaultcount;
    }
Beispiel #3
0
    public void SetData(GuildMake parent, GuildShopMakeItem data)
    {
        m_parent = parent;
        m_data   = data;

        if (data.IsValid())
        {
            Tab_CommonItem tabCommonItem = TableManager.GetCommonItemByID(data.m_ItemID, 0);
            if (tabCommonItem == null)
            {
                return;
            }
            if (SpriteQuality != null)
            {
                SpriteQuality.spriteName = GlobeVar.QualityColorGrid[tabCommonItem.Quality - 1];
            }

            if (SpriteIcon != null)
            {
                SpriteIcon.spriteName = tabCommonItem.Icon;
            }

            if (LabelName != null)
            {
                LabelName.text = tabCommonItem.Name;
            }

            if (LableDesc != null)
            {
                LableDesc.text = Utils.GetDicByID(data.m_DictID);
            }
        }
    }
Beispiel #4
0
 void ShowRemind()
 {
     if (m_ItemDataIDBuffer.Count > 0)
     {
         if (!m_bOnShow)
         {
             m_ItemSlot.InitInfo_Item(m_ItemDataIDBuffer[0]);
             Tab_CommonItem tabItem = TableManager.GetCommonItemByID(m_ItemDataIDBuffer[0], 0);
             if (tabItem != null)
             {
                 m_NameLabel.text = tabItem.Name;
             }
             m_bOnShow        = true;
             m_fStartShowTime = Time.fixedTime;
         }
         else if (Time.fixedTime - m_fStartShowTime >= GetShowTime())
         {
             m_bOnShow        = false;
             m_fStartShowTime = GlobeVar.INVALID_ID;
             m_ItemDataIDBuffer.RemoveAt(0);
         }
     }
     else
     {
         UIManager.CloseUI(UIInfo.ItemRemindRoot);
     }
 }
Beispiel #5
0
    //减少购买物品WW
    void onClickSubBuyItem()
    {
        Tab_PvpShop tabPvp = TableManager.GetPvpShopByID(m_BuyPvpId, 0);

        if (tabPvp == null)
        {
            return;
        }

        Tab_CommonItem tabCommonItem = TableManager.GetCommonItemByID(tabPvp.ItemId, 0);

        if (tabCommonItem == null)
        {
            return;
        }

        if (m_BuyItemNum - 1 > 0)
        {
            int cellprice = 0;
            if (m_BuyItemNum == 0)
            {
                cellprice = int.Parse(m_BuyItemPrice.text);
            }
            else
            {
                cellprice = int.Parse(m_BuyItemPrice.text) / m_BuyItemNum;
            }

            m_BuyItemNum       -= 1;
            m_BuyItemCount.text = m_BuyItemNum.ToString();
            m_BuyItemPrice.text = (m_BuyItemNum * cellprice).ToString();
        }
    }
Beispiel #6
0
    public void SetRewardInfo(ActivityRewardData rewardData)
    {
        m_RewardData = rewardData;

        if (m_RewardData.Item1DataID > 0)
        {
            Tab_CommonItem curItem = TableManager.GetCommonItemByID(m_RewardData.Item1DataID, 0);
            if (null != curItem)
            {
                m_ItemIcon.spriteName = curItem.Icon;
            }

            m_NumLabel.text = m_RewardData.Item1Count + "";
        }
        else
        {
            if (m_RewardData.Money > 0)
            {
                m_ItemIcon.spriteName = "jinbi";
                m_NumLabel.text       = m_RewardData.Money + "";
            }
        }

        DateTime curDateTime = CurDateTime; //curDateTime.Month + "月" + curDateTime.Day + "日"

        //StrDictionary.GetClientDictionaryString("#{5094}", rewardData.Number.ToString());
        m_TimeLabel.text = StrDictionary.GetClientDictionaryString("#{5208}", curDateTime.Month, curDateTime.Day);

        m_RewardItem = m_RewardData.Item1DataID;

        SetShowState(m_RewardData.State);
        IsChoose = false;
    }
    void ShowEquipLevel(GameItem equip)
    {
        if (equip != null && equip.IsValid())
        {
            int nPlayerLevel = Singleton <ObjManager> .GetInstance().MainPlayer.BaseAttr.Level;

            Tab_CommonItem tabItem = TableManager.GetCommonItemByID(equip.DataID, 0);
            if (null != tabItem)
            {
                int nEquipLevel = tabItem.MinLevelRequire;
                if (nPlayerLevel >= nEquipLevel)
                {
                    m_EquipLevelTitleLabel.text = "[b4ffd1]" + StrDictionary.GetClientDictionaryString("#{10233}");
                    m_EquipLevelLabel.text      = "[b4ffd1]";
                }
                else
                {
                    m_EquipLevelTitleLabel.text = "[E60012]" + StrDictionary.GetClientDictionaryString("#{10233}");
                    m_EquipLevelLabel.text      = "[E60012]";
                }
                //string strEquipLevel = "人物等级需求: {0}";
                //string strEquipLevel = StrDictionary.GetClientDictionaryString("#{2832}", nEquipLevel);
                //m_EquipLevelLabel.text += string.Format(strEquipLevel, nEquipLevel);
                m_EquipLevelLabel.text += "Lv." + nEquipLevel;
            }
        }
    }
Beispiel #8
0
    void ShowComparePrice(GameItem equip)
    {
        Tab_CommonItem tabItem = TableManager.GetCommonItemByID(equip.DataID, 0);

        if (tabItem != null)
        {
            // 价格
            m_ComparePriceLabel.text  = "[FFFFCC]";
            m_ComparePriceLabel.text += tabItem.SellPrice.ToString();

            // 出售方式 图标
//             int nPower = Mathf.FloorToInt(Mathf.Log10((float)nComparePrice));
//             m_ComparePriceIcon.gameObject.transform.localPosition = new Vector3(84 + 12 * nPower, 0, 0);
            if (tabItem.SellMoneyType == (int)ItemSellMoneyType.TYPE_COIN)
            {
                m_ComparePriceIcon.spriteName = "qian5";
            }
            else if (tabItem.SellMoneyType == (int)ItemSellMoneyType.TYPE_YUANBAO)
            {
                m_ComparePriceIcon.spriteName = "qian2";
            }
            else if (tabItem.SellMoneyType == (int)ItemSellMoneyType.TYPE_BIND_YUANBAO)
            {
                m_ComparePriceIcon.spriteName = "qian3";
            }
        }
    }
Beispiel #9
0
    public void InitInfo_Restaurant(int id, OnClick delSlotOnClick = null, string strNum = "", bool showNum = false)
    {
        m_ItemID         = id;
        m_eItemType      = SLOT_TYPE.TYPE_RESTAURANT;
        m_delSlotOnClick = delSlotOnClick;

        Tab_CommonItem tabCommonItem = TableManager.GetCommonItemByID(id, 0);

        if (tabCommonItem == null)
        {
            ClearInfo();
        }
        else
        {
            m_ItemIcon.spriteName = tabCommonItem.Icon;
            m_ItemIcon.gameObject.SetActive(true);

            m_QualitySprite.spriteName = GlobeVar.QualityColorGrid[tabCommonItem.Quality - 1];
            m_QualitySprite.gameObject.SetActive(true);

            if (showNum || strNum != "")
            {
                m_NumLabel.text = strNum;
                m_NumLabel.gameObject.SetActive(true);
            }
            else
            {
                m_NumLabel.gameObject.SetActive(false);
            }

            m_DisableSprite.gameObject.SetActive(false);
        }
    }
Beispiel #10
0
    void UpDateUI(int nShopTabID)
    {
        Tab_GongJiShop ShopTab = TableManager.GetGongJiShopByID(nShopTabID, 0);

        if (ShopTab == null)
        {
            return;
        }

        Price        = ShopTab.Price;
        ConsumItemID = ShopTab.ConsumItemID;

        Tab_CommonItem ShopItem = TableManager.GetCommonItemByID(ShopTab.ItemID, 0);

        if (ShopItem == null)
        {
            return;
        }

        m_ItemSlot.InitInfo(ItemSlotLogic.SLOT_TYPE.TYPE_ITEM, ShopTab.ItemID, ItemOnClick);

        if (null != m_NameLabel)
        {
            m_NameLabel.text = ShopItem.Name;
        }
    }
Beispiel #11
0
        public void SetNameBoardColor()
        {
            string         strColor = "FFFFFF";
            Tab_CommonItem line     = TableManager.GetCommonItemByID(m_nItemId, 0);

            if (line != null)
            {
                switch ((Item.ItemClass)line.ClassID)
                {
                case Item.ItemClass.EQUIP:
                case Item.ItemClass.MATERIAL:
                case Item.ItemClass.STRENGTHEN:
                case Item.ItemClass.PRIZE:
                case Item.ItemClass.MEDIC:
                case Item.ItemClass.MISSION:
                case Item.ItemClass.MOUNT:
                case Item.ItemClass.FASHION:
                case Item.ItemClass.FELLOW:
                {
                    strColor = "70E718";
                }
                break;

                default:
                    break;
                }
            }
            if (m_NameBoard)
            {
                m_NameBoard.color = Utils.GetColorByString(strColor);
            }
        }
    public void Init(int nGoodIndex, int nGoodId, int nLeftCount)
    {
        Tab_GuildShop tabShopItem = TableManager.GetGuildShopByID(nGoodId, 0);

        if (tabShopItem == null)
        {
            return;
        }

        Tab_CommonItem tabItem = TableManager.GetCommonItemByID(tabShopItem.ItemID, 0);

        if (tabItem == null)
        {
            return;
        }

        m_ItemSlot.InitInfo_Item(tabShopItem.ItemID, ItemSlotLogic.OnClickOpenTips, tabShopItem.StackSize > 1 ? tabShopItem.StackSize.ToString() : "", tabShopItem.StackSize > 1);
        m_NumContent.text   = nLeftCount <= 0 ? "[FF0000]" + nLeftCount.ToString() : nLeftCount.ToString();
        m_PriceContent.text = tabShopItem.Price.ToString();
        m_NameLabel.text    = tabItem.Name;

        m_GoodsIndex = nGoodIndex;
        m_GoodsId    = nGoodId;
        m_ItemID     = tabItem.Id;
        m_LeftCount  = nLeftCount;
        m_nPrice     = tabShopItem.Price;
    }
Beispiel #13
0
    //职业
    private void SetProfession(GameItem item)
    {
        Tab_CommonItem tabItem = TableManager.GetCommonItemByID(item.DataID, 0);

        if (null != tabItem)
        {
            int Profession        = tabItem.ProfessionRequire;
            int nPlayerProfession = Singleton <ObjManager> .Instance.MainPlayer.Profession;
            if (Profession == -1 || Profession == nPlayerProfession)
            {
                m_ProfessionLabel.text = "[ffff69]";
            }
            else
            {
                m_ProfessionLabel.text = "[E60012]"; // 红色
            }

            string professionStr = StrDictionary.GetClientDictionaryString("#{1243}");
            if (0 <= Profession && Profession < (int)CharacterDefine.PROFESSION.MAX)
            {
                professionStr = Utils.GetProfessionNameByType(Profession);//StrDictionary.GetClientDictionaryString("#{" + CharacterDefine.PROFESSION_DICNUM[Profession].ToString() + "}");
            }
            m_ProfessionLabel.text += professionStr;
        }
    }
        public uint Execute(PacketDistributed ipacket)
        {
            GC_PLAY_YANHUA packet = (GC_PLAY_YANHUA)ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }

            int nEffectID = packet.Effectid;

            if (BackCamerControll.Instance() != null)
            {
                BackCamerControll.Instance().PlaySceneEffect(nEffectID);
            }
            Tab_CommonItem TabItem = TableManager.GetCommonItemByID(packet.Itemid, 0);

            if (TabItem != null)
            {
                string strMsg = StrDictionary.GetClientDictionaryString("#{3050}", packet.Username, TabItem.Name);
                GUIData.AddNotifyData(strMsg);
            }

            //enter your logic
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
Beispiel #15
0
    public void BuyItem(int pvpshopId, int money)
    {
        Tab_PvpShop tabPvp = TableManager.GetPvpShopByID(pvpshopId, 0);

        if (tabPvp == null)
        {
            return;
        }

        Tab_CommonItem tabCommonItem = TableManager.GetCommonItemByID(tabPvp.ItemId, 0);

        if (tabCommonItem == null)
        {
            return;
        }
        //add 修复取消后,在此打开显示购买数量为0的问题
        if (m_BuyItemNum < 1)
        {
            m_BuyItemNum = 1;
        }
        m_BuyPvpId          = pvpshopId;
        m_BuyItemName.text  = tabCommonItem.Name;
        m_BuyItemCount.text = m_BuyItemNum.ToString();
        m_BuyItemPrice.text = money.ToString();
        m_BuyContext.SetActive(true);
    }
    void UpdateItemCountInfo()
    {
        int    BackPackItemCount = GameManager.gameManager.PlayerDataPool.BackPack.GetItemCountByDataId(m_ItemID);
        string strColor          = "";

        if (BackPackItemCount >= m_RequireCount)
        {
            strColor = "[32A100]";
        }
        else
        {
            strColor = "[FF2222]";
        }
        m_CountLabel.text = strColor + BackPackItemCount.ToString() + "[FFFFFF]/" + m_RequireCount.ToString();
        m_SelBtGameObj.SetActive(false);
        Tab_CommonItem line = TableManager.GetCommonItemByID(m_ItemID, 0);

        if (line != null)
        {
            if (line.ClassID == (int)ItemClass.EQUIP)
            {
                if (BackPackItemCount > m_RequireCount)
                {
                    m_SelBtGameObj.SetActive(true);
                }
            }
        }
    }
    void InitData()
    {
        m_NewServerDays  = GameManager.gameManager.PlayerDataPool.AwardActivityData.NewServerDays;
        m_lblCurDay.text = StrDictionary.GetClientDictionaryString("#{11221}", m_NewServerDays + 1);
        int nStTime    = GameManager.gameManager.PlayerDataPool.NStartTime;
        int nStarDay   = (nStTime / 10000) % 100;
        int nStarMonth = (nStTime / 1000000) % 100;
        int nStarYear  = 2000 + (nStTime / 100000000);
//        string sStTime = nStarMonth.ToString() + "." + nStarDay.ToString();
        int nEndTime  = GameManager.gameManager.PlayerDataPool.NEndTime;
        int nEndDay   = (nEndTime / 10000) % 100;
        int nEndMonth = (nEndTime / 1000000) % 100;
        int nEndYear  = 2000 + (nStTime / 100000000);

//        string sEndTime = nEndMonth.ToString() + "." + nEndDay.ToString();
        m_lblTime.text = StrDictionary.GetClientDictionaryString("#{" + m_lblTime.curDicID + "}",
                                                                 nStarYear, nStarMonth, nStarDay, nEndYear, nEndMonth, nEndDay);
        Tab_CommonItem item = TableManager.GetCommonItemByID(GameDefine_Globe.NEWSERVER_ACTIVITY_EXTRA_AWARD, 0);

        if (item != null)
        {
            m_lblNotice.text = StrDictionary.GetClientDictionaryString("#{" + m_lblNotice.curDicID + "}", item.Name);
        }

        UpDateWindow();
    }
    void HandleFitOnEquipment(int nGoodsId, int nDataID)
    {
        m_FitOnVisual.FellowGoodsID = GlobeVar.INVALID_ID;
        m_FitOnVisual.MountGoodsID  = GlobeVar.INVALID_ID;

        m_FitOnVisual.FellowID = GlobeVar.INVALID_ID;
        m_FitOnVisual.MountID  = GlobeVar.INVALID_ID;

        Tab_CommonItem tabCommonItem = TableManager.GetCommonItemByID(nDataID, 0);

        if (tabCommonItem == null)
        {
            return;
        }

        Tab_EquipAttr tabEquipAttr = TableManager.GetEquipAttrByID(nDataID, 0);

        if (tabEquipAttr == null)
        {
            return;
        }

        // 武器装备
        if (tabEquipAttr.Component == (int)EquipPackSlot.Slot_WEAPON + 1)
        {
            HandleFitOnWeapon(nGoodsId, nDataID, tabEquipAttr);
        }
        if (tabEquipAttr.Component == (int)EquipPackSlot.Slot_ARMOR + 1)
        {
            HandleFitOnArmor(nGoodsId, nDataID, tabEquipAttr);
        }
    }
    /// <summary>
    /// 更新宝石槽位
    /// </summary>
    public void UpdateGemSlot()
    {
        GemData gemdata = GameManager.gameManager.OtherPlayerData.GemData;

        for (int i = 0; i < (int)CONSTVALUE.GEM_SLOT_NUM; i++)
        {
            m_GemSlotId[i] = gemdata.GetGemId(m_CurEquipSlot, i);
        }
        for (int i = 0; i < (int)CONSTVALUE.GEM_SLOT_NUM; i++)
        {
            if (m_GemSlotId[i] >= 0)
            {
                Tab_CommonItem line = TableManager.GetCommonItemByID(m_GemSlotId[i], 0);
                if (line != null)
                {
                    m_GemSlotSprite[i].gameObject.SetActive(true);
                    m_GemSlotSprite[i].spriteName = line.Icon;
                    m_GemItemQualitySprite[i].gameObject.SetActive(true);
                    m_GemItemQualitySprite[i].spriteName = GlobeVar.QualityColorGrid[line.Quality - 1];
                }
            }
            else
            {
                m_GemSlotSprite[i].gameObject.SetActive(false);
                m_GemItemQualitySprite[i].gameObject.SetActive(false);
            }
        }
        //================
        string name = GetCurEquipIcon(m_CurEquipSlot);

        m_CurEquipIcon.gameObject.SetActive(true);
        m_CurEquipIcon.spriteName = name;

        WriteGemDes();
    }
Beispiel #20
0
    public static AutoDrugItem CreateEquip(GameObject grid, GameObject resItem, AutoDrugWindow parent, GameItem equip)
    {
        GameObject curItemObject = Utils.BindObjToParent(resItem, grid, equip.DataID.ToString());

        if (null != curItemObject)
        {
            AutoDrugItem curItemComponent = curItemObject.GetComponent <AutoDrugItem>();
            if (null != curItemComponent)
            {
                Tab_CommonItem curItem = TableManager.GetCommonItemByID(equip.DataID, 0);
                if (null != curItem)
                {
                    curItemComponent.m_ItemName.text       = curItem.Name;
                    curItemComponent.m_ItemIcon.spriteName = curItem.Icon;
                    curItemComponent.m_nId      = curItem.Id;
                    curItemComponent.m_parent   = parent;
                    curItemComponent.m_ItemGuid = equip.Guid;
                    //curItemComponent.m_BackgroundSprite.spriteName = background;
                    curItemComponent.m_QualitySprite.spriteName = equip.GetQualityFrame();
                    return(curItemComponent);
                }
            }
        }
        return(null);
    }
Beispiel #21
0
    public void onClick()
    {
        int         id      = int.Parse(gameObject.name);
        Tab_PvpShop pvpshop = TableManager.GetPvpShopByID(id, 0);

        if (pvpshop == null)
        {
            return;
        }

        Tab_CommonItem line = TableManager.GetCommonItemByID(pvpshop.ItemId, 0);

        if (line != null)
        {
            if (line.ClassID == (int)ItemClass.EQUIP)
            {
                EquipTooltipsLogic.ShowEquipTooltip(pvpshop.ItemId, EquipTooltipsLogic.ShowType.Info);
            }

            else
            {
                ItemTooltipsLogic.ShowItemTooltip(pvpshop.ItemId, ItemTooltipsLogic.ShowType.Info);
            }
        }
    }
Beispiel #22
0
    void ShowRemind()
    {
        if (m_UseItemBuffer.Count > 0)
        {
            // 处在显示状态且时间已达到10秒
            if (Time.fixedTime - m_fStartShowTime >= ShowTime && m_bOnShow)
            {
                m_bOnShow        = false;
                m_bOnHide        = true;
                m_fStartShowTime = 0.0f;
                m_fStartHideTime = Time.fixedTime;
                m_ItemRemind.SetActive(false);
                if (ItemRemindLogic.Instance() != null)
                {
                    ItemRemindLogic.Instance().HandleEquipRemind(false);
                }
                m_UseItemBuffer.RemoveAt(0);
            }
            // 未处在显示10秒和隐藏2秒状态 且自身需要显示
            else if (!m_ItemRemind.activeInHierarchy && !m_bOnHide)
            {
                //装备提醒 在的时候暂时不显示
                if (EquipRemindLogic.Instance() == null ||
                    (EquipRemindLogic.Instance() != null && EquipRemindLogic.Instance().m_EquipRemind.activeInHierarchy == false))
                {
                    m_fStartShowTime = Time.fixedTime;
                    m_ItemRemind.SetActive(true);
                    if (ItemRemindLogic.Instance() != null)
                    {
                        ItemRemindLogic.Instance().HandleEquipRemind(true);
                    }

                    if (m_UseItemBuffer[0] == null || !m_UseItemBuffer[0].IsValid())
                    {
                        return;
                    }

                    Tab_CommonItem tabItem = TableManager.GetCommonItemByID(m_UseItemBuffer[0].DataID, 0);
                    if (tabItem != null)
                    {
                        m_IconSprite.spriteName = tabItem.Icon;
                        m_IconSprite.MakePixelPerfect();
                        m_QualitySprite.spriteName = GlobeVar.QualityColorGrid[tabItem.Quality - 1];
                        m_TitleNameLabel.text      = tabItem.Name;
                        m_bOnShow = true;
                    }
                }
            }
            // 处在隐藏状态且时间已达到2秒
            if (Time.fixedTime - m_fStartHideTime >= HideTime && m_bOnHide)
            {
                m_bOnHide        = false;
                m_fStartHideTime = 0.0f;
            }
        }
        else
        {
            UIManager.CloseUI(UIInfo.UseItemRemindRoot);
        }
    }
Beispiel #23
0
    public void ReFreshGemInfo()
    {
        clearGemInfo();

        int nEquipMax = (int)EquipPackSlot.Slot_NUM;
        int nGemMax   = (int)GemLogic.CONSTVALUE.GEM_SLOT_NUM;

        GemData gemdata = GameManager.gameManager.OtherPlayerData.GemData;

        for (int eIndex = 0; eIndex < nEquipMax; ++eIndex)
        {
            for (int gIndex = 0; gIndex < nGemMax; ++gIndex)
            {
                int nListIndex = GetIndexByEquipSlot(eIndex) * nGemMax + gIndex;
                int nGemID     = gemdata.GetGemId(eIndex, gIndex);
                if (nGemID >= 0)
                {
                    Tab_CommonItem line = TableManager.GetCommonItemByID(nGemID, 0);
                    if (line != null && nListIndex >= 0 && nListIndex < m_GemsInEquips.Length)
                    {
                        m_GemsInEquips[nListIndex].gameObject.SetActive(true);
                        m_GemsInEquips[nListIndex].spriteName = line.Icon;
                    }
                }
            }
        }
    }
    public void Init(int goodsid, int count, PresentRootLogic.TAB_INDEX tab, int index = GlobeVar.INVALID_ID)
    {
        m_GoodsID    = goodsid;
        m_GoodsCount = count;
        m_Type       = tab;
        m_GoodsIndex = index;

        Tab_YuanBaoShop tabGood = TableManager.GetYuanBaoShopByID(goodsid, 0);

        if (tabGood != null && tabGood.ItemType == (int)YuanBaoShopItemLogic.ITEM_TYPE.TYPE_ITEM)
        {
            int            itemid  = tabGood.ItemID;
            Tab_CommonItem tabItem = TableManager.GetCommonItemByID(itemid, 0);
            if (tabItem != null)
            {
                m_ItemSlot.InitInfo_Item(tabItem.Id, GoodsOnClick, tabGood.Num.ToString(), true);
                m_CountLabel.text = count.ToString();
                m_DeleteButton.SetActive(true);
                m_NameLabel.text = tabItem.Name;
            }
        }

        if (tab == PresentRootLogic.TAB_INDEX.TAB_SHOPPINGCART)
        {
            m_DeleteButton.SetActive(true);
        }
        else
        {
            m_DeleteButton.SetActive(false);
        }
    }
    void InitInfo()
    {
        Tab_CommonItem tBook = TableManager.GetCommonItemByID(m_ItemID, 0);

        if (tBook != null)
        {
            m_ItemName.text          = tBook.Name;
            m_ItemLevel.text         = tBook.MinLevelRequire.ToString();
            m_ItemIcon.spriteName    = tBook.Icon;
            m_ItemQuality.spriteName = GCGame.Utils.GetItemQualityById(m_ItemID);
            m_ItemIntroduction.text  = tBook.Tips;
            m_ItemAttrValue.text     = GetMountSpeedValueByItem(m_ItemID);
        }
        else
        {
            m_ItemDisable.spriteName = "";
            m_ItemChoose.spriteName  = "";
            m_ItemIcon.spriteName    = "";
            m_ItemQuality.spriteName = "";

            m_ItemAttrValue.text = "0";
            m_ItemName.text      = "";
            m_ItemLevel.text     = "";

            m_ItemIntroduction.text = "";
        }
        m_ItemAttrName.text = StrDictionary.GetClientDictionaryString("#{1588}");
    }
    private void ShowForedinationHead()    //魔灵未激活状态 宿命也能够显示
    {
        Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;
        int       count    = ForeordinationHead.Length;

        for (int i = 0; i < count; ++i)
        {
            if (ForeordinationHead[i] != null)
            {
                if (i < belleTab.getAffectionConditonValueCount())
                {
                    int id = belleTab.GetAffectionConditonValuebyIndex(i);
                    ForeordinationHead[i].SetActive(true);
                    bool      isHas          = BelleData.OwnedBelleMap.ContainsKey(id);
                    Tab_Belle affectionbelle = TableManager.GetBelleByID(id, 0);
                    if (affectionbelle != null)
                    {
                        Tab_CommonItem cItem = TableManager.GetCommonItemByID(affectionbelle.BelleItemID, 0);
                        if (cItem != null)
                        {
                            UISprite us = ForeordinationHead[i].GetComponent <UISprite>();
                            if (us != null)
                            {
                                us.spriteName = Games.GlobeDefine.GlobeVar.QualityColorGrid[cItem.Quality - 1];
                                if (isHas)
                                {
                                    us.color = Games.GlobeDefine.GlobeVar.BUTTONCOLER;
                                }
                                else
                                {
                                    us.color = Games.GlobeDefine.GlobeVar.BUTTONGRAY;
                                }
                            }
                            Transform tf = ForeordinationHead[i].transform.Find("Head");
                            if (tf != null)
                            {
                                UISprite usc = tf.GetComponent <UISprite>();
                                if (usc != null)
                                {
                                    usc.spriteName = cItem.Icon;
                                    if (isHas)
                                    {
                                        usc.color = Games.GlobeDefine.GlobeVar.BUTTONCOLER;
                                    }
                                    else
                                    {
                                        usc.color = Games.GlobeDefine.GlobeVar.BUTTONGRAY;
                                    }
                                }
                            }
                        }
                    }
                }
                else
                {
                    ForeordinationHead[i].SetActive(false);
                }
            }
        }
    }
    public void CreateBelle()
    {
        if (BelleInfoWindow.Instance() != null)
        {
            Tab_Belle belleTab = BelleInfoWindow.Instance().CurSellectedBelleData;

            if (null == belleTab)
            {
                LogModule.ErrorLog("BelleInfoWindow.Instance().CurSellectedBelleData is null!");
                return;
            }

            int belleSubItemId     = belleTab.BelleItemID;
            int belleTotalSubCount = belleTab.BelleItemCount;
            int belleSubItemCount  = GameManager.gameManager.PlayerDataPool.BackPack.GetItemCountByDataId(belleSubItemId);

            //数量不够显示获取界面
            if (belleTotalSubCount > 0 && belleSubItemCount < belleTotalSubCount)
            {
                //提示数量不够
            }
            else if (belleTotalSubCount > 0 && belleSubItemCount >= belleTotalSubCount)
            {
                //合成,发送消息包
                ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////合成美人发送消息包。
                Tab_CommonItem commonItemTab = TableManager.GetCommonItemByID(belleSubItemId, 0);
                if (commonItemTab != null)
                {
                    string tip = StrDictionary.GetClientDictionaryString("#{10257}", commonItemTab.Name, belleTotalSubCount);
                    //定义一个激活美人消息包
                    MessageBoxLogic.OpenOKCancelBox(tip, "", DoGetBelle);
                }
            }
        }
    }
Beispiel #28
0
    public void SetData(ItemClickDelegate clickFun, ItemClickDelegate doubleClickFun, ItemClickDelegate iconClickFun, int shopIndex, Tab_SystemShop tabSysShop)
    {
        if (tabSysShop == null)
        {
            return;
        }
        delItemClick       = clickFun;
        delItemDoubleClick = doubleClickFun;
        delItemIconClick   = iconClickFun;
        int pid = tabSysShop.GetPidbyIndex(shopIndex);

        LabelMoney.text = tabSysShop.GetPricebyIndex(shopIndex).ToString();
        Tab_CommonItem curTabItem = TableManager.GetCommonItemByID(pid, 0);

        if (null == curTabItem)
        {
            LogModule.WarningLog("can not read cur common item talbe :" + pid.ToString());
            return;
        }

        int groupCount = tabSysShop.GetNumPerGroupbyIndex(shopIndex);

        if (groupCount < 0)
        {
            groupCount = 1;
        }

        LabelName.text     = curTabItem.Name;// +"*" + groupCount.ToString();
        sprIcon.spriteName = curTabItem.Icon;
        int colorQuality = curTabItem.Quality - 1;

        if (colorQuality >= 0 && colorQuality < GlobeVar.QualityColorGrid.Length)
        {
            QualitySprite.spriteName = GlobeVar.QualityColorGrid[curTabItem.Quality - 1];
        }


        int moneyType    = tabSysShop.GetMoneyTypebyIndex(shopIndex);
        int moneySubType = tabSysShop.GetMoneySubTypebyIndex(shopIndex);

        if (moneyType == (int)Consume_Type.COIN)
        {
            MoneyIcon.spriteName = "qian5";
        }
        else if (moneyType == (int)Consume_Type.YUANBAO)
        {
            if (moneySubType == (int)Consume_SubType.YUANBAO_NORMAL)
            {
                MoneyIcon.spriteName = "qian2";
            }
            else if (moneySubType == (int)Consume_SubType.YUANBAO_BIND)
            {
                MoneyIcon.spriteName = "qian3";
            }
        }

        m_curGameItem        = new GameItem();
        m_curGameItem.DataID = pid;
    }
Beispiel #29
0
    public void UpdateGiftInfo(Int32 itemId, Int32 itemCount)
    {
        Tab_CommonItem tabItem = TableManager.GetCommonItemByID(itemId, 0);

        m_GiftIcon.spriteName = tabItem.Icon;
        m_GiftName.text       = tabItem.Name;
        m_GiftCount.text      = itemCount.ToString();
    }
Beispiel #30
0
    public void InitInfo(int nTableID)
    {
        Tab_CangJingGeExtraReward tabExtraReward = TableManager.GetCangJingGeExtraRewardByID(nTableID, 0);

        if (null == tabExtraReward)
        {
            LogModule.WarningLog("CangJingGeExtraRewardItem::InitInfo TableID is Invalid!!!");
            Clear();
        }
        else
        {
            Clear();
            ExtraRewardTableID = nTableID;
            m_TierNum.text     = StrDictionary.GetClientDictionaryString("#{2087}", tabExtraReward.TierLimit);
            for (int ii = 0; ii < MAX_ITEM_NUM; ++ii)
            {
                int nItemID = tabExtraReward.GetItemIDbyIndex(ii);
                int nCount  = tabExtraReward.GetItemNumbyIndex(ii);
                if (0 >= nCount || 0 > nItemID)
                {
                    m_Reward[ii].SetActive(false);
                    continue;
                }
                Tab_CommonItem tabItem = TableManager.GetCommonItemByID(nItemID, 0);
                if (null == tabItem)
                {
                    m_Reward[ii].SetActive(false);
                    continue;
                }
                else
                {
                    m_RewardItemIconSprite[ii].spriteName = tabItem.Icon;
                    m_RewardItemCount[ii].text            = nCount.ToString();
                    m_nRewardItemID[ii] = tabItem.Id;
                }
            }

            if (GetReceiveExtraRewardTableID() == ExtraRewardTableID)
            {
                m_BtnReceive.SetActive(true);
                m_CantReceive.SetActive(false);
            }
            else
            {
                m_BtnReceive.SetActive(false);
                m_CantReceive.SetActive(true);
                m_CantReceive.GetComponent <UIWidget>().color = new Color(0, 1, 1, 1);
                if (GameManager.gameManager.PlayerDataPool.CommonData.IsAlreadyReceiveReward(ExtraRewardTableID))
                {
                    m_LabelCantReceive.text = StrDictionary.GetClientDictionaryString("#{10819}");
                }
                else
                {
                    m_LabelCantReceive.text = StrDictionary.GetClientDictionaryString("#{10818}");
                }
            }
        }
    }