Example #1
0
 // Token: 0x06000296 RID: 662 RVA: 0x00009F70 File Offset: 0x00008370
 public void CloseBagScrollView1Result(Item.Type itemType, int btnId, int itemId)
 {
     this.ChangeButton.GetComponent <Button>().enabled = true;
     base.GetComponentInParent <FlickCheaker>().stopFlick(false);
     if (itemType == Item.Type.NONE)
     {
         return;
     }
     if (itemType != Item.Type._ElmMax)
     {
         ItemDataFormat itemDataFormat = SuperGameMaster.sDataBase.get_ItemDB_forId(itemId);
         if (itemDataFormat == null)
         {
             return;
         }
         this.BagButton[btnId].GetComponent <BagPanelButton>().CngItemImage(itemDataFormat.img);
         this.tmpBagList[btnId] = itemId;
     }
     else
     {
         this.BagButton[btnId].GetComponent <BagPanelButton>().CngItemImage(this.DefaultSplite);
         this.tmpBagList[btnId] = -1;
     }
     if (this.DeskPanel)
     {
         this.ResetBtnEnableCheck();
     }
 }
Example #2
0
 // Token: 0x060003D7 RID: 983 RVA: 0x00018117 File Offset: 0x00016517
 public void OpenScrollView(GameObject _callObj, ItemScrollView.Mode _setListMode, int _setId, Item.Type _itemType)
 {
     this.CallObj     = _callObj;
     this.listMode    = _setListMode;
     this.setId       = _setId;
     this.setItemType = _itemType;
     this.OpenScrollView();
 }
