mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 05:43:21 +08:00
Extract update background method
This commit is contained in:
parent
e58bdbb8a9
commit
63757a77a5
@ -79,18 +79,7 @@ namespace osu.Game.Overlays.Chat
|
||||
set
|
||||
{
|
||||
alteringBackground = value;
|
||||
|
||||
if (background == null)
|
||||
{
|
||||
AddInternal(background = new Box
|
||||
{
|
||||
BypassAutoSizeAxes = Axes.Both,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = Color4.White,
|
||||
});
|
||||
}
|
||||
|
||||
background.Alpha = value ? 0.04f : 0f;
|
||||
updateBackground();
|
||||
}
|
||||
}
|
||||
|
||||
@ -283,5 +272,20 @@ namespace osu.Game.Overlays.Chat
|
||||
Color4Extensions.FromHex("812a96"),
|
||||
Color4Extensions.FromHex("992861"),
|
||||
};
|
||||
|
||||
private void updateBackground()
|
||||
{
|
||||
if (background == null)
|
||||
{
|
||||
AddInternal(background = new Box
|
||||
{
|
||||
BypassAutoSizeAxes = Axes.Both,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = Color4.White,
|
||||
});
|
||||
}
|
||||
|
||||
background.Alpha = alteringBackground ? 0.04f : 0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ namespace osu.Game.Overlays.Chat
|
||||
highlightedMessage.Value = null;
|
||||
});
|
||||
|
||||
private void processMessageBackgroundAltering()
|
||||
private void processChatlineBackgroundAltering()
|
||||
{
|
||||
for (int i = 0; i < ChatLineFlow.Count; i++)
|
||||
{
|
||||
@ -169,7 +169,7 @@ namespace osu.Game.Overlays.Chat
|
||||
scroll.ScrollToEnd();
|
||||
|
||||
processMessageHighlighting();
|
||||
processMessageBackgroundAltering();
|
||||
processChatlineBackgroundAltering();
|
||||
});
|
||||
|
||||
private void pendingMessageResolved(Message existing, Message updated) => Schedule(() =>
|
||||
|
Loading…
Reference in New Issue
Block a user