1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 16:27:26 +08:00

Welded bindables.

This commit is contained in:
Dean Herbert 2017-02-26 22:08:21 +09:00
parent c5ad79e3e2
commit c227eb1be5
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49
31 changed files with 94 additions and 128 deletions

@ -1 +1 @@
Subproject commit 7cad7cf48b2ae9f16cac503d46bd0ea801e7561f Subproject commit 12fbf2b94af0ddef9daf0fab11c05288dee054a7

View File

@ -79,8 +79,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuConfigManager config) private void load(OsuConfigManager config)
{ {
snakingIn = config.GetBindable<bool>(OsuConfig.SnakingInSliders); snakingIn = config.GetWeldedBindable<bool>(OsuConfig.SnakingInSliders);
snakingOut = config.GetBindable<bool>(OsuConfig.SnakingOutSliders); snakingOut = config.GetWeldedBindable<bool>(OsuConfig.SnakingOutSliders);
int textureWidth = (int)PathWidth * 2; int textureWidth = (int)PathWidth * 2;

View File

@ -79,7 +79,7 @@ namespace osu.Game.Beatmaps.Drawables
{ {
this.config = config; this.config = config;
preferUnicode = config.GetBindable<bool>(OsuConfig.ShowUnicode); preferUnicode = config.GetWeldedBindable<bool>(OsuConfig.ShowUnicode);
preferUnicode.ValueChanged += preferUnicode_changed; preferUnicode.ValueChanged += preferUnicode_changed;
preferUnicode_changed(preferUnicode, null); preferUnicode_changed(preferUnicode, null);
} }

View File

@ -40,7 +40,7 @@ namespace osu.Game.Graphics.Containers
private void load(UserInputManager input, OsuConfigManager config) private void load(UserInputManager input, OsuConfigManager config)
{ {
this.input = input; this.input = input;
parallaxEnabled = config.GetBindable<bool>(OsuConfig.MenuParallax); parallaxEnabled = config.GetWeldedBindable<bool>(OsuConfig.MenuParallax);
parallaxEnabled.ValueChanged += delegate parallaxEnabled.ValueChanged += delegate
{ {
if (!parallaxEnabled) if (!parallaxEnabled)

View File

@ -43,7 +43,7 @@ namespace osu.Game.Graphics.Cursor
class OsuCursor : Container class OsuCursor : Container
{ {
private Container cursorContainer; private Container cursorContainer;
private BindableDouble cursorScale; private Bindable<double> cursorScale;
public OsuCursor() public OsuCursor()
{ {
@ -54,7 +54,7 @@ namespace osu.Game.Graphics.Cursor
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(TextureStore textures, OsuConfigManager config) private void load(TextureStore textures, OsuConfigManager config)
{ {
cursorScale = (BindableDouble)config.GetBindable<double>(OsuConfig.CursorSize); cursorScale = config.GetWeldedBindable<double>(OsuConfig.CursorSize);
Children = new Drawable[] Children = new Drawable[]
{ {

View File

@ -87,7 +87,7 @@ namespace osu.Game
Dependencies.Cache(this); Dependencies.Cache(this);
PlayMode = LocalConfig.GetBindable<PlayMode>(OsuConfig.PlayMode); PlayMode = LocalConfig.GetWeldedBindable<PlayMode>(OsuConfig.PlayMode);
} }
protected async void ImportBeatmapsAsync(IEnumerable<string> paths) protected async void ImportBeatmapsAsync(IEnumerable<string> paths)

View File

@ -211,7 +211,7 @@ namespace osu.Game.Overlays
this.beatmaps = beatmaps; this.beatmaps = beatmaps;
trackManager = osuGame.Audio.Track; trackManager = osuGame.Audio.Track;
preferUnicode = config.GetBindable<bool>(OsuConfig.ShowUnicode); preferUnicode = config.GetWeldedBindable<bool>(OsuConfig.ShowUnicode);
preferUnicode.ValueChanged += preferUnicode_changed; preferUnicode.ValueChanged += preferUnicode_changed;
beatmapSource = osuGame.Beatmap ?? new Bindable<WorkingBeatmap>(); beatmapSource = osuGame.Beatmap ?? new Bindable<WorkingBeatmap>();

View File

@ -21,7 +21,7 @@ namespace osu.Game.Overlays.Options.Sections.Audio
new OptionSlider<int> new OptionSlider<int>
{ {
LabelText = "Universal Offset", LabelText = "Universal Offset",
Bindable = (BindableInt)config.GetBindable<int>(OsuConfig.Offset) Bindable = (BindableInt)config.GetWeldedBindable<int>(OsuConfig.Offset)
}, },
new OsuButton new OsuButton
{ {

View File

@ -24,7 +24,7 @@ namespace osu.Game.Overlays.Options.Sections.Audio
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Ignore beatmap hitsounds", LabelText = "Ignore beatmap hitsounds",
Bindable = config.GetBindable<bool>(OsuConfig.IgnoreBeatmapSamples) Bindable = config.GetWeldedBindable<bool>(OsuConfig.IgnoreBeatmapSamples)
} }
}; };
} }

View File

@ -23,7 +23,7 @@ namespace osu.Game.Overlays.Options.Sections.Debug
new OptionEnumDropDown<GCLatencyMode> new OptionEnumDropDown<GCLatencyMode>
{ {
LabelText = "Active mode", LabelText = "Active mode",
Bindable = config.GetBindable<GCLatencyMode>(FrameworkDebugConfig.ActiveGCMode) Bindable = config.GetWeldedBindable<GCLatencyMode>(FrameworkDebugConfig.ActiveGCMode)
}, },
new OsuButton new OsuButton
{ {

View File

@ -24,32 +24,32 @@ namespace osu.Game.Overlays.Options.Sections
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Background video", LabelText = "Background video",
Bindable = config.GetBindable<bool>(OsuConfig.VideoEditor) Bindable = config.GetWeldedBindable<bool>(OsuConfig.VideoEditor)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Always use default skin", LabelText = "Always use default skin",
Bindable = config.GetBindable<bool>(OsuConfig.EditorDefaultSkin) Bindable = config.GetWeldedBindable<bool>(OsuConfig.EditorDefaultSkin)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Snaking sliders", LabelText = "Snaking sliders",
Bindable = config.GetBindable<bool>(OsuConfig.EditorSnakingSliders) Bindable = config.GetWeldedBindable<bool>(OsuConfig.EditorSnakingSliders)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Hit animations", LabelText = "Hit animations",
Bindable = config.GetBindable<bool>(OsuConfig.EditorHitAnimations) Bindable = config.GetWeldedBindable<bool>(OsuConfig.EditorHitAnimations)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Follow points", LabelText = "Follow points",
Bindable = config.GetBindable<bool>(OsuConfig.EditorFollowPoints) Bindable = config.GetWeldedBindable<bool>(OsuConfig.EditorFollowPoints)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Stacking", LabelText = "Stacking",
Bindable = config.GetBindable<bool>(OsuConfig.EditorStacking) Bindable = config.GetWeldedBindable<bool>(OsuConfig.EditorStacking)
}, },
}; };
} }

View File

@ -21,42 +21,42 @@ namespace osu.Game.Overlays.Options.Sections.Gameplay
new OptionSlider<int> new OptionSlider<int>
{ {
LabelText = "Background dim", LabelText = "Background dim",
Bindable = (BindableInt)config.GetBindable<int>(OsuConfig.DimLevel) Bindable = (BindableInt)config.GetWeldedBindable<int>(OsuConfig.DimLevel)
}, },
new OptionEnumDropDown<ProgressBarType> new OptionEnumDropDown<ProgressBarType>
{ {
LabelText = "Progress display", LabelText = "Progress display",
Bindable = config.GetBindable<ProgressBarType>(OsuConfig.ProgressBarType) Bindable = config.GetWeldedBindable<ProgressBarType>(OsuConfig.ProgressBarType)
}, },
new OptionEnumDropDown<ScoreMeterType> new OptionEnumDropDown<ScoreMeterType>
{ {
LabelText = "Score meter type", LabelText = "Score meter type",
Bindable = config.GetBindable<ScoreMeterType>(OsuConfig.ScoreMeter) Bindable = config.GetWeldedBindable<ScoreMeterType>(OsuConfig.ScoreMeter)
}, },
new OptionSlider<double> new OptionSlider<double>
{ {
LabelText = "Score meter size", LabelText = "Score meter size",
Bindable = (BindableDouble)config.GetBindable<double>(OsuConfig.ScoreMeterScale) Bindable = (BindableDouble)config.GetWeldedBindable<double>(OsuConfig.ScoreMeterScale)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Always show key overlay", LabelText = "Always show key overlay",
Bindable = config.GetBindable<bool>(OsuConfig.KeyOverlay) Bindable = config.GetWeldedBindable<bool>(OsuConfig.KeyOverlay)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Show approach circle on first \"Hidden\" object", LabelText = "Show approach circle on first \"Hidden\" object",
Bindable = config.GetBindable<bool>(OsuConfig.HiddenShowFirstApproach) Bindable = config.GetWeldedBindable<bool>(OsuConfig.HiddenShowFirstApproach)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Scale osu!mania scroll speed with BPM", LabelText = "Scale osu!mania scroll speed with BPM",
Bindable = config.GetBindable<bool>(OsuConfig.ManiaSpeedBPMScale) Bindable = config.GetWeldedBindable<bool>(OsuConfig.ManiaSpeedBPMScale)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Remember osu!mania scroll speed per beatmap", LabelText = "Remember osu!mania scroll speed per beatmap",
Bindable = config.GetBindable<bool>(OsuConfig.UsePerBeatmapManiaSpeed) Bindable = config.GetWeldedBindable<bool>(OsuConfig.UsePerBeatmapManiaSpeed)
}, },
}; };
} }

