mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 17:29:56 +09:00
Preserve flashlight size through aspect adjustment
This commit is contained in:
@ -43,13 +43,17 @@ namespace osu.Game.Rulesets.Taiko.Mods
|
|||||||
|
|
||||||
private Vector2 getSizeFor(int combo)
|
private Vector2 getSizeFor(int combo)
|
||||||
{
|
{
|
||||||
|
Vector2 size;
|
||||||
|
|
||||||
if (combo > 200)
|
if (combo > 200)
|
||||||
return new Vector2(0, default_flashlight_size * 0.8f);
|
size = new Vector2(0, default_flashlight_size * 0.8f);
|
||||||
|
else if (combo > 100)
|
||||||
|
size = new Vector2(0, default_flashlight_size * 0.9f);
|
||||||
|
else
|
||||||
|
size = new Vector2(0, default_flashlight_size);
|
||||||
|
|
||||||
if (combo > 100)
|
// Preserve flashlight size through the playfield's aspect adjustment.
|
||||||
return new Vector2(0, default_flashlight_size * 0.9f);
|
return size * taikoPlayfield.DrawHeight / TaikoPlayfield.DEFAULT_HEIGHT;
|
||||||
|
|
||||||
return new Vector2(0, default_flashlight_size);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnComboChange(ValueChangedEvent<int> e)
|
protected override void OnComboChange(ValueChangedEvent<int> e)
|
||||||
@ -66,6 +70,10 @@ namespace osu.Game.Rulesets.Taiko.Mods
|
|||||||
if (!flashlightProperties.IsValid)
|
if (!flashlightProperties.IsValid)
|
||||||
{
|
{
|
||||||
FlashlightPosition = ToLocalSpace(taikoPlayfield.HitTarget.ScreenSpaceDrawQuad.Centre);
|
FlashlightPosition = ToLocalSpace(taikoPlayfield.HitTarget.ScreenSpaceDrawQuad.Centre);
|
||||||
|
|
||||||
|
ClearTransforms(targetMember: nameof(FlashlightSize));
|
||||||
|
FlashlightSize = getSizeFor(Combo.Value);
|
||||||
|
|
||||||
flashlightProperties.Validate();
|
flashlightProperties.Validate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user