示例#1
0
        protected void OpenInventory(int cnt, List <StuffItem> itemList)
        {
            MapUIContainer.ReserveSystemMenuMode(SystemMenuUI.MenuMode.InventoryEnter);
            SystemMenuUI          systemUI    = MapUIContainer.SystemMenuUI;
            InventoryUIController inventoryUI = systemUI.InventoryEnterUI;

            inventoryUI.isConfirm = true;
            inventoryUI.CountViewerVisible(true);
            inventoryUI.itemList = (Func <List <StuffItem> >)(() => itemList);
            inventoryUI.SetItemFilter(InventoryBase.ToFilter(this.GetArgToSplitLastTable(cnt)));
            inventoryUI.OnSubmit = (Action <StuffItem>)(item =>
            {
                this.Item = item;
                InventoryUIController inventoryUiController = inventoryUI;
                if (inventoryUiController == null)
                {
                    return;
                }
                inventoryUiController.OnClose();
            });
            inventoryUI.OnClose = (Action)(() =>
            {
                inventoryUI.OnSubmit = (Action <StuffItem>)null;
                inventoryUI.IsActiveControl = false;
                systemUI.IsActiveControl = false;
                Singleton <Input> .Instance.FocusLevel = 0;
                Singleton <Input> .Instance.ReserveState(Input.ValidType.UI);
                this.isClose = true;
                inventoryUI.OnClose = (Action)null;
            });
            MapUIContainer.SetActiveSystemMenuUI(true);
        }