View File

@ -20,12 +20,12 @@ namespace osu.Game.Overlays.Options.Sections.Gameplay
new OptionSlider<double> new OptionSlider<double>
{ {
LabelText = "Display beatmaps from", LabelText = "Display beatmaps from",
Bindable = (BindableDouble)config.GetBindable<double>(OsuConfig.DisplayStarsMinimum) Bindable = (BindableDouble)config.GetWeldedBindable<double>(OsuConfig.DisplayStarsMinimum)
}, },
new OptionSlider<double> new OptionSlider<double>
{ {
LabelText = "up to", LabelText = "up to",
Bindable = (BindableDouble)config.GetBindable<double>(OsuConfig.DisplayStarsMaximum) Bindable = (BindableDouble)config.GetWeldedBindable<double>(OsuConfig.DisplayStarsMaximum)
}, },
}; };
} }

View File

@ -21,12 +21,12 @@ namespace osu.Game.Overlays.Options.Sections.General
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Prefer metadata in original language", LabelText = "Prefer metadata in original language",
Bindable = config.GetBindable<bool>(OsuConfig.ShowUnicode) Bindable = config.GetWeldedBindable<bool>(OsuConfig.ShowUnicode)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Use alternative font for chat display", LabelText = "Use alternative font for chat display",
Bindable = config.GetBindable<bool>(OsuConfig.AlternativeChatFont) Bindable = config.GetWeldedBindable<bool>(OsuConfig.AlternativeChatFont)
}, },
}; };
} }

