public void ConfirmButtonPressed() //Project - New - Confirm { project = new Project(); audioFileBytes = File.ReadAllBytes(songFile.FullName); songAudioClip = AudioLoader.LoadFromBuffer(audioFileBytes, songFile.Extension); project.songName = songFile.Name; project.charts = new Chart[4]; for (int i = 0; i < 4; i++) { project.charts[i] = new Chart { difficulty = i, level = "1" } } ; stage.musicSource.clip = songAudioClip; infoPanelButton.SetActive(true); chartsPanelButton.SetActive(true); newProjectPanel.SetActive(false); infoPanel.SetActive(true); currentInStage = -1; InfoInitialization(); LvlInputFieldInit(); if (songAudioClip == null) { MessageScreen.Activate( new[] { "Failed to load audio", "读取音频失败" }, new[] { "Please select another audio file", "请选择其他的音频文件" }, new[] { "Load another audio file", "读取其他的音频文件" }, ChangeMusicFile); } }
//-File Panel- public void NewProject() //Project - New { if (project != null) { stage.StopPlaying(); stage.editor.pianoSoundEditor.Deactivate(false); MessageScreen.Activate( new string[] { "Current project will be closed when you start a new project", "启动新项目时当前的项目会被关闭" }, new string[] { "<color=#ff5555>Make sure that you have SAVED your project!</color>", "<color=#ff5555>请确认你已经保存当前的项目文件!</color>" }, new string[] { "Start a new project now!", "启动新项目!" }, ClearStageStartNewProject, new string[] { "Take me back to my project", "返回到当前项目" }, delegate { dragAndDropFileName = null; }); clearStageNewProjectMode = true; return; } songFile = null; projectFileName = null; projectFolder = null; songSelectButtonText.color = new Color(25.0f / 64, 25.0f / 64, 25.0f / 64, 0.5f); fileSelectButtonText.color = new Color(25.0f / 64, 25.0f / 64, 25.0f / 64, 0.5f); songSelectButtonText.SetStrings("Select the song file", "选择音乐文件"); fileSelectButtonText.SetStrings("Create a new project file", "创建新工程文件"); newProjectPanel.SetActive(true); filePanel.SetActive(false); CheckConfirmButton(); }
private void CheckVersion() { finished = false; List <int> latest = GetVersion(latestVersion); if (UpToDate(GetVersion(currentVersion), latest)) { updateHistoryText.SetStrings("The program is up to date.", "程序已是最新版本"); return; } updateHistoryText.SetStrings("New version detected", "检测到新版本"); FindObjectOfType <UpdateHistory>().Deactivate(); MessageScreen.Activate( new[] { "New version of Deenote detected", "检测到新版本" }, new[] { "Current version: " + currentVersion + " | Latest version: " + latestVersion, "当前版本: " + currentVersion + " | 最新版本: " + latestVersion }, new[] { "Go to release page", "转到发布页面" }, () => Process.Start("https://github.com/Chlorie/Deenote/releases/latest"), new[] { "Go to download page", "转到下载页面" }, GoToDownloadPage, new[] { "Update later", "稍后更新" }); }
public void OpenQuitScreen() { MessageScreen.Activate( new string[] { "Are you sure that you want to quit?", "真的要退出吗?" }, new string[] { "<color=#ff5555>Make sure that you have SAVED your project!</color>", "<color=#ff5555>请确认你已经保存当前的项目文件!</color>" }, new string[] { "Yes, I'm quite sure! Quit now!", "是的, 我很确定(理直气壮)" }, QuitScreenYes, new string[] { "No, take me back to my project...", "不是, 回到刚才的项目..." }); }
public void ExportAllJSONCharts(int diff) { if (project != null) { JSONExportDirectorySelect(diff + 4); } else { MessageScreen.Activate(new string[] { "No project file is opened!", "目前没有已经打开的项目文件!" }, new string[] { "<color=ff7f7f>What are you expecting to be exported???</color>", "<color=ff7f7f>你认为这样能导出什么东西呢???</color>" }, new string[] { "Back", "返回" }, delegate { }); } }
private void NewSongSelected() { songFile = new FileInfo(directorySelectorController.selectedItemFullName); songNameText.text = songFile.Name; project.songName = songNameText.text; directorySelectorController.DeactivateSelection(); audioFileBytes = File.ReadAllBytes(songFile.FullName); songAudioClip = AudioLoader.LoadFromBuffer(audioFileBytes, songFile.Extension); if (songAudioClip == null) { MessageScreen.Activate( new[] { "Failed to load audio", "读取音频失败" }, new[] { "Please select another audio file", "请选择其他的音频文件" }, new[] { "Load another audio file", "读取其他的音频文件" }, ChangeMusicFile); return; } stage.musicSource.clip = songAudioClip; stage.timeSlider.value = 0.0f; stage.timeSlider.maxValue = songAudioClip.length; stage.OnSliderValueChanged(); }
public IEnumerator ProjectToLoadSelected(string fileName = null) { string projectFullDir = fileName ?? directorySelectorController.selectedItemFullName; string audioType = null; FileInfo projectFile; directorySelectorController.DeactivateSelection(); dragAndDropFileName = null; yield return(StartCoroutine(projectSL.LoadProjectFromFile(res => project = res, res => audioFileBytes = res, res => audioType = res, projectFullDir))); songAudioClip = AudioLoader.LoadFromBuffer(audioFileBytes, audioType); infoPanelButton.SetActive(true); chartsPanelButton.SetActive(true); songAudioClip?.LoadAudioData(); stage.musicSource.clip = songAudioClip; editPanelButton.SetActive(false); projectFile = new FileInfo(projectFullDir); projectFileName = projectFile.Name.Remove(projectFile.Name.Length - 7, 7); projectFolder = projectFile.FullName.Remove(projectFile.FullName.Length - projectFile.Name.Length, projectFile.Name.Length); filePanel.SetActive(false); currentInStage = -1; InfoInitialization(); LvlInputFieldInit(); if (songAudioClip == null) { MessageScreen.Activate( new[] { "Failed to load audio", "读取音频失败" }, new[] { "Please select another audio file", "请选择其他的音频文件" }, new[] { "Load another audio file", "读取其他的音频文件" }, ChangeMusicFile); } yield return(new WaitForSeconds(3.0f)); projectSL.loadCompleteText.SetActive(false); }
public void LoadProject() //Project - Open { if (project != null) { stage.StopPlaying(); stage.editor.pianoSoundEditor.Deactivate(false); MessageScreen.Activate( new string[] { "Current project will be closed when you start a new project", "启动新项目时当前的项目会被关闭" }, new string[] { "<color=#ff5555>Make sure that you have SAVED your project!</color>", "<color=#ff5555>请确认你已经保存当前的项目文件!</color>" }, new string[] { "Start a new project now!", "启动新项目!" }, ClearStageStartNewProject, new string[] { "Take me back to my project", "返回到当前项目" }, delegate { dragAndDropFileName = null; }); clearStageNewProjectMode = false; return; } if (dragAndDropFileName == null || dragAndDropFileName == "") { string[] extensions = { ".dsproj" }; directorySelectorController.ActivateSelection(extensions, ProjectToLoadSelected()); } else { StartCoroutine(ProjectToLoadSelected(dragAndDropFileName)); } }
private void ShowMessage() => MessageScreen.Activate( new[] { "Unhandled exception detected", "发现未经处理的异常" }, new[] { "Full information has been output to exceptions.log", "完整信息已输出至exceptions.log" }, new[] { "OK, got it", "好的, 我知道了" }, () => { });