1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 12:33:01 +08:00

Apply naming and styling changes

This commit is contained in:
Dean Herbert 2019-11-12 10:45:46 +09:00
parent b37bf4ea01
commit a43b0ee01b
2 changed files with 10 additions and 8 deletions

View File

@ -203,12 +203,14 @@ namespace osu.Game.Rulesets.Osu.Objects
var sampleList = new List<HitSampleInfo>(); var sampleList = new List<HitSampleInfo>();
if (firstSample != null) if (firstSample != null)
{
sampleList.Add(new HitSampleInfo sampleList.Add(new HitSampleInfo
{ {
Bank = firstSample.Bank, Bank = firstSample.Bank,
Volume = firstSample.Volume, Volume = firstSample.Volume,
Name = @"slidertick", Name = @"slidertick",
}); });
}
foreach (var tick in NestedHitObjects.OfType<SliderTick>()) foreach (var tick in NestedHitObjects.OfType<SliderTick>())
tick.Samples = sampleList; tick.Samples = sampleList;

View File

@ -241,36 +241,36 @@ namespace osu.Game.Screens.Edit.Compose.Components
private MenuItem createHitSampleMenuItem(string name, string sampleName) private MenuItem createHitSampleMenuItem(string name, string sampleName)
{ {
return new ThreeStateMenuItem(name, MenuItemType.Standard, setHitSampleState) return new TernaryStateMenuItem(name, MenuItemType.Standard, setHitSampleState)
{ {
State = { Value = getHitSampleState() } State = { Value = getHitSampleState() }
}; };
void setHitSampleState(ThreeStates state) void setHitSampleState(TernaryState state)
{ {
switch (state) switch (state)
{ {
case ThreeStates.Disabled: case TernaryState.False:
RemoveHitSample(sampleName); RemoveHitSample(sampleName);
break; break;
case ThreeStates.Enabled: case TernaryState.True:
AddHitSample(sampleName); AddHitSample(sampleName);
break; break;
} }
} }
ThreeStates getHitSampleState() TernaryState getHitSampleState()
{ {
int countExisting = SelectedHitObjects.Count(h => h.Samples.Any(s => s.Name == sampleName)); int countExisting = SelectedHitObjects.Count(h => h.Samples.Any(s => s.Name == sampleName));
if (countExisting == 0) if (countExisting == 0)
return ThreeStates.Disabled; return TernaryState.False;
if (countExisting < SelectedHitObjects.Count()) if (countExisting < SelectedHitObjects.Count())
return ThreeStates.Indeterminate; return TernaryState.Indeterminate;
return ThreeStates.Enabled; return TernaryState.True;
} }
} }