View File

@ -122,12 +122,12 @@ namespace osu.Game.Overlays.Options.Sections.General
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Remember username", LabelText = "Remember username",
Bindable = config.GetBindable<bool>(OsuConfig.SaveUsername), Bindable = config.GetWeldedBindable<bool>(OsuConfig.SaveUsername),
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Stay logged in", LabelText = "Stay logged in",
Bindable = config.GetBindable<bool>(OsuConfig.SavePassword), Bindable = config.GetWeldedBindable<bool>(OsuConfig.SavePassword),
}, },
new OsuButton new OsuButton
{ {

View File

@ -21,7 +21,7 @@ namespace osu.Game.Overlays.Options.Sections.General
new OptionEnumDropDown<ReleaseStream> new OptionEnumDropDown<ReleaseStream>
{ {
LabelText = "Release stream", LabelText = "Release stream",
Bindable = config.GetBindable<ReleaseStream>(OsuConfig.ReleaseStream), Bindable = config.GetWeldedBindable<ReleaseStream>(OsuConfig.ReleaseStream),
}, },
new OptionLabel { Text = "Your osu! is up to date" }, // TODO: map this to reality new OptionLabel { Text = "Your osu! is up to date" }, // TODO: map this to reality
new OsuButton new OsuButton

View File

@ -20,47 +20,47 @@ namespace osu.Game.Overlays.Options.Sections.Graphics
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Snaking in sliders", LabelText = "Snaking in sliders",
Bindable = config.GetBindable<bool>(OsuConfig.SnakingInSliders) Bindable = config.GetWeldedBindable<bool>(OsuConfig.SnakingInSliders)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Snaking out sliders", LabelText = "Snaking out sliders",
Bindable = config.GetBindable<bool>(OsuConfig.SnakingOutSliders) Bindable = config.GetWeldedBindable<bool>(OsuConfig.SnakingOutSliders)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Background video", LabelText = "Background video",
Bindable = config.GetBindable<bool>(OsuConfig.Video) Bindable = config.GetWeldedBindable<bool>(OsuConfig.Video)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Storyboards", LabelText = "Storyboards",
Bindable = config.GetBindable<bool>(OsuConfig.ShowStoryboard) Bindable = config.GetWeldedBindable<bool>(OsuConfig.ShowStoryboard)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Combo bursts", LabelText = "Combo bursts",
Bindable = config.GetBindable<bool>(OsuConfig.ComboBurst) Bindable = config.GetWeldedBindable<bool>(OsuConfig.ComboBurst)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Hit lighting", LabelText = "Hit lighting",
Bindable = config.GetBindable<bool>(OsuConfig.HitLighting) Bindable = config.GetWeldedBindable<bool>(OsuConfig.HitLighting)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Shaders", LabelText = "Shaders",
Bindable = config.GetBindable<bool>(OsuConfig.Bloom) Bindable = config.GetWeldedBindable<bool>(OsuConfig.Bloom)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Softening filter", LabelText = "Softening filter",
Bindable = config.GetBindable<bool>(OsuConfig.BloomSoftening) Bindable = config.GetWeldedBindable<bool>(OsuConfig.BloomSoftening)
}, },
new OptionEnumDropDown<ScreenshotFormat> new OptionEnumDropDown<ScreenshotFormat>
{ {
LabelText = "Screenshot", LabelText = "Screenshot",
Bindable = config.GetBindable<ScreenshotFormat>(OsuConfig.ScreenshotFormat) Bindable = config.GetWeldedBindable<ScreenshotFormat>(OsuConfig.ScreenshotFormat)
} }
}; };
} }

