mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Update variable names
Also cleans up some weird code
This commit is contained in:
@ -39,7 +39,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
|
|
||||||
public void ApplyToScoreProcessor(ScoreProcessor scoreProcessor)
|
public void ApplyToScoreProcessor(ScoreProcessor scoreProcessor)
|
||||||
{
|
{
|
||||||
scoreProcessor.Health.ValueChanged += e => { blinds.AnimateClosedness((float)e.NewValue); };
|
scoreProcessor.Health.ValueChanged += health => { blinds.AnimateClosedness((float)health.NewValue); };
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -69,7 +69,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
});
|
});
|
||||||
|
|
||||||
channelTabControl.OnRequestLeave += channel => channelTabControl.RemoveChannel(channel);
|
channelTabControl.OnRequestLeave += channel => channelTabControl.RemoveChannel(channel);
|
||||||
channelTabControl.Current.ValueChanged += e => currentText.Text = "Currently selected channel: " + e.NewValue.ToString();
|
channelTabControl.Current.ValueChanged += channel => currentText.Text = "Currently selected channel: " + channel.NewValue.ToString();
|
||||||
|
|
||||||
AddStep("Add random private channel", addRandomPrivateChannel);
|
AddStep("Add random private channel", addRandomPrivateChannel);
|
||||||
AddAssert("There is only one channels", () => channelTabControl.Items.Count() == 2);
|
AddAssert("There is only one channels", () => channelTabControl.Items.Count() == 2);
|
||||||
|
@ -47,7 +47,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
void setState(Visibility state) => AddStep(state.ToString(), () => manager.State = state);
|
void setState(Visibility state) => AddStep(state.ToString(), () => manager.State = state);
|
||||||
void checkProgressingCount(int expected) => AddAssert($"progressing count is {expected}", () => progressingNotifications.Count == expected);
|
void checkProgressingCount(int expected) => AddAssert($"progressing count is {expected}", () => progressingNotifications.Count == expected);
|
||||||
|
|
||||||
manager.UnreadCount.ValueChanged += e => { displayedCount.Text = $"displayed count: {e.NewValue}"; };
|
manager.UnreadCount.ValueChanged += count => { displayedCount.Text = $"displayed count: {count.NewValue}"; };
|
||||||
|
|
||||||
setState(Visibility.Visible);
|
setState(Visibility.Visible);
|
||||||
AddStep(@"simple #1", sendHelloNotification);
|
AddStep(@"simple #1", sendHelloNotification);
|
||||||
|
@ -48,7 +48,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
breadcrumbs.Current.ValueChanged += e => titleText.Text = $"Changed to {e.NewValue.ToString()}";
|
breadcrumbs.Current.ValueChanged += screen => titleText.Text = $"Changed to {screen.NewValue.ToString()}";
|
||||||
breadcrumbs.Current.TriggerChange();
|
breadcrumbs.Current.TriggerChange();
|
||||||
|
|
||||||
waitForCurrent();
|
waitForCurrent();
|
||||||
|
@ -33,9 +33,9 @@ namespace osu.Game.Tests.Visual
|
|||||||
filter.PinItem(GroupMode.All);
|
filter.PinItem(GroupMode.All);
|
||||||
filter.PinItem(GroupMode.RecentlyPlayed);
|
filter.PinItem(GroupMode.RecentlyPlayed);
|
||||||
|
|
||||||
filter.Current.ValueChanged += e =>
|
filter.Current.ValueChanged += grouping =>
|
||||||
{
|
{
|
||||||
text.Text = "Currently Selected: " + e.NewValue.ToString();
|
text.Text = "Currently Selected: " + grouping.NewValue.ToString();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
this.audioManager = audioManager;
|
this.audioManager = audioManager;
|
||||||
|
|
||||||
ValueChanged += e => registerAudioTrack(e.NewValue);
|
ValueChanged += b => registerAudioTrack(b.NewValue);
|
||||||
|
|
||||||
// If the track has changed prior to this being called, let's register it
|
// If the track has changed prior to this being called, let's register it
|
||||||
if (Value != Default)
|
if (Value != Default)
|
||||||
|
@ -61,9 +61,9 @@ namespace osu.Game.Configuration
|
|||||||
databasedSettings.Add(setting);
|
databasedSettings.Add(setting);
|
||||||
}
|
}
|
||||||
|
|
||||||
bindable.ValueChanged += e =>
|
bindable.ValueChanged += b =>
|
||||||
{
|
{
|
||||||
setting.Value = e.NewValue;
|
setting.Value = b.NewValue;
|
||||||
settings.Update(setting);
|
settings.Update(setting);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -33,14 +33,14 @@ namespace osu.Game.Configuration
|
|||||||
Set(OsuSetting.Username, string.Empty);
|
Set(OsuSetting.Username, string.Empty);
|
||||||
Set(OsuSetting.Token, string.Empty);
|
Set(OsuSetting.Token, string.Empty);
|
||||||
|
|
||||||
Set(OsuSetting.SavePassword, false).ValueChanged += e =>
|
Set(OsuSetting.SavePassword, false).ValueChanged += enabled =>
|
||||||
{
|
{
|
||||||
if (e.NewValue) Set(OsuSetting.SaveUsername, true);
|
if (enabled.NewValue) Set(OsuSetting.SaveUsername, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
Set(OsuSetting.SaveUsername, true).ValueChanged += e =>
|
Set(OsuSetting.SaveUsername, true).ValueChanged += enabled =>
|
||||||
{
|
{
|
||||||
if (!e.NewValue) Set(OsuSetting.SavePassword, false);
|
if (!enabled.NewValue) Set(OsuSetting.SavePassword, false);
|
||||||
};
|
};
|
||||||
|
|
||||||
Set(OsuSetting.ExternalLinkWarning, true);
|
Set(OsuSetting.ExternalLinkWarning, true);
|
||||||
|
@ -156,7 +156,7 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
};
|
};
|
||||||
|
|
||||||
cursorScale = config.GetBindable<double>(OsuSetting.MenuCursorSize);
|
cursorScale = config.GetBindable<double>(OsuSetting.MenuCursorSize);
|
||||||
cursorScale.ValueChanged += e => cursorContainer.Scale = new Vector2((float)e.NewValue * base_scale);
|
cursorScale.ValueChanged += scale => cursorContainer.Scale = new Vector2((float)scale.NewValue * base_scale);
|
||||||
cursorScale.TriggerChange();
|
cursorScale.TriggerChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,12 +27,12 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
Height = 32;
|
Height = 32;
|
||||||
TabContainer.Spacing = new Vector2(padding, 0f);
|
TabContainer.Spacing = new Vector2(padding, 0f);
|
||||||
Current.ValueChanged += e =>
|
Current.ValueChanged += index =>
|
||||||
{
|
{
|
||||||
foreach (var t in TabContainer.Children.OfType<BreadcrumbTabItem>())
|
foreach (var t in TabContainer.Children.OfType<BreadcrumbTabItem>())
|
||||||
{
|
{
|
||||||
var tIndex = TabContainer.IndexOf(t);
|
var tIndex = TabContainer.IndexOf(t);
|
||||||
var tabIndex = TabContainer.IndexOf(TabMap[e.NewValue]);
|
var tabIndex = TabContainer.IndexOf(TabMap[index.NewValue]);
|
||||||
|
|
||||||
t.State = tIndex < tabIndex ? Visibility.Hidden : Visibility.Visible;
|
t.State = tIndex < tabIndex ? Visibility.Hidden : Visibility.Visible;
|
||||||
t.Chevron.FadeTo(tIndex <= tabIndex ? 0f : 1f, 500, Easing.OutQuint);
|
t.Chevron.FadeTo(tIndex <= tabIndex ? 0f : 1f, 500, Easing.OutQuint);
|
||||||
|
@ -41,9 +41,9 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
Current.ValueChanged += e =>
|
Current.ValueChanged += filled =>
|
||||||
{
|
{
|
||||||
if (e.NewValue)
|
if (filled.NewValue)
|
||||||
fill.FadeIn(200, Easing.OutQuint);
|
fill.FadeIn(200, Easing.OutQuint);
|
||||||
else
|
else
|
||||||
fill.FadeTo(0.01f, 200, Easing.OutQuint); //todo: remove once we figure why containers aren't drawing at all times
|
fill.FadeTo(0.01f, 200, Easing.OutQuint); //todo: remove once we figure why containers aren't drawing at all times
|
||||||
|
@ -86,9 +86,9 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
Current.ValueChanged += e =>
|
Current.ValueChanged += enabled =>
|
||||||
{
|
{
|
||||||
if (e.NewValue)
|
if (enabled.NewValue)
|
||||||
sampleChecked?.Play();
|
sampleChecked?.Play();
|
||||||
else
|
else
|
||||||
sampleUnchecked?.Play();
|
sampleUnchecked?.Play();
|
||||||
|
@ -118,9 +118,9 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Current.ValueChanged += e =>
|
Current.ValueChanged += selected =>
|
||||||
{
|
{
|
||||||
if (e.NewValue)
|
if (selected.NewValue)
|
||||||
{
|
{
|
||||||
fadeIn();
|
fadeIn();
|
||||||
icon.Icon = FontAwesome.fa_check_circle_o;
|
icon.Icon = FontAwesome.fa_check_circle_o;
|
||||||
|
@ -97,9 +97,9 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
DisplayedCount = Current.Value;
|
DisplayedCount = Current.Value;
|
||||||
|
|
||||||
Current.ValueChanged += e =>
|
Current.ValueChanged += val =>
|
||||||
{
|
{
|
||||||
if (IsLoaded) TransformCount(displayedCount, e.NewValue);
|
if (IsLoaded) TransformCount(displayedCount, val.NewValue);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
onPushed(null, stack.CurrentScreen);
|
onPushed(null, stack.CurrentScreen);
|
||||||
|
|
||||||
Current.ValueChanged += e => e.NewValue.MakeCurrent();
|
Current.ValueChanged += current => current.NewValue.MakeCurrent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onPushed(IScreen lastScreen, IScreen newScreen)
|
private void onPushed(IScreen lastScreen, IScreen newScreen)
|
||||||
|
@ -175,12 +175,12 @@ namespace osu.Game
|
|||||||
// bind config int to database RulesetInfo
|
// bind config int to database RulesetInfo
|
||||||
configRuleset = LocalConfig.GetBindable<int>(OsuSetting.Ruleset);
|
configRuleset = LocalConfig.GetBindable<int>(OsuSetting.Ruleset);
|
||||||
ruleset.Value = RulesetStore.GetRuleset(configRuleset.Value) ?? RulesetStore.AvailableRulesets.First();
|
ruleset.Value = RulesetStore.GetRuleset(configRuleset.Value) ?? RulesetStore.AvailableRulesets.First();
|
||||||
ruleset.ValueChanged += e => configRuleset.Value = e.NewValue.ID ?? 0;
|
ruleset.ValueChanged += r => configRuleset.Value = r.NewValue.ID ?? 0;
|
||||||
|
|
||||||
// bind config int to database SkinInfo
|
// bind config int to database SkinInfo
|
||||||
configSkin = LocalConfig.GetBindable<int>(OsuSetting.Skin);
|
configSkin = LocalConfig.GetBindable<int>(OsuSetting.Skin);
|
||||||
SkinManager.CurrentSkinInfo.ValueChanged += e => configSkin.Value = e.NewValue.ID;
|
SkinManager.CurrentSkinInfo.ValueChanged += skin => configSkin.Value = skin.NewValue.ID;
|
||||||
configSkin.ValueChanged += e => SkinManager.CurrentSkinInfo.Value = SkinManager.Query(s => s.ID == e.NewValue) ?? SkinInfo.Default;
|
configSkin.ValueChanged += skinId => SkinManager.CurrentSkinInfo.Value = SkinManager.Query(s => s.ID == skinId.NewValue) ?? SkinInfo.Default;
|
||||||
configSkin.TriggerChange();
|
configSkin.TriggerChange();
|
||||||
|
|
||||||
LocalConfig.BindWith(OsuSetting.VolumeInactive, inactiveVolumeAdjust);
|
LocalConfig.BindWith(OsuSetting.VolumeInactive, inactiveVolumeAdjust);
|
||||||
@ -516,9 +516,9 @@ namespace osu.Game
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
OverlayActivationMode.ValueChanged += e =>
|
OverlayActivationMode.ValueChanged += mode =>
|
||||||
{
|
{
|
||||||
if (e.NewValue != OverlayActivation.All) CloseAllOverlays();
|
if (mode.NewValue != OverlayActivation.All) CloseAllOverlays();
|
||||||
};
|
};
|
||||||
|
|
||||||
void updateScreenOffset()
|
void updateScreenOffset()
|
||||||
|
@ -209,7 +209,7 @@ namespace osu.Game
|
|||||||
// TODO: This is temporary until we reimplement the local FPS display.
|
// TODO: This is temporary until we reimplement the local FPS display.
|
||||||
// It's just to allow end-users to access the framework FPS display without knowing the shortcut key.
|
// It's just to allow end-users to access the framework FPS display without knowing the shortcut key.
|
||||||
fpsDisplayVisible = LocalConfig.GetBindable<bool>(OsuSetting.ShowFpsDisplay);
|
fpsDisplayVisible = LocalConfig.GetBindable<bool>(OsuSetting.ShowFpsDisplay);
|
||||||
fpsDisplayVisible.ValueChanged += e => { FrameStatisticsMode = e.NewValue ? FrameStatisticsMode.Minimal : FrameStatisticsMode.None; };
|
fpsDisplayVisible.ValueChanged += visible => { FrameStatisticsMode = visible.NewValue ? FrameStatisticsMode.Minimal : FrameStatisticsMode.None; };
|
||||||
fpsDisplayVisible.TriggerChange();
|
fpsDisplayVisible.TriggerChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ namespace osu.Game.Overlays.AccountCreation
|
|||||||
characterCheckText = passwordDescription.AddText("8 characters long");
|
characterCheckText = passwordDescription.AddText("8 characters long");
|
||||||
passwordDescription.AddText(". Choose something long but also something you will remember, like a line from your favourite song.");
|
passwordDescription.AddText(". Choose something long but also something you will remember, like a line from your favourite song.");
|
||||||
|
|
||||||
passwordTextBox.Current.ValueChanged += e => { characterCheckText.ForEach(s => s.Colour = e.NewValue.Length == 0 ? Color4.White : Interpolation.ValueAt(e.NewValue.Length, Color4.OrangeRed, Color4.YellowGreen, 0, 8, Easing.In)); };
|
passwordTextBox.Current.ValueChanged += password => { characterCheckText.ForEach(s => s.Colour = password.NewValue.Length == 0 ? Color4.White : Interpolation.ValueAt(password.NewValue.Length, Color4.OrangeRed, Color4.YellowGreen, 0, 8, Easing.In)); };
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
|
@ -138,9 +138,9 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
Beatmap.ValueChanged += e =>
|
Beatmap.ValueChanged += b =>
|
||||||
{
|
{
|
||||||
showBeatmap(e.NewValue);
|
showBeatmap(b.NewValue);
|
||||||
updateDifficultyButtons();
|
updateDifficultyButtons();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -53,9 +53,9 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
Favourited.ValueChanged += e =>
|
Favourited.ValueChanged += favourited =>
|
||||||
{
|
{
|
||||||
if (e.NewValue)
|
if (favourited.NewValue)
|
||||||
{
|
{
|
||||||
pink.FadeIn(200);
|
pink.FadeIn(200);
|
||||||
icon.Icon = FontAwesome.fa_heart;
|
icon.Icon = FontAwesome.fa_heart;
|
||||||
|
@ -67,7 +67,7 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
|
|||||||
};
|
};
|
||||||
|
|
||||||
Action = () => playButton.Click();
|
Action = () => playButton.Click();
|
||||||
Playing.ValueChanged += e => progress.FadeTo(e.NewValue ? 1 : 0, 100);
|
Playing.ValueChanged += playing => progress.FadeTo(playing.NewValue ? 1 : 0, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
|
@ -181,8 +181,8 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
Picker.Beatmap.ValueChanged += e => Details.Beatmap = e.NewValue;
|
Picker.Beatmap.ValueChanged += b => Details.Beatmap = b.NewValue;
|
||||||
Picker.Beatmap.ValueChanged += e => externalLink.Link = $@"https://osu.ppy.sh/beatmapsets/{BeatmapSet.Value?.OnlineBeatmapSetID}#{e.NewValue?.Ruleset.ShortName}/{e.NewValue?.OnlineBeatmapID}";
|
Picker.Beatmap.ValueChanged += b => externalLink.Link = $@"https://osu.ppy.sh/beatmapsets/{BeatmapSet.Value?.OnlineBeatmapSetID}#{b.NewValue?.Ruleset.ShortName}/{b.NewValue?.OnlineBeatmapID}";
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -219,11 +219,12 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
private void updateDownloadButtons()
|
private void updateDownloadButtons()
|
||||||
{
|
{
|
||||||
if (BeatmapSet.Value == null) return;
|
if (BeatmapSet.Value == null) return;
|
||||||
|
|
||||||
switch (State.Value)
|
switch (State.Value)
|
||||||
{
|
{
|
||||||
case DownloadState.LocallyAvailable:
|
case DownloadState.LocallyAvailable:
|
||||||
// temporary for UX until new design is implemented.
|
// temporary for UX until new design is implemented.
|
||||||
downloadButtonsContainer.Child = new osu.Game.Overlays.Direct.DownloadButton(e.NewValue)
|
downloadButtonsContainer.Child = new osu.Game.Overlays.Direct.DownloadButton(BeatmapSet.Value)
|
||||||
{
|
{
|
||||||
Width = 50,
|
Width = 50,
|
||||||
RelativeSizeAxes = Axes.Y
|
RelativeSizeAxes = Axes.Y
|
||||||
@ -232,12 +233,12 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
case DownloadState.Downloading:
|
case DownloadState.Downloading:
|
||||||
case DownloadState.Downloaded:
|
case DownloadState.Downloaded:
|
||||||
// temporary to avoid showing two buttons for maps with novideo. will be fixed in new beatmap overlay design.
|
// temporary to avoid showing two buttons for maps with novideo. will be fixed in new beatmap overlay design.
|
||||||
downloadButtonsContainer.Child = new DownloadButton(e.NewValue);
|
downloadButtonsContainer.Child = new DownloadButton(BeatmapSet.Value);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
downloadButtonsContainer.Child = new DownloadButton(e.NewValue);
|
downloadButtonsContainer.Child = new DownloadButton(BeatmapSet.Value);
|
||||||
if (BeatmapSet.Value.OnlineInfo.HasVideo)
|
if (BeatmapSet.Value.OnlineInfo.HasVideo)
|
||||||
downloadButtonsContainer.Add(new DownloadButton(e.NewValue, true));
|
downloadButtonsContainer.Add(new DownloadButton(BeatmapSet.Value, true));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -101,10 +101,10 @@ namespace osu.Game.Overlays
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
header.Picker.Beatmap.ValueChanged += e =>
|
header.Picker.Beatmap.ValueChanged += b =>
|
||||||
{
|
{
|
||||||
info.Beatmap = e.NewValue;
|
info.Beatmap = b.NewValue;
|
||||||
scores.Beatmap = e.NewValue;
|
scores.Beatmap = b.NewValue;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ namespace osu.Game.Overlays.Chat.Selection
|
|||||||
joinedColour = colours.Blue;
|
joinedColour = colours.Blue;
|
||||||
hoverColour = colours.Yellow;
|
hoverColour = colours.Yellow;
|
||||||
|
|
||||||
joinedBind.ValueChanged += e => updateColour(e.NewValue);
|
joinedBind.ValueChanged += joined => updateColour(joined.NewValue);
|
||||||
joinedBind.BindTo(channel.Joined);
|
joinedBind.BindTo(channel.Joined);
|
||||||
|
|
||||||
joinedBind.TriggerChange();
|
joinedBind.TriggerChange();
|
||||||
|
@ -125,7 +125,7 @@ namespace osu.Game.Overlays.Chat.Selection
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
search.Current.ValueChanged += e => sectionsFlow.SearchTerm = e.NewValue;
|
search.Current.ValueChanged += term => sectionsFlow.SearchTerm = term.NewValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateAvailableChannels(IEnumerable<Channel> channels)
|
public void UpdateAvailableChannels(IEnumerable<Channel> channels)
|
||||||
|
@ -162,8 +162,8 @@ namespace osu.Game.Overlays
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
channelTabControl.Current.ValueChanged += e => channelManager.CurrentChannel.Value = e.NewValue;
|
channelTabControl.Current.ValueChanged += current => channelManager.CurrentChannel.Value = current.NewValue;
|
||||||
channelTabControl.ChannelSelectorActive.ValueChanged += e => channelSelectionOverlay.State = e.NewValue ? Visibility.Visible : Visibility.Hidden;
|
channelTabControl.ChannelSelectorActive.ValueChanged += active => channelSelectionOverlay.State = active.NewValue ? Visibility.Visible : Visibility.Hidden;
|
||||||
channelSelectionOverlay.StateChanged += state =>
|
channelSelectionOverlay.StateChanged += state =>
|
||||||
{
|
{
|
||||||
if (state == Visibility.Hidden && channelManager.CurrentChannel.Value == null)
|
if (state == Visibility.Hidden && channelManager.CurrentChannel.Value == null)
|
||||||
@ -328,11 +328,11 @@ namespace osu.Game.Overlays
|
|||||||
private void load(OsuConfigManager config, OsuColour colours, ChannelManager channelManager)
|
private void load(OsuConfigManager config, OsuColour colours, ChannelManager channelManager)
|
||||||
{
|
{
|
||||||
ChatHeight = config.GetBindable<double>(OsuSetting.ChatDisplayHeight);
|
ChatHeight = config.GetBindable<double>(OsuSetting.ChatDisplayHeight);
|
||||||
ChatHeight.ValueChanged += e =>
|
ChatHeight.ValueChanged += height =>
|
||||||
{
|
{
|
||||||
chatContainer.Height = (float)e.NewValue;
|
chatContainer.Height = (float)height.NewValue;
|
||||||
channelSelectionContainer.Height = 1f - (float)e.NewValue;
|
channelSelectionContainer.Height = 1f - (float)height.NewValue;
|
||||||
tabBackground.FadeTo(e.NewValue == 1 ? 1 : 0.8f, 200);
|
tabBackground.FadeTo(height.NewValue == 1 ? 1 : 0.8f, 200);
|
||||||
};
|
};
|
||||||
ChatHeight.TriggerChange();
|
ChatHeight.TriggerChange();
|
||||||
|
|
||||||
|
@ -127,8 +127,11 @@ namespace osu.Game.Overlays.Direct
|
|||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
this.FadeInFromZero(200, Easing.Out);
|
this.FadeInFromZero(200, Easing.Out);
|
||||||
|
|
||||||
PreviewPlaying.ValueChanged += e => PlayButton.FadeTo(e.NewValue || IsHovered || !FadePlayButton ? 1 : 0, 120, Easing.InOutQuint);
|
PreviewPlaying.ValueChanged += playing =>
|
||||||
PreviewPlaying.ValueChanged += e => PreviewBar.FadeTo(e.NewValue ? 1 : 0, 120, Easing.InOutQuint);
|
{
|
||||||
|
PlayButton.FadeTo(playing.NewValue || IsHovered || !FadePlayButton ? 1 : 0, 120, Easing.InOutQuint);
|
||||||
|
PreviewBar.FadeTo(playing.NewValue ? 1 : 0, 120, Easing.InOutQuint);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
protected List<DifficultyIcon> GetDifficultyIcons()
|
protected List<DifficultyIcon> GetDifficultyIcons()
|
||||||
|
@ -116,9 +116,9 @@ namespace osu.Game.Overlays
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
Filter.Search.Current.ValueChanged += e =>
|
Filter.Search.Current.ValueChanged += text =>
|
||||||
{
|
{
|
||||||
if (e.NewValue != string.Empty)
|
if (text.NewValue != string.Empty)
|
||||||
{
|
{
|
||||||
Header.Tabs.Current.Value = DirectTab.Search;
|
Header.Tabs.Current.Value = DirectTab.Search;
|
||||||
|
|
||||||
@ -133,13 +133,13 @@ namespace osu.Game.Overlays
|
|||||||
Filter.Tabs.Current.Value = DirectSortCriteria.Ranked;
|
Filter.Tabs.Current.Value = DirectSortCriteria.Ranked;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
((FilterControl)Filter).Ruleset.ValueChanged += e => Scheduler.AddOnce(updateSearch);
|
((FilterControl)Filter).Ruleset.ValueChanged += _ => Scheduler.AddOnce(updateSearch);
|
||||||
Filter.DisplayStyleControl.DisplayStyle.ValueChanged += e => recreatePanels(e.NewValue);
|
Filter.DisplayStyleControl.DisplayStyle.ValueChanged += style => recreatePanels(style.NewValue);
|
||||||
Filter.DisplayStyleControl.Dropdown.Current.ValueChanged += e => Scheduler.AddOnce(updateSearch);
|
Filter.DisplayStyleControl.Dropdown.Current.ValueChanged += _ => Scheduler.AddOnce(updateSearch);
|
||||||
|
|
||||||
Header.Tabs.Current.ValueChanged += e =>
|
Header.Tabs.Current.ValueChanged += tab =>
|
||||||
{
|
{
|
||||||
if (e.NewValue != DirectTab.Search)
|
if (tab.NewValue != DirectTab.Search)
|
||||||
{
|
{
|
||||||
currentQuery.Value = string.Empty;
|
currentQuery.Value = string.Empty;
|
||||||
Filter.Tabs.Current.Value = (DirectSortCriteria)Header.Tabs.Current.Value;
|
Filter.Tabs.Current.Value = (DirectSortCriteria)Header.Tabs.Current.Value;
|
||||||
@ -147,11 +147,11 @@ namespace osu.Game.Overlays
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
currentQuery.ValueChanged += e =>
|
currentQuery.ValueChanged += text =>
|
||||||
{
|
{
|
||||||
queryChangedDebounce?.Cancel();
|
queryChangedDebounce?.Cancel();
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(e.NewValue))
|
if (string.IsNullOrEmpty(text.NewValue))
|
||||||
Scheduler.AddOnce(updateSearch);
|
Scheduler.AddOnce(updateSearch);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -164,9 +164,9 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
currentQuery.BindTo(Filter.Search.Current);
|
currentQuery.BindTo(Filter.Search.Current);
|
||||||
|
|
||||||
Filter.Tabs.Current.ValueChanged += e =>
|
Filter.Tabs.Current.ValueChanged += tab =>
|
||||||
{
|
{
|
||||||
if (Header.Tabs.Current.Value != DirectTab.Search && e.NewValue != (DirectSortCriteria)Header.Tabs.Current.Value)
|
if (Header.Tabs.Current.Value != DirectTab.Search && tab.NewValue != (DirectSortCriteria)Header.Tabs.Current.Value)
|
||||||
Header.Tabs.Current.Value = DirectTab.Search;
|
Header.Tabs.Current.Value = DirectTab.Search;
|
||||||
|
|
||||||
Scheduler.AddOnce(updateSearch);
|
Scheduler.AddOnce(updateSearch);
|
||||||
|
@ -33,7 +33,7 @@ namespace osu.Game.Overlays
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Progress.ValueChanged += e => overlay.Alpha = (float)e.NewValue;
|
Progress.ValueChanged += p => overlay.Alpha = (float)p.NewValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,10 +63,10 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.user.ValueChanged += e =>
|
this.user.ValueChanged += u =>
|
||||||
{
|
{
|
||||||
total.Count = e.NewValue?.Kudosu.Total ?? 0;
|
total.Count = u.NewValue?.Kudosu.Total ?? 0;
|
||||||
avaliable.Count = e.NewValue?.Kudosu.Available ?? 0;
|
avaliable.Count = u.NewValue?.Kudosu.Available ?? 0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,9 +152,9 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
|||||||
|
|
||||||
panel.Status.BindTo(api.LocalUser.Value.Status);
|
panel.Status.BindTo(api.LocalUser.Value.Status);
|
||||||
|
|
||||||
dropdown.Current.ValueChanged += e =>
|
dropdown.Current.ValueChanged += action =>
|
||||||
{
|
{
|
||||||
switch (e.NewValue)
|
switch (action.NewValue)
|
||||||
{
|
{
|
||||||
case UserAction.Online:
|
case UserAction.Online:
|
||||||
api.LocalUser.Value.Status.Value = new UserStatusOnline();
|
api.LocalUser.Value.Status.Value = new UserStatusOnline();
|
||||||
|
@ -159,7 +159,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
|||||||
/// <returns>A bindable which will propagate updates with a delay.</returns>
|
/// <returns>A bindable which will propagate updates with a delay.</returns>
|
||||||
private void bindPreviewEvent(Bindable<float> bindable)
|
private void bindPreviewEvent(Bindable<float> bindable)
|
||||||
{
|
{
|
||||||
bindable.ValueChanged += e =>
|
bindable.ValueChanged += _ =>
|
||||||
{
|
{
|
||||||
switch (scalingMode.Value)
|
switch (scalingMode.Value)
|
||||||
{
|
{
|
||||||
|
@ -56,19 +56,19 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
rawInputToggle.ValueChanged += e =>
|
rawInputToggle.ValueChanged += enabled =>
|
||||||
{
|
{
|
||||||
// this is temporary until we support per-handler settings.
|
// this is temporary until we support per-handler settings.
|
||||||
const string raw_mouse_handler = @"OsuTKRawMouseHandler";
|
const string raw_mouse_handler = @"OsuTKRawMouseHandler";
|
||||||
const string standard_mouse_handler = @"OsuTKMouseHandler";
|
const string standard_mouse_handler = @"OsuTKMouseHandler";
|
||||||
|
|
||||||
ignoredInputHandler.Value = e.NewValue ? standard_mouse_handler : raw_mouse_handler;
|
ignoredInputHandler.Value = enabled.NewValue ? standard_mouse_handler : raw_mouse_handler;
|
||||||
};
|
};
|
||||||
|
|
||||||
ignoredInputHandler = config.GetBindable<string>(FrameworkSetting.IgnoredInputHandlers);
|
ignoredInputHandler = config.GetBindable<string>(FrameworkSetting.IgnoredInputHandlers);
|
||||||
ignoredInputHandler.ValueChanged += e =>
|
ignoredInputHandler.ValueChanged += handler =>
|
||||||
{
|
{
|
||||||
bool raw = !e.NewValue.Contains("Raw");
|
bool raw = !handler.NewValue.Contains("Raw");
|
||||||
rawInputToggle.Value = raw;
|
rawInputToggle.Value = raw;
|
||||||
sensitivity.Bindable.Disabled = !raw;
|
sensitivity.Bindable.Disabled = !raw;
|
||||||
};
|
};
|
||||||
|
@ -104,15 +104,15 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
AddInternal(Sidebar = new Sidebar { Width = sidebar_width });
|
AddInternal(Sidebar = new Sidebar { Width = sidebar_width });
|
||||||
|
|
||||||
SectionsContainer.SelectedSection.ValueChanged += e =>
|
SectionsContainer.SelectedSection.ValueChanged += section =>
|
||||||
{
|
{
|
||||||
selectedSidebarButton.Selected = false;
|
selectedSidebarButton.Selected = false;
|
||||||
selectedSidebarButton = Sidebar.Children.Single(b => b.Section == e.NewValue);
|
selectedSidebarButton = Sidebar.Children.Single(b => b.Section == section.NewValue);
|
||||||
selectedSidebarButton.Selected = true;
|
selectedSidebarButton.Selected = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
searchTextBox.Current.ValueChanged += e => SectionsContainer.SearchContainer.SearchTerm = e.NewValue;
|
searchTextBox.Current.ValueChanged += term => SectionsContainer.SearchContainer.SearchTerm = term.NewValue;
|
||||||
|
|
||||||
CreateSections()?.ForEach(AddSection);
|
CreateSections()?.ForEach(AddSection);
|
||||||
}
|
}
|
||||||
|
@ -55,9 +55,9 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
Add(loading = new LoadingAnimation());
|
Add(loading = new LoadingAnimation());
|
||||||
|
|
||||||
Filter.Search.Current.ValueChanged += e =>
|
Filter.Search.Current.ValueChanged += text =>
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(e.NewValue))
|
if (!string.IsNullOrEmpty(text.NewValue))
|
||||||
{
|
{
|
||||||
// force searching in players until searching for friends is supported
|
// force searching in players until searching for friends is supported
|
||||||
Header.Tabs.Current.Value = SocialTab.AllPlayers;
|
Header.Tabs.Current.Value = SocialTab.AllPlayers;
|
||||||
@ -71,14 +71,14 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
Filter.Tabs.Current.ValueChanged += _ => Scheduler.AddOnce(updateSearch);
|
Filter.Tabs.Current.ValueChanged += _ => Scheduler.AddOnce(updateSearch);
|
||||||
|
|
||||||
Filter.DisplayStyleControl.DisplayStyle.ValueChanged += e => recreatePanels(e.NewValue);
|
Filter.DisplayStyleControl.DisplayStyle.ValueChanged += style => recreatePanels(style.NewValue);
|
||||||
Filter.DisplayStyleControl.Dropdown.Current.ValueChanged += e => Scheduler.AddOnce(updateSearch);
|
Filter.DisplayStyleControl.Dropdown.Current.ValueChanged += _ => Scheduler.AddOnce(updateSearch);
|
||||||
|
|
||||||
currentQuery.ValueChanged += e =>
|
currentQuery.ValueChanged += query =>
|
||||||
{
|
{
|
||||||
queryChangedDebounce?.Cancel();
|
queryChangedDebounce?.Cancel();
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(e.NewValue))
|
if (string.IsNullOrEmpty(query.NewValue))
|
||||||
Scheduler.AddOnce(updateSearch);
|
Scheduler.AddOnce(updateSearch);
|
||||||
else
|
else
|
||||||
queryChangedDebounce = Scheduler.AddDelayed(updateSearch, 500);
|
queryChangedDebounce = Scheduler.AddDelayed(updateSearch, 500);
|
||||||
|
@ -45,13 +45,13 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
if (notificationOverlay != null)
|
if (notificationOverlay != null)
|
||||||
NotificationCount.BindTo(notificationOverlay.UnreadCount);
|
NotificationCount.BindTo(notificationOverlay.UnreadCount);
|
||||||
|
|
||||||
NotificationCount.ValueChanged += e =>
|
NotificationCount.ValueChanged += count =>
|
||||||
{
|
{
|
||||||
if (e.NewValue == 0)
|
if (count.NewValue == 0)
|
||||||
countDisplay.FadeOut(200, Easing.OutQuint);
|
countDisplay.FadeOut(200, Easing.OutQuint);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
countDisplay.Count = e.NewValue;
|
countDisplay.Count = count.NewValue;
|
||||||
countDisplay.FadeIn(200, Easing.OutQuint);
|
countDisplay.FadeIn(200, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -126,16 +126,16 @@ namespace osu.Game.Overlays
|
|||||||
RelativeSizeAxes = Axes.Both
|
RelativeSizeAxes = Axes.Both
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
sectionsContainer.SelectedSection.ValueChanged += e =>
|
sectionsContainer.SelectedSection.ValueChanged += section =>
|
||||||
{
|
{
|
||||||
if (lastSection != e.NewValue)
|
if (lastSection != section.NewValue)
|
||||||
{
|
{
|
||||||
lastSection = e.NewValue;
|
lastSection = section.NewValue;
|
||||||
tabs.Current.Value = lastSection;
|
tabs.Current.Value = lastSection;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
tabs.Current.ValueChanged += e =>
|
tabs.Current.ValueChanged += section =>
|
||||||
{
|
{
|
||||||
if (lastSection == null)
|
if (lastSection == null)
|
||||||
{
|
{
|
||||||
@ -144,9 +144,9 @@ namespace osu.Game.Overlays
|
|||||||
tabs.Current.Value = lastSection;
|
tabs.Current.Value = lastSection;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (lastSection != e.NewValue)
|
if (lastSection != section.NewValue)
|
||||||
{
|
{
|
||||||
lastSection = e.NewValue;
|
lastSection = section.NewValue;
|
||||||
sectionsContainer.ScrollTo(lastSection);
|
sectionsContainer.ScrollTo(lastSection);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -69,10 +69,10 @@ namespace osu.Game.Overlays.Volume
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Current.ValueChanged += e =>
|
Current.ValueChanged += muted =>
|
||||||
{
|
{
|
||||||
icon.Icon = e.NewValue ? FontAwesome.fa_volume_off : FontAwesome.fa_volume_up;
|
icon.Icon = muted.NewValue ? FontAwesome.fa_volume_off : FontAwesome.fa_volume_up;
|
||||||
icon.Margin = new MarginPadding { Left = e.NewValue ? width / 2 - 15 : width / 2 - 10 }; //Magic numbers to line up both icons because they're different widths
|
icon.Margin = new MarginPadding { Left = muted.NewValue ? width / 2 - 15 : width / 2 - 10 }; //Magic numbers to line up both icons because they're different widths
|
||||||
};
|
};
|
||||||
Current.TriggerChange();
|
Current.TriggerChange();
|
||||||
}
|
}
|
||||||
|
@ -175,10 +175,10 @@ namespace osu.Game.Overlays.Volume
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Bindable.ValueChanged += e =>
|
Bindable.ValueChanged += volume =>
|
||||||
{
|
{
|
||||||
this.TransformTo("DisplayVolume",
|
this.TransformTo("DisplayVolume",
|
||||||
e.NewValue,
|
volume.NewValue,
|
||||||
400,
|
400,
|
||||||
Easing.OutQuint);
|
Easing.OutQuint);
|
||||||
};
|
};
|
||||||
|
@ -74,9 +74,9 @@ namespace osu.Game.Overlays
|
|||||||
volumeMeterEffect.Bindable.BindTo(audio.VolumeSample);
|
volumeMeterEffect.Bindable.BindTo(audio.VolumeSample);
|
||||||
volumeMeterMusic.Bindable.BindTo(audio.VolumeTrack);
|
volumeMeterMusic.Bindable.BindTo(audio.VolumeTrack);
|
||||||
|
|
||||||
muteButton.Current.ValueChanged += e =>
|
muteButton.Current.ValueChanged += muted =>
|
||||||
{
|
{
|
||||||
if (e.NewValue)
|
if (muted.NewValue)
|
||||||
audio.AddAdjustment(AdjustableProperty.Volume, muteAdjustment);
|
audio.AddAdjustment(AdjustableProperty.Volume, muteAdjustment);
|
||||||
else
|
else
|
||||||
audio.RemoveAdjustment(AdjustableProperty.Volume, muteAdjustment);
|
audio.RemoveAdjustment(AdjustableProperty.Volume, muteAdjustment);
|
||||||
|
@ -124,14 +124,14 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
State.ValueChanged += e =>
|
State.ValueChanged += armed =>
|
||||||
{
|
{
|
||||||
UpdateState(e.NewValue);
|
UpdateState(armed.NewValue);
|
||||||
|
|
||||||
// apply any custom state overrides
|
// apply any custom state overrides
|
||||||
ApplyCustomUpdateState?.Invoke(this, e.NewValue);
|
ApplyCustomUpdateState?.Invoke(this, armed.NewValue);
|
||||||
|
|
||||||
if (e.NewValue == ArmedState.Hit)
|
if (armed.NewValue == ArmedState.Hit)
|
||||||
PlaySamples();
|
PlaySamples();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -94,12 +94,12 @@ namespace osu.Game.Rulesets.UI
|
|||||||
Ruleset = ruleset;
|
Ruleset = ruleset;
|
||||||
playfield = new Lazy<Playfield>(CreatePlayfield);
|
playfield = new Lazy<Playfield>(CreatePlayfield);
|
||||||
|
|
||||||
IsPaused.ValueChanged += e =>
|
IsPaused.ValueChanged += paused =>
|
||||||
{
|
{
|
||||||
if (HasReplayLoaded.Value)
|
if (HasReplayLoaded.Value)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
KeyBindingInputManager.UseParentInput = !e.NewValue;
|
KeyBindingInputManager.UseParentInput = !paused.NewValue;
|
||||||
};
|
};
|
||||||
|
|
||||||
Cursor = CreateCursor();
|
Cursor = CreateCursor();
|
||||||
|
@ -61,7 +61,7 @@ namespace osu.Game.Screens.Edit.Components
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
tabs.Current.ValueChanged += e => Beatmap.Value.Track.Tempo.Value = e.NewValue;
|
tabs.Current.ValueChanged += tempo => Beatmap.Value.Track.Tempo.Value = tempo.NewValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnKeyDown(KeyDownEvent e)
|
protected override bool OnKeyDown(KeyDownEvent e)
|
||||||
|
@ -80,10 +80,10 @@ namespace osu.Game.Screens.Edit.Components.RadioButtons
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
button.Selected.ValueChanged += e =>
|
button.Selected.ValueChanged += selected =>
|
||||||
{
|
{
|
||||||
updateSelectionState();
|
updateSelectionState();
|
||||||
if (e.NewValue)
|
if (selected.NewValue)
|
||||||
Selected?.Invoke(button);
|
Selected?.Invoke(button);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -44,9 +44,9 @@ namespace osu.Game.Screens.Edit.Components.RadioButtons
|
|||||||
private RadioButton currentlySelected;
|
private RadioButton currentlySelected;
|
||||||
private void addButton(RadioButton button)
|
private void addButton(RadioButton button)
|
||||||
{
|
{
|
||||||
button.Selected.ValueChanged += e =>
|
button.Selected.ValueChanged += selected =>
|
||||||
{
|
{
|
||||||
if (e.NewValue)
|
if (selected.NewValue)
|
||||||
{
|
{
|
||||||
currentlySelected?.Deselect();
|
currentlySelected?.Deselect();
|
||||||
currentlySelected = button;
|
currentlySelected = button;
|
||||||
|
@ -24,10 +24,10 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
|
|||||||
{
|
{
|
||||||
AddInternal(timeline = new Container { RelativeSizeAxes = Axes.Both });
|
AddInternal(timeline = new Container { RelativeSizeAxes = Axes.Both });
|
||||||
|
|
||||||
Beatmap.ValueChanged += e =>
|
Beatmap.ValueChanged += b =>
|
||||||
{
|
{
|
||||||
updateRelativeChildSize();
|
updateRelativeChildSize();
|
||||||
LoadBeatmap(e.NewValue);
|
LoadBeatmap(b.NewValue);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,12 +157,8 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
beatDivisor.BindValueChanged(val => Text = $"1/{val.NewValue}", true);
|
||||||
beatDivisor.ValueChanged += e => updateText();
|
|
||||||
updateText();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateText() => Text = $"1/{beatDivisor.Value}";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class DivisorButton : IconButton
|
private class DivisorButton : IconButton
|
||||||
@ -219,9 +215,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
|
|
||||||
AddInternal(marker = new Marker());
|
AddInternal(marker = new Marker());
|
||||||
|
|
||||||
CurrentNumber.ValueChanged += e =>
|
CurrentNumber.ValueChanged += div =>
|
||||||
{
|
{
|
||||||
marker.MoveToX(getMappedPosition(e.NewValue), 100, Easing.OutQuint);
|
marker.MoveToX(getMappedPosition(div.NewValue), 100, Easing.OutQuint);
|
||||||
marker.Flash();
|
marker.Flash();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
// We don't want the centre marker to scroll
|
// We don't want the centre marker to scroll
|
||||||
AddInternal(new CentreMarker());
|
AddInternal(new CentreMarker());
|
||||||
|
|
||||||
WaveformVisible.ValueChanged += e => waveform.FadeTo(e.NewValue ? 1 : 0, 200, Easing.OutQuint);
|
WaveformVisible.ValueChanged += visible => waveform.FadeTo(visible.NewValue ? 1 : 0, 200, Easing.OutQuint);
|
||||||
|
|
||||||
Beatmap.BindTo(beatmap);
|
Beatmap.BindTo(beatmap);
|
||||||
Beatmap.BindValueChanged(e =>
|
Beatmap.BindValueChanged(e =>
|
||||||
|
@ -117,7 +117,7 @@ namespace osu.Game.Screens.Menu
|
|||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
private void load(AudioManager audio, IdleTracker idleTracker)
|
private void load(AudioManager audio, IdleTracker idleTracker)
|
||||||
{
|
{
|
||||||
isIdle.ValueChanged += e => updateIdleState(e.NewValue);
|
isIdle.ValueChanged += idle => updateIdleState(idle.NewValue);
|
||||||
|
|
||||||
if (idleTracker != null) isIdle.BindTo(idleTracker.IsIdle);
|
if (idleTracker != null) isIdle.BindTo(idleTracker.IsIdle);
|
||||||
|
|
||||||
|
@ -85,10 +85,10 @@ namespace osu.Game.Screens.Multi
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
breadcrumbs.Current.ValueChanged += e =>
|
breadcrumbs.Current.ValueChanged += scren =>
|
||||||
{
|
{
|
||||||
if (e.NewValue is IMultiplayerSubScreen mpScreen)
|
if (scren.NewValue is IMultiplayerSubScreen multiScreen)
|
||||||
screenType.Text = mpScreen.ShortTitle.ToLowerInvariant();
|
screenType.Text = multiScreen.ShortTitle.ToLowerInvariant();
|
||||||
};
|
};
|
||||||
|
|
||||||
breadcrumbs.Current.TriggerChange();
|
breadcrumbs.Current.TriggerChange();
|
||||||
|
@ -176,7 +176,7 @@ namespace osu.Game.Screens.Play
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
button.Selected.ValueChanged += e => buttonSelectionChanged(button, e.NewValue);
|
button.Selected.ValueChanged += selected => buttonSelectionChanged(button, selected.NewValue);
|
||||||
|
|
||||||
InternalButtons.Add(button);
|
InternalButtons.Add(button);
|
||||||
}
|
}
|
||||||
@ -191,6 +191,7 @@ namespace osu.Game.Screens.Play
|
|||||||
if (_selectionIndex == value)
|
if (_selectionIndex == value)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
// Deselect the previously-selected button
|
// Deselect the previously-selected button
|
||||||
if (_selectionIndex != -1)
|
if (_selectionIndex != -1)
|
||||||
InternalButtons[_selectionIndex].Selected.Value = false;
|
InternalButtons[_selectionIndex].Selected.Value = false;
|
||||||
|
@ -63,7 +63,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
|
|
||||||
TextSize = 80;
|
TextSize = 80;
|
||||||
|
|
||||||
Current.ValueChanged += e => updateCount(e.NewValue == 0);
|
Current.ValueChanged += combo => updateCount(combo.NewValue == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
|
|
||||||
protected HealthDisplay()
|
protected HealthDisplay()
|
||||||
{
|
{
|
||||||
Current.ValueChanged += e => SetHealth((float)e.NewValue);
|
Current.ValueChanged += health => SetHealth((float)health.NewValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void SetHealth(float value);
|
protected abstract void SetHealth(float value);
|
||||||
|
@ -163,7 +163,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
private void bind()
|
private void bind()
|
||||||
{
|
{
|
||||||
circularProgress.Current.BindTo(Progress);
|
circularProgress.Current.BindTo(Progress);
|
||||||
Progress.ValueChanged += e => icon.Scale = new Vector2(1 + (float)e.NewValue * 0.2f);
|
Progress.ValueChanged += progress => icon.Scale = new Vector2(1 + (float)progress.NewValue * 0.2f);
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool pendingAnimation;
|
private bool pendingAnimation;
|
||||||
|
@ -65,10 +65,10 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Current.ValueChanged += e =>
|
Current.ValueChanged += mods =>
|
||||||
{
|
{
|
||||||
iconsContainer.Clear();
|
iconsContainer.Clear();
|
||||||
foreach (Mod mod in e.NewValue)
|
foreach (Mod mod in mods.NewValue)
|
||||||
{
|
{
|
||||||
iconsContainer.Add(new ModIcon(mod) { Scale = new Vector2(0.6f) });
|
iconsContainer.Add(new ModIcon(mod) { Scale = new Vector2(0.6f) });
|
||||||
}
|
}
|
||||||
|
@ -104,7 +104,7 @@ namespace osu.Game.Screens.Play
|
|||||||
private void load(OsuConfigManager config, NotificationOverlay notificationOverlay)
|
private void load(OsuConfigManager config, NotificationOverlay notificationOverlay)
|
||||||
{
|
{
|
||||||
showHud = config.GetBindable<bool>(OsuSetting.ShowInterface);
|
showHud = config.GetBindable<bool>(OsuSetting.ShowInterface);
|
||||||
showHud.ValueChanged += e => visibilityContainer.FadeTo(e.NewValue ? 1 : 0, duration);
|
showHud.ValueChanged += visible => visibilityContainer.FadeTo(visible.NewValue ? 1 : 0, duration);
|
||||||
showHud.TriggerChange();
|
showHud.TriggerChange();
|
||||||
|
|
||||||
if (!showHud.Value && !hasShownNotificationOnce)
|
if (!showHud.Value && !hasShownNotificationOnce)
|
||||||
|
@ -159,7 +159,7 @@ namespace osu.Game.Screens.Play
|
|||||||
// the final usable gameplay clock with user-set offsets applied.
|
// the final usable gameplay clock with user-set offsets applied.
|
||||||
var offsetClock = new FramedOffsetClock(platformOffsetClock);
|
var offsetClock = new FramedOffsetClock(platformOffsetClock);
|
||||||
|
|
||||||
userAudioOffset.ValueChanged += e => offsetClock.Offset = e.NewValue;
|
userAudioOffset.ValueChanged += offset => offsetClock.Offset = offset.NewValue;
|
||||||
userAudioOffset.TriggerChange();
|
userAudioOffset.TriggerChange();
|
||||||
|
|
||||||
ScoreProcessor = RulesetContainer.CreateScoreProcessor();
|
ScoreProcessor = RulesetContainer.CreateScoreProcessor();
|
||||||
|
@ -17,7 +17,7 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
|||||||
|
|
||||||
public IAdjustableClock AdjustableClock { set; get; }
|
public IAdjustableClock AdjustableClock { set; get; }
|
||||||
|
|
||||||
private readonly PlayerSliderBar<double> sliderbar;
|
private readonly PlayerSliderBar<double> rateSlider;
|
||||||
|
|
||||||
private readonly OsuSpriteText multiplierText;
|
private readonly OsuSpriteText multiplierText;
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
sliderbar = new PlayerSliderBar<double>
|
rateSlider = new PlayerSliderBar<double>
|
||||||
{
|
{
|
||||||
Bindable = new BindableDouble(1)
|
Bindable = new BindableDouble(1)
|
||||||
{
|
{
|
||||||
@ -69,9 +69,9 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
|||||||
var clockRate = AdjustableClock.Rate;
|
var clockRate = AdjustableClock.Rate;
|
||||||
|
|
||||||
// can't trigger this line instantly as the underlying clock may not be ready to accept adjustments yet.
|
// can't trigger this line instantly as the underlying clock may not be ready to accept adjustments yet.
|
||||||
sliderbar.Bindable.ValueChanged += e => AdjustableClock.Rate = clockRate * e.NewValue;
|
rateSlider.Bindable.ValueChanged += multiplier => AdjustableClock.Rate = clockRate * multiplier.NewValue;
|
||||||
|
|
||||||
sliderbar.Bindable.BindValueChanged(multiplier => multiplierText.Text = $"{multiplier:0.0}x", true);
|
rateSlider.Bindable.BindValueChanged(multiplier => multiplierText.Text = $"{multiplier:0.0}x", true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -104,7 +104,7 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
State = Visibility.Visible;
|
State = Visibility.Visible;
|
||||||
|
|
||||||
replayLoaded.ValueChanged += e => AllowSeeking = e.NewValue;
|
replayLoaded.ValueChanged += loaded => AllowSeeking = loaded.NewValue;
|
||||||
replayLoaded.TriggerChange();
|
replayLoaded.TriggerChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ namespace osu.Game.Screens.Select
|
|||||||
config.BindWith(OsuSetting.RandomSelectAlgorithm, RandomAlgorithm);
|
config.BindWith(OsuSetting.RandomSelectAlgorithm, RandomAlgorithm);
|
||||||
config.BindWith(OsuSetting.SongSelectRightMouseScroll, RightClickScrollingEnabled);
|
config.BindWith(OsuSetting.SongSelectRightMouseScroll, RightClickScrollingEnabled);
|
||||||
|
|
||||||
RightClickScrollingEnabled.ValueChanged += e => RightMouseScrollbar = e.NewValue;
|
RightClickScrollingEnabled.ValueChanged += enabled => RightMouseScrollbar = enabled.NewValue;
|
||||||
RightClickScrollingEnabled.TriggerChange();
|
RightClickScrollingEnabled.TriggerChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -509,9 +509,9 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
foreach (var c in set.Beatmaps)
|
foreach (var c in set.Beatmaps)
|
||||||
{
|
{
|
||||||
c.State.ValueChanged += e =>
|
c.State.ValueChanged += state =>
|
||||||
{
|
{
|
||||||
if (e.NewValue == CarouselItemState.Selected)
|
if (state.NewValue == CarouselItemState.Selected)
|
||||||
{
|
{
|
||||||
selectedBeatmapSet = set;
|
selectedBeatmapSet = set;
|
||||||
SelectionChanged?.Invoke(c.Beatmap);
|
SelectionChanged?.Invoke(c.Beatmap);
|
||||||
|
@ -69,8 +69,8 @@ namespace osu.Game.Screens.Select
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
tabs.Current.ValueChanged += e => invokeOnFilter();
|
tabs.Current.ValueChanged += _ => invokeOnFilter();
|
||||||
modsCheckbox.Current.ValueChanged += e => invokeOnFilter();
|
modsCheckbox.Current.ValueChanged += _ => invokeOnFilter();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
|
|
||||||
public virtual void AddChild(CarouselItem i)
|
public virtual void AddChild(CarouselItem i)
|
||||||
{
|
{
|
||||||
i.State.ValueChanged += e => ChildItemStateChanged(i, e.NewValue);
|
i.State.ValueChanged += state => ChildItemStateChanged(i, state.NewValue);
|
||||||
i.ChildID = ++currentChildID;
|
i.ChildID = ++currentChildID;
|
||||||
InternalChildren.Add(i);
|
InternalChildren.Add(i);
|
||||||
}
|
}
|
||||||
@ -58,9 +58,9 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
{
|
{
|
||||||
if (items != null) InternalChildren = items;
|
if (items != null) InternalChildren = items;
|
||||||
|
|
||||||
State.ValueChanged += e =>
|
State.ValueChanged += state =>
|
||||||
{
|
{
|
||||||
switch (e.NewValue)
|
switch (state.NewValue)
|
||||||
{
|
{
|
||||||
case CarouselItemState.Collapsed:
|
case CarouselItemState.Collapsed:
|
||||||
case CarouselItemState.NotSelected:
|
case CarouselItemState.NotSelected:
|
||||||
|
@ -13,9 +13,9 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
{
|
{
|
||||||
public CarouselGroupEagerSelect()
|
public CarouselGroupEagerSelect()
|
||||||
{
|
{
|
||||||
State.ValueChanged += e =>
|
State.ValueChanged += state =>
|
||||||
{
|
{
|
||||||
if (e.NewValue == CarouselItemState.Selected)
|
if (state.NewValue == CarouselItemState.Selected)
|
||||||
attemptSelection();
|
attemptSelection();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -37,9 +37,9 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
{
|
{
|
||||||
DrawableRepresentation = new Lazy<DrawableCarouselItem>(CreateDrawableRepresentation);
|
DrawableRepresentation = new Lazy<DrawableCarouselItem>(CreateDrawableRepresentation);
|
||||||
|
|
||||||
Filtered.ValueChanged += e =>
|
Filtered.ValueChanged += filtered =>
|
||||||
{
|
{
|
||||||
if (e.NewValue && State.Value == CarouselItemState.Selected)
|
if (filtered.NewValue && State.Value == CarouselItemState.Selected)
|
||||||
State.Value = CarouselItemState.NotSelected;
|
State.Value = CarouselItemState.NotSelected;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -189,7 +189,7 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
: base(item.Beatmap)
|
: base(item.Beatmap)
|
||||||
{
|
{
|
||||||
filtered.BindTo(item.Filtered);
|
filtered.BindTo(item.Filtered);
|
||||||
filtered.ValueChanged += e => Schedule(() => this.FadeTo(e.NewValue ? 0.1f : 1, 100));
|
filtered.ValueChanged += isFiltered => Schedule(() => this.FadeTo(isFiltered.NewValue ? 0.1f : 1, 100));
|
||||||
filtered.TriggerChange();
|
filtered.TriggerChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,12 +146,12 @@ namespace osu.Game.Screens.Select
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
searchTextBox.Current.ValueChanged += e => FilterChanged?.Invoke(CreateCriteria());
|
searchTextBox.Current.ValueChanged += _ => FilterChanged?.Invoke(CreateCriteria());
|
||||||
|
|
||||||
groupTabs.PinItem(GroupMode.All);
|
groupTabs.PinItem(GroupMode.All);
|
||||||
groupTabs.PinItem(GroupMode.RecentlyPlayed);
|
groupTabs.PinItem(GroupMode.RecentlyPlayed);
|
||||||
groupTabs.Current.ValueChanged += e => Group = e.NewValue;
|
groupTabs.Current.ValueChanged += group => Group = group.NewValue;
|
||||||
sortTabs.Current.ValueChanged += e => Sort = e.NewValue;
|
sortTabs.Current.ValueChanged += sort => Sort = sort.NewValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Deactivate()
|
public void Deactivate()
|
||||||
@ -178,7 +178,7 @@ namespace osu.Game.Screens.Select
|
|||||||
sortTabs.AccentColour = colours.GreenLight;
|
sortTabs.AccentColour = colours.GreenLight;
|
||||||
|
|
||||||
showConverted = config.GetBindable<bool>(OsuSetting.ShowConvertedBeatmaps);
|
showConverted = config.GetBindable<bool>(OsuSetting.ShowConvertedBeatmaps);
|
||||||
showConverted.ValueChanged += e => updateCriteria();
|
showConverted.ValueChanged += _ => updateCriteria();
|
||||||
|
|
||||||
ruleset.BindTo(parentRuleset);
|
ruleset.BindTo(parentRuleset);
|
||||||
ruleset.BindValueChanged(_ => updateCriteria(), true);
|
ruleset.BindValueChanged(_ => updateCriteria(), true);
|
||||||
|
@ -598,9 +598,9 @@ namespace osu.Game.Screens.Select
|
|||||||
{
|
{
|
||||||
// manual binding to parent ruleset to allow for delayed load in the incoming direction.
|
// manual binding to parent ruleset to allow for delayed load in the incoming direction.
|
||||||
rulesetNoDebounce = decoupledRuleset.Value = Ruleset.Value;
|
rulesetNoDebounce = decoupledRuleset.Value = Ruleset.Value;
|
||||||
Ruleset.ValueChanged += e => updateSelectedRuleset(e.NewValue);
|
Ruleset.ValueChanged += r => updateSelectedRuleset(r.NewValue);
|
||||||
|
|
||||||
decoupledRuleset.ValueChanged += e => Ruleset.Value = e.NewValue;
|
decoupledRuleset.ValueChanged += r => Ruleset.Value = r.NewValue;
|
||||||
decoupledRuleset.DisabledChanged += r => Ruleset.Disabled = r;
|
decoupledRuleset.DisabledChanged += r => Ruleset.Disabled = r;
|
||||||
|
|
||||||
Beatmap.BindDisabledChanged(disabled => Carousel.AllowSelection = !disabled, true);
|
Beatmap.BindDisabledChanged(disabled => Carousel.AllowSelection = !disabled, true);
|
||||||
|
@ -42,10 +42,10 @@ namespace osu.Game.Skinning
|
|||||||
CurrentSkinInfo.Value = SkinInfo.Default;
|
CurrentSkinInfo.Value = SkinInfo.Default;
|
||||||
};
|
};
|
||||||
|
|
||||||
CurrentSkinInfo.ValueChanged += e => CurrentSkin.Value = getSkin(e.NewValue);
|
CurrentSkinInfo.ValueChanged += skin => CurrentSkin.Value = getSkin(skin.NewValue);
|
||||||
CurrentSkin.ValueChanged += e =>
|
CurrentSkin.ValueChanged += skin =>
|
||||||
{
|
{
|
||||||
if (e.NewValue.SkinInfo != CurrentSkinInfo.Value)
|
if (skin.NewValue.SkinInfo != CurrentSkinInfo.Value)
|
||||||
throw new InvalidOperationException($"Setting {nameof(CurrentSkin)}'s value directly is not supported. Use {nameof(CurrentSkinInfo)} instead.");
|
throw new InvalidOperationException($"Setting {nameof(CurrentSkin)}'s value directly is not supported. Use {nameof(CurrentSkinInfo)} instead.");
|
||||||
|
|
||||||
SourceChanged?.Invoke();
|
SourceChanged?.Invoke();
|
||||||
|
@ -191,8 +191,8 @@ namespace osu.Game.Users
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Status.ValueChanged += e => displayStatus(e.NewValue);
|
Status.ValueChanged += status => displayStatus(status.NewValue);
|
||||||
Status.ValueChanged += e => statusBg.FadeColour(e.NewValue?.GetAppropriateColour(colours) ?? colours.Gray5, 500, Easing.OutQuint);
|
Status.ValueChanged += status => statusBg.FadeColour(status.NewValue?.GetAppropriateColour(colours) ?? colours.Gray5, 500, Easing.OutQuint);
|
||||||
|
|
||||||
base.Action = ViewProfile = () =>
|
base.Action = ViewProfile = () =>
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user