Exemplo n.º 1
0
 public void Save()
 {
     if (this.IsMessage)
     {
         return;
     }
     Singleton <CraftScene> .Instance.Capture((Action <byte[]>)(_png =>
     {
         int sizeType = Singleton <Manager.Housing> .Instance.GetSizeType(Singleton <CraftScene> .Instance.HousingID);
         DateTime now = DateTime.Now;
         string str   = string.Format("{0}_{1:00}{2:00}_{3:00}{4:00}_{5:00}_{6:000}.png", (object)now.Year, (object)now.Month, (object)now.Day, (object)now.Hour, (object)now.Minute, (object)now.Second, (object)now.Millisecond);
         Singleton <CraftScene> .Instance.CraftInfo.Save(UserData.Create(string.Format("{0}{1:00}", (object)"housing/", (object)(sizeType + 1))) + str, _png);
         this.IsMessage = true;
         MapUIContainer.PushMessageUI("保存しました", 0, 1, (Action)(() => this.IsMessage = false));
         Singleton <Resources> .Instance.SoundPack.Play(SoundPack.SystemSE.Save);
     }));
 }
Exemplo n.º 2
0
        private void OnItemsRemoving(object sender, ItemsCancelArgs e)
        {
            HashSet <ObjectCtrl> objectCtrlSet = new HashSet <ObjectCtrl>(e.Items.Select <object, ObjectCtrl>((Func <object, ObjectCtrl>)(v => v as ObjectCtrl)));

            foreach (ObjectCtrl _objectCtrl in e.Items.Select <object, ObjectCtrl>((Func <object, ObjectCtrl>)(v => v as ObjectCtrl)))
            {
                this.CheckParent(objectCtrlSet, _objectCtrl);
            }
            bool isMessage = false;

            e.Items = ((IEnumerable <object>)objectCtrlSet.Where <ObjectCtrl>((Func <ObjectCtrl, bool>)(v =>
            {
                bool flag = v.OnRemoving();
                isMessage |= !flag;
                return(flag);
            }))).ToList <object>();
            if (!isMessage)
            {
                return;
            }
            MapUIContainer.PushMessageUI("アイテムがいっぱいです", 2, 1, (Action)(() => {}));
        }
Exemplo n.º 3
0
        private void OnInputAction(bool isDown)
        {
            if (this._acception == CommandLabel.AcceptionState.None || this._disposable != null)
            {
                return;
            }
            if (isDown)
            {
                switch (this._acception)
                {
                case CommandLabel.AcceptionState.InvokeAcception:
                    CommandLabel.CommandInfo element = this._commands.GetElement <CommandLabel.CommandInfo>(this._commandID);
                    if (element == null)
                    {
                        break;
                    }
                    if (element.IsHold)
                    {
                        if ((double)this._holdElapsedTime < (double)this._holdDuration && this._isPressedAction && (Singleton <Manager.Map> .IsInstance() && Object.op_Inequality((Object)Singleton <Manager.Map> .Instance.Player, (Object)null)) && this._acception == CommandLabel.AcceptionState.InvokeAcception)
                        {
                            this._holdElapsedTime += Time.get_deltaTime();
                        }
                        if ((double)this._holdElapsedTime < (double)this._holdDuration)
                        {
                            break;
                        }
                        PlayerActor player = Singleton <Manager.Map> .Instance.Player;
                        Func <PlayerActor, bool> condition = element.Condition;
                        bool?nullable = condition != null ? new bool?(condition(player)) : new bool?();
                        if ((!nullable.HasValue ? 1 : (nullable.Value ? 1 : 0)) != 0)
                        {
                            Action action = element.Event;
                            if (action != null)
                            {
                                action();
                            }
                        }
                        else if (element.ErrorText != null)
                        {
                            MapUIContainer.PushMessageUI(element.ErrorText(player), 2, 0, (Action)null);
                        }
                        this._holdElapsedTime = 0.0f;
                        this._isPressedAction = false;
                        break;
                    }
                    if (!this._isPressedAction || !Singleton <Manager.Map> .IsInstance() || !Object.op_Inequality((Object)Singleton <Manager.Map> .Instance.Player, (Object)null))
                    {
                        break;
                    }
                    PlayerActor player1 = Singleton <Manager.Map> .Instance.Player;
                    Func <PlayerActor, bool> condition1 = element.Condition;
                    bool?nullable1 = condition1 != null ? new bool?(condition1(player1)) : new bool?();
                    if ((!nullable1.HasValue ? 1 : (nullable1.Value ? 1 : 0)) != 0)
                    {
                        Action action = element.Event;
                        if (action != null)
                        {
                            action();
                        }
                    }
                    else if (element.ErrorText != null)
                    {
                        MapUIContainer.PushMessageUI(element.ErrorText(player1), 2, 0, (Action)null);
                    }
                    this._isPressedAction = false;
                    break;

                case CommandLabel.AcceptionState.CancelAcception:
                    if (this._cancelCommand == null)
                    {
                        break;
                    }
                    Debug.Log((object)"Run CancelCommand");
                    Action action1 = this._cancelCommand.Event;
                    if (action1 != null)
                    {
                        action1();
                    }
                    this._cancelCommand = (CommandLabel.CommandInfo)null;
                    break;
                }
            }
            else
            {
                this._isPressedAction = false;
                this._holdElapsedTime = 0.0f;
            }
        }
