mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Move CreateContent()
to BDL
This commit is contained in:
@ -1,7 +1,9 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
@ -22,15 +24,9 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
Enabled.Value = !isLoading;
|
Enabled.Value = !isLoading;
|
||||||
|
|
||||||
if (value)
|
if (value)
|
||||||
{
|
|
||||||
loading.Show();
|
loading.Show();
|
||||||
OnLoadStarted();
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
loading.Hide();
|
loading.Hide();
|
||||||
OnLoadFinished();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,18 +40,34 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
protected LoadingButton()
|
protected LoadingButton()
|
||||||
{
|
{
|
||||||
AddRange(new[]
|
Add(loading = new LoadingSpinner
|
||||||
{
|
|
||||||
CreateContent(),
|
|
||||||
loading = new LoadingSpinner
|
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Size = new Vector2(12)
|
Size = new Vector2(12),
|
||||||
}
|
Depth = -1,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load()
|
||||||
|
{
|
||||||
|
Add(CreateContent());
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
|
||||||
|
loading.State.BindValueChanged(s =>
|
||||||
|
{
|
||||||
|
if (s.NewValue == Visibility.Visible)
|
||||||
|
OnLoadStarted();
|
||||||
|
else
|
||||||
|
OnLoadFinished();
|
||||||
|
}, true);
|
||||||
|
}
|
||||||
|
|
||||||
protected override bool OnClick(ClickEvent e)
|
protected override bool OnClick(ClickEvent e)
|
||||||
{
|
{
|
||||||
if (!Enabled.Value)
|
if (!Enabled.Value)
|
||||||
|
@ -198,8 +198,6 @@ namespace osu.Game.Overlays.Comments
|
|||||||
IdleColour = colourProvider.Light4;
|
IdleColour = colourProvider.Light4;
|
||||||
HoverColour = colourProvider.Light3;
|
HoverColour = colourProvider.Light3;
|
||||||
blockedBackground.Colour = colourProvider.Background5;
|
blockedBackground.Colour = colourProvider.Background5;
|
||||||
|
|
||||||
drawableText.Text = text;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
@ -237,6 +235,7 @@ namespace osu.Game.Overlays.Comments
|
|||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Font = OsuFont.GetFont(size: 12, weight: FontWeight.Bold),
|
Font = OsuFont.GetFont(size: 12, weight: FontWeight.Bold),
|
||||||
Margin = new MarginPadding { Horizontal = 20 },
|
Margin = new MarginPadding { Horizontal = 20 },
|
||||||
|
Text = text,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user