mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Make toolbar testable and add the most basic of visual tests
This commit is contained in:
@ -13,7 +13,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
SetIcon(FontAwesome.fa_comments);
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(ChatOverlay chat)
|
||||
{
|
||||
StateContainer = chat;
|
||||
|
@ -13,7 +13,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
SetIcon(FontAwesome.fa_osu_chevron_down_o);
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(DirectOverlay direct)
|
||||
{
|
||||
StateContainer = direct;
|
||||
|
@ -64,7 +64,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
};
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(RulesetStore rulesets, OsuGame game)
|
||||
{
|
||||
foreach (var r in rulesets.AvailableRulesets)
|
||||
@ -81,7 +81,10 @@ namespace osu.Game.Overlays.Toolbar
|
||||
|
||||
ruleset.ValueChanged += rulesetChanged;
|
||||
ruleset.DisabledChanged += disabledChanged;
|
||||
ruleset.BindTo(game.Ruleset);
|
||||
if (game != null)
|
||||
ruleset.BindTo(game.Ruleset);
|
||||
else
|
||||
ruleset.Value = rulesets.AvailableRulesets.FirstOrDefault();
|
||||
}
|
||||
|
||||
public override bool HandleInput => !ruleset.Disabled;
|
||||
|
@ -13,7 +13,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
Icon = FontAwesome.fa_music;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(MusicController music)
|
||||
{
|
||||
StateContainer = music;
|
||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
TooltipSub = "Waiting for 'ya";
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(NotificationOverlay notificationOverlay)
|
||||
{
|
||||
StateContainer = notificationOverlay;
|
||||
|
@ -21,8 +21,11 @@ namespace osu.Game.Overlays.Toolbar
|
||||
set
|
||||
{
|
||||
stateContainer = value;
|
||||
Action = stateContainer.ToggleVisibility;
|
||||
stateContainer.StateChanged += stateChanged;
|
||||
if (stateContainer != null)
|
||||
{
|
||||
Action = stateContainer.ToggleVisibility;
|
||||
stateContainer.StateChanged += stateChanged;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
TooltipSub = "Change your settings";
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(SettingsOverlay settings)
|
||||
{
|
||||
StateContainer = settings;
|
||||
|
@ -13,7 +13,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
Icon = FontAwesome.fa_users;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(SocialOverlay chat)
|
||||
{
|
||||
StateContainer = chat;
|
||||
|
Reference in New Issue
Block a user