1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:12:54 +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>();
if (firstSample != null)
{
sampleList.Add(new HitSampleInfo
{
Bank = firstSample.Bank,
Volume = firstSample.Volume,
Name = @"slidertick",
});
}
foreach (var tick in NestedHitObjects.OfType<SliderTick>())
tick.Samples = sampleList;

View File

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