View File

@ -21,22 +21,22 @@ namespace osu.Game.Overlays.Options.Sections.Graphics
new OptionEnumDropDown<WindowMode> new OptionEnumDropDown<WindowMode>
{ {
LabelText = "Screen mode", LabelText = "Screen mode",
Bindable = config.GetBindable<WindowMode>(FrameworkConfig.WindowMode), Bindable = config.GetWeldedBindable<WindowMode>(FrameworkConfig.WindowMode),
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Letterboxing", LabelText = "Letterboxing",
Bindable = config.GetBindable<bool>(FrameworkConfig.Letterboxing), Bindable = config.GetWeldedBindable<bool>(FrameworkConfig.Letterboxing),
}, },
new OptionSlider<int> new OptionSlider<int>
{ {
LabelText = "Horizontal position", LabelText = "Horizontal position",
Bindable = (BindableInt)config.GetBindable<int>(FrameworkConfig.LetterboxPositionX) Bindable = (BindableInt)config.GetWeldedBindable<int>(FrameworkConfig.LetterboxPositionX)
}, },
new OptionSlider<int> new OptionSlider<int>
{ {
LabelText = "Vertical position", LabelText = "Vertical position",
Bindable = (BindableInt)config.GetBindable<int>(FrameworkConfig.LetterboxPositionY) Bindable = (BindableInt)config.GetWeldedBindable<int>(FrameworkConfig.LetterboxPositionY)
}, },
}; };
} }

