public void InitPrize()
 {
     m_ItemSlot1.InitInfo_Item(GetPrizeEquipId(), ItemSlotLogic.OnClickOpenTips);
     m_ItemSlot2.InitInfo_YuanbaoBind();
     m_ItemSlot3.InitInfo_Item(PrizeItemId1, ItemSlotLogic.OnClickOpenTips, PrizeItemNum1.ToString(), true);
     m_ItemSlot4.InitInfo_Item(PrizeItemId2, ItemSlotLogic.OnClickOpenTips, PrizeItemNum2.ToString(), true);
 }
Пример #2
0
 public void InitPrize()
 {
     m_ItemSlot1.InitInfo_YuanbaoBind();
     m_Num1.text = BindYuanBaoNum.ToString();
     m_ItemSlot2.InitInfo_Item(ItemId, ItemSlotLogic.OnClickOpenTips, "", false);
     m_Num2.text = ItemNum.ToString();
 }
Пример #3
0
 void ShowPrizeItem(ItemSlotLogic itemSlot, int id, int num)
 {
     itemSlot.gameObject.SetActive(true);
     if (id < 0)
     {
         itemSlot.gameObject.SetActive(false);
     }
     else if (id == 0)
     {
         //金币
         itemSlot.InitInfo_Coin(null, num.ToString(), true);
     }
     else if (id == 1)
     {
         //元宝
         itemSlot.InitInfo_Yuanbao(null, num.ToString(), true);
     }
     else if (id == 2)
     {
         //绑定元宝
         itemSlot.InitInfo_YuanbaoBind(null, num.ToString(), true);
     }
     else
     {
         //物品
         itemSlot.InitInfo_Item(id, ItemSlotLogic.OnClickOpenTips, num.ToString(), true);
     }
 }
Пример #4
0
    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;
    }
Пример #5
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;
    }
Пример #6
0
 public void UpdateItem(GameItem item)
 {
     m_ArrowUpSprite.gameObject.SetActive(false);
     m_ArrowDownSprite.gameObject.SetActive(false);
     m_ItemSlot.InitInfo_Item(item.DataID, null, item.StackCount.ToString());
     m_Item = item;
 }
Пример #7
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);
     }
 }
Пример #8
0
    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);
        }
    }
Пример #9
0
 public void UpdateItem(GameItem item)
 {
     m_ArrowUpSprite.gameObject.SetActive(false);
     m_ArrowDownSprite.gameObject.SetActive(false);
     m_ItemSlot.InitInfo_Item(item.DataID, null, item.StackCount.ToString());
     m_ItemSlotBgSprite.spriteName = "Quality-Normal";
     m_Item  = item;
     mIsLock = false;
 }
Пример #10
0
    private void SetItemSlotInfo(GameItem item)
    {
        if (item != null && item.IsValid())
        {
            m_ItemSlot.InitInfo_Item(item.DataID, ItemSlotOnClick, item.StackCount.ToString());

            if (BackPackLogic.Instance().m_QianKunDai != null)
            {
                m_ItemSlot.SetItemSlotChoose(BackPackLogic.Instance().m_QianKunDai.IsInStuffChoose(item));
            }
        }
    }
