Skip to content

Commit 487ec47

Browse files
committed
Allow force to enable nightcore beats
1 parent c4ee72c commit 487ec47

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

KeyAsio.Gui/Models/RealtimeOptions.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public class RealtimeOptions : ViewModelBase
1616
private bool _enableMusicFunctions;
1717
private int _musicTrackVolume = 100;
1818
private int _effectTrackVolume = 100;
19+
private bool _forceNightcoreBeats;
1920

2021
[Description("If true, the software will enable memory scanning and play the right hitsounds of beatmaps.")]
2122
public bool RealtimeMode
@@ -106,4 +107,11 @@ public int EffectTrackVolume
106107
get => _effectTrackVolume;
107108
set => SetField(ref _effectTrackVolume, value);
108109
}
110+
111+
[Description("Force to use nightcore beats.")]
112+
public bool ForceNightcoreBeats
113+
{
114+
get => _forceNightcoreBeats;
115+
set => SetField(ref _forceNightcoreBeats, value);
116+
}
109117
}

KeyAsio.Gui/Realtime/RealtimeModeManager.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,14 @@ private async Task InitializeNodeListsAsync(string folder, string diffFilename)
419419
using var _ = DebugUtils.CreateTimer("InitAudio", Logger);
420420
var hitsoundList = await osuDir.GetHitsoundNodesAsync(osuFile);
421421
await Task.Delay(100);
422-
if (PlayMods != ModsInfo.Mods.Unknown && (PlayMods & ModsInfo.Mods.Nightcore) != 0)
422+
var isNightcore = PlayMods != ModsInfo.Mods.Unknown && (PlayMods & ModsInfo.Mods.Nightcore) != 0;
423+
if (isNightcore || AppSettings.RealtimeOptions.ForceNightcoreBeats)
423424
{
424-
Logger.Info("Current Mods:" + PlayMods);
425+
if (isNightcore)
426+
{
427+
Logger.Info("Current Mods:" + PlayMods);
428+
}
429+
425430
var list = NightcoreTilingHelper.GetHitsoundNodes(osuFile, TimeSpan.Zero);
426431
hitsoundList.AddRange(list);
427432
hitsoundList = hitsoundList.OrderBy(k => k.Offset).ToList();

KeyAsio.Gui/Windows/RealtimeOptionsWindow.xaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,21 @@
104104
Text="{Binding AppSettings.RealtimeOptions.IgnoreLineVolumes, Converter={StaticResource Boolean2StringConverter}, ConverterParameter=Off;On}" />
105105
</StackPanel>
106106
</StackPanel>
107+
108+
<StackPanel>
109+
<TextBlock Margin="0,0,0,10" Text="Force nightcore beats" />
110+
<StackPanel Margin="0,0,0,10" Orientation="Horizontal">
111+
<ToggleButton
112+
Margin="0,0,8,0"
113+
HorizontalAlignment="Left"
114+
IsChecked="{Binding AppSettings.RealtimeOptions.ForceNightcoreBeats}"
115+
Style="{StaticResource ToggleButtonSwitch}" />
116+
<TextBlock
117+
VerticalAlignment="Center"
118+
FontSize="12"
119+
Text="{Binding AppSettings.RealtimeOptions.ForceNightcoreBeats, Converter={StaticResource Boolean2StringConverter}, ConverterParameter=Off;On}" />
120+
</StackPanel>
121+
</StackPanel>
107122
</UniformGrid>
108123
<TextBlock Margin="0,0,0,10" Text="Playback behavior for slider tail" />
109124
<ComboBox

0 commit comments

Comments
 (0)