Exemplo n.º 4
0
        protected override void OnAwake(PlayerActor player)
        {
            this._eventPoint = player.CurrentEventPoint;
            if (Object.op_Inequality((Object)this._eventPoint, (Object)null))
            {
                CommonDefine.EventStoryInfoGroup playInfo = !Singleton <Resources> .IsInstance() ? (CommonDefine.EventStoryInfoGroup)null : Singleton <Resources> .Instance.CommonDefine?.EventStoryInfo;

                Dictionary <int, List <string> > textTable = !Singleton <Resources> .IsInstance() ? (Dictionary <int, List <string> >)null : Singleton <Resources> .Instance.Map?.EventPointCommandLabelTextTable;

                MapUIContainer.RequestUI.CancelEvent = (System.Action)(() => EventPoint.ChangePrevPlayerMode());
                MapUIContainer.RequestUI.ClosedEvent = (System.Action)(() => player.CurrentEventPoint = (EventPoint)null);
                MapUIContainer.RequestUI.SubmitEvent = (System.Action)(() =>
                {
                    if (Object.op_Equality((Object)this._eventPoint, (Object)null))
                    {
                        EventPoint.ChangePrevPlayerMode();
                    }
                    else
                    {
                        this._eventPoint.RemoveConsiderationCommand();
                        int eventId = this._eventPoint.EventID;
                        int groupId = this._eventPoint.GroupID;
                        int pointId = this._eventPoint.PointID;
                        switch (eventId)
                        {
                        case 0:
                            if (Object.op_Equality((Object)player, (Object)null) || playInfo == null)
                            {
                                EventPoint.ChangePrevPlayerMode();
                                break;
                            }
                            player.PlayerController.ChangeState("Idle");
                            EventPoint.OpenEventStart(player, playInfo.StartEventFadeTime, playInfo.EndEventFadeTime, playInfo.Generator.SEID, playInfo.Generator.SoundPlayDelayTime, playInfo.Generator.EndIntervalTime, (System.Action)(() =>
                            {
                                if (Singleton <Manager.Map> .IsInstance())
                                {
                                    Singleton <Manager.Map> .Instance.SetTimeRelationAreaOpenState(0, true);
                                }
                                Manager.Map.ForcedSetTutorialProgress(25);
                            }), (System.Action)(() =>
                            {
                                if (!textTable.IsNullOrEmpty <int, List <string> >())
                                {
                                    List <string> source;
                                    textTable.TryGetValue(6, out source);
                                    MapUIContainer.PushMessageUI(source.GetElement <string>(EventPoint.LangIdx) ?? string.Empty, 0, 0, (System.Action)null);
                                }
                                EventPoint.ChangePrevPlayerMode();
                            }));
                            break;

                        case 1:
                            if (Object.op_Equality((Object)player, (Object)null) || playInfo == null)
                            {
                                EventPoint.ChangePrevPlayerMode();
                                break;
                            }
                            player.PlayerController.ChangeState("Idle");
                            EventPoint.OpenEventStart(player, playInfo.StartEventFadeTime, playInfo.EndEventFadeTime, playInfo.ShipRepair.SEID, playInfo.ShipRepair.SoundPlayDelayTime, playInfo.ShipRepair.EndIntervalTime, (System.Action)(() =>
                            {
                                if (!Object.op_Inequality((Object)this._eventPoint, (Object)null))
                                {
                                    return;
                                }
                                this._eventPoint.SetDedicatedNumber(1);
                                this.ChangeGameCleared();
                            }), (System.Action)(() =>
                            {
                                (!Singleton <Manager.Map> .IsInstance() ? (StoryPointEffect)null : Singleton <Manager.Map> .Instance.StoryPointEffect)?.FadeOutAndDestroy();
                                if (!textTable.IsNullOrEmpty <int, List <string> >())
                                {
                                    List <string> source;
                                    textTable.TryGetValue(7, out source);
                                    MapUIContainer.PushMessageUI(source.GetElement <string>(EventPoint.LangIdx) ?? string.Empty, 0, 0, (System.Action)null);
                                }
                                Manager.Map.ForcedSetTutorialProgress(28);
                                DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <long>((IObservable <M0>)Observable.Timer(TimeSpan.FromSeconds(!Singleton <Resources> .IsInstance() ? 5.0 : (double)Singleton <Resources> .Instance.CommonDefine.EventStoryInfo.StoryCompleteNextSupportChangeTime)), (System.Action <M0>)(_ => Manager.Map.ForcedSetTutorialProgressAndUIUpdate(29))), (Component)Singleton <MapScene> .Instance);
                                EventPoint.ChangePrevPlayerMode();
                            }));
                            break;

                        case 2:
                            if (Object.op_Equality((Object)player, (Object)null) || playInfo == null || pointId != 4 && pointId != 5 && pointId != 6)
                            {
                                EventPoint.ChangePrevPlayerMode();
                                break;
                            }
                            player.PlayerController.ChangeState("Idle");
                            EventPoint.OpenEventStart(player, playInfo.StartEventFadeTime, playInfo.EndEventFadeTime, playInfo.PodDevice.SEID, playInfo.PodDevice.SoundPlayDelayTime, playInfo.PodDevice.EndIntervalTime, (System.Action)(() => this._eventPoint.SetAgentOpenState(true)), (System.Action)(() =>
                            {
                                if (!textTable.IsNullOrEmpty <int, List <string> >())
                                {
                                    List <string> source;
                                    textTable.TryGetValue(9, out source);
                                    MapUIContainer.PushMessageUI(source.GetElement <string>(EventPoint.LangIdx) ?? string.Empty, 0, 0, (System.Action)null);
                                }
                                EventPoint.ChangePrevPlayerMode();
                            }));
                            break;

                        case 3:
                            EventPoint.ChangePrevPlayerMode();
                            break;

                        case 4:
                        case 5:
                        case 6:
                            EventPoint.ChangePrevPlayerMode();
                            break;
                        }
                    }
                });
                MapUIContainer.OpenRequestUI((Popup.Request.Type) this._eventPoint.EventID);
                if (0 > this._eventPoint.WarningID || !MapUIContainer.RequestUI.IsImpossible)
                {
                    return;
                }
                MapUIContainer.PushWarningMessage((Popup.Warning.Type) this._eventPoint.WarningID);
            }
            else
            {
                player.PlayerController.ChangeState("Normal");
            }
        }
