Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
            static void Draw(int id)
            {
                GUILayout.BeginArea(innerRect);
                {
                    GUILayout.BeginVertical();
                    {
                        GUILayout.Label("You Died", labelStyle);
                        GUILayout.Label("Change your player character or revive.", subLabelStyle);

                        if (PlayerDeath.Value != DeathType.PermaDeath)
                        {
                            GUILayout.Label("Revived character will lose all items, equipment and skills", subLabelStyle);
                        }

                        GUILayout.BeginHorizontal();
                        {
                            GUILayout.FlexibleSpace();
                            GUILayout.BeginVertical();
                            {
                                if (PlayerDeath.Value != DeathType.PermaDeath)
                                {
                                    if (GUILayout.Button("Revive"))
                                    {
                                        Status.RevivePlayer();
                                    }
                                }

                                if (GUILayout.Button("Device Menu"))
                                {
                                    OpenDeviceMenu();
                                }

                                if (GUILayout.Button("System Menu"))
                                {
                                    MapUIContainer.SetActiveSystemMenuUI(true);
                                }
                            }
                            GUILayout.EndVertical();
                            GUILayout.FlexibleSpace();
                        }
                        GUILayout.EndHorizontal();
                    }
                    GUILayout.EndVertical();
                }
                GUILayout.EndArea();
            }
Ejemplo n.º 3
0
 protected override void OnAwake(PlayerActor player)
 {
     player.EventKey = (EventType)0;
     player.SetActiveOnEquipedItem(false);
     player.ChaControl.setAllLayerWeight(0.0f);
     if (player.PlayerController.PrevStateName != "Onbu")
     {
         Resources   instance   = Singleton <Resources> .Instance;
         PoseKeyPair menuPoseId = instance.PlayerProfile.PoseIDData.MenuPoseID;
         PlayState   playState  = instance.Animation.PlayerActionAnimTable[(int)player.ChaControl.sex][menuPoseId.postureID][menuPoseId.poseID];
         player.Animation.LoadEventKeyTable(menuPoseId.postureID, menuPoseId.poseID);
         if (player.ChaControl.visibleAll)
         {
             player.LoadEventItems(playState);
             player.LoadEventParticles(menuPoseId.postureID, menuPoseId.poseID);
         }
         player.Animation.InitializeStates(playState);
         ActorAnimInfo actorAnimInfo = new ActorAnimInfo()
         {
             layer          = playState.Layer,
             inEnableBlend  = playState.MainStateInfo.InStateInfo.EnableFade,
             inBlendSec     = playState.MainStateInfo.InStateInfo.FadeSecond,
             outEnableBlend = playState.MainStateInfo.OutStateInfo.EnableFade,
             outBlendSec    = playState.MainStateInfo.OutStateInfo.FadeSecond,
             directionType  = playState.DirectionType,
             isLoop         = playState.MainStateInfo.IsLoop,
             endEnableBlend = playState.EndEnableBlend,
             endBlendSec    = playState.EndBlendRate
         };
         player.Animation.AnimInfo = actorAnimInfo;
         ActorAnimInfo animInfo = actorAnimInfo;
         player.OldEnabledHoldingHand = ((Behaviour)player.HandsHolder).get_enabled();
         if (player.OldEnabledHoldingHand)
         {
             ((Behaviour)player.HandsHolder).set_enabled(false);
             if (player.HandsHolder.EnabledHolding)
             {
                 player.HandsHolder.EnabledHolding = false;
             }
         }
         MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None);
         player.Animation.StopAllAnimCoroutine();
         player.Animation.PlayInLocoAnimation(animInfo.inEnableBlend, animInfo.inBlendSec, animInfo.layer);
         ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndMenu, 1), (Action <M0>)(_ => player.Animation.PlayOutAnimation(animInfo.outEnableBlend, animInfo.outBlendSec, animInfo.layer)));
         this._onEndOutAnimDisposable = ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndOutAnimation, 1), (Action <M0>)(_ =>
         {
             if (this._onEndInputDisposable != null)
             {
                 this._onEndInputDisposable.Dispose();
             }
             this.EndState(player);
         }));
     }
     ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndInAnimation, 1), (Action <M0>)(_ => MapUIContainer.SetActiveSystemMenuUI(true)));
     this._onEndInputDisposable = ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndInput, 1), (Action <M0>)(_ =>
     {
         if (this._onEndOutAnimDisposable != null)
         {
             this._onEndOutAnimDisposable.Dispose();
         }
         this.EndState(player);
     }));
 }