mirror of
https://github.com/ppy/osu.git
synced 2025-01-30 21:13:22 +08:00
Merge pull request #20260 from peppy/fix-skin-animation-edge-case
Fix new-style legacy skins with animated judgements not adding correct transforms
This commit is contained in:
commit
34463c3956
@ -126,7 +126,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
AddStep("select unchanged Difficulty Adjust mod", () =>
|
AddStep("select unchanged Difficulty Adjust mod", () =>
|
||||||
{
|
{
|
||||||
var ruleset = advancedStats.BeatmapInfo.Ruleset.CreateInstance().AsNonNull();
|
var ruleset = advancedStats.BeatmapInfo.Ruleset.CreateInstance().AsNonNull();
|
||||||
var difficultyAdjustMod = ruleset.CreateMod<ModDifficultyAdjust>();
|
var difficultyAdjustMod = ruleset.CreateMod<ModDifficultyAdjust>().AsNonNull();
|
||||||
difficultyAdjustMod.ReadFromDifficulty(advancedStats.BeatmapInfo.Difficulty);
|
difficultyAdjustMod.ReadFromDifficulty(advancedStats.BeatmapInfo.Difficulty);
|
||||||
SelectedMods.Value = new[] { difficultyAdjustMod };
|
SelectedMods.Value = new[] { difficultyAdjustMod };
|
||||||
});
|
});
|
||||||
@ -145,7 +145,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
AddStep("select changed Difficulty Adjust mod", () =>
|
AddStep("select changed Difficulty Adjust mod", () =>
|
||||||
{
|
{
|
||||||
var ruleset = advancedStats.BeatmapInfo.Ruleset.CreateInstance().AsNonNull();
|
var ruleset = advancedStats.BeatmapInfo.Ruleset.CreateInstance().AsNonNull();
|
||||||
var difficultyAdjustMod = ruleset.CreateMod<OsuModDifficultyAdjust>();
|
var difficultyAdjustMod = ruleset.CreateMod<OsuModDifficultyAdjust>().AsNonNull();
|
||||||
var originalDifficulty = advancedStats.BeatmapInfo.Difficulty;
|
var originalDifficulty = advancedStats.BeatmapInfo.Difficulty;
|
||||||
|
|
||||||
difficultyAdjustMod.ReadFromDifficulty(originalDifficulty);
|
difficultyAdjustMod.ReadFromDifficulty(originalDifficulty);
|
||||||
|
@ -53,8 +53,6 @@ namespace osu.Game.Rulesets.UI
|
|||||||
{
|
{
|
||||||
var resources = ruleset.CreateResourceStore();
|
var resources = ruleset.CreateResourceStore();
|
||||||
|
|
||||||
if (resources != null)
|
|
||||||
{
|
|
||||||
var host = parent.Get<GameHost>();
|
var host = parent.Get<GameHost>();
|
||||||
|
|
||||||
TextureStore = new TextureStore(host.Renderer, parent.Get<GameHost>().CreateTextureLoaderStore(new NamespacedResourceStore<byte[]>(resources, @"Textures")));
|
TextureStore = new TextureStore(host.Renderer, parent.Get<GameHost>().CreateTextureLoaderStore(new NamespacedResourceStore<byte[]>(resources, @"Textures")));
|
||||||
@ -66,7 +64,6 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
ShaderManager = new ShaderManager(host.Renderer, new NamespacedResourceStore<byte[]>(resources, @"Shaders"));
|
ShaderManager = new ShaderManager(host.Renderer, new NamespacedResourceStore<byte[]>(resources, @"Shaders"));
|
||||||
CacheAs(ShaderManager = new FallbackShaderManager(host.Renderer, ShaderManager, parent.Get<ShaderManager>()));
|
CacheAs(ShaderManager = new FallbackShaderManager(host.Renderer, ShaderManager, parent.Get<ShaderManager>()));
|
||||||
}
|
|
||||||
|
|
||||||
RulesetConfigManager = parent.Get<IRulesetConfigCache>().GetConfigFor(ruleset);
|
RulesetConfigManager = parent.Get<IRulesetConfigCache>().GetConfigFor(ruleset);
|
||||||
if (RulesetConfigManager != null)
|
if (RulesetConfigManager != null)
|
||||||
|
@ -56,7 +56,7 @@ namespace osu.Game.Skinning
|
|||||||
if (result != HitResult.Miss)
|
if (result != HitResult.Miss)
|
||||||
{
|
{
|
||||||
//new judgement shows old as a temporary effect
|
//new judgement shows old as a temporary effect
|
||||||
AddInternal(temporaryOldStyle = new LegacyJudgementPieceOld(result, createMainDrawable, 1.05f)
|
AddInternal(temporaryOldStyle = new LegacyJudgementPieceOld(result, createMainDrawable, 1.05f, true)
|
||||||
{
|
{
|
||||||
Blending = BlendingParameters.Additive,
|
Blending = BlendingParameters.Additive,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
|
@ -18,11 +18,13 @@ namespace osu.Game.Skinning
|
|||||||
private readonly HitResult result;
|
private readonly HitResult result;
|
||||||
|
|
||||||
private readonly float finalScale;
|
private readonly float finalScale;
|
||||||
|
private readonly bool forceTransforms;
|
||||||
|
|
||||||
public LegacyJudgementPieceOld(HitResult result, Func<Drawable> createMainDrawable, float finalScale = 1f)
|
public LegacyJudgementPieceOld(HitResult result, Func<Drawable> createMainDrawable, float finalScale = 1f, bool forceTransforms = false)
|
||||||
{
|
{
|
||||||
this.result = result;
|
this.result = result;
|
||||||
this.finalScale = finalScale;
|
this.finalScale = finalScale;
|
||||||
|
this.forceTransforms = forceTransforms;
|
||||||
|
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
@ -43,8 +45,8 @@ namespace osu.Game.Skinning
|
|||||||
this.FadeInFromZero(fade_in_length);
|
this.FadeInFromZero(fade_in_length);
|
||||||
this.Delay(fade_out_delay).FadeOut(fade_out_length);
|
this.Delay(fade_out_delay).FadeOut(fade_out_length);
|
||||||
|
|
||||||
// legacy judgements don't play any transforms if they are an animation.
|
// legacy judgements don't play any transforms if they are an animation.... UNLESS they are the temporary displayed judgement from new piece.
|
||||||
if (animation?.FrameCount > 1)
|
if (animation?.FrameCount > 1 && !forceTransforms)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (result)
|
switch (result)
|
||||||
|
Loading…
Reference in New Issue
Block a user