Exemplo n.º 5
0
        public override void Init(UICtrl _uiCtrl, bool _tutorial)
        {
            base.Init(_uiCtrl, _tutorial);
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonAdd), (Action <M0>)(_ => this.UICtrl.AddUICtrl.Active = !this.UICtrl.AddUICtrl.Active));
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonUndo), (Action <M0>)(_ =>
            {
                if (!Singleton <UndoRedoManager> .IsInstance())
                {
                    return;
                }
                Singleton <UndoRedoManager> .Instance.Undo();
            }));
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonRedo), (Action <M0>)(_ =>
            {
                if (!Singleton <UndoRedoManager> .IsInstance())
                {
                    return;
                }
                Singleton <UndoRedoManager> .Instance.Redo();
            }));
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonCamera), (Action <M0>)(_ => this.Camera = !this.Camera));
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonAxis), (Action <M0>)(_ => this.Axis     = !this.Axis));
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonGrid), (Action <M0>)(_ => this.Grid     = !this.Grid));
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonSave), (Action <M0>)(_ => this.Save()));
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonLoad), (Action <M0>)(_ => this.UICtrl.SaveLoadUICtrl.Open()));
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonReset), (Action <M0>)(_ =>
            {
                ConfirmScene.Sentence     = "初期化しますか?\n" + "セットされたアイテムは削除されます。".Coloring("#DE4529FF").Size(24);
                ConfirmScene.OnClickedYes = (Action)(() =>
                {
                    this.UICtrl.ListUICtrl.VirtualizingTreeView.SelectedIndex = -1;
                    Singleton <Manager.Housing> .Instance.ResetObject();
                    this.UICtrl.ListUICtrl.UpdateUI();
                    Singleton <UndoRedoManager> .Instance.Clear();
                });
                ConfirmScene.OnClickedNo = (Action)(() => {});
                Singleton <Game> .Instance.LoadDialog();
            }));
            ObservableExtensions.Subscribe <Unit>((IObservable <M0>)UnityUIComponentExtensions.OnClickAsObservable(this.buttonEnd), (Action <M0>)(_ =>
            {
                if (Singleton <CraftScene> .Instance.IsShortcutUI)
                {
                    return;
                }
                if (Singleton <CraftScene> .Instance.CraftInfo.IsOverlapNow)
                {
                    this.IsMessage = true;
                    MapUIContainer.PushMessageUI("配置に問題があるものが存在します", 2, 1, (Action)(() => this.IsMessage = false));
                }
                else
                {
                    ConfirmScene.Sentence     = "ハウジングを終了しますか?";
                    ConfirmScene.OnClickedYes = (Action)(() =>
                    {
                        Singleton <CraftScene> .Instance.SceneEnd();
                        ObservableExtensions.Subscribe <Unit>((IObservable <M0>)MapUIContainer.StartFade(FadeCanvas.PanelType.Blackout, (FadeType)0, 1f, true), (Action <M0>)(__ => {}), (Action)(() => this.EndHousing()));
                    });
                    ConfirmScene.OnClickedNo = (Action)(() => Singleton <CraftScene> .Instance.IsEndCheck = false);
                    Singleton <Game> .Instance.LoadDialog();
                    Singleton <CraftScene> .Instance.IsEndCheck = true;
                }
            }));
            ObservableExtensions.Subscribe <bool>((IObservable <M0>) this.cameraReactive, (Action <M0>)(_b => this.spritesCamera.SafeProc <Sprite>(!_b ? 1 : 0, (Action <Sprite>)(_s => ((Selectable)this.buttonCamera).get_image().set_sprite(_s)))));
            ObservableExtensions.Subscribe <bool>((IObservable <M0>) this.axisReactive, (Action <M0>)(_b =>
            {
                this.spritesAxis.SafeProc <Sprite>(!_b ? 1 : 0, (Action <Sprite>)(_s => ((Selectable)this.buttonAxis).get_image().set_sprite(_s)));
                GuideObject guideObject = Singleton <GuideManager> .Instance.GuideObject;
                if (!Object.op_Implicit((Object)guideObject))
                {
                    return;
                }
                guideObject.visibleOutside = _b;
            }));
            ObservableExtensions.Subscribe <bool>((IObservable <M0>) this.gridReactive, (Action <M0>)(_b =>
            {
                this.spritesGrid.SafeProc <Sprite>(!_b ? 1 : 0, (Action <Sprite>)(_s => ((Selectable)this.buttonGrid).get_image().set_sprite(_s)));
                if (!Singleton <GuideManager> .IsInstance())
                {
                    return;
                }
                Singleton <GuideManager> .Instance.VisibleGrid = _b;
            }));
            CraftCamera craftCamera = this.UICtrl.CraftCamera;

            craftCamera.NoCtrlCondition = craftCamera.NoCtrlCondition + new VirtualCameraController.NoCtrlFunc(this.NoCameraCtrl);
            if (Singleton <UndoRedoManager> .IsInstance())
            {
                Singleton <UndoRedoManager> .Instance.CanUndoChange += new EventHandler <CanhangeArgs>(this.CanUndoChange);
                Singleton <UndoRedoManager> .Instance.CanRedoChange += new EventHandler <CanhangeArgs>(this.CanRedoChange);
            }
            ((Selectable)this.buttonUndo).set_interactable(false);
            ((Selectable)this.buttonRedo).set_interactable(false);
            if (!_tutorial)
            {
                return;
            }
            ((Selectable)this.buttonSave).set_interactable(false);
            ((Selectable)this.buttonLoad).set_interactable(false);
        }
Exemplo n.º 6
0
 public override void Do()
 {
     base.Do();
     MapUIContainer.WarningMessageUI.isFadeInForOutWait = true;
     MapUIContainer.PushMessageUI(this.args[0], 0, 1, (Action)null);
 }
Exemplo n.º 7
0
 private void OutputWarningMessage()
 {
     MapUIContainer.PushMessageUI("ここに女の子を下ろすことはできません", 2, 0, (System.Action)null);
 }