コード例 #1
0
 public void Save(int slot)
 {
     if (BurikoMemory.Instance.GetGlobalFlag("GUsePrompts").BoolValue())
     {
         StateDialogPrompt prompt = new StateDialogPrompt(PromptType.DialogSave, delegate
         {
             DoSave(slot);
         }, null);
         GameSystem.Instance.PushStateObject(prompt);
         GameSystem.Instance.RegisterAction(delegate
         {
             PromptController p = prompt.GetPromptController();
             if (p == null)
             {
                 Debug.LogWarning("Prompt does not exist!");
             }
             else
             {
                 GameSystem.Instance.SceneController.GetScreenshot(delegate(Texture2D tex)
                 {
                     DateTime now     = DateTime.Now;
                     string fullText  = GameSystem.Instance.TextController.GetFullText(1);
                     string fullText2 = GameSystem.Instance.TextController.GetFullText(0);
                     p.SetScreenshotDetails(tex, now.ToString("ddd MMM dd, yyyy h:mm tt"), fullText, fullText2);
                 });
             }
         });
         GameSystem.Instance.ExecuteActions();
     }
     else
     {
         DoSave(slot);
     }
 }
コード例 #2
0
        private void OnClick()
        {
            if (UICamera.currentTouchID >= -1 && !(cooldown > 0f))
            {
                SlideButtonType type = Type;
                switch (type)
                {
                case SlideButtonType.Log:
                    GameSystem.Instance.SwitchToHistoryScreen();
                    break;

                case SlideButtonType.Auto:
                    GameSystem.Instance.IsAuto = true;
                    break;

                case SlideButtonType.Skip:
                    GameSystem.Instance.IsSkipping = true;
                    break;

                case SlideButtonType.Menu:
                    GameSystem.Instance.SwitchToRightClickMenu();
                    break;

                case SlideButtonType.QuickSave:
                    if (!GameSystem.Instance.CanSave)
                    {
                        AudioController.Instance.PlaySystemSound("sysse04.ogg", 1);
                        return;
                    }
                    GameSystem.Instance.ScriptSystem.SaveQuickSave();
                    break;

                case SlideButtonType.QuickLoad:
                {
                    if (!GameSystem.Instance.CanSave || !GameSystem.Instance.CanLoad)
                    {
                        AudioController.Instance.PlaySystemSound("sysse04.ogg", 1);
                        return;
                    }
                    SaveEntry d = BurikoScriptSystem.Instance.GetQSaveInfo();
                    if (d == null)
                    {
                        return;
                    }
                    StateDialogPrompt prompt = new StateDialogPrompt(PromptType.DialogLoad, delegate
                        {
                            GameSystem.Instance.ScriptSystem.LoadQuickSave();
                        }, null);
                    GameSystem.Instance.PushStateObject(prompt);
                    GameSystem.Instance.RegisterAction(delegate
                        {
                            PromptController promptController = prompt.GetPromptController();
                            if (!(promptController == null))
                            {
                                string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(d.Path);
                                Texture2D image = AssetManager.Instance.LoadScreenshot(fileNameWithoutExtension + ".png");
                                Debug.Log(promptController);
                                Debug.Log(d);
                                promptController.SetScreenshotDetails(image, d.Time.ToString("ddd MMM dd, yyyy h:mm tt"), d.Text, d.TextJp);
                            }
                        });
                    GameSystem.Instance.ExecuteActions();
                    break;
                }
                }
                AudioController.Instance.PlaySystemSound("wa_038.ogg", 1);
                cooldown = 0.5f;
            }
        }
コード例 #3
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;
                }
            }
        }