mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 00:53:56 +09:00
General refactoring
This commit is contained in:
@ -47,12 +47,12 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
|
|
||||||
Add(new OsuSpriteText
|
Add(new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = build.CreatedAt.Date.ToString("dd MMM yyyy"),
|
|
||||||
Font = OsuFont.GetFont(weight: FontWeight.Regular, size: 24),
|
|
||||||
Colour = OsuColour.FromHex(@"FD5"),
|
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Margin = new MarginPadding { Top = 15 },
|
Margin = new MarginPadding { Top = 15 },
|
||||||
|
Text = build.CreatedAt.Date.ToString("dd MMM yyyy"),
|
||||||
|
Font = OsuFont.GetFont(weight: FontWeight.Regular, size: 24),
|
||||||
|
Colour = OsuColour.FromHex(@"FD5"),
|
||||||
});
|
});
|
||||||
|
|
||||||
currentDate = build.CreatedAt.Date;
|
currentDate = build.CreatedAt.Date;
|
||||||
|
@ -87,6 +87,13 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
SelectedTab.BindValueChanged(_ => updateState(), true);
|
SelectedTab.BindValueChanged(_ => updateState(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(AudioManager audio)
|
||||||
|
{
|
||||||
|
sampleClick = audio.Sample.Get(@"UI/generic-select-soft");
|
||||||
|
sampleHover = audio.Sample.Get(@"UI/generic-hover-soft");
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnActivated() => updateState();
|
protected override void OnActivated() => updateState();
|
||||||
|
|
||||||
protected override void OnDeactivated() => updateState();
|
protected override void OnDeactivated() => updateState();
|
||||||
@ -146,12 +153,5 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
externalDimRequested = false;
|
externalDimRequested = false;
|
||||||
updateState();
|
updateState();
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(AudioManager audio)
|
|
||||||
{
|
|
||||||
sampleClick = audio.Sample.Get(@"UI/generic-select-soft");
|
|
||||||
sampleHover = audio.Sample.Get(@"UI/generic-hover-soft");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -120,10 +120,7 @@ namespace osu.Game.Overlays
|
|||||||
?? streams.Find(s => s.Name == updateStream)?.LatestBuild;
|
?? streams.Find(s => s.Name == updateStream)?.LatestBuild;
|
||||||
|
|
||||||
if (build != null)
|
if (build != null)
|
||||||
{
|
ShowBuild(build);
|
||||||
Current.Value = build;
|
|
||||||
State = Visibility.Visible;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
State = Visibility.Visible;
|
State = Visibility.Visible;
|
||||||
@ -193,13 +190,13 @@ namespace osu.Game.Overlays
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private CancellationTokenSource loadContentTask;
|
private CancellationTokenSource loadContentCancellation;
|
||||||
|
|
||||||
private void loadContent(ChangelogContent newContent)
|
private void loadContent(ChangelogContent newContent)
|
||||||
{
|
{
|
||||||
content.FadeTo(0.2f, 300, Easing.OutQuint);
|
content.FadeTo(0.2f, 300, Easing.OutQuint);
|
||||||
|
|
||||||
loadContentTask?.Cancel();
|
loadContentCancellation?.Cancel();
|
||||||
|
|
||||||
LoadComponentAsync(newContent, c =>
|
LoadComponentAsync(newContent, c =>
|
||||||
{
|
{
|
||||||
@ -207,7 +204,7 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
c.BuildSelected = ShowBuild;
|
c.BuildSelected = ShowBuild;
|
||||||
content.Child = c;
|
content.Child = c;
|
||||||
}, (loadContentTask = new CancellationTokenSource()).Token);
|
}, (loadContentCancellation = new CancellationTokenSource()).Token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user