private void Start() { ShowAboutText(selectedTextIndex); nextItemButton.RegisterCallbackButtonTriggered(() => { selectedTextIndex++; if (selectedTextIndex >= textAssets.Count) { selectedTextIndex = 0; } ShowAboutText(selectedTextIndex); }); previousItemButton.RegisterCallbackButtonTriggered(() => { selectedTextIndex--; if (selectedTextIndex < 0) { selectedTextIndex = textAssets.Count - 1; } ShowAboutText(selectedTextIndex); }); nextItemButton.Focus(); backButton.RegisterCallbackButtonTriggered(() => sceneNavigator.LoadScene(EScene.MainScene)); InputManager.GetInputAction(R.InputActions.usplay_back).PerformedAsObservable(5) .Subscribe(_ => sceneNavigator.LoadScene(EScene.MainScene)); }
private void Start() { LabeledItemPickerControl <ENoteDisplayMode> noteDisplayModePickerControl = new(noteDisplayModeContainer.Q <ItemPicker>(), EnumUtils.GetValuesAsList <ENoteDisplayMode>()); noteDisplayModePickerControl.Bind(() => settings.GraphicSettings.noteDisplayMode, newValue => settings.GraphicSettings.noteDisplayMode = newValue); noteDisplayModePickerControl.GetLabelTextFunction = noteDisplayMode => noteDisplayMode == ENoteDisplayMode.SentenceBySentence ? TranslationManager.GetTranslation(R.Messages.options_noteDisplayMode_sentenceBySentence) : TranslationManager.GetTranslation(R.Messages.options_noteDisplayMode_scrollingNoteStream); new BoolPickerControl(lyricsOnNotesContainer.Q <ItemPicker>()) .Bind(() => settings.GraphicSettings.showLyricsOnNotes, newValue => settings.GraphicSettings.showLyricsOnNotes = newValue); new BoolPickerControl(pitchIndicatorContainer.Q <ItemPicker>()) .Bind(() => settings.GraphicSettings.showPitchIndicator, newValue => settings.GraphicSettings.showPitchIndicator = newValue); new BoolPickerControl(imageAsCursorContainer.Q <ItemPicker>()) .Bind(() => settings.GraphicSettings.useImageAsCursor, newValue => settings.GraphicSettings.useImageAsCursor = newValue); backButton.RegisterCallbackButtonTriggered(() => sceneNavigator.LoadScene(EScene.OptionsScene)); backButton.Focus(); InputManager.GetInputAction(R.InputActions.usplay_back).PerformedAsObservable(5) .Subscribe(_ => sceneNavigator.LoadScene(EScene.OptionsScene)); }
private void Start() { backButton.RegisterCallbackButtonTriggered(() => sceneNavigator.LoadScene(EScene.OptionsScene)); backButton.Focus(); InputManager.GetInputAction(R.InputActions.usplay_back).PerformedAsObservable(5) .Subscribe(_ => sceneNavigator.LoadScene(EScene.OptionsScene)); }
private void Start() { UpdateConnectedClients(); serverSideConnectRequestManager.ClientConnectedEventStream .Subscribe(_ => UpdateConnectedClients()) .AddTo(gameObject); backButton.RegisterCallbackButtonTriggered(() => sceneNavigator.LoadScene(EScene.OptionsScene)); backButton.Focus(); InputManager.GetInputAction(R.InputActions.usplay_back).PerformedAsObservable(5) .Subscribe(_ => sceneNavigator.LoadScene(EScene.OptionsScene)); }
public void FinishScene() { SongSelectSceneData songSelectSceneData = new SongSelectSceneData(); songSelectSceneData.SongMeta = sceneData.SongMeta; sceneNavigator.LoadScene(EScene.SongSelectScene, songSelectSceneData); }
private void Start() { new BoolPickerControl(ratePlayersContainer.Q <ItemPicker>()) .Bind(() => settings.GameSettings.RatePlayers, newValue => settings.GameSettings.RatePlayers = newValue); new BoolPickerControl(combineDuetScoresContainer.Q <ItemPicker>()) .Bind(() => settings.GameSettings.CombineDuetScores, newValue => settings.GameSettings.CombineDuetScores = newValue); backButton.RegisterCallbackButtonTriggered(() => sceneNavigator.LoadScene(EScene.OptionsScene)); backButton.Focus(); InputManager.GetInputAction(R.InputActions.usplay_back).PerformedAsObservable(5) .Subscribe(_ => sceneNavigator.LoadScene(EScene.OptionsScene)); }
private void OpenSongEditorScene(SongMeta songMeta) { sceneNavigator.LoadScene(EScene.SongEditorScene, new SongEditorSceneData { PreviousScene = EScene.MainScene, SelectedSongMeta = songMeta, }); }
private void Start() { InputManager.GetInputAction(R.InputActions.usplay_start).PerformedAsObservable() .Subscribe(_ => sceneNavigator.LoadScene(EScene.SongSelectScene)); InputManager.GetInputAction(R.InputActions.usplay_back).PerformedAsObservable(5) .Subscribe(_ => OnBack()); }
private void Start() { new BoolPickerControl(showFpsContainer.Q <ItemPicker>()) .Bind(() => settings.DeveloperSettings.showFps, newValue => { settings.DeveloperSettings.showFps = newValue; if (newValue) { uiManager.CreateShowFpsInstance(); } else { uiManager.DestroyShowFpsInstance(); } }); new PitchDetectionAlgorithmPicker(pitchDetectionAlgorithmContainer.Q <ItemPicker>()) .Bind(() => settings.AudioSettings.pitchDetectionAlgorithm, newValue => settings.AudioSettings.pitchDetectionAlgorithm = newValue); new BoolPickerControl(analyzeBeatsWithoutTargetNoteContainer.Q <ItemPicker>()) .Bind(() => settings.GraphicSettings.analyzeBeatsWithoutTargetNote, newValue => settings.GraphicSettings.analyzeBeatsWithoutTargetNote = newValue); ipAddressLabel.text = TranslationManager.GetTranslation(R.Messages.options_ipAddress, "value", HttpServer.Instance.host); if (HttpServer.IsSupported) { httpServerPortLabel.text = TranslationManager.GetTranslation(R.Messages.options_httpServerPortWithExampleUri, "host", HttpServer.Instance.host, "port", HttpServer.Instance.port); } else { httpServerPortLabel.text = TranslationManager.GetTranslation(R.Messages.options_httpServerNotSupported); } backButton.RegisterCallbackButtonTriggered(() => sceneNavigator.LoadScene(EScene.OptionsScene)); backButton.Focus(); InputManager.GetInputAction(R.InputActions.usplay_back).PerformedAsObservable(5) .Subscribe(_ => sceneNavigator.LoadScene(EScene.OptionsScene)); }
private void Start() { UpdatePlayerProfileList(); settings.ObserveEveryValueChanged(s => s.PlayerProfiles) .Subscribe(onNext => UpdatePlayerProfileList()) .AddTo(gameObject); addButton.RegisterCallbackButtonTriggered(() => { settings.PlayerProfiles.Add(new PlayerProfile()); UpdatePlayerProfileList(); }); backButton.RegisterCallbackButtonTriggered(() => sceneNavigator.LoadScene(EScene.OptionsScene)); backButton.Focus(); InputManager.GetInputAction(R.InputActions.usplay_back).PerformedAsObservable(5) .Subscribe(_ => sceneNavigator.LoadScene(EScene.OptionsScene)); }
private void Start() { settings.GameSettings.ObserveEveryValueChanged(gameSettings => gameSettings.songDirs) .Subscribe(onNext => UpdateSongFolderList()) .AddTo(gameObject); addButton.RegisterCallbackButtonTriggered(() => { settings.GameSettings.songDirs.Add("./Songs"); UpdateSongFolderList(); RequestExternalStoragePermissionIfNeeded(); }); downloadSceneButton.RegisterCallbackButtonTriggered(() => sceneNavigator.LoadScene(EScene.ContentDownloadScene)); backButton.RegisterCallbackButtonTriggered(() => sceneNavigator.LoadScene(EScene.OptionsScene)); backButton.Focus(); InputManager.GetInputAction(R.InputActions.usplay_back).PerformedAsObservable(5) .Subscribe(_ => sceneNavigator.LoadScene(EScene.OptionsScene)); }
private void Start() { new BoolPickerControl(backgroundMusicEnabledChooser) .Bind(() => settings.AudioSettings.BackgroundMusicEnabled, newValue => settings.AudioSettings.BackgroundMusicEnabled = newValue); NumberPickerControl previewVolumePickerControl = new(previewVolumeChooser); previewVolumePickerControl.GetLabelTextFunction = item => item + " %"; previewVolumePickerControl.Bind(() => settings.AudioSettings.PreviewVolumePercent, newValue => settings.AudioSettings.PreviewVolumePercent = (int)newValue); NumberPickerControl volumePickerControl = new(volumeChooser); volumePickerControl.GetLabelTextFunction = item => item + " %"; volumePickerControl.Bind(() => settings.AudioSettings.VolumePercent, newValue => settings.AudioSettings.VolumePercent = (int)newValue); backButton.RegisterCallbackButtonTriggered(() => sceneNavigator.LoadScene(EScene.OptionsScene)); backButton.Focus(); InputManager.GetInputAction(R.InputActions.usplay_back).PerformedAsObservable(5) .Subscribe(_ => sceneNavigator.LoadScene(EScene.OptionsScene)); }
private void ApplyGraphicSettingsAndExitScene() { ApplyGraphicSettings(); sceneNavigator.LoadScene(EScene.OptionsScene); }
private void Start() { SongMetaManager.Instance.ScanFilesIfNotDoneYet(); // Give the song search some time, otherwise the "no songs found" label flickers once. if (!SongMetaManager.IsSongScanFinished) { Thread.Sleep(100); } sceneData = SceneNavigator.Instance.GetSceneData(CreateDefaultSceneData()); InitSongMetas(); HidePlayerSelectOverlay(); HideMenuOverlay(); HideSongDetailOverlay(); SongOrderPickerControl = new SongOrderPickerControl(songOrderItemPicker); // Register Callbacks toggleFavoriteButton.RegisterCallbackButtonTriggered(() => ToggleSelectedSongIsFavorite()); closePlayerSelectOverlayButton.RegisterCallbackButtonTriggered(() => HidePlayerSelectOverlay()); fuzzySearchTextLabel.ShowByDisplay(); songSelectSceneInputControl.FuzzySearchText .Subscribe(newValue => fuzzySearchTextLabel.text = newValue); startButton.RegisterCallbackButtonTriggered(() => CheckAudioAndStartSingScene()); menuButton.RegisterCallbackButtonTriggered(() => ShowMenuOverlay()); closeMenuOverlayButton.RegisterCallbackButtonTriggered(() => HideMenuOverlay()); backToMainMenuButton.RegisterCallbackButtonTriggered(() => sceneNavigator.LoadScene(EScene.MainScene)); toggleSongDetailOverlayButton.RegisterCallbackButtonTriggered(() => { if (IsSongDetailOverlayVisible) { HideSongDetailOverlay(); } else { ShowSongDetailOverlay(); } }); nextSongButton.RegisterCallbackButtonTriggered(() => songRouletteControl.SelectNextSong()); previousSongButton.RegisterCallbackButtonTriggered(() => songRouletteControl.SelectPreviousSong()); UpdateNextAndPreviousSongButtonLabels(); inputManager.InputDeviceChangeEventStream.Subscribe(evt => UpdateNextAndPreviousSongButtonLabels()); songIndexButton.RegisterCallbackButtonTriggered(() => songSearchControl.SetSearchText($"#{SelectedSongIndex + 1}")); SongSearchControl.SearchChangedEventStream.Subscribe(_ => OnSearchTextChanged()); PlaylistChooserControl.Selection.Subscribe(_ => UpdateFilteredSongs()); SongOrderPickerControl.Selection.Subscribe(newValue => { settings.SongSelectSettings.songOrder = newValue; characterQuickJumpListControl.UpdateCharacters(); UpdateFilteredSongs(); }); playlistManager.PlaylistChangeEventStream.Subscribe(playlistChangeEvent => { if (playlistChangeEvent.Playlist == PlaylistChooserControl.Selection.Value) { UpdateFilteredSongs(); } UpdateFavoriteIcon(); }); InitSongRouletteSongMetas(); songRouletteControl.SelectionClickedEventStream .Subscribe(_ => CheckAudioAndStartSingScene()); UpdateInputLegend(); inputManager.InputDeviceChangeEventStream.Subscribe(_ => UpdateInputLegend()); focusableNavigator.FocusSongRoulette(); songAudioPlayer.AudioClipLoadedEventStream .Subscribe(_ => UpdateSongDurationLabel(songAudioPlayer.DurationOfSongInMillis)); }
private void Start() { gameOptionsButton.Focus(); gameOptionsButton.RegisterCallbackButtonTriggered(() => sceneNavigator.LoadScene(EScene.OptionsGameScene)); backButton.RegisterCallbackButtonTriggered(() => sceneNavigator.LoadScene(EScene.MainScene)); songsOptionsButton.RegisterCallbackButtonTriggered(() => sceneNavigator.LoadScene(EScene.SongLibraryOptionsScene)); graphicsOptionsButton.RegisterCallbackButtonTriggered(() => sceneNavigator.LoadScene(EScene.OptionsGraphicsScene)); soundOptionsButton.RegisterCallbackButtonTriggered(() => sceneNavigator.LoadScene(EScene.OptionsSoundScene)); recordingOptionsButton.RegisterCallbackButtonTriggered(() => sceneNavigator.LoadScene(EScene.RecordingOptionsScene)); profileOptionsButton.RegisterCallbackButtonTriggered(() => sceneNavigator.LoadScene(EScene.PlayerProfileSetupScene)); designOptionsButton.RegisterCallbackButtonTriggered(() => sceneNavigator.LoadScene(EScene.ThemeOptionsScene)); internetOptionsButton.RegisterCallbackButtonTriggered(() => sceneNavigator.LoadScene(EScene.NetworkOptionsScene)); appOptionsButton.RegisterCallbackButtonTriggered(() => sceneNavigator.LoadScene(EScene.CompanionAppOptionsScene)); developerOptionsButton.RegisterCallbackButtonTriggered(() => sceneNavigator.LoadScene(EScene.DevelopmentOptionsScene)); InitLanguageChooser(); InputManager.GetInputAction(R.InputActions.usplay_back).PerformedAsObservable(5) .Subscribe(_ => sceneNavigator.LoadScene(EScene.MainScene)); }