View File

@ -19,27 +19,27 @@ namespace osu.Game.Overlays.Options.Sections.Graphics
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Snow", LabelText = "Snow",
Bindable = config.GetBindable<bool>(OsuConfig.MenuSnow) Bindable = config.GetWeldedBindable<bool>(OsuConfig.MenuSnow)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Parallax", LabelText = "Parallax",
Bindable = config.GetBindable<bool>(OsuConfig.MenuParallax) Bindable = config.GetWeldedBindable<bool>(OsuConfig.MenuParallax)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Menu tips", LabelText = "Menu tips",
Bindable = config.GetBindable<bool>(OsuConfig.ShowMenuTips) Bindable = config.GetWeldedBindable<bool>(OsuConfig.ShowMenuTips)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Interface voices", LabelText = "Interface voices",
Bindable = config.GetBindable<bool>(OsuConfig.MenuVoice) Bindable = config.GetWeldedBindable<bool>(OsuConfig.MenuVoice)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "osu! music theme", LabelText = "osu! music theme",
Bindable = config.GetBindable<bool>(OsuConfig.MenuMusic) Bindable = config.GetWeldedBindable<bool>(OsuConfig.MenuMusic)
}, },
}; };
} }

View File

@ -23,22 +23,22 @@ namespace osu.Game.Overlays.Options.Sections.Graphics
new OptionEnumDropDown<FrameSync> new OptionEnumDropDown<FrameSync>
{ {
LabelText = "Frame limiter", LabelText = "Frame limiter",
Bindable = config.GetBindable<FrameSync>(FrameworkConfig.FrameSync) Bindable = config.GetWeldedBindable<FrameSync>(FrameworkConfig.FrameSync)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Show FPS counter", LabelText = "Show FPS counter",
Bindable = osuConfig.GetBindable<bool>(OsuConfig.FpsCounter), Bindable = osuConfig.GetWeldedBindable<bool>(OsuConfig.FpsCounter),
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Reduce dropped frames", LabelText = "Reduce dropped frames",
Bindable = osuConfig.GetBindable<bool>(OsuConfig.ForceFrameFlush), Bindable = osuConfig.GetWeldedBindable<bool>(OsuConfig.ForceFrameFlush),
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Detect performance issues", LabelText = "Detect performance issues",
Bindable = osuConfig.GetBindable<bool>(OsuConfig.DetectPerformanceIssues), Bindable = osuConfig.GetWeldedBindable<bool>(OsuConfig.DetectPerformanceIssues),
}, },
}; };
} }

View File

@ -19,7 +19,7 @@ namespace osu.Game.Overlays.Options.Sections.Graphics
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Show thumbnails", LabelText = "Show thumbnails",
Bindable = config.GetBindable<bool>(OsuConfig.SongSelectThumbnails) Bindable = config.GetWeldedBindable<bool>(OsuConfig.SongSelectThumbnails)
} }
}; };
} }

View File

