private void HandleSongListResponse(string downloadHandlerText) { try { LoadedSongsDto = JsonConverter.FromJson <LoadedSongsDto>(downloadHandlerText); if (!LoadedSongsDto.IsSongScanFinished && LoadedSongsDto.SongCount == 0) { SuccessfullyLoadedAllSongs = false; FireErrorMessageEvent(TranslationManager.GetTranslation(R.Messages.songList_error_noSongsFound)); return; } if (LoadedSongsDto.IsSongScanFinished) { SuccessfullyLoadedAllSongs = true; } songListEventStream.OnNext(new SongListEvent { LoadedSongsDto = LoadedSongsDto, }); } catch (Exception e) { Debug.LogException(e); SuccessfullyLoadedAllSongs = false; FireErrorMessageEvent(TranslationManager.GetTranslation(R.Messages.songList_error_general)); } }
public static string GetTranslatedName(this ESongOrder songOrder) { switch (songOrder) { case ESongOrder.Artist: return(TranslationManager.GetTranslation(R.Messages.order_Artist)); case ESongOrder.Title: return(TranslationManager.GetTranslation(R.Messages.order_Title)); case ESongOrder.Genre: return(TranslationManager.GetTranslation(R.Messages.order_Genre)); case ESongOrder.Language: return(TranslationManager.GetTranslation(R.Messages.order_Language)); case ESongOrder.Folder: return(TranslationManager.GetTranslation(R.Messages.order_Folder)); case ESongOrder.Year: return(TranslationManager.GetTranslation(R.Messages.order_Year)); case ESongOrder.CountCanceled: return(TranslationManager.GetTranslation(R.Messages.order_CountCanceled)); case ESongOrder.CountFinished: return(TranslationManager.GetTranslation(R.Messages.order_CountFinished)); default: return(TranslationManager.GetTranslation(R.Messages.order_Artist)); } }
public void UpdateTranslation() { normalNoteScoreContainer.Q <Label>(R.UxmlNames.scoreName).text = TranslationManager.GetTranslation(R.Messages.score_notes); goldenNoteScoreContainer.Q <Label>(R.UxmlNames.scoreName).text = TranslationManager.GetTranslation(R.Messages.score_goldenNotes); phraseBonusScoreContainer.Q <Label>(R.UxmlNames.scoreName).text = TranslationManager.GetTranslation(R.Messages.score_phraseBonus); totalScoreContainer.Q <Label>(R.UxmlNames.scoreName).text = TranslationManager.GetTranslation(R.Messages.score_total); }
public void UpdateTranslation() { if (!Application.isPlaying && sceneTitle == null) { SceneInjectionManager.Instance.DoInjection(); } sceneTitle.text = TranslationManager.GetTranslation(R.Messages.companionApp_title); connectionStatusText.text = TranslationManager.GetTranslation(R.Messages.companionApp_connecting); recordingDeviceLabel.text = TranslationManager.GetTranslation(R.Messages.options_recording_title); languageLabel.text = TranslationManager.GetTranslation(R.Messages.language); devModeLabel.text = TranslationManager.GetTranslation(R.Messages.devMode); visualizeAudioLabel.text = TranslationManager.GetTranslation(R.Messages.companionApp_visualizeMicInput); showMicViewButton.text = TranslationManager.GetTranslation(R.Messages.companionApp_button_showMicrophone); showSongViewButton.text = TranslationManager.GetTranslation(R.Messages.companionApp_button_showSongs); closeMenuButton.text = TranslationManager.GetTranslation(R.Messages.back); recordingDevicePickerControl.UpdateLabelText(); languagePickerControl.UpdateLabelText(); TranslationManager.GetTranslation("yes"); devModePickerControl.UpdateLabelText(); // Search text field hint string searchPropertiesText = new List <string> { TranslationManager.GetTranslation(R.Messages.songProperty_artist), TranslationManager.GetTranslation(R.Messages.songProperty_title), }.ToCsv(", ", "", ""); songSearchHint.text = TranslationManager.GetTranslation(R.Messages.songSelectScene_searchTextFieldHint, "properties", searchPropertiesText); }
private void StartLiveView() { //if (!IsActive) // return; string resp = SelectedCameraDevice.GetProhibitionCondition(OperationEnum.LiveView); if (string.IsNullOrEmpty(resp)) { Thread thread = new Thread(StartLiveViewThread); thread.Start(); thread.Join(); } else { Log.Error("Error starting live view " + resp); // in nikon case no show error message // if the images not transferd yet from SDRam if (resp != "LabelImageInRAM" && resp != "LabelCommandProcesingError") { ServiceProvider.WindowsManager.ExecuteCommand(WindowsCmdConsts.LiveViewWnd_Message, TranslationStrings.LabelLiveViewError + "\n" + TranslationManager.GetTranslation(resp)); } } }
private void UpdateSongStatistics(SongMeta songMeta) { LocalStatistic localStatistic = statistics.GetLocalStats(songMeta); if (localStatistic != null) { timesClearedLabel.text = TranslationManager.GetTranslation(R.Messages.songSelectScene_timesClearedInfo, "value", localStatistic.TimesFinished); timesCanceledLabel.text = TranslationManager.GetTranslation(R.Messages.songSelectScene_timesCanceledInfo, "value", localStatistic.TimesCanceled); List <SongStatistic> topScores = localStatistic.StatsEntries.GetTopScores(3); List <int> topScoreNumbers = topScores.Select(it => it.Score).ToList(); UpdateTopScoreLabels(topScoreNumbers, localHighScoreContainer); UpdateTopScoreLabels(new List <int>(), onlineHighScoreContainer); } else { timesClearedLabel.text = ""; timesCanceledLabel.text = ""; UpdateTopScoreLabels(new List <int>(), localHighScoreContainer); UpdateTopScoreLabels(new List <int>(), onlineHighScoreContainer); } }
private void UpdateConnectionStatus(ConnectEvent connectEvent) { if (connectEvent.IsSuccess) { connectionStatusText.text = TranslationManager.GetTranslation(R.Messages.companionApp_connectedTo, "remote", connectEvent.ServerIpEndPoint.Address); onlyVisibleWhenConnected.ForEach(it => it.ShowByDisplay()); onlyVisibleWhenNotConnected.ForEach(it => it.HideByDisplay()); audioWaveForm.SetVisibleByDisplay(settings.ShowAudioWaveForm); connectionThroubleshootingText.HideByDisplay(); serverErrorResponseText.HideByDisplay(); toggleRecordingButton.Focus(); connectionInfoText.text = $"Connected to {connectEvent.ServerIpEndPoint.Address}:{connectEvent.ServerIpEndPoint.Port}"; } else { connectionInfoText.text = "Not connected"; connectionStatusText.text = connectEvent.ConnectRequestCount > 0 ? TranslationManager.GetTranslation(R.Messages.companionApp_connectingWithFailedAttempts, "count", connectEvent.ConnectRequestCount) : TranslationManager.GetTranslation(R.Messages.companionApp_connecting); onlyVisibleWhenConnected.ForEach(it => it.HideByDisplay()); onlyVisibleWhenNotConnected.ForEach(it => it.ShowByDisplay()); if (connectEvent.ConnectRequestCount > ConnectRequestCountShowTroubleshootingHintThreshold) { connectionThroubleshootingText.ShowByDisplay(); connectionThroubleshootingText.text = TranslationManager.GetTranslation(R.Messages.companionApp_troubleShootingHints); } if (!connectEvent.ErrorMessage.IsNullOrEmpty()) { serverErrorResponseText.ShowByDisplay(); serverErrorResponseText.text = connectEvent.ErrorMessage; } } }
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 UpdateConnectionStatus(ConnectEvent connectEvent) { if (connectEvent.IsSuccess) { connectionStatusText.text = TranslationManager.GetTranslation(R.Messages.connectedTo, "remote", connectEvent.ServerIpEndPoint.Address); uiDoc.rootVisualElement.Query(null, "onlyVisibleWhenConnected").ForEach(it => it.Show()); audioWaveForm.SetVisible(settings.ShowAudioWaveForm); connectionThroubleshootingText.Hide(); serverErrorResponseText.Hide(); toggleRecordingButton.Focus(); UpdateRecordingDeviceButtons(); } else { connectionStatusText.text = connectEvent.ConnectRequestCount > 0 ? TranslationManager.GetTranslation(R.Messages.connectingWithFailedAttempts, "count", connectEvent.ConnectRequestCount) : TranslationManager.GetTranslation(R.Messages.connecting); uiDoc.rootVisualElement.Query(null, "onlyVisibleWhenConnected").ForEach(it => it.Hide()); if (connectEvent.ConnectRequestCount > ConnectRequestCountShowTroubleshootingHintThreshold) { connectionThroubleshootingText.Show(); connectionThroubleshootingText.text = TranslationManager.GetTranslation(R.Messages.troubleShootingHints); } if (!connectEvent.ErrorMessage.IsNullOrEmpty()) { serverErrorResponseText.Show(); serverErrorResponseText.text = connectEvent.ErrorMessage; } } }
public void UpdateTranslation() { if (!Application.isPlaying && sceneTitle == null) { SceneInjectionManager.Instance.DoInjection(); } sceneTitle.text = TranslationManager.GetTranslation(R.Messages.songSelectScene_title); menuButton.text = TranslationManager.GetTranslation(R.Messages.menu); closeMenuOverlayButton.text = TranslationManager.GetTranslation(R.Messages.back); backToMainMenuButton.text = TranslationManager.GetTranslation(R.Messages.mainScene_title); toggleSongDetailOverlayButton.text = TranslationManager.GetTranslation(R.Messages.songSelectScene_toggleSongDetailsButton); duetLegendLabel.text = TranslationManager.GetTranslation(R.Messages.songSelectScene_duetLegendLabel); videoLegendLabel.text = TranslationManager.GetTranslation(R.Messages.songSelectScene_videoLegendLabel); closePlayerSelectOverlayButton.text = TranslationManager.GetTranslation(R.Messages.back); startButton.text = TranslationManager.GetTranslation(R.Messages.mainScene_button_sing_label); localHighScoreContainer.Q <Label>(R.UxmlNames.title).text = TranslationManager.GetTranslation(R.Messages.songSelectScene_localTopScoresTitle); onlineHighScoreContainer.Q <Label>(R.UxmlNames.title).text = TranslationManager.GetTranslation(R.Messages.songSelectScene_onlineTopScoresTitle); PlaylistChooserControl.UpdateTranslation(); SongSearchControl.UpdateTranslation(); songRouletteControl.UpdateTranslation(); UpdateInputLegend(); }
private VisualElement CreatePlayerProfileEntry(PlayerProfile playerProfile, int indexInList) { VisualElement result = playerProfileListEntryAsset.CloneTree(); Button deleteButton = result.Q <Button>(R.UxmlNames.deleteButton); deleteButton.text = TranslationManager.GetTranslation(R.Messages.delete); deleteButton.RegisterCallbackButtonTriggered(() => { settings.PlayerProfiles.RemoveAt(indexInList); UpdatePlayerProfileList(); backButton.Focus(); }); TextField nameTextField = result.Q <TextField>(R.UxmlNames.nameTextField); nameTextField.value = playerProfile.Name; nameTextField.RegisterValueChangedCallback(evt => playerProfile.Name = evt.newValue); Toggle enabledToggle = result.Q <Toggle>(R.UxmlNames.enabledToggle); enabledToggle.value = playerProfile.IsEnabled; enabledToggle.RegisterValueChangedCallback(evt => playerProfile.IsEnabled = evt.newValue); result.Q <Label>(R.UxmlNames.enabledLabel).text = TranslationManager.GetTranslation(R.Messages.active); new AvatarPickerControl(result.Q <ItemPicker>(R.UxmlNames.avatarPicker), uiManager) .Bind(() => playerProfile.Avatar, newValue => playerProfile.Avatar = newValue); new DifficultyPicker(result.Q <ItemPicker>(R.UxmlNames.difficultyPicker)) .Bind(() => playerProfile.Difficulty, newValue => playerProfile.Difficulty = newValue); return(result); }
private void ShowHighscores(SongMeta songMeta, EDifficulty difficulty) { currentDifficulty = difficulty; difficultyText.text = TranslationManager.GetTranslation(R.Messages.difficulty) + ": " + difficulty.GetTranslatedName(); titleAndArtistText.text = $"{songMeta.Title} - {songMeta.Artist}"; LocalStatistic localStatistic = statistics.GetLocalStats(songMeta); List <SongStatistic> songStatistics = localStatistic?.StatsEntries?.SongStatistics? .Where(it => it.Difficulty == difficulty).ToList(); if (songStatistics.IsNullOrEmpty()) { songStatistics = new List <SongStatistic>(); } songStatistics.Sort(new CompareBySongScoreDescending()); List <SongStatistic> topSongStatistics = songStatistics.Take(highscoreEntries.Count).ToList(); for (int i = 0; i < highscoreEntries.Count; i++) { if (i < topSongStatistics.Count) { highscoreEntries[i].ShowByDisplay(); FillHighscoreEntry(highscoreEntries[i], topSongStatistics[i], i); } else { highscoreEntries[i].HideByDisplay(); } } // update "next difficulty button" text UpdateTranslation(); }
public void UpdateTranslation() { string displayName = releaseName.IsNullOrEmpty() ? remoteRelease : releaseName; dialogMessage.text = TranslationManager.GetTranslation(R.Messages.newVersionAvailableDialog_message, "remoteRelease", displayName, "websiteLink", websiteLink); dialogTitle.text = TranslationManager.GetTranslation(R.Messages.newVersionAvailableDialog_title); ignoreThisVersionButton.text = TranslationManager.GetTranslation(R.Messages.newVersionAvailableDialog_ignoreThisVersion); ignoreAllFutureVersionsButton.text = TranslationManager.GetTranslation(R.Messages.newVersionAvailableDialog_ignoreAllFutureVersions); }
public SampleRatePickerControl(ItemPicker itemPicker) : base(itemPicker, new List <int> { 0, 48000, 44100, 22050, 16000 }) { GetLabelTextFunction = item => item <= 0 ? TranslationManager.GetTranslation(R.Messages.options_sampleRate_auto) : item.ToString(); }
public void UpdateTranslation() { sceneTitle.text = TranslationManager.GetTranslation(R.Messages.highscoreScene_title); continueButton.text = TranslationManager.GetTranslation(R.Messages.continue_); EDifficulty nextDifficulty = GetNextDifficulty(currentDifficulty, 1); nextItemButton.Q <Label>().text = nextDifficulty.GetTranslatedName(); }
public void UpdateTranslation() { if (!Application.isPlaying && backButton == null) { SceneInjectionManager.Instance.DoInjection(); } backButton.text = TranslationManager.GetTranslation(R.Messages.back); sceneTitle.text = TranslationManager.GetTranslation(R.Messages.aboutScene_title); }
public void UpdateTranslation() { if (!Application.isPlaying && backButton == null) { SceneInjectionManager.Instance.DoInjection(); } downloadSceneButton.text = TranslationManager.GetTranslation(R.Messages.options_downloadSongs_button); backButton.text = TranslationManager.GetTranslation(R.Messages.back); sceneTitle.text = TranslationManager.GetTranslation(R.Messages.options_songLibrary_title); }
public SongOrderPickerControl(ItemPicker itemPicker) : base(itemPicker, EnumUtils.GetValuesAsList <ESongOrder>()) { GetLabelTextFunction = (songOrder) => { string prefixTranslation = TranslationManager.GetTranslation(R.Messages.order); string valueTranslation = songOrder.GetTranslatedName(); return($"{prefixTranslation}:\n{valueTranslation}"); }; }
public void UpdateTranslation() { if (!Application.isPlaying && createPlaylistButton == null) { SceneInjectionManager.Instance.DoInjection(); } playlistChooserDropdownTitle.text = TranslationManager.GetTranslation(R.Messages.songSelectScene_playlistDropdownTitle); editPlaylistButton.text = TranslationManager.GetTranslation(R.Messages.songSelectScene_editPlaylistButton); createPlaylistButton.text = TranslationManager.GetTranslation(R.Messages.songSelectScene_createPlaylistButton); }
// public override void UpdateTranslation() { // Static method to access translations. // In this example, a generated constant is used to access the translation (avoids typos and makes refactoring easier). // The path to the generated resources folder is specified in the TranslationManager. // After the translation key, further arguments can be given in the form [key1, value1, key2, value2, ...]. GetComponent <Text>().text = TranslationManager.GetTranslation(R.Messages.sampleScene_staticMethodAccessExample, "city", city, "age", age); }
public void UpdateTranslation() { if (!Application.isPlaying && backButton == null) { SceneInjectionManager.Instance.DoInjection(); } ratePlayersContainer.Q <Label>().text = TranslationManager.GetTranslation(R.Messages.options_ratePlayers); combineDuetScoresContainer.Q <Label>().text = TranslationManager.GetTranslation(R.Messages.options_combineDuetScores); backButton.text = TranslationManager.GetTranslation(R.Messages.back); sceneTitle.text = TranslationManager.GetTranslation(R.Messages.options_game_title); }
public void UpdateTranslation() { if (!Application.isPlaying && backButton == null) { SceneInjectionManager.Instance.DoInjection(); } resolutionContainer.Q <Label>().text = TranslationManager.GetTranslation(R.Messages.options_resolution); fpsContainer.Q <Label>().text = TranslationManager.GetTranslation(R.Messages.options_targetFps); fullscreenContainer.Q <Label>().text = TranslationManager.GetTranslation(R.Messages.options_fullscreenMode); backButton.text = TranslationManager.GetTranslation(R.Messages.back); sceneTitle.text = TranslationManager.GetTranslation(R.Messages.options_graphics_title); }
private void UpdateConnectedClients() { connectedClientList.Clear(); serverSideConnectRequestManager.GetAllConnectedClientHandlers() .ForEach(clientHandler => { connectedClientList.Add(CreateClientEntry(clientHandler)); }); connectedClientCountLabel.text = TranslationManager.GetTranslation(R.Messages.options_connectedClientCount, "count", ServerSideConnectRequestManager.ConnectedClientCount); }
public void UpdateTranslation() { if (!Application.isPlaying && backButton == null) { SceneInjectionManager.Instance.DoInjection(); } showFpsContainer.Q <Label>().text = TranslationManager.GetTranslation(R.Messages.options_showFps); pitchDetectionAlgorithmContainer.Q <Label>().text = TranslationManager.GetTranslation(R.Messages.options_pitchDetectionAlgorithm); analyzeBeatsWithoutTargetNoteContainer.Q <Label>().text = TranslationManager.GetTranslation(R.Messages.options_analyzeBeatsWithoutTargetNote); backButton.text = TranslationManager.GetTranslation(R.Messages.back); sceneTitle.text = TranslationManager.GetTranslation(R.Messages.options_development_title); }
public void UpdateTranslation() { if (!Application.isPlaying && backButton == null) { SceneInjectionManager.Instance.DoInjection(); } backgroundMusicEnabledLabel.text = TranslationManager.GetTranslation(R.Messages.options_backgroundMusicEnabled); previewVolumeLabel.text = TranslationManager.GetTranslation(R.Messages.options_previewVolume); volumeLabel.text = TranslationManager.GetTranslation(R.Messages.options_volume); backButton.text = TranslationManager.GetTranslation(R.Messages.back); sceneTitle.text = TranslationManager.GetTranslation(R.Messages.options_sound_title); }
public void UpdateTranslation() { if (!Application.isPlaying && connectionStatusText == null) { SceneInjectionManager.Instance.DoInjection(); } connectionStatusText.text = TranslationManager.GetTranslation(R.Messages.connecting); sceneTitle.text = TranslationManager.GetTranslation(R.Messages.title); visualizeAudioToggle.label = TranslationManager.GetTranslation(R.Messages.visualizeMicInput); showSongListButton.text = TranslationManager.GetTranslation(R.Messages.songList_show); closeSongListButton.text = TranslationManager.GetTranslation(R.Messages.songList_hide); }
private void UpdateFps() { frameCountTime += Time.deltaTime; frameCount++; if (frameCountTime > 1) { int fps = (int)(frameCount / frameCountTime); fpsText.text = TranslationManager.GetTranslation(R.Messages.fps, "value", fps); frameCount = 0; frameCountTime = 0; } }
TranslateText([FromBody] TranslationInput translationInput) { if (translationInput.Text == null || translationInput.To == null) { return(BadRequest()); } TranslationManager.OriginalText = translationInput.Text; var result = await TranslationManager.GetTranslation(translationInput.To); return(Ok(result)); }
private void OnRecordingStateChanged(bool isRecording) { if (isRecording) { toggleRecordingButton.text = TranslationManager.GetTranslation(R.Messages.stopRecording); toggleRecordingButton.AddToClassList("stopRecordingButton"); } else { toggleRecordingButton.text = TranslationManager.GetTranslation(R.Messages.startRecording); toggleRecordingButton.RemoveFromClassList("stopRecordingButton"); } }
private VisualElement CreateSongFolderEntry(string songDir, int indexInList) { VisualElement result = songFolderListEntryAsset.CloneTree(); VisualElement warningContainer = result.Q <VisualElement>(R.UxmlNames.warningContainer); Label warningLabel = warningContainer.Q <Label>(R.UxmlNames.warningLabel); void CheckFolderExists(string path) { if (Directory.Exists(path)) { warningContainer.HideByDisplay(); } else if (File.Exists(path)) { warningContainer.ShowByDisplay(); warningLabel.text = "Not a folder."; } else { warningContainer.ShowByDisplay(); warningLabel.text = "File does not exist."; } } TextField textField = result.Q <TextField>(R.UxmlNames.pathTextField); textField.value = songDir; PathTextFieldControl pathTextFieldControl = new(textField); pathTextFieldControl.ValueChangedEventStream .Subscribe(newValueUnescaped => { settings.GameSettings.songDirs[indexInList] = newValueUnescaped; CheckFolderExists(newValueUnescaped); }); Button deleteButton = result.Q <Button>(R.UxmlNames.deleteButton); deleteButton.text = TranslationManager.GetTranslation(R.Messages.delete); deleteButton.RegisterCallbackButtonTriggered(() => { settings.GameSettings.songDirs.RemoveAt(indexInList); UpdateSongFolderList(); backButton.Focus(); }); CheckFolderExists(songDir); return(result); }