Example #3
0
    // Token: 0x060003DB RID: 987 RVA: 0x000184F4 File Offset: 0x000168F4
    public void CreateButton(Item.Type itemType)
    {
        RectTransform component = this.contentsList.GetComponent <RectTransform>();

        this.DeleteButtonAll();
        List <int> list = new List <int>();

        if (this.listMode == ItemScrollView.Mode.Equip)
        {
            list = this.CallObj.GetComponent <BagPanel>().Get_tmpItemListAll();
        }
        else
        {
            list.AddRange(SuperGameMaster.GetBagList());
            list.AddRange(SuperGameMaster.GetDeskList());
        }
        using (List <ItemListFormat> .Enumerator enumerator = SuperGameMaster.saveData.ItemList.GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                ItemListFormat item           = enumerator.Current;
                ItemDataFormat itemDataFormat = SuperGameMaster.sDataBase.get_ItemDB_forId(item.id);
                if (itemDataFormat != null)
                {
                    if (itemType == Item.Type.NONE || itemDataFormat.type == itemType)
                    {
                        GameObject gameObject;
                        if (itemDataFormat.type != Item.Type.Specialty)
                        {
                            gameObject = UnityEngine.Object.Instantiate <GameObject>(this.btnPref);
                            gameObject.transform.SetParent(component, false);
                            gameObject.GetComponent <ItemButton>().CngItemName(itemDataFormat.name);
                            gameObject.GetComponent <ItemButton>().CngItemInfo(itemDataFormat.info);
                        }
                        else
                        {
                            gameObject = UnityEngine.Object.Instantiate <GameObject>(this.spe_btnPref);
                            gameObject.transform.SetParent(this.spe_contentsList.GetComponent <RectTransform>(), false);
                        }
                        gameObject.GetComponent <ItemButton>().setItemId(itemDataFormat.id, itemDataFormat.type);
                        gameObject.GetComponent <ItemButton>().CngImage(itemDataFormat.img);
                        gameObject.GetComponent <ItemButton>().ItemScrollView = base.gameObject;
                        ItemScrollView.Mode mode = this.listMode;
                        if (mode != ItemScrollView.Mode.View)
                        {
                            if (mode != ItemScrollView.Mode.Present)
                            {
                                if (mode == ItemScrollView.Mode.Equip)
                                {
                                    if (itemDataFormat.spend)
                                    {
                                        int num = item.stock;
                                        if (list.FindIndex((int itemId) => itemId.Equals(item.id)) != -1)
                                        {
                                            foreach (int num2 in list)
                                            {
                                                if (num2 == item.id)
                                                {
                                                    num--;
                                                }
                                            }
                                        }
                                        gameObject.GetComponent <ItemButton>().CngStockNum(num);
                                        if (this.CallObj.GetComponent <BagPanel>().tmpBagList[this.setId] == itemDataFormat.id)
                                        {
                                            gameObject.GetComponent <ItemButton>().Fade(new Color(0.7f, 0.7f, 0.7f));
                                            gameObject.GetComponent <ItemButton>().SetCheckImage(true);
                                            gameObject.GetComponent <ItemButton>().setItemId(-2, Item.Type._ElmMax);
                                        }
                                        else if (num <= 0)
                                        {
                                            UnityEngine.Object.Destroy(gameObject);
                                        }
                                    }
                                    else
                                    {
                                        if (list.FindIndex((int itemId) => itemId.Equals(item.id)) != -1)
                                        {
                                            gameObject.GetComponent <Button>().interactable = false;
                                            if (this.CallObj.GetComponent <BagPanel>().tmpBagList[this.setId] == itemDataFormat.id)
                                            {
                                                gameObject.GetComponent <ItemButton>().SetCheckImage(true);
                                                gameObject.GetComponent <ItemButton>().Fade(new Color(0.7f, 0.7f, 0.7f));
                                                gameObject.GetComponent <ItemButton>().setItemId(-2, Item.Type._ElmMax);
                                                gameObject.GetComponent <Button>().interactable = true;
                                            }
                                            else
                                            {
                                                gameObject.GetComponent <ItemButton>().Fade(new Color(0.7f, 0.7f, 0.7f));
                                            }
                                        }
                                        gameObject.GetComponent <ItemButton>().CngStockNum(-2);
                                    }
                                }
                            }
                            else if (itemDataFormat.spend)
                            {
                                int num3 = item.stock;
                                if (list.FindIndex((int itemId) => itemId.Equals(item.id)) != -1)
                                {
                                    foreach (int num4 in list)
                                    {
                                        if (num4 == item.id)
                                        {
                                            num3--;
                                        }
                                    }
                                }
                                if (num3 > 0)
                                {
                                    gameObject.GetComponent <ItemButton>().CngStockNum(num3);
                                }
                                else
                                {
                                    UnityEngine.Object.Destroy(gameObject);
                                }
                            }
                            else
                            {
                                gameObject.GetComponent <ItemButton>().CngStockNum(-2);
                            }
                        }
                        else
                        {
                            gameObject.GetComponent <Button>().enabled = false;
                            if (itemDataFormat.spend)
                            {
                                int num5 = item.stock;
                                if (list.FindIndex((int itemId) => itemId.Equals(item.id)) != -1)
                                {
                                    foreach (int num6 in list)
                                    {
                                        if (num6 == item.id)
                                        {
                                            num5--;
                                        }
                                    }
                                }
                                if (num5 > 0)
                                {
                                    gameObject.GetComponent <ItemButton>().CngStockNum(num5);
                                }
                                else
                                {
                                    UnityEngine.Object.Destroy(gameObject);
                                }
                            }
                            else
                            {
                                gameObject.GetComponent <ItemButton>().CngStockNum(-2);
                            }
                        }
                    }
                }
            }
        }
    }
Example #4
0
 // Token: 0x0600022A RID: 554 RVA: 0x000072BD File Offset: 0x000056BD
 public void setItemId(int id, Item.Type type)
 {
     this.itemId   = id;
     this.itemType = type;
 }
Example #5
0
 // Token: 0x06000295 RID: 661 RVA: 0x00009F36 File Offset: 0x00008336
 public void OpenBagScrollView(Item.Type itemType, int btnId)
 {
     this.ChangeButton.GetComponent <Button>().enabled = false;
     base.GetComponentInParent <FlickCheaker>().stopFlick(true);
     this.ItemView.GetComponent <ItemScrollView>().OpenScrollView(base.gameObject, ItemScrollView.Mode.Equip, btnId, itemType);
 }