Ejemplo n.º 1
0
        public void OnConfirmButtonCallBack()
        {
            List <StorageDataItemBase> storageItemList = new List <StorageDataItemBase>();

            if (this.storageDataItem is MaterialDataItem)
            {
                StorageDataItemBase item = new MaterialDataItem(ItemMetaDataReader.GetItemMetaDataByKey(this.storageDataItem.ID))
                {
                    number = this._sellItemNumber
                };
                storageItemList.Add(item);
            }
            else
            {
                storageItemList.Add(this.storageDataItem);
            }
            Singleton <NetworkManager> .Instance.RequestEquipmentSell(storageItemList);

            if (!(this.storageDataItem is MaterialDataItem) || (this.storageDataItem.number <= this._sellItemNumber))
            {
                Singleton <MainUIManager> .Instance.BackPageTo("StorageShowPageContext");

                this.Destroy();
            }
        }
Ejemplo n.º 2
0
 private void UpdateSelectedItem(StorageDataItemBase selectedItem)
 {
     this._selectedItem  = (selectedItem == null) ? (this._showItemList[0] as MaterialDataItem) : (selectedItem as MaterialDataItem);
     this._num_materials = 1;
     base.view.transform.Find("Dialog/Content/Materials").GetComponent <MonoGridScroller>().RefreshCurrent();
     this.UpdateInfo();
 }
Ejemplo n.º 3
0
        public DropLinkDialogContext(MaterialDataItem dropItem, Action <LevelDataItem> onDropLinkClick = null)
        {
            ContextPattern pattern = new ContextPattern {
                contextName    = "DropLinkDialogContext",
                viewPrefabPath = "UI/Menus/Dialog/ItemDropLinkDialog"
            };

            base.config   = pattern;
            this.dropItem = dropItem;
            this.SetupLevelList(onDropLinkClick);
        }
Ejemplo n.º 4
0
        private string GetAllDesc()
        {
            string           str         = UIUtil.ProcessStrWithNewLine(this.storageItem.GetDescription());
            MaterialDataItem storageItem = this.storageItem as MaterialDataItem;

            if (storageItem != null)
            {
                string bGDescription = storageItem.GetBGDescription();
                return(string.Format("{0}{1}<color=#a8a8a8ff>{2}</color>", str, Environment.NewLine, bGDescription));
            }
            return(str);
        }
Ejemplo n.º 5
0
 private void UpdateSelectedItem(StorageDataItemBase selectedItem)
 {
     if (selectedItem != null)
     {
         this._selectedItem = selectedItem as MaterialDataItem;
     }
     else
     {
         this._selectedItem = this._showItemList[0] as MaterialDataItem;
     }
     this._useNumber = 1;
     base.view.transform.Find("Dialog/Content/Materials").GetComponent <MonoGridScroller>().RefreshCurrent();
     this.UpdateInfo();
 }
Ejemplo n.º 6
0
        private bool TicketConditionCheck(int ticketID, int num)
        {
            if (!this.IsStorageFull())
            {
                MaterialDataItem item = Singleton <StorageModule> .Instance.TryGetMaterialDataByID(ticketID);

                if ((item != null) && (item.number >= num))
                {
                    return(true);
                }
                Singleton <MainUIManager> .Instance.ShowDialog(new GachaTicketLackDialogContext(ticketID, num), UIType.Any);
            }
            return(false);
        }
Ejemplo n.º 7
0
        public bool ProcessEvoMaterial()
        {
            if (this._data == null)
            {
                this.RealClearContent();
                return(true);
            }
            MaterialDataItem storageItemByTypeAndID = Singleton <StorageModule> .Instance.GetStorageItemByTypeAndID(this._data.GetType(), this._data.ID) as MaterialDataItem;

            if ((storageItemByTypeAndID != null) && (storageItemByTypeAndID.number >= this._data.number))
            {
                return(true);
            }
            base.transform.GetComponent <Image>().color = Color.gray;
            base.transform.Find("Image").GetComponent <Image>().color = Color.gray;
            return(false);
        }
Ejemplo n.º 8
0
        private bool OnGetEquipmentDataRsp(GetEquipmentDataRsp rsp)
        {
            this._useNumber = 1;
            if (Singleton <StorageModule> .Instance.GetStorageItemByTypeAndID(typeof(MaterialDataItem), this._selectedItem.ID) == null)
            {
                this._selectedItem = null;
            }
            if (this._selectedItem == null)
            {
                this._showItemList = Singleton <StorageModule> .Instance.GetAllAvatarExpAddMaterial();

                if (this._showItemList.Count <= 0)
                {
                    this.Destroy();
                    return(false);
                }
                this.SetupList();
            }
            this.UpdateSelectedItem(this._selectedItem);
            return(false);
        }
Ejemplo n.º 9
0
        protected override bool SetupView()
        {
            this.Init();
            base.view.transform.Find("Dialog/ItemButton").GetComponent <MonoStorageItemIcon>().SetupView(this.storageDataItem, base.view.transform.Find("Dialog"), null, -1, this.storageDataItem.GetType(), true);
            bool flag = this.storageDataItem is MaterialDataItem;

            this._oneItemSellInfoPanel.SetActive(!flag);
            this._multipItemSellInfoPanel.SetActive(flag);
            if (flag)
            {
                MaterialDataItem storageDataItem = this.storageDataItem as MaterialDataItem;
                this._sellItemNumber = 1;
                this._maxItemNumber  = storageDataItem.number;
                this.OnSellNumChange();
            }
            else
            {
                base.view.transform.Find("Dialog/OneItemSellInfoPanel/CoinGotNumber").GetComponent <Text>().text = Mathf.FloorToInt(this.storageDataItem.GetPriceForSell()).ToString();
            }
            return(false);
        }