1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 07:32:55 +08:00

Merge pull request #8677 from smoogipoo/fix-minwidth-override

Fix hidden notes due to 0 minimum width
This commit is contained in:
Dean Herbert 2020-04-08 23:32:25 +09:00 committed by GitHub
commit 9bdc881b3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 1 deletions

View File

@ -0,0 +1,4 @@
[Mania]
Keys: 4
ColumnWidth: 10,10,10,10
WidthForNoteHeightScale: 0

View File

@ -99,5 +99,20 @@ namespace osu.Game.Tests.Skins
Assert.That(configs[0].CustomColours, Contains.Key("ColourBarline").And.ContainValue(new Color4(50, 50, 50, 50)));
}
}
[Test]
public void TestMinimumColumnWidthFallsBackWhenZeroIsProvided()
{
var decoder = new LegacyManiaSkinDecoder();
using (var resStream = TestResources.OpenResource("mania-skin-zero-minwidth.ini"))
using (var stream = new LineBufferedReader(resStream))
{
var configs = decoder.Decode(stream);
Assert.That(configs.Count, Is.EqualTo(1));
Assert.That(configs[0].MinimumColumnWidth, Is.EqualTo(16));
}
}
}
}

View File

@ -102,7 +102,9 @@ namespace osu.Game.Skinning
break;
case "WidthForNoteHeightScale":
currentConfig.MinimumColumnWidth = float.Parse(pair.Value, CultureInfo.InvariantCulture) * LegacyManiaSkinConfiguration.POSITION_SCALE_FACTOR;
float minWidth = float.Parse(pair.Value, CultureInfo.InvariantCulture) * LegacyManiaSkinConfiguration.POSITION_SCALE_FACTOR;
if (minWidth > 0)
currentConfig.MinimumColumnWidth = minWidth;
break;
case string _ when pair.Key.StartsWith("Colour"):