Example #1
0
 /*void OnClickGemItem1(int nItemID, ItemSlotLogic.SLOT_TYPE eItemType, string strSlotName)
  * {
  *  if (m_NewPlayerGuide_Step == 1)
  *  {
  *      NewPlayerGuide(2);
  *  }
  *  if (m_NewPlayerGuide_Step == 4)
  *  {
  *      NewPlayerGuide(5);
  *  }
  *  int ItemIndex = (m_CurGemItemPage - 1) * (int)CONSTVALUE.GEM_ITEM_NUM + 0;
  *  if (ItemIndex >= 0 && ItemIndex < m_GemItemList.Count)
  *  {
  *      ClearGemItemChoose();
  *      m_CurGemItem = m_GemItemList[ItemIndex];
  *      m_GemItem[0].ItemSlotChoose();
  *      ShowChooseGemInfo(m_CurGemItem);
  *  }
  * }
  *
  * void OnClickGemItem2(int nItemID, ItemSlotLogic.SLOT_TYPE eItemType, string strSlotName)
  * {
  *  int ItemIndex = (m_CurGemItemPage - 1) * (int)CONSTVALUE.GEM_ITEM_NUM + 1;
  *  if (ItemIndex >= 0 && ItemIndex < m_GemItemList.Count)
  *  {
  *      ClearGemItemChoose();
  *      m_CurGemItem = m_GemItemList[ItemIndex];
  *      m_GemItem[1].ItemSlotChoose();
  *      ShowChooseGemInfo(m_CurGemItem);
  *  }
  * }
  *
  * void OnClickGemItem3(int nItemID, ItemSlotLogic.SLOT_TYPE eItemType, string strSlotName)
  * {
  *  int ItemIndex = (m_CurGemItemPage - 1) * (int)CONSTVALUE.GEM_ITEM_NUM + 2;
  *  if (ItemIndex >= 0 && ItemIndex < m_GemItemList.Count)
  *  {
  *      ClearGemItemChoose();
  *      m_CurGemItem = m_GemItemList[ItemIndex];
  *      m_GemItem[2].ItemSlotChoose();
  *      ShowChooseGemInfo(m_CurGemItem);
  *  }
  * }
  *
  * void OnClickGemItem4(int nItemID, ItemSlotLogic.SLOT_TYPE eItemType, string strSlotName)
  * {
  *  int ItemIndex = (m_CurGemItemPage - 1) * (int)CONSTVALUE.GEM_ITEM_NUM + 3;
  *  if (ItemIndex >= 0 && ItemIndex < m_GemItemList.Count)
  *  {
  *      ClearGemItemChoose();
  *      m_CurGemItem = m_GemItemList[ItemIndex];
  *      m_GemItem[3].ItemSlotChoose();
  *      ShowChooseGemInfo(m_CurGemItem);
  *  }
  * }
  *
  * void OnClickGemItem5(int nItemID, ItemSlotLogic.SLOT_TYPE eItemType, string strSlotName)
  * {
  *  int ItemIndex = (m_CurGemItemPage - 1) * (int)CONSTVALUE.GEM_ITEM_NUM + 4;
  *  if (ItemIndex >= 0 && ItemIndex < m_GemItemList.Count)
  *  {
  *      ClearGemItemChoose();
  *      m_CurGemItem = m_GemItemList[ItemIndex];
  *      m_GemItem[4].ItemSlotChoose();
  *      ShowChooseGemInfo(m_CurGemItem);
  *  }
  * }
  *
  * void OnClickGemItem6(int nItemID, ItemSlotLogic.SLOT_TYPE eItemType, string strSlotName)
  * {
  *  int ItemIndex = (m_CurGemItemPage - 1) * (int)CONSTVALUE.GEM_ITEM_NUM + 5;
  *  if (ItemIndex >= 0 && ItemIndex < m_GemItemList.Count)
  *  {
  *      ClearGemItemChoose();
  *      m_CurGemItem = m_GemItemList[ItemIndex];
  *      m_GemItem[5].ItemSlotChoose();
  *      ShowChooseGemInfo(m_CurGemItem);
  *  }
  * }
  *
  * void OnClickGemItem7(int nItemID, ItemSlotLogic.SLOT_TYPE eItemType, string strSlotName)
  * {
  *  int ItemIndex = (m_CurGemItemPage - 1) * (int)CONSTVALUE.GEM_ITEM_NUM + 6;
  *  if (ItemIndex >= 0 && ItemIndex < m_GemItemList.Count)
  *  {
  *      ClearGemItemChoose();
  *      m_CurGemItem = m_GemItemList[ItemIndex];
  *      m_GemItem[6].ItemSlotChoose();
  *      ShowChooseGemInfo(m_CurGemItem);
  *  }
  * }
  *
  * void OnClickGemItem8(int nItemID, ItemSlotLogic.SLOT_TYPE eItemType, string strSlotName)
  * {
  *  int ItemIndex = (m_CurGemItemPage - 1) * (int)CONSTVALUE.GEM_ITEM_NUM + 7;
  *  if (ItemIndex >= 0 && ItemIndex < m_GemItemList.Count)
  *  {
  *      ClearGemItemChoose();
  *      m_CurGemItem = m_GemItemList[ItemIndex];
  *      m_GemItem[7].ItemSlotChoose();
  *      ShowChooseGemInfo(m_CurGemItem);
  *  }
  * }
  */
 void ClearGemItemChoose()
 {
     /*for (int i = 0; i < (int)CONSTVALUE.GEM_ITEM_NUM; i++)
      * {
      *  m_GemItem[i].ItemSlotChooseCancel();
      * }*/
     for (int nIndex = 0; nIndex < GameItemContainer.MAXSIZE_BACKPACK; ++nIndex)
     {
         Transform ItemTrans = m_GemListGrid.transform.FindChild((nIndex + 1000).ToString());
         if (ItemTrans != null && ItemTrans.gameObject && ItemTrans.gameObject.activeInHierarchy)
         {
             Transform child = ItemTrans.FindChild("ItemSlot");
             if (child != null)
             {
                 ItemSlotLogic tempIS = child.gameObject.GetComponent <ItemSlotLogic>();
                 if (null != tempIS)
                 {
                     tempIS.ItemSlotChooseCancel();
                 }
             }
         }
     }
     ClearChooseGemInfo();
     m_CurGemItem = null;
 }
