Skip to content

Commit

Permalink
Merge pull request #200 from andy840119/banana/update-package
Browse files Browse the repository at this point in the history
Update package.
  • Loading branch information
andy840119 authored Oct 10, 2020
2 parents cc5a4fb + 63b1d05 commit 0b10981
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 57 deletions.
12 changes: 6 additions & 6 deletions osu.Game.Rulesets.Karaoke/Edit/KaraokeSelectionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ protected override IEnumerable<MenuItem> GetContextMenuItemsForSelection(IEnumer
};
}

if (SelectedHitObjects.All(x => x is Note)
&& SelectedHitObjects.Count() > 1)
if (EditorBeatmap.SelectedHitObjects.All(x => x is Note)
&& EditorBeatmap.SelectedHitObjects.Count() > 1)
{
var menu = new List<MenuItem>();
var selectedObject = SelectedHitObjects.Cast<Note>().OrderBy(x => x.StartTime);
var selectedObject = EditorBeatmap.SelectedHitObjects.Cast<Note>().OrderBy(x => x.StartTime);

// Set multi note display property
menu.Add(createMultiNoteDisplayPropertyMenuItem(selectedObject));
Expand Down Expand Up @@ -108,7 +108,7 @@ private MenuItem createLayoutMenuItem()
ChangeHandler.BeginChange();

if (state == TernaryState.True)
SelectedHitObjects.Cast<LyricLine>().ForEach(l => l.LayoutIndex = x.Key);
EditorBeatmap.SelectedHitObjects.Cast<LyricLine>().ForEach(l => l.LayoutIndex = x.Key);

ChangeHandler.EndChange();
})).ToArray()
Expand All @@ -125,7 +125,7 @@ private MenuItem createFontMenuItem()
ChangeHandler.BeginChange();

if (state == TernaryState.True)
SelectedHitObjects.Cast<LyricLine>().ForEach(l => l.FontIndex = x.Key);
EditorBeatmap.SelectedHitObjects.Cast<LyricLine>().ForEach(l => l.FontIndex = x.Key);

ChangeHandler.EndChange();
})).ToArray()
Expand Down Expand Up @@ -174,7 +174,7 @@ private void performColumnMovement(Tone lastTone, MoveSelectionEvent moveEvent)
if (deltaTone == 0)
return;