@ -21,37 +21,37 @@ namespace osu.Game.Overlays.Options.Sections.Input
new OptionSlider<double> new OptionSlider<double>
{ {
LabelText = "Sensitivity", LabelText = "Sensitivity",
Bindable = (BindableDouble)config.GetBindable<double>(OsuConfig.MouseSpeed), Bindable = (BindableDouble)config.GetWeldedBindable<double>(OsuConfig.MouseSpeed),
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Raw input", LabelText = "Raw input",
Bindable = config.GetBindable<bool>(OsuConfig.RawInput) Bindable = config.GetWeldedBindable<bool>(OsuConfig.RawInput)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Map absolute raw input to the osu! window", LabelText = "Map absolute raw input to the osu! window",
Bindable = config.GetBindable<bool>(OsuConfig.AbsoluteToOsuWindow) Bindable = config.GetWeldedBindable<bool>(OsuConfig.AbsoluteToOsuWindow)
}, },
new OptionEnumDropDown<ConfineMouseMode> new OptionEnumDropDown<ConfineMouseMode>
{ {
LabelText = "Confine mouse cursor", LabelText = "Confine mouse cursor",
Bindable = config.GetBindable<ConfineMouseMode>(OsuConfig.ConfineMouse), Bindable = config.GetWeldedBindable<ConfineMouseMode>(OsuConfig.ConfineMouse),
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Disable mouse wheel in play mode", LabelText = "Disable mouse wheel in play mode",
Bindable = config.GetBindable<bool>(OsuConfig.MouseDisableWheel) Bindable = config.GetWeldedBindable<bool>(OsuConfig.MouseDisableWheel)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Disable mouse buttons in play mode", LabelText = "Disable mouse buttons in play mode",
Bindable = config.GetBindable<bool>(OsuConfig.MouseDisableButtons) Bindable = config.GetWeldedBindable<bool>(OsuConfig.MouseDisableButtons)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Cursor ripples", LabelText = "Cursor ripples",
Bindable = config.GetBindable<bool>(OsuConfig.CursorRipple) Bindable = config.GetWeldedBindable<bool>(OsuConfig.CursorRipple)
}, },
}; };
} }

View File

@ -20,12 +20,12 @@ namespace osu.Game.Overlays.Options.Sections.Input
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "OS TabletPC support", LabelText = "OS TabletPC support",
Bindable = config.GetBindable<bool>(OsuConfig.Tablet) Bindable = config.GetWeldedBindable<bool>(OsuConfig.Tablet)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Wiimote/TaTaCon Drum Support", LabelText = "Wiimote/TaTaCon Drum Support",
Bindable = config.GetBindable<bool>(OsuConfig.Wiimote) Bindable = config.GetWeldedBindable<bool>(OsuConfig.Wiimote)
}, },
}; };
} }

View File

@ -20,32 +20,32 @@ namespace osu.Game.Overlays.Options.Sections.Online
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Filter offensive words", LabelText = "Filter offensive words",
Bindable = config.GetBindable<bool>(OsuConfig.ChatFilter) Bindable = config.GetWeldedBindable<bool>(OsuConfig.ChatFilter)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Filter foreign characters", LabelText = "Filter foreign characters",
Bindable = config.GetBindable<bool>(OsuConfig.ChatRemoveForeign) Bindable = config.GetWeldedBindable<bool>(OsuConfig.ChatRemoveForeign)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Log private messages", LabelText = "Log private messages",
Bindable = config.GetBindable<bool>(OsuConfig.LogPrivateMessages) Bindable = config.GetWeldedBindable<bool>(OsuConfig.LogPrivateMessages)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Block private messages from non-friends", LabelText = "Block private messages from non-friends",
Bindable = config.GetBindable<bool>(OsuConfig.BlockNonFriendPM) Bindable = config.GetWeldedBindable<bool>(OsuConfig.BlockNonFriendPM)
}, },
new OptionLabel { Text = "Chat ignore list (space-seperated list)" }, new OptionLabel { Text = "Chat ignore list (space-seperated list)" },
new OptionTextBox { new OptionTextBox {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Bindable = config.GetBindable<string>(OsuConfig.IgnoreList) Bindable = config.GetWeldedBindable<string>(OsuConfig.IgnoreList)
}, },
new OptionLabel { Text = "Chat highlight words (space-seperated list)" }, new OptionLabel { Text = "Chat highlight words (space-seperated list)" },
new OptionTextBox { new OptionTextBox {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Bindable = config.GetBindable<string>(OsuConfig.HighlightWords) Bindable = config.GetWeldedBindable<string>(OsuConfig.HighlightWords)
}, },
}; };
} }

View File