Example #2
0
    public void ClickGemInList(GameObject obj)
    {
        if (m_NewPlayerGuide_Step == 1)
        {
            NewPlayerGuide(2);
        }
        if (m_NewPlayerGuide_Step == 4)
        {
            NewPlayerGuide(5);
        }
        int ItemIndex = System.Convert.ToInt32(obj.name) - 1000;

        if (ItemIndex >= 0 && ItemIndex < m_GemItemList.Count)
        {
            ClearGemItemChoose();
            m_CurGemItem = m_GemItemList[ItemIndex];

            Transform transform = obj.transform.FindChild("ItemSlot");
            if (transform != null)
            {
                ItemSlotLogic tempIS = transform.gameObject.GetComponent <ItemSlotLogic>();
                if (tempIS != null)
                {
                    tempIS.ItemSlotChoose();
                }
            }
            ShowChooseGemInfo(m_CurGemItem);
        }
    }
 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);
     }
 }
 public static void ShowEquipTooltip(GameItem equip, ShowType type, ItemSlotLogic slot = null)
 {
     m_curItem     = equip;
     m_curType     = type;
     m_curItemSlot = slot;
     UIManager.ShowUI(UIInfo.EquipTooltipsRoot, EquipTooltipsLogic.OnShowEquipTip);
 }
    public static void ShowEquipTooltip(int dataId, ShowType type, ItemSlotLogic slot = null)
    {
        GameItem item = new GameItem();

        item.DataID = dataId;
        if (item.IsValid() && item.IsEquipMent())
        {
            ShowEquipTooltip(item, type, slot);
        }
    }
Example #6
0
    public void ChooseStuff(GameItem chooseitem, ItemSlotLogic slot)
    {
        if (chooseitem == null || !chooseitem.IsValid())
        {
            return;
        }
        // 格子数量上限6
        int nCurStuffNum = m_ChooseStuffGuid.Count;

        if (nCurStuffNum >= StuffSlotMax)
        {
            Singleton <ObjManager> .Instance.MainPlayer.SendNoticMsg(false, "#{2076}");

            return;
        }

        // 不可重复放入物品
        for (int i = 0; i < m_ChooseStuffGuid.Count; i++)
        {
            GameItem item = GameManager.gameManager.PlayerDataPool.BackPack.GetItemByGuid(m_ChooseStuffGuid[i]);
            if (item != null && item.IsValid())
            {
                if (item.Guid == chooseitem.Guid)
                {
                    Singleton <ObjManager> .Instance.MainPlayer.SendNoticMsg(false, "#{2173}");

                    return;
                }
            }
        }

        if (m_ChooseStuffKinds.ContainsKey(chooseitem.DataID))
        {
            m_ChooseStuffKinds[chooseitem.DataID] += chooseitem.StackCount;
        }
        else
        {
            m_ChooseStuffKinds.Add(chooseitem.DataID, chooseitem.StackCount);
        }

        m_StuffSlotArray[nCurStuffNum].InitInfo_Item(chooseitem.DataID, StuffSlotOnClick, chooseitem.StackCount.ToString());
        m_StuffSlotArray[nCurStuffNum].ItemSlotEnable();
        m_ChooseStuffGuid.Add(chooseitem.Guid);

        slot.SetItemSlotChoose(true);

        ClearProductSlot();

        //显示合成说明过滤界面
        ShowFilter();
    }
Example #7
0
    /// <summary>
    /// 更新宝石物品
    /// </summary>
    public void UpdateGemItemList()
    {
        GameItemContainer BackPack = GameManager.gameManager.PlayerDataPool.BackPack;

        m_GemItemList = ItemTool.ItemFilter(BackPack, (int)ItemClass.STRENGTHEN, (int)StrengthenSubClass.GEM);
        m_GemItemList = GemFilter(m_GemItemList);

        for (int nIndex = 0; nIndex < GameItemContainer.MAXSIZE_BACKPACK; ++nIndex)
        {
            Transform ItemTrans = m_GemListGrid.transform.FindChild((nIndex + 1000).ToString());
            if (ItemTrans != null)
            {
                if (nIndex < m_GemItemList.Count)
                {
                    ItemTrans.gameObject.SetActive(true);
                    Transform child = ItemTrans.FindChild("ItemSlot");
                    if (child != null)
                    {
                        ItemSlotLogic tempIS = child.gameObject.GetComponent <ItemSlotLogic>();
                        if (null != tempIS)
                        {
                            tempIS.InitInfo(ItemSlotLogic.SLOT_TYPE.TYPE_ITEM,
                                            m_GemItemList[nIndex].DataID,
                                            null,
                                            m_GemItemList[nIndex].StackCount.ToString(),
                                            true);
                        }
                    }
                }
                else
                {
                    ItemTrans.gameObject.SetActive(false);
                }
            }
        }
        ClearGemItemChoose();
    }
Example #8
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();
    }