mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 04:02:57 +08:00
Merge pull request #23946 from FrBst/mania-triangles-fix
Fix column colours not being correctly applied on Triangles skin with Dual Stages mod active
This commit is contained in:
commit
822c556c5a
@ -8,6 +8,7 @@ using NUnit.Framework;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets.Mania.Beatmaps;
|
||||
using osu.Game.Rulesets.Mania.UI;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Mania.Tests.Skinning
|
||||
{
|
||||
@ -25,22 +26,35 @@ namespace osu.Game.Rulesets.Mania.Tests.Skinning
|
||||
new StageDefinition(2)
|
||||
};
|
||||
|
||||
SetContents(_ => new ManiaPlayfield(stageDefinitions));
|
||||
SetContents(_ => new ManiaInputManager(new ManiaRuleset().RulesetInfo, 2)
|
||||
{
|
||||
Child = new ManiaPlayfield(stageDefinitions)
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestDualStages()
|
||||
[TestCase(2)]
|
||||
[TestCase(3)]
|
||||
[TestCase(5)]
|
||||
public void TestDualStages(int columnCount)
|
||||
{
|
||||
AddStep("create stage", () =>
|
||||
{
|
||||
stageDefinitions = new List<StageDefinition>
|
||||
{
|
||||
new StageDefinition(2),
|
||||
new StageDefinition(2)
|
||||
new StageDefinition(columnCount),
|
||||
new StageDefinition(columnCount)
|
||||
};
|
||||
|
||||
SetContents(_ => new ManiaPlayfield(stageDefinitions));
|
||||
SetContents(_ => new ManiaInputManager(new ManiaRuleset().RulesetInfo, (int)PlayfieldType.Dual + 2 * columnCount)
|
||||
{
|
||||
Child = new ManiaPlayfield(stageDefinitions)
|
||||
{
|
||||
// bit of a hack to make sure the dual stages fit on screen without overlapping each other.
|
||||
Size = new Vector2(1.5f),
|
||||
Scale = new Vector2(1 / 1.5f)
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -35,10 +35,12 @@ namespace osu.Game.Rulesets.Mania.Skinning.Default
|
||||
|
||||
var stage = beatmap.GetStageForColumnIndex(column);
|
||||
|
||||
if (stage.IsSpecialColumn(column))
|
||||
int columnInStage = column % stage.Columns;
|
||||
|
||||
if (stage.IsSpecialColumn(columnInStage))
|
||||
return SkinUtils.As<TValue>(new Bindable<Color4>(colourSpecial));
|
||||
|
||||
int distanceToEdge = Math.Min(column, (stage.Columns - 1) - column);
|
||||
int distanceToEdge = Math.Min(columnInStage, (stage.Columns - 1) - columnInStage);
|
||||
return SkinUtils.As<TValue>(new Bindable<Color4>(distanceToEdge % 2 == 0 ? colourOdd : colourEven));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user