示例#1
0
        public override bool IsRequestMatch(string command)
        {
            var normilizedCommand             = command.TrimStart('/').Trim().ToLower();
            var normilizedCurrentStateCommand = StateTitle.ToLower();

            return(normilizedCommand.StartsWith(normilizedCurrentStateCommand));
        }
    public ExaState createState(int id, object[] parameters)
    {
        //Initialize
        ExaState NewState = null;

        //Check ID
        switch(id) {
        case ExaState.TITLE:
            if (parameters != null && parameters.Length >= 1) NewState = new StateTitle((StateGame)parameters[0]);
            break;

        case ExaState.GAME:
            NewState = new StateGame();
            break;

        case ExaState.PAUSE:
            break;

        case ExaState.RESULT:
            if (parameters != null && parameters.Length >= 2) NewState = new StateResult ((StateGame)parameters [0], (float)parameters[1]);
            break;
        }

        //Return
        return NewState;
    }
示例#3
0
        private void OnClick()
        {
            GameSystem gameSystem = GameSystem.Instance;

            if (gameSystem.GameState == GameState.TitleScreen && !(time > 0f) && UICamera.currentTouchID == -1)
            {
                StateTitle stateTitle = gameSystem.GetStateObject() as StateTitle;
                if (stateTitle != null)
                {
                    switch (base.name)
                    {
                    case "0-Start":
                        BurikoMemory.Instance.SetFlag("LOCALWORK_NO_RESULT", 0);
                        stateTitle.RequestLeave();
                        gameSystem.AudioController.StopAllAudio();
                        gameSystem.AudioController.PlaySystemSound("wa_040.ogg");
                        IsEnabled = false;
                        break;

                    case "1-Load":
                        gameSystem.PushStateObject(new StateSaveLoad(restoreUI: false));
                        break;

                    case "2-Config":
                        gameSystem.SwitchToConfig(0, showMessageWindow: false);
                        break;

                    case "3-CGGallery":
                        BurikoMemory.Instance.SetFlag("LOCALWORK_NO_RESULT", 1);
                        BurikoMemory.Instance.SetFlag("TipsMode", 1);
                        stateTitle.RequestLeave();
                        gameSystem.AudioController.FadeOutBGM(2, 1000, waitForFade: false);
                        BurikoScriptSystem.Instance.CallBlock("ViewTipsDisplay");
                        gameSystem.SceneController.DrawScene("black", 0.5f);
                        gameSystem.ExecuteActions();
                        break;

                    case "4-Exit":
                        GameSystem.Instance.PushStateObject(new StateDialogPrompt(PromptType.DialogExit, delegate
                        {
                            gameSystem.CanExit = true;
                            Application.Quit();
                        }, null));
                        break;

                    default:
                        Debug.Log("Button ID not found: " + base.name);
                        break;
                    }
                    if (base.name != "0-Start")
                    {
                        AudioController.Instance.PlaySystemSound("wa_038.ogg", 1);
                    }
                    IsEnabled = false;
                }
            }
        }
示例#4
0
        private void OnClick()
        {
            if (gameSystem == null)
            {
                gameSystem = GameSystem.Instance;
            }
            if (gameSystem.GameState == GameState.SaveLoadScreen && !(time > 0f) && UICamera.currentTouchID == -1 && isEnabled)
            {
                StateSaveLoad state = gameSystem.GetStateObject() as StateSaveLoad;
                if (state != null)
                {
                    switch (base.name)
                    {
                    case "Save":
                    case "0-Save":
                        manager.Save(slot);
                        break;

                    case "Load":
                    case "1-Load":
                    {
                        SaveEntry d = BurikoScriptSystem.Instance.GetSaveInfo(slot);
                        if (d == null)
                        {
                            return;
                        }
                        StateDialogPrompt state2 = new StateDialogPrompt(PromptType.DialogLoad, delegate
                            {
                                state.Leave(delegate
                                {
                                    StateTitle stateTitle = gameSystem.GetStateObject() as StateTitle;
                                    if (!manager.CanSave())
                                    {
                                        stateTitle?.RequestLeaveImmediate();
                                    }
                                    (gameSystem.GetStateObject() as StateChapterScreen)?.RequestLeaveImmediate();
                                    GameSystem.Instance.ScriptSystem.LoadGame(slot);
                                });
                            }, null);
                        gameSystem.PushStateObject(state2);
                        gameSystem.RegisterAction(delegate
                            {
                                PromptController promptController = state2.GetPromptController();
                                if (!(promptController == null))
                                {
                                    string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(d.Path);
                                    Texture2D image = AssetManager.Instance.LoadScreenshot(fileNameWithoutExtension + ".png");
                                    promptController.SetScreenshotDetails(image, d.Time.ToString("ddd MMM dd, yyyy h:mm tt"), d.Text, d.TextJp);
                                }
                            });
                        gameSystem.ExecuteActions();
                        break;
                    }

                    case "2-Edit":
                    {
                        SaveEntry d2 = BurikoScriptSystem.Instance.GetSaveInfo(slot);
                        if (d2 == null)
                        {
                            return;
                        }
                        SaveLoadManager.EditSlot = slot;
                        StateDialogPrompt state3 = new StateDialogPrompt(PromptType.DialogEdit, delegate
                            {
                            }, null);
                        gameSystem.PushStateObject(state3);
                        gameSystem.RegisterAction(delegate
                            {
                                PromptController promptController2 = state3.GetPromptController();
                                if (!(promptController2 == null))
                                {
                                    string fileNameWithoutExtension2 = Path.GetFileNameWithoutExtension(d2.Path);
                                    Texture2D image2 = AssetManager.Instance.LoadScreenshot(fileNameWithoutExtension2 + ".png");
                                    promptController2.SetScreenshotDetails(image2, d2.Time.ToString("ddd MMM dd, yyyy h:mm tt"), d2.Text, d2.TextJp);
                                }
                            });
                        gameSystem.ExecuteActions();
                        break;
                    }

                    case "3-Delete":
                    {
                        SaveEntry d3 = BurikoScriptSystem.Instance.GetSaveInfo(slot);
                        if (d3 == null)
                        {
                            return;
                        }
                        StateDialogPrompt prompt = new StateDialogPrompt(PromptType.DialogDelete, delegate
                            {
                                BurikoScriptSystem.Instance.DeleteSave(slot);
                                manager.RefreshList();
                            }, null);
                        GameSystem.Instance.PushStateObject(prompt);
                        GameSystem.Instance.RegisterAction(delegate
                            {
                                PromptController promptController3 = prompt.GetPromptController();
                                if (!(promptController3 == null))
                                {
                                    string fileNameWithoutExtension3 = Path.GetFileNameWithoutExtension(d3.Path);
                                    Texture2D image3 = AssetManager.Instance.LoadScreenshot(fileNameWithoutExtension3 + ".png");
                                    promptController3.SetScreenshotDetails(image3, d3.Time.ToString("ddd MMM dd, yyyy h:mm tt"), d3.Text, d3.TextJp);
                                }
                            });
                        break;
                    }

                    case "Return":
                        state.Leave(null);
                        break;

                    default:
                        Debug.LogWarning("Unhandled button action!");
                        break;
                    }
                    AudioController.Instance.PlaySystemSound("wa_038.ogg", 1);
                    time = 0.45f;
                }
            }
        }