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:
parent
b37bf4ea01
commit
a43b0ee01b
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user