Skip to content

Commit

Permalink
Merge pull request #1376 from andy840119/implement-the-first-time-setup
Browse files Browse the repository at this point in the history
Implement first-run step for the ruleset.
  • Loading branch information
andy840119 authored Jun 11, 2022
2 parents 6aa8b20 + a234871 commit 6e07a51
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@ public static class KaraokeSettingsSubsectionStrings
{
private const string prefix = @"osu.Game.Rulesets.Karaoke.Resources.Localisation.KaraokeSettingsSubsection";

/// <summary>
/// "Scrolling direction"
/// </summary>
public static LocalisableString ScrollingDirection => new TranslatableString(getKey(@"scrolling_direction"), @"Scrolling direction");

/// <summary>
/// "Adjust the scroll direction in the scoring area. Will show that in the gameplay if the beatmap is support the scoring."
/// </summary>
public static LocalisableString ScrollingDirectionTooltip => new TranslatableString(
getKey(@"scrolling_direction_tooltip"),
@"Adjust the scroll direction in the scoring area. Will show that in the gameplay if the beatmap is support the scoring."
);

/// <summary>
/// "Scroll speed"
/// </summary>
Expand All @@ -19,11 +32,21 @@ public static class KaraokeSettingsSubsectionStrings
/// </summary>
public static LocalisableString ShowCursorWhilePlaying => new TranslatableString(getKey(@"show_cursor_while_playing"), @"Show cursor while playing");

/// <summary>
/// "Will not showing the cursor while gameplay if not select this option."
/// </summary>
public static LocalisableString ShowCursorWhilePlayingTooltip => new TranslatableString(getKey(@"show_cursor_while_playing_tooltip"), @"Will not showing the cursor while gameplay if not select this option.");

/// <summary>
/// "Translate"
/// </summary>
public static LocalisableString Translate => new TranslatableString(getKey(@"translate"), @"Translate");

/// <summary>
/// "Show the translation under the lyric if contains in the beatmap."
/// </summary>
public static LocalisableString TranslateTooltip => new TranslatableString(getKey(@"translate_tooltip"), @"Show the translation under the lyric if contains in the beatmap.");

/// <summary>
/// "Prefer language"
/// </summary>
Expand All @@ -32,12 +55,12 @@ public static class KaraokeSettingsSubsectionStrings
/// <summary>
/// "Select prefer translate language."
/// </summary>
public static LocalisableString SelectPreferTranslateLanguage => new TranslatableString(getKey(@"select_prefer_translate_language"), @"Select prefer translate language.");
public static LocalisableString PreferLanguageTooltip => new TranslatableString(getKey(@"prefer_language_tooltip"), @"Select prefer translate language.");

/// <summary>
/// "Microphone devices"
/// "Microphone device"
/// </summary>
public static LocalisableString MicrophoneDevices => new TranslatableString(getKey(@"microphone_devices"), @"Microphone devices");
public static LocalisableString MicrophoneDevice => new TranslatableString(getKey(@"microphone_device"), @"Microphone device");

/// <summary>
/// "Practice preempt time"
Expand All @@ -52,8 +75,7 @@ public static class KaraokeSettingsSubsectionStrings
/// <summary>
/// "Open ruleset settings for adjusting more configs."
/// </summary>
public static LocalisableString OpenRulesetSettingsForAdjustingMoreConfigs =>
new TranslatableString(getKey(@"open_ruleset_settings_for_adjusting_more_configs"), @"Open ruleset settings for adjusting more configs.");
public static LocalisableString OpenRulesetSettingsTooltip => new TranslatableString(getKey(@"open_ruleset_settings_tooltip"), @"Open ruleset settings for adjusting more configs.");

/// <summary>
/// "Change log"
Expand All @@ -63,7 +85,7 @@ public static class KaraokeSettingsSubsectionStrings
/// <summary>
/// "Let&#39;s see what karaoke! changed."
/// </summary>
public static LocalisableString LetsSeeWhatKaraokeChanged => new TranslatableString(getKey(@"lets_see_what_karaoke_changed"), @"Let's see what karaoke! changed.");
public static LocalisableString ChangeLogTooltip => new TranslatableString(getKey(@"change_log_tooltip"), @"Let's see what karaoke! changed.");

private static string getKey(string key) => $@"{prefix}:{key}";
}
Expand Down
20 changes: 16 additions & 4 deletions osu.Game.Rulesets.Karaoke/UI/KaraokeSettingsSubsection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,31 +38,43 @@ private void load()
Children = new Drawable[]
{
// Scrolling
new SettingsEnumDropdown<KaraokeScrollingDirection>
{
ClassicDefault = KaraokeScrollingDirection.Left,
LabelText = KaraokeSettingsSubsectionStrings.ScrollingDirection,
TooltipText = KaraokeSettingsSubsectionStrings.ScrollingDirectionTooltip,
Current = config.GetBindable<KaraokeScrollingDirection>(KaraokeRulesetSetting.ScrollDirection)
},
new SettingsSlider<double, TimeSlider>
{
LabelText = KaraokeSettingsSubsectionStrings.ScrollSpeed,
Current = config.GetBindable<double>(KaraokeRulesetSetting.ScrollTime)
},
// Gameplay
new SettingsCheckbox
{
LabelText = KaraokeSettingsSubsectionStrings.ShowCursorWhilePlaying,
TooltipText = KaraokeSettingsSubsectionStrings.ShowCursorWhilePlayingTooltip,
Current = config.GetBindable<bool>(KaraokeRulesetSetting.ShowCursor)
},
// Translate
new SettingsCheckbox
{
LabelText = KaraokeSettingsSubsectionStrings.Translate,
TooltipText = KaraokeSettingsSubsectionStrings.TranslateTooltip,
Current = config.GetBindable<bool>(KaraokeRulesetSetting.UseTranslate)
},
new SettingsLanguage
{
LabelText = KaraokeSettingsSubsectionStrings.PreferLanguage,
TooltipText = KaraokeSettingsSubsectionStrings.SelectPreferTranslateLanguage,
TooltipText = KaraokeSettingsSubsectionStrings.PreferLanguageTooltip,
Current = config.GetBindable<CultureInfo>(KaraokeRulesetSetting.PreferLanguage)
},
// Device
new SettingsMicrophoneDeviceDropdown
{
LabelText = KaraokeSettingsSubsectionStrings.MicrophoneDevices,
ClassicDefault = null,
LabelText = KaraokeSettingsSubsectionStrings.MicrophoneDevice,
Current = config.GetBindable<string>(KaraokeRulesetSetting.MicrophoneDevice)
},
// Practice
Expand All @@ -74,7 +86,7 @@ private void load()
new DangerousSettingsButton
{
Text = KaraokeSettingsSubsectionStrings.OpenRulesetSettings,
TooltipText = KaraokeSettingsSubsectionStrings.OpenRulesetSettingsForAdjustingMoreConfigs,
TooltipText = KaraokeSettingsSubsectionStrings.OpenRulesetSettingsTooltip,
Action = () =>
{
try
Expand All @@ -92,7 +104,7 @@ private void load()
new SettingsButton
{
Text = KaraokeSettingsSubsectionStrings.ChangeLog,
TooltipText = KaraokeSettingsSubsectionStrings.LetsSeeWhatKaraokeChanged,
TooltipText = KaraokeSettingsSubsectionStrings.ChangeLogTooltip,
Action = () =>
{
try
Expand Down

0 comments on commit 6e07a51

Please sign in to comment.