protected virtual void Awake()
 {
     base.Awake();
     if (Object.op_Equality((Object)this._recyclingUI, (Object)null))
     {
         this._recyclingUI = (RecyclingUI)((Component)this).GetComponentInParent <RecyclingUI>();
     }
     this.ListController.Bind(this._itemListUI);
 }
 protected override void Awake()
 {
     base.Awake();
     if (!Object.op_Equality((Object)this._recyclingUI, (Object)null))
     {
         return;
     }
     this._recyclingUI = (RecyclingUI)((Component)this).GetComponentInParent <RecyclingUI>();
 }
Beispiel #3
0
 protected override void Awake()
 {
     base.Awake();
     this._numInputField.set_contentType((InputField.ContentType) 2);
     if (!Object.op_Equality((Object)this._recyclingUI, (Object)null))
     {
         return;
     }
     this._recyclingUI = (RecyclingUI)((Component)this).GetComponentInParent <RecyclingUI>();
 }
Beispiel #4
0
        private void FinishedInventoryUISetting()
        {
            this._vieweres = new RecyclingInventoryFacadeViewer[2]
            {
                this._pouchInventoryUI,
                this._chestInventoryUI
            };
            if (this.WarningUIs.IsNullOrEmpty <WarningViewer>())
            {
                List <WarningViewer> toRelease = ListPool <WarningViewer> .Get();

                toRelease.Add(this._pouchWarningViewer);
                toRelease.Add(this._chestWarningViewer);
                toRelease.Add(this._pouchAndChestWarningViewer);
                toRelease.RemoveAll((Predicate <WarningViewer>)(x => Object.op_Equality((Object)x, (Object)null)));
                this.WarningUIs = new WarningViewer[toRelease.Count];
                for (int index = 0; index < toRelease.Count; ++index)
                {
                    this.WarningUIs[index] = toRelease[index];
                }
                ListPool <WarningViewer> .Release(toRelease);
            }
            if (this.MenuUIBehaviours.IsNullOrEmpty <MenuUIBehaviour>())
            {
                List <MenuUIBehaviour> toRelease = ListPool <MenuUIBehaviour> .Get();

                toRelease.Add((MenuUIBehaviour)this);
                toRelease.Add((MenuUIBehaviour)this._infoPanelUI);
                toRelease.Add((MenuUIBehaviour)this._deleteRequestUI);
                toRelease.AddRange((IEnumerable <MenuUIBehaviour>) this._pouchInventoryUI.viewer.MenuUIList);
                toRelease.AddRange((IEnumerable <MenuUIBehaviour>) this._chestInventoryUI.viewer.MenuUIList);
                toRelease.Add((MenuUIBehaviour)this._decidedItemSlotUI.ItemListUI);
                toRelease.Add((MenuUIBehaviour)this._createItemStockUI.ItemListUI);
                toRelease.Add((MenuUIBehaviour)this._createPanelUI);
                toRelease.RemoveAll((Predicate <MenuUIBehaviour>)(x => Object.op_Equality((Object)x, (Object)null)));
                this.MenuUIBehaviours = new MenuUIBehaviour[toRelease.Count];
                for (int index = 0; index < toRelease.Count; ++index)
                {
                    this.MenuUIBehaviours[index] = toRelease[index];
                }
                ListPool <MenuUIBehaviour> .Release(toRelease);
            }
            if (this.ItemListUIBehaviours.IsNullOrEmpty <MenuUIBehaviour>())
            {
                List <MenuUIBehaviour> toRelease = ListPool <MenuUIBehaviour> .Get();

                toRelease.Add((MenuUIBehaviour)this._pouchInventoryUI.itemListUI);
                toRelease.Add((MenuUIBehaviour)this._chestInventoryUI.itemListUI);
                toRelease.Add((MenuUIBehaviour)this._decidedItemSlotUI.ItemListUI);
                toRelease.Add((MenuUIBehaviour)this._createItemStockUI.ItemListUI);
                toRelease.RemoveAll((Predicate <MenuUIBehaviour>)(x => Object.op_Equality((Object)x, (Object)null)));
                this.ItemListUIBehaviours = new MenuUIBehaviour[toRelease.Count];
                for (int index = 0; index < toRelease.Count; ++index)
                {
                    this.ItemListUIBehaviours[index] = toRelease[index];
                }
                ListPool <MenuUIBehaviour> .Release(toRelease);
            }
            if (this.ItemListUIs.IsNullOrEmpty <ItemListUI>())
            {
                List <ItemListUI> toRelease = ListPool <ItemListUI> .Get();

                toRelease.Add(this._pouchInventoryUI.itemListUI);
                toRelease.Add(this._chestInventoryUI.itemListUI);
                toRelease.Add(this._decidedItemSlotUI.ItemListUI);
                toRelease.Add(this._createItemStockUI.ItemListUI);
                toRelease.RemoveAll((Predicate <ItemListUI>)(x => Object.op_Equality((Object)x, (Object)null)));
                this.ItemListUIs = new ItemListUI[toRelease.Count];
                for (int index = 0; index < toRelease.Count; ++index)
                {
                    this.ItemListUIs[index] = toRelease[index];
                }
                ListPool <ItemListUI> .Release(toRelease);
            }
            if (this.ListControllers.IsNullOrEmpty <ItemListController>())
            {
                List <ItemListController> toRelease = ListPool <ItemListController> .Get();

                toRelease.Add(this._pouchInventoryUI.ListController);
                toRelease.Add(this._chestInventoryUI.ListController);
                toRelease.Add(this._decidedItemSlotUI.ListController);
                toRelease.Add(this._createItemStockUI.ListController);
                toRelease.RemoveAll((Predicate <ItemListController>)(x => x == null));
                this.ListControllers = new ItemListController[toRelease.Count];
                for (int index = 0; index < toRelease.Count; ++index)
                {
                    this.ListControllers[index] = toRelease[index];
                }
                ListPool <ItemListController> .Release(toRelease);
            }
            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>((IObservable <M0>) this._infoPanelUI.ClickDecide, (Action <M0>)(_ => this.SendItem(this._infoPanelUI))), (Component)this);
            DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <Unit>((IObservable <M0>) this._infoPanelUI.ClickReturn, (Action <M0>)(_ => this.SendItem(this._infoPanelUI))), (Component)this);
            this._pouchInventoryUI.itemListUI.CurrentChanged  += (Action <int, ItemNodeUI>)((currentID, node) => this.CurrentChanged(PanelType.Pouch, currentID, node));
            this._chestInventoryUI.itemListUI.CurrentChanged  += (Action <int, ItemNodeUI>)((currentID, node) => this.CurrentChanged(PanelType.Chest, currentID, node));
            this._decidedItemSlotUI.ItemListUI.CurrentChanged += (Action <int, ItemNodeUI>)((currentID, node) => this.CurrentChanged(PanelType.DecidedItem, currentID, node));
            this._createItemStockUI.ItemListUI.CurrentChanged += (Action <int, ItemNodeUI>)((currentID, node) =>
            {
                if (Object.op_Equality((Object)node, (Object)null))
                {
                    return;
                }
                this.NonSelection(this._createItemStockUI.ListController);
                this._infoPanelUI.AttachDeleteItem(this._createItemStockUI.ListController, node, currentID);
            });
            this._pouchInventoryUI.ItemNodeOnDoubleClick        = (Action <InventoryFacadeViewer.DoubleClickData>)(data => this.OnDoubleClick(PanelType.Pouch, data.ID, data.node));
            this._chestInventoryUI.ItemNodeOnDoubleClick        = (Action <InventoryFacadeViewer.DoubleClickData>)(data => this.OnDoubleClick(PanelType.Chest, data.ID, data.node));
            this._decidedItemSlotUI.ListController.DoubleClick += (Action <int, ItemNodeUI>)((currentID, nodeUI) => this.OnDoubleClick(PanelType.DecidedItem, currentID, nodeUI));
            this._createItemStockUI.ListController.DoubleClick += (Action <int, ItemNodeUI>)((currentID, nodeUI) => this.OnDoubleClick(PanelType.CreatedItem, currentID, nodeUI));
            if (!this.ItemListUIs.IsNullOrEmpty <ItemListUI>())
            {
                foreach (ItemListUI itemListUi in this.ItemListUIs)
                {
                    ItemListUI  ui          = itemListUi;
                    RecyclingUI recyclingUi = this;
                    if (!Object.op_Equality((Object)ui, (Object)null))
                    {
                        DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <int>(Observable.Where <int>((IObservable <M0>)ui.OnEntered, (Func <M0, bool>)(_ => ((Behaviour)recyclingUi).get_isActiveAndEnabled())), (Action <M0>)(_ => recyclingUi.NonEnabledInput(ui))), (Component)this);
                    }
                }
            }
            if (!this.ListControllers.IsNullOrEmpty <ItemListController>())
            {
                int num = -1;
                foreach (ItemListController listController in this.ListControllers)
                {
                    ++num;
                    if (listController != null)
                    {
                        listController.RefreshEvent += (Action)(() => this.UpdateWarningUI());
                    }
                }
            }
            this.SetActive(false, ((Component)this).get_gameObject());
            this.Initialized = true;
        }