@ -20,22 +20,22 @@ namespace osu.Game.Overlays.Options.Sections.Online
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Integrate with Yahoo! status display", LabelText = "Integrate with Yahoo! status display",
Bindable = config.GetBindable<bool>(OsuConfig.YahooIntegration) Bindable = config.GetWeldedBindable<bool>(OsuConfig.YahooIntegration)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Integrate with MSN Live status display", LabelText = "Integrate with MSN Live status display",
Bindable = config.GetBindable<bool>(OsuConfig.MsnIntegration) Bindable = config.GetWeldedBindable<bool>(OsuConfig.MsnIntegration)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Automatically start osu!direct downloads", LabelText = "Automatically start osu!direct downloads",
Bindable = config.GetBindable<bool>(OsuConfig.AutomaticDownload) Bindable = config.GetWeldedBindable<bool>(OsuConfig.AutomaticDownload)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Prefer no-video downloads", LabelText = "Prefer no-video downloads",
Bindable = config.GetBindable<bool>(OsuConfig.AutomaticDownloadNoVideo) Bindable = config.GetWeldedBindable<bool>(OsuConfig.AutomaticDownloadNoVideo)
}, },
}; };
} }

View File

@ -20,32 +20,32 @@ namespace osu.Game.Overlays.Options.Sections.Online
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Enable chat ticker", LabelText = "Enable chat ticker",
Bindable = config.GetBindable<bool>(OsuConfig.Ticker) Bindable = config.GetWeldedBindable<bool>(OsuConfig.Ticker)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Show a notification popup when someone says your name", LabelText = "Show a notification popup when someone says your name",
Bindable = config.GetBindable<bool>(OsuConfig.ChatHighlightName) Bindable = config.GetWeldedBindable<bool>(OsuConfig.ChatHighlightName)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Show chat message notifications", LabelText = "Show chat message notifications",
Bindable = config.GetBindable<bool>(OsuConfig.ChatMessageNotification) Bindable = config.GetWeldedBindable<bool>(OsuConfig.ChatMessageNotification)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Play a sound when someone says your name", LabelText = "Play a sound when someone says your name",
Bindable = config.GetBindable<bool>(OsuConfig.ChatAudibleHighlight) Bindable = config.GetWeldedBindable<bool>(OsuConfig.ChatAudibleHighlight)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Show notification popups instantly during gameplay", LabelText = "Show notification popups instantly during gameplay",
Bindable = config.GetBindable<bool>(OsuConfig.PopupDuringGameplay) Bindable = config.GetWeldedBindable<bool>(OsuConfig.PopupDuringGameplay)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Show notification popups when friends change status", LabelText = "Show notification popups when friends change status",
Bindable = config.GetBindable<bool>(OsuConfig.NotifyFriends) Bindable = config.GetWeldedBindable<bool>(OsuConfig.NotifyFriends)
}, },
}; };
} }

View File

@ -20,12 +20,12 @@ namespace osu.Game.Overlays.Options.Sections.Online
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Share your city location with others", LabelText = "Share your city location with others",
Bindable = config.GetBindable<bool>(OsuConfig.DisplayCityLocation) Bindable = config.GetWeldedBindable<bool>(OsuConfig.DisplayCityLocation)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Allow multiplayer game invites from all users", LabelText = "Allow multiplayer game invites from all users",
Bindable = config.GetBindable<bool>(OsuConfig.AllowPublicInvites) Bindable = config.GetWeldedBindable<bool>(OsuConfig.AllowPublicInvites)
}, },
}; };
} }

View File