Пример #11
0
    public void Init(Tab_GuildShop tabShopItem)
    {
        if (tabShopItem == null)
        {
            return;
        }

        m_ItemSlot.InitInfo_Item(
            tabShopItem.ItemID,
            ItemSlotLogic.OnClickOpenTips,
            tabShopItem.StackSize > 1 ? tabShopItem.StackSize.ToString() : "",
            tabShopItem.StackSize > 1);
    }
    public void Init(Tab_GongZhanReward reward)
    {
        if (reward == null)
        {
            return;
        }

        m_Id               = reward.Id;
        m_ItemId           = reward.ItemId;
        m_ZhanKuangPaiNeed = reward.ZhanKuangPaiNeed;

        m_ItemSlot.InitInfo_Item(m_ItemId, ShowRewardTooltips);
        m_ExchangeLabel.text = StrDictionary.GetClientDictionaryString("#{5362}", m_ZhanKuangPaiNeed);
    }
 public void InitInfoForStaticProduct(int nFormulaID)
 {
     Tab_LivingSkill tabLivingSkill = TableManager.GetLivingSkillByID(nFormulaID, 0);
     if (tabLivingSkill == null)
     {
         return;
     }
     m_FormulaID = nFormulaID;
     m_NameLabel.text = tabLivingSkill.Name;
     //m_NameLabel2.text = tabLivingSkill.Name;
     m_InfoLabel.text = tabLivingSkill.Info;
     m_ItemSlot.InitInfo_Item(tabLivingSkill.StaticProductItemId, ShowStaticProductTips);
     UpdateEnableState();
 }
    /// <summary>
    /// 打开元素技能升级界面
    /// </summary>
    /// <param name="skillid"></param>
    public void OnElementSkillLevelUpClick(int skillid)
    {
        Tab_CabalFellowElementSkill tabCurSkill = TableManager.GetCabalFellowElementSkillByID(skillid, 0);

        if (tabCurSkill == null)
        {
            return;
        }

        m_SkillLevelUpWindow.SetActive(true);
        m_LevelUpWindowType = LEVELUP_WINDOWTYPE.TYPE_ELEMENT;

        //m_TalentSkillBookBtn.SetActive(false);

        m_SkillCurLevel.InitElementSkill(skillid);

        m_SkillLevelUpCostName.text = StrDictionary.GetClientDictionaryString("#{10193}");

        int           nNextSkillId = tabCurSkill.NextSkillId;
        UIImageButton upgradeBtn   = skillbookArea.transform.parent.FindChild("OKButton").GetComponent <UIImageButton>();

        if (nNextSkillId == GlobeVar.INVALID_ID)
        {
            // 满级
            m_SkillNextLevel.InitElementSkill(skillid);
            skillbookArea.SetActive(false);
            upgradeBtn.isEnabled = false;
        }
        else
        {
            // 非满级
            skillbookArea.SetActive(true);
            upgradeBtn.isEnabled = true;
            m_SkillBookSlot.InitInfo_Item(tabCurSkill.NeedBookId, ItemSlotLogic.OnClickOpenTips);
            if (tabCurSkill.NeedBookCount > 0)
            {
                m_SkillLevelUpCostSprite.value = (float)GameManager.gameManager.PlayerDataPool.BackPack.GetItemCountByDataId(tabCurSkill.NeedBookId) / (float)tabCurSkill.NeedBookCount;
            }
            m_SkillLevelUpCostLabel.text = GameManager.gameManager.PlayerDataPool.BackPack.GetItemCountByDataId(tabCurSkill.NeedBookId).ToString() + "/" + tabCurSkill.NeedBookCount.ToString();

            m_SkillNextLevel.InitElementSkill(tabCurSkill.NextSkillId);
            InitGetInfoDialog(tabCurSkill.NeedBookId);
        }

        m_LevelUpSkillChooseBuffer = skillid;
    }
