mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Fix SliderBody's accent colour and thread-safety.
This commit is contained in:
@ -39,6 +39,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
|
|||||||
{
|
{
|
||||||
body = new SliderBody(s)
|
body = new SliderBody(s)
|
||||||
{
|
{
|
||||||
|
AccentColour = AccentColour,
|
||||||
Position = s.StackedPosition,
|
Position = s.StackedPosition,
|
||||||
PathWidth = s.Scale * 64,
|
PathWidth = s.Scale * 64,
|
||||||
},
|
},
|
||||||
|
@ -44,7 +44,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces
|
|||||||
return;
|
return;
|
||||||
accentColour = value;
|
accentColour = value;
|
||||||
|
|
||||||
reloadTexture();
|
if (LoadState == LoadState.Loaded)
|
||||||
|
Schedule(reloadTexture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,15 +100,12 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces
|
|||||||
snakingIn = config.GetBindable<bool>(OsuConfig.SnakingInSliders);
|
snakingIn = config.GetBindable<bool>(OsuConfig.SnakingInSliders);
|
||||||
snakingOut = config.GetBindable<bool>(OsuConfig.SnakingOutSliders);
|
snakingOut = config.GetBindable<bool>(OsuConfig.SnakingOutSliders);
|
||||||
|
|
||||||
path.Texture = new Texture(textureWidth, 1);
|
|
||||||
|
|
||||||
reloadTexture();
|
reloadTexture();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void reloadTexture()
|
private void reloadTexture()
|
||||||
{
|
{
|
||||||
if (path.Texture == null)
|
var texture = new Texture(textureWidth, 1);
|
||||||
return;
|
|
||||||
|
|
||||||
//initialise background
|
//initialise background
|
||||||
var upload = new TextureUpload(textureWidth * 4);
|
var upload = new TextureUpload(textureWidth * 4);
|
||||||
@ -142,8 +140,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
path.Texture.SetData(upload);
|
texture.SetData(upload);
|
||||||
path.Invalidate(Invalidation.DrawNode, this);
|
path.Texture = texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly List<Vector2> currentCurve = new List<Vector2>();
|
private readonly List<Vector2> currentCurve = new List<Vector2>();
|
||||||
|
Reference in New Issue
Block a user