@ -42,32 +42,32 @@ namespace osu.Game.Overlays.Options.Sections
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Ignore all beatmap skins", LabelText = "Ignore all beatmap skins",
Bindable = config.GetBindable<bool>(OsuConfig.IgnoreBeatmapSkins) Bindable = config.GetWeldedBindable<bool>(OsuConfig.IgnoreBeatmapSkins)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Use skin's sound samples", LabelText = "Use skin's sound samples",
Bindable = config.GetBindable<bool>(OsuConfig.SkinSamples) Bindable = config.GetWeldedBindable<bool>(OsuConfig.SkinSamples)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Use Taiko skin for Taiko mode", LabelText = "Use Taiko skin for Taiko mode",
Bindable = config.GetBindable<bool>(OsuConfig.UseTaikoSkin) Bindable = config.GetWeldedBindable<bool>(OsuConfig.UseTaikoSkin)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Always use skin cursor", LabelText = "Always use skin cursor",
Bindable = config.GetBindable<bool>(OsuConfig.UseSkinCursor) Bindable = config.GetWeldedBindable<bool>(OsuConfig.UseSkinCursor)
}, },
new OptionSlider<double> new OptionSlider<double>
{ {
LabelText = "Cursor size", LabelText = "Cursor size",
Bindable = (BindableDouble)config.GetBindable<double>(OsuConfig.CursorSize) Bindable = (BindableDouble)config.GetWeldedBindable<double>(OsuConfig.CursorSize)
}, },
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Automatic cursor size", LabelText = "Automatic cursor size",
Bindable = config.GetBindable<bool>(OsuConfig.AutomaticCursorSizing) Bindable = config.GetWeldedBindable<bool>(OsuConfig.AutomaticCursorSizing)
}, },
}; };
} }

View File

@ -24,43 +24,20 @@ namespace osu.Game.Screens
protected new OsuGameBase Game => base.Game as OsuGameBase; protected new OsuGameBase Game => base.Game as OsuGameBase;
private bool boundToBeatmap; private readonly Bindable<WorkingBeatmap> beatmap = new Bindable<WorkingBeatmap>();
private Bindable<WorkingBeatmap> beatmap;
public WorkingBeatmap Beatmap public WorkingBeatmap Beatmap
{ {
get get
{ {
bindBeatmap();
return beatmap.Value; return beatmap.Value;
} }
set set
{ {
bindBeatmap();
beatmap.Value = value; beatmap.Value = value;
} }
} }
private void bindBeatmap()
{
if (beatmap == null)
beatmap = new Bindable<WorkingBeatmap>();
if (!boundToBeatmap)
{
beatmap.ValueChanged += beatmap_ValueChanged;
boundToBeatmap = true;
}
}
protected override void Dispose(bool isDisposing)
{
if (boundToBeatmap)
beatmap.ValueChanged -= beatmap_ValueChanged;
base.Dispose(isDisposing);
}
private void beatmap_ValueChanged(object sender, EventArgs e) private void beatmap_ValueChanged(object sender, EventArgs e)
{ {
OnBeatmapChanged(beatmap.Value); OnBeatmapChanged(beatmap.Value);
@ -69,19 +46,8 @@ namespace osu.Game.Screens
[BackgroundDependencyLoader(permitNulls: true)] [BackgroundDependencyLoader(permitNulls: true)]
private void load(OsuGameBase game) private void load(OsuGameBase game)
{ {
if (beatmap == null) beatmap.Weld(game?.Beatmap);
beatmap = game?.Beatmap; beatmap.ValueChanged += beatmap_ValueChanged;
}
public override bool Push(Screen screen)
{
OsuScreen nextOsu = screen as OsuScreen;
if (nextOsu != null)
{
nextOsu.beatmap = beatmap;
}
return base.Push(screen);
} }
protected virtual void OnBeatmapChanged(WorkingBeatmap beatmap) protected virtual void OnBeatmapChanged(WorkingBeatmap beatmap)

View File

@ -71,7 +71,7 @@ namespace osu.Game.Screens.Play
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuGameBase game, OsuConfigManager config) private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuGameBase game, OsuConfigManager config)
{ {
dimLevel = config.GetBindable<int>(OsuConfig.DimLevel); dimLevel = config.GetWeldedBindable<int>(OsuConfig.DimLevel);
try try
{ {
if (Beatmap == null) if (Beatmap == null)

View File

@ -25,7 +25,7 @@ namespace osu.Game.Screens.Play
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuConfigManager config) private void load(OsuConfigManager config)
{ {
mouseDisabled = config.GetBindable<bool>(OsuConfig.MouseDisableButtons) mouseDisabled = config.GetWeldedBindable<bool>(OsuConfig.MouseDisableButtons)
?? new Bindable<bool>(false); ?? new Bindable<bool>(false);
} }