Пример #15
0
    public void Init()
    {
        Dictionary <int, OnlineAwardLine> DataTab = GameManager.gameManager.PlayerDataPool.AwardActivityData.New7DayOnlineAwardTable;
        List <int> GetList = GameManager.gameManager.PlayerDataPool.AwardActivityData.New7DayGetList;

        if (DataTab != null && ItemPerObj != null && GetList != null)
        {
            if (childWindows.Length < 3 || childWindows[2] == null)
            {
                return;
            }
            Transform par = childWindows[2].transform;
            UIGrid    ug  = childWindows[2].GetComponent <UIGrid>();
            if (ug != null)
            {
                ug.repositionNow = true;
            }
            foreach (KeyValuePair <int, OnlineAwardLine> pair in DataTab)
            {
                if (pair.Value.ID < 0)
                {
                    return;
                }
                GameObject go;
                if (!AwardKeyFindGoDic.TryGetValue(pair.Value.ID, out go))
                {
                    go = GameObject.Instantiate(ItemPerObj) as GameObject;
                    //}
                    if (go != null)
                    {
                        if (GetList[pair.Value.ID] == 1)
                        {
                            go.transform.name = "z" + pair.Value.ID;
                        }
                        else
                        {
                            go.transform.name = pair.Value.ID.ToString();
                        }
                        go.transform.parent        = par;
                        go.transform.localPosition = Vector3.zero;
                        go.transform.localScale    = Vector3.one;
                        //OnlineAwardLine直接操作
                        AwardKeyFindGoDic.Add(pair.Value.ID, go);
                        int sign = 0;
                        if (pair.Value.Exp > 0)
                        {
                            ++sign;
                            Transform tf = go.transform.Find("Item0" + sign + "/ItemSlot");
                            if (tf != null)
                            {
                                ItemSlotLogic isl = tf.GetComponent <ItemSlotLogic>();
                                if (isl != null)
                                {
                                    isl.InitInfo_PlayerExp("x" + pair.Value.Exp, ItemSlotLogic.OnClickOpenTips);
                                }
                            }
                        }
                        if (pair.Value.Money > 0)
                        {
                            ++sign;
                            Transform tf = go.transform.Find("Item0" + sign + "/ItemSlot");
                            if (tf != null)
                            {
                                ItemSlotLogic isl = tf.GetComponent <ItemSlotLogic>();
                                if (isl != null)
                                {
                                    isl.InitInfo_Coin(ItemSlotLogic.OnClickOpenTips, "x" + pair.Value.Money, true);
                                }
                            }
                        }
                        if (pair.Value.BindYuanbao > 0)
                        {
                            ++sign;
                            Transform tf = go.transform.Find("Item0" + sign + "/ItemSlot");
                            if (tf != null)
                            {
                                ItemSlotLogic isl = tf.GetComponent <ItemSlotLogic>();
                                if (isl != null)
                                {
                                    isl.InitInfo_YuanbaoBind(ItemSlotLogic.OnClickOpenTips, "x" + pair.Value.BindYuanbao, true);
                                }
                            }
                        }
                        if (pair.Value.Item1DataID > -1)
                        {
                            if (sign > 2)
                            {
                                return;
                            }
                            ++sign;
                            Transform tf = go.transform.Find("Item0" + sign + "/ItemSlot");
                            if (tf != null)
                            {
                                ItemSlotLogic isl = tf.GetComponent <ItemSlotLogic>();
                                if (isl != null)
                                {
                                    isl.InitInfo_Item(pair.Value.Item1DataID, ItemSlotLogic.OnClickOpenTips, "x" + pair.Value.Item1Count, true);
                                }
                            }
                        }
                        if (pair.Value.Item2DataID > -1)
                        {
                            if (sign > 2)
                            {
                                return;
                            }
                            ++sign;
                            Transform tf = go.transform.Find("Item0" + sign + "/ItemSlot");
                            if (tf != null)
                            {
                                ItemSlotLogic isl = tf.GetComponent <ItemSlotLogic>();
                                if (isl != null)
                                {
                                    isl.InitInfo_Item(pair.Value.Item2DataID, ItemSlotLogic.OnClickOpenTips, "x" + pair.Value.Item2count, true);
                                }
                            }
                        }
                        for (int i = 1; i < 4; ++i)
                        {
                            Transform tf = go.transform.Find("Item0" + i);
                            if (tf != null)
                            {
                                if (i > sign)
                                {
                                    tf.gameObject.SetActive(false);
                                }
                                else
                                {
                                    tf.gameObject.SetActive(true);
                                }
                            }
                        }
                        {
                            Transform tf = go.transform.Find("Reward-Des");
                            if (tf != null)
                            {
                                UILabel ul = tf.GetComponent <UILabel>();
                                if (ul != null)
                                {
                                    ul.text = GCGame.Table.StrDictionary.GetClientDictionaryString(string.Format("#{{{0}}}", ul.curDicID), pair.Value.LeftTime / 60);
                                }
                            }
                        }
                        LabelData labelData;
                        if (!LabelTimeDic.TryGetValue(pair.Value.ID, out labelData))
                        {
                            UILabel   UILabelCounting  = null;
                            UILabel   UILabelAvailable = null;
                            UILabel   UIFinish         = null;
                            Transform tftime           = go.transform.Find("Time");
                            if (tftime != null)
                            {
                                Transform tf0 = tftime.Find("Time-Counting");
                                if (tf0 != null)
                                {
                                    UILabelCounting = tf0.GetComponent <UILabel>();
                                }
                                Transform tf1 = tftime.Find("Time-Available");
                                if (tf1 != null)
                                {
                                    UILabelAvailable = tf1.GetComponent <UILabel>();
                                }
                                Transform tf2 = tftime.Find("Time-Finished");
                                if (tf2 != null)
                                {
                                    UIFinish = tf1.GetComponent <UILabel>();
                                }
                                //buttonPar = go.transform.Find("Reward01-Btn");
                                LabelTimeDic.Add(pair.Value.ID, new LabelData(pair.Value.ID, UILabelCounting, UILabelAvailable, UIFinish, go));
                            }
                        }
                    }
                }
                else if (go != null)
                {
                    if (GetList[pair.Value.ID] == 1)
                    {
                        go.transform.name = "z" + pair.Value.ID;
                    }
                    else
                    {
                        go.transform.name = pair.Value.ID.ToString();
                    }
                }
            }
            if (childWindows.Length > 1)
            {
                UILabel ul = childWindows[1].GetComponent <UILabel>();
                if (ul != null)
                {
                    ul.text = GCGame.Table.StrDictionary.GetClientDictionaryString(string.Format("#{{{0}}}", ul.curDicID), DataTab.Count);
                }
            }
        }
        int nowCountId = GameManager.gameManager.PlayerDataPool.AwardActivityData.New7DayOnlineAwardID;
        int time       = 0;
        Dictionary <int, OnlineAwardLine> dataDic = GameManager.gameManager.PlayerDataPool.AwardActivityData.New7DayOnlineAwardTable;
        OnlineAwardLine data;

        if (!dataDic.TryGetValue(nowCountId, out data))
        {
            if (nowCountId > dataDic.Count - 1)
            {
                time = dataDic[dataDic.Count - 1].LeftTime + (nowCountId - dataDic.Count) * 600;
            }
            else
            {
                return;
            }
        }
        else
        {
            time = data.LeftTime;
        }
        int datalefttime = GameManager.gameManager.PlayerDataPool.AwardActivityData.New7DayLeftTime;

        lastTime = Time.realtimeSinceStartup;
        int livetime = Mathf.RoundToInt(lastTime - GameManager.gameManager.PlayerDataPool.AwardActivityData.New7DayBeginTime);

        pastTime = time - datalefttime + livetime - 1;
        UpdateCountdown();
    }