foreach (var note in SelectedHitObjects.OfType<Note>())
foreach (var note in EditorBeatmap.SelectedHitObjects.OfType<Note>())
{
if (note.Tone >= calculator.MaxTone() && deltaTone > 0)
continue;
Expand Down
4 changes: 0 additions & 4 deletions osu.Game.Rulesets.Karaoke/Judgements/KaraokeLyricJudgement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ public class KaraokeLyricJudgement : KaraokeJudgement
{
public LyricTime Time { get; set; }

protected override int NumericResultFor(HitResult result) => 0;

public override bool AffectsCombo => false;

public override HitResult MaxResult => HitResult.Perfect;

protected override double HealthIncreaseFor(HitResult result) => 0;
Expand Down
27 changes: 0 additions & 27 deletions osu.Game.Rulesets.Karaoke/Judgements/KaraokeNoteJudgement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,6 @@ public class KaraokeNoteJudgement : KaraokeJudgement
{
public bool Saitenable { get; set; }

protected override int NumericResultFor(HitResult result)
{
if (!Saitenable)
return 0;

switch (result)
{
default:
return 0;

case HitResult.Meh:
return 300;

case HitResult.Ok:
return 100;

case HitResult.Good:
return 200;

case HitResult.Great:
case HitResult.Perfect:
return 300;
}
}

public override bool AffectsCombo => Saitenable;

protected override double HealthIncreaseFor(HitResult result)
{
if (!Saitenable)
Expand Down
27 changes: 27 additions & 0 deletions osu.Game.Rulesets.Karaoke/KaraokeRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,33 @@ public override IEnumerable<Mod> GetModsFor(ModType type)

public override RulesetSettingsSubsection CreateSettings() => new KaraokeSettingsSubsection(this);

protected override IEnumerable<HitResult> GetValidHitResults()
{
return new[]
{
HitResult.Great,
HitResult.Ok,
HitResult.Meh,
};
}

public override string GetDisplayNameForHitResult(HitResult result)
{
switch (result)
{
case HitResult.Great:
return "Great";

case HitResult.Ok:
return "OK";

case HitResult.Meh:
return "Meh";
}

return base.GetDisplayNameForHitResult(result);
}

public override StatisticRow[] CreateStatisticsForScore(ScoreInfo score, IBeatmap playableBeatmap)
{
const int fix_height = 560;
Expand Down
28 changes: 14 additions & 14 deletions osu.Game.Rulesets.Karaoke/UI/KaraokeSettingsSubsection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,76 +36,76 @@ private void load(OsuGame game)
new SettingsEnumDropdown<KaraokeScrollingDirection>
{
LabelText = "Scrolling direction",
Bindable = config.GetBindable<KaraokeScrollingDirection>(KaraokeRulesetSetting.ScrollDirection)
Current = config.GetBindable<KaraokeScrollingDirection>(KaraokeRulesetSetting.ScrollDirection)
},
new SettingsSlider<double, TimeSlider>
{
LabelText = "Scroll speed",
Bindable = config.GetBindable<double>(KaraokeRulesetSetting.ScrollTime)
Current = config.GetBindable<double>(KaraokeRulesetSetting.ScrollTime)
},
new SettingsCheckbox
{
LabelText = "Display alternative text",
Bindable = config.GetBindable<bool>(KaraokeRulesetSetting.DisplayAlternativeText)
Current = config.GetBindable<bool>(KaraokeRulesetSetting.DisplayAlternativeText)
},
new SettingsCheckbox
{
LabelText = "Show cursor while playing",
Bindable = config.GetBindable<bool>(KaraokeRulesetSetting.ShowCursor)
Current = config.GetBindable<bool>(KaraokeRulesetSetting.ShowCursor)
},
// Translate
new SettingsCheckbox
{
LabelText = "Translate",
Bindable = config.GetBindable<bool>(KaraokeRulesetSetting.UseTranslate)
Current = config.GetBindable<bool>(KaraokeRulesetSetting.UseTranslate)
},
new SettingsTextBox
{
LabelText = "Prefer language",
Bindable = config.GetBindable<string>(KaraokeRulesetSetting.PreferLanguage)
Current = config.GetBindable<string>(KaraokeRulesetSetting.PreferLanguage)
},
// Pitch
new SettingsCheckbox
{
LabelText = "Override pitch at gameplay",
Bindable = config.GetBindable<bool>(KaraokeRulesetSetting.OverridePitchAtGameplay)
Current = config.GetBindable<bool>(KaraokeRulesetSetting.OverridePitchAtGameplay)
},
new MicrophoneDeviceSettingsDropdown
{
LabelText = "Microphone devices",
Items = microphoneManager.MicrophoneDeviceNames,
Bindable = config.GetBindable<string>(KaraokeRulesetSetting.MicrophoneDevice)
Current = config.GetBindable<string>(KaraokeRulesetSetting.MicrophoneDevice)
},
new SettingsSlider<int, PitchSlider>
{
LabelText = "Pitch",
Bindable = config.GetBindable<int>(KaraokeRulesetSetting.Pitch)
Current = config.GetBindable<int>(KaraokeRulesetSetting.Pitch)
},
new SettingsCheckbox
{
LabelText = "Override vocal pitch at gameplay",
Bindable = config.GetBindable<bool>(KaraokeRulesetSetting.OverrideVocalPitchAtGameplay)
Current = config.GetBindable<bool>(KaraokeRulesetSetting.OverrideVocalPitchAtGameplay)
},
new SettingsSlider<int, PitchSlider>
{
LabelText = "Vocal pitch",
Bindable = config.GetBindable<int>(KaraokeRulesetSetting.VocalPitch)
Current = config.GetBindable<int>(KaraokeRulesetSetting.VocalPitch)
},
new SettingsCheckbox
{
LabelText = "Override saiten pitch at gameplay",
Bindable = config.GetBindable<bool>(KaraokeRulesetSetting.OverrideSaitenPitchAtGameplay)
Current = config.GetBindable<bool>(KaraokeRulesetSetting.OverrideSaitenPitchAtGameplay)
},
new SettingsSlider<int, PitchSlider>
{
LabelText = "Saiten pitch",
Bindable = config.GetBindable<int>(KaraokeRulesetSetting.SaitenPitch)
Current = config.GetBindable<int>(KaraokeRulesetSetting.SaitenPitch)
},
// Practice
new SettingsSlider<double, TimeSlider>
{
LabelText = "Practice preempt time",
Bindable = config.GetBindable<double>(KaraokeRulesetSetting.PracticePreemptTime)
Current = config.GetBindable<double>(KaraokeRulesetSetting.PracticePreemptTime)
},
new SettingsButton
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ public PitchSettings()
[BackgroundDependencyLoader]
private void load(KaraokeSessionStatics session)
{
pitchSliderBar.Bindable = session.GetBindable<int>(KaraokeRulesetSession.Pitch);
vocalPitchSliderBar.Bindable = session.GetBindable<int>(KaraokeRulesetSession.VocalPitch);
saitenPitchSliderBar.Bindable = session.GetBindable<int>(KaraokeRulesetSession.SaitenPitch);
pitchSliderBar.Current = session.GetBindable<int>(KaraokeRulesetSession.Pitch);
vocalPitchSliderBar.Current = session.GetBindable<int>(KaraokeRulesetSession.VocalPitch);
saitenPitchSliderBar.Current = session.GetBindable<int>(KaraokeRulesetSession.SaitenPitch);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void OnReleased(KaraokeAction action)
[BackgroundDependencyLoader]
private void load(KaraokeSessionStatics session)
{
playBackSliderBar.Bindable = session.GetBindable<int>(KaraokeRulesetSession.PlaybackSpeed);
playBackSliderBar.Current = session.GetBindable<int>(KaraokeRulesetSession.PlaybackSpeed);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void OnReleased(KaraokeAction action)
[BackgroundDependencyLoader]
private void load(KaraokeRulesetConfigManager config, KaraokeSessionStatics session)
{
preemptTimeSliderBar.Bindable = config.GetBindable<double>(KaraokeRulesetSetting.PracticePreemptTime);
preemptTimeSliderBar.Current = config.GetBindable<double>(KaraokeRulesetSetting.PracticePreemptTime);
session.BindWith(KaraokeRulesetSession.NowLyric, lyricPreview.SelectedLyricLine);
}
}
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Karaoke/osu.Game.Rulesets.Karaoke.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageReference Include="ILRepack.MSBuild.Task" Version="2.0.13" />
<PackageReference Include="Octokit" Version="0.48.0" />
<PackageReference Include="osu.Framework.Microphone" Version="1.0.10" />
<PackageReference Include="ppy.osu.Game" Version="2020.1005.0" />
<PackageReference Include="ppy.osu.Game" Version="2020.1009.0" />
<PackageReference Include="LyricMaker" Version="1.1.1" />
<PackageReference Include="NicoKaraParser" Version="1.1.0" />
<PackageReference Include="osu.KaraokeFramework" Version="1.2.1" />
Expand Down

0 comments on commit 0b10981

Please sign in to comment.