Update to latest DI stuff

This commit is contained in:
Drew DeVault 2016-11-10 17:40:42 -05:00
parent 7327db307b
commit 0d4560a054
24 changed files with 481 additions and 436 deletions

2
.vscode/launch.json vendored
View File

@ -5,7 +5,7 @@
"name": "Launch", "name": "Launch",
"type": "mono", "type": "mono",
"request": "launch", "request": "launch",
"program": "${workspaceRoot}/osu.Desktop/bin/Debug/osu!.exe", "program": "${workspaceRoot}/osu.Desktop.VisualTests/bin/Debug/osu!.exe",
"args": [], "args": [],
"cwd": "${workspaceRoot}", "cwd": "${workspaceRoot}",
"preLaunchTask": "", "preLaunchTask": "",

3
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,3 @@
// Place your settings in this file to overwrite default and user settings.
{
}

@ -1 +1 @@
Subproject commit eb16219058e87210c9ad90b1e214ccc2c1556058 Subproject commit aa01720fe9eb6e3b30a4455298a1c6eca7fb7680

View File

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.GameModes.Testing; using osu.Framework.GameModes.Testing;
using osu.Game.Overlays; using osu.Game.Overlays;
@ -24,9 +25,9 @@ namespace osu.Desktop.Tests
protected MusicController mc; protected MusicController mc;
protected override void Load(BaseGame game) [Initializer]
private void Load()
{ {
base.Load(game);
ourClock = new FramedClock(); ourClock = new FramedClock();
} }

View File

@ -8,6 +8,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using osu.Framework; using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Configuration; using osu.Framework.Configuration;
using osu.Framework.GameModes; using osu.Framework.GameModes;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
@ -69,10 +70,10 @@ namespace osu.Game.GameModes
OnBeatmapChanged(beatmap.Value); OnBeatmapChanged(beatmap.Value);
} }
protected override void Load(BaseGame game) [Initializer(permitNulls: true)]
private void Load(OsuGameBase game)
{ {
base.Load(game); beatmap = game?.Beatmap;
beatmap = (game as OsuGameBase)?.Beatmap;
} }
public override bool Push(GameMode mode) public override bool Push(GameMode mode)

View File

@ -16,16 +16,7 @@ namespace osu.Game.Graphics.Containers
public ParallaxContainer() public ParallaxContainer()
{ {
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
} AddInternal(content = new Container
private Container content;
protected override Container<Drawable> Content => content;
[Initializer]
private void Load()
{
AddInternal(content = new Container()
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
@ -33,6 +24,10 @@ namespace osu.Game.Graphics.Containers
}); });
} }
private Container content;
protected override Container<Drawable> Content => content;
protected override bool OnMouseMove(InputState state) protected override bool OnMouseMove(InputState state)
{ {
content.Position = (state.Mouse.Position - DrawSize / 2) * ParallaxAmount; content.Position = (state.Mouse.Position - DrawSize / 2) * ParallaxAmount;

View File

@ -64,6 +64,8 @@ namespace osu.Game
if (args?.Length > 0) if (args?.Length > 0)
Schedule(delegate { Dependencies.Get<BeatmapDatabase>().Import(args); }); Schedule(delegate { Dependencies.Get<BeatmapDatabase>().Import(args); });
Dependencies.Cache(this);
//attach our bindables to the audio subsystem. //attach our bindables to the audio subsystem.
Audio.Volume.Weld(Config.GetBindable<double>(OsuConfig.VolumeUniversal)); Audio.Volume.Weld(Config.GetBindable<double>(OsuConfig.VolumeUniversal));
Audio.VolumeSample.Weld(Config.GetBindable<double>(OsuConfig.VolumeEffect)); Audio.VolumeSample.Weld(Config.GetBindable<double>(OsuConfig.VolumeEffect));
@ -93,7 +95,7 @@ namespace osu.Game
} }
}); });
(Options = new OptionsOverlay { Depth = float.MaxValue / 2 }).Preload(game, Add); (Options = new OptionsOverlay { Depth = float.MaxValue / 2 }).Preload(this, Add);
(intro = new Intro (intro = new Intro
{ {

View File

@ -67,14 +67,14 @@ namespace osu.Game
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-BlackItalic")); Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-BlackItalic"));
AddInternal(ratioContainer = new RatioAdjust()); AddInternal(ratioContainer = new RatioAdjust());
var options = new OptionsOverlay();
Children = new Drawable[] Children = new Drawable[]
{ {
Options = new OptionsOverlay(), options,
Cursor = new OsuCursorContainer { Depth = float.MaxValue } Cursor = new OsuCursorContainer { Depth = float.MaxValue }
}; };
Dependencies.Cache(options);
Dependencies.Cache(Options);
Beatmap.ValueChanged += Beatmap_ValueChanged; Beatmap.ValueChanged += Beatmap_ValueChanged;

View File

@ -7,6 +7,8 @@ using System.Threading.Tasks;
using OpenTK; using OpenTK;
using OpenTK.Graphics; using OpenTK.Graphics;
using osu.Framework; using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Track; using osu.Framework.Audio.Track;
using osu.Framework.Configuration; using osu.Framework.Configuration;
using osu.Framework.Graphics; using osu.Framework.Graphics;
@ -174,21 +176,16 @@ namespace osu.Game.Overlays
}; };
} }
protected override void Load(BaseGame game) [Initializer(permitNulls: true)]
private void Load(OsuGame osuGame, BeatmapDatabase beatmaps, AudioManager audio, TextureStore textures)
{ {
base.Load(game); if (database == null) database = beatmaps;
var osuGame = game as OsuGameBase; trackManager = audio.Track;
if (osuGame != null)
{
if (database == null) database = osuGame.Beatmaps;
trackManager = osuGame.Audio.Track;
}
beatmapSource = osuGame?.Beatmap ?? new Bindable<WorkingBeatmap>(); beatmapSource = osuGame?.Beatmap ?? new Bindable<WorkingBeatmap>();
playList = database.GetAllWithChildren<BeatmapSetInfo>(); playList = database.GetAllWithChildren<BeatmapSetInfo>();
backgroundSprite = getScaledSprite(fallbackTexture = game.Textures.Get(@"Backgrounds/bg4")); backgroundSprite = getScaledSprite(fallbackTexture = textures.Get(@"Backgrounds/bg4"));
AddInternal(backgroundSprite); AddInternal(backgroundSprite);
} }

View File

@ -1,36 +1,36 @@
using osu.Framework; using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration; using osu.Game.Configuration;
namespace osu.Game.Overlays.Options.Audio namespace osu.Game.Overlays.Options.Audio
{ {
public class VolumeOptions : OptionsSubsection public class VolumeOptions : OptionsSubsection
{ {
protected override string Header => "Volume"; protected override string Header => "Volume";
private CheckBoxOption ignoreHitsounds; private CheckBoxOption ignoreHitsounds;
public VolumeOptions() public VolumeOptions()
{ {
Children = new Drawable[]
{
new SpriteText { Text = "Master: TODO slider" },
new SpriteText { Text = "Music: TODO slider" },
new SpriteText { Text = "Effect: TODO slider" },
ignoreHitsounds = new CheckBoxOption { LabelText = "Ignore beatmap hitsounds" }
};
} }
protected override void Load(BaseGame game) [Initializer]
private void Load(OsuConfigManager config)
{ {
base.Load(game); Children = new Drawable[]
var osuGame = game as OsuGameBase;
if (osuGame != null)
{ {
ignoreHitsounds.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.IgnoreBeatmapSamples); new SpriteText { Text = "Master: TODO slider" },
} new SpriteText { Text = "Music: TODO slider" },
} new SpriteText { Text = "Effect: TODO slider" },
} new CheckBoxOption
{
LabelText = "Ignore beatmap hitsounds",
Bindable = config.GetBindable<bool>(OsuConfig.IgnoreBeatmapSamples)
}
};
}
}
} }

View File

@ -1,47 +1,56 @@
using OpenTK; using OpenTK;
using osu.Framework; using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Graphics; using osu.Game.Graphics;
namespace osu.Game.Overlays.Options namespace osu.Game.Overlays.Options
{ {
public class EditorSection : OptionsSection public class EditorSection : OptionsSection
{ {
protected override string Header => "Editor"; protected override string Header => "Editor";
public override FontAwesome Icon => FontAwesome.fa_pencil; public override FontAwesome Icon => FontAwesome.fa_pencil;
private CheckBoxOption backgroundVideo, defaultSkin, snakingSliders, hitAnimations, followPoints, stacking; [Initializer]
private void Load(OsuConfigManager config)
public EditorSection()
{
content.Spacing = new Vector2(0, 5);
Children = new Drawable[]
{
backgroundVideo = new CheckBoxOption { LabelText = "Background video" },
defaultSkin = new CheckBoxOption { LabelText = "Always use default skin" },
snakingSliders = new CheckBoxOption { LabelText = "Snaking sliders" },
hitAnimations = new CheckBoxOption { LabelText = "Hit animations" },
followPoints = new CheckBoxOption { LabelText = "Follow points" },
stacking = new CheckBoxOption { LabelText = "Stacking" },
};
}
protected override void Load(BaseGame game)
{ {
base.Load(game); content.Spacing = new Vector2(0, 5);
var osuGame = game as OsuGameBase; Children = new Drawable[]
if (osuGame != null)
{ {
backgroundVideo.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.VideoEditor); new CheckBoxOption
defaultSkin.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.EditorDefaultSkin); {
snakingSliders.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.EditorSnakingSliders); LabelText = "Background video",
hitAnimations.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.EditorHitAnimations); Bindable = config.GetBindable<bool>(OsuConfig.VideoEditor)
followPoints.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.EditorFollowPoints); },
stacking.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.EditorStacking); new CheckBoxOption
} {
} LabelText = "Always use default skin",
} Bindable = config.GetBindable<bool>(OsuConfig.EditorDefaultSkin)
} },
new CheckBoxOption
{
LabelText = "Snaking sliders",
Bindable = config.GetBindable<bool>(OsuConfig.EditorSnakingSliders)
},
new CheckBoxOption
{
LabelText = "Hit animations",
Bindable = config.GetBindable<bool>(OsuConfig.EditorHitAnimations)
},
new CheckBoxOption
{
LabelText = "Follow points",
Bindable = config.GetBindable<bool>(OsuConfig.EditorFollowPoints)
},
new CheckBoxOption
{
LabelText = "Stacking",
Bindable = config.GetBindable<bool>(OsuConfig.EditorStacking)
},
};
}
}
}

View File

@ -1,18 +1,18 @@
using osu.Framework; using osu.Framework;
using osu.Framework.Graphics; using osu.Framework.Allocation;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.Sprites;
using osu.Game.Configuration; using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration;
namespace osu.Game.Overlays.Options.Gameplay namespace osu.Game.Overlays.Options.Gameplay
{ {
public class GeneralGameplayOptions : OptionsSubsection public class GeneralGameplayOptions : OptionsSubsection
{ {
protected override string Header => "General"; protected override string Header => "General";
private CheckBoxOption keyOverlay, hiddenApproachCircle, scaleManiaScroll, rememberManiaScroll;
public GeneralGameplayOptions() [Initializer]
private void Load(OsuConfigManager config)
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
@ -20,24 +20,27 @@ namespace osu.Game.Overlays.Options.Gameplay
new SpriteText { Text = "Progress display: TODO dropdown" }, new SpriteText { Text = "Progress display: TODO dropdown" },
new SpriteText { Text = "Score meter type: TODO dropdown" }, new SpriteText { Text = "Score meter type: TODO dropdown" },
new SpriteText { Text = "Score meter size: TODO slider" }, new SpriteText { Text = "Score meter size: TODO slider" },
keyOverlay = new CheckBoxOption { LabelText = "Always show key overlay" }, new CheckBoxOption
hiddenApproachCircle = new CheckBoxOption { LabelText = "Show approach circle on first \"Hidden\" object" }, {
scaleManiaScroll = new CheckBoxOption { LabelText = "Scale osu!mania scroll speed with BPM" }, LabelText = "Always show key overlay",
rememberManiaScroll = new CheckBoxOption { LabelText = "Remember osu!mania scroll speed per beatmap" }, Bindable = config.GetBindable<bool>(OsuConfig.KeyOverlay)
},
new CheckBoxOption
{
LabelText = "Show approach circle on first \"Hidden\" object",
Bindable = config.GetBindable<bool>(OsuConfig.HiddenShowFirstApproach)
},
new CheckBoxOption
{
LabelText = "Scale osu!mania scroll speed with BPM",
Bindable = config.GetBindable<bool>(OsuConfig.ManiaSpeedBPMScale)
},
new CheckBoxOption
{
LabelText = "Remember osu!mania scroll speed per beatmap",
Bindable = config.GetBindable<bool>(OsuConfig.UsePerBeatmapManiaSpeed)
},
}; };
}
protected override void Load(BaseGame game)
{
base.Load(game);
var osuGame = game as OsuGameBase;
if (osuGame != null)
{
keyOverlay.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.KeyOverlay);
hiddenApproachCircle.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.HiddenShowFirstApproach);
scaleManiaScroll.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.ManiaSpeedBPMScale);
rememberManiaScroll.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.UsePerBeatmapManiaSpeed);
}
} }
} }
} }

View File

@ -1,47 +1,58 @@
using osu.Framework; using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration; using osu.Game.Configuration;
namespace osu.Game.Overlays.Options.Graphics namespace osu.Game.Overlays.Options.Graphics
{ {
public class DetailOptions : OptionsSubsection public class DetailOptions : OptionsSubsection
{ {
protected override string Header => "Detail Settings"; protected override string Header => "Detail Settings";
private CheckBoxOption snakingSliders, backgroundVideo, storyboards, comboBursts, [Initializer]
hitLighting, shaders, softeningFilter; private void Load(OsuConfigManager config)
public DetailOptions()
{
Children = new Drawable[]
{
snakingSliders = new CheckBoxOption { LabelText = "Snaking sliders" },
backgroundVideo = new CheckBoxOption { LabelText = "Background video" },
storyboards = new CheckBoxOption { LabelText = "Storyboards" },
comboBursts = new CheckBoxOption { LabelText = "Combo bursts" },
hitLighting = new CheckBoxOption { LabelText = "Hit lighting" },
shaders = new CheckBoxOption { LabelText = "Shaders" },
softeningFilter = new CheckBoxOption { LabelText = "Softening filter" },
new SpriteText { Text = "Screenshot format TODO: dropdown" }
};
}
protected override void Load(BaseGame game)
{ {
base.Load(game); Children = new Drawable[]
var osuGame = game as OsuGameBase;
if (osuGame != null)
{ {
snakingSliders.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.SnakingSliders); new CheckBoxOption
backgroundVideo.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.Video); {
storyboards.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.ShowStoryboard); LabelText = "Snaking sliders",
comboBursts.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.ComboBurst); Bindable = config.GetBindable<bool>(OsuConfig.SnakingSliders)
hitLighting.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.HitLighting); },
shaders.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.Bloom); new CheckBoxOption
softeningFilter.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.BloomSoftening); {
} LabelText = "Background video",
} Bindable = config.GetBindable<bool>(OsuConfig.Video)
} },
new CheckBoxOption
{
LabelText = "Storyboards",
Bindable = config.GetBindable<bool>(OsuConfig.ShowStoryboard)
},
new CheckBoxOption
{
LabelText = "Combo bursts",
Bindable = config.GetBindable<bool>(OsuConfig.ComboBurst)
},
new CheckBoxOption
{
LabelText = "Hit lighting",
Bindable = config.GetBindable<bool>(OsuConfig.HitLighting)
},
new CheckBoxOption
{
LabelText = "Shaders",
Bindable = config.GetBindable<bool>(OsuConfig.Bloom)
},
new CheckBoxOption
{
LabelText = "Softening filter",
Bindable = config.GetBindable<bool>(OsuConfig.BloomSoftening)
},
new SpriteText { Text = "Screenshot format TODO: dropdown" }
};
}
}
} }

View File

@ -1,4 +1,5 @@
using osu.Framework; using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
@ -10,31 +11,27 @@ namespace osu.Game.Overlays.Options.Graphics
{ {
protected override string Header => "Layout"; protected override string Header => "Layout";
private CheckBoxOption fullscreen, letterboxing; [Initializer]
private void Load(OsuConfigManager config)
public LayoutOptions()
{
Children = new Drawable[]
{
new SpriteText { Text = "Resolution: TODO dropdown" },
fullscreen = new CheckBoxOption { LabelText = "Fullscreen mode" },
letterboxing = new CheckBoxOption { LabelText = "Letterboxing" },
new SpriteText { Text = "Horizontal position" },
new SpriteText { Text = "TODO: slider" },
new SpriteText { Text = "Vertical position" },
new SpriteText { Text = "TODO: slider" },
};
}
protected override void Load(BaseGame game)
{ {
base.Load(game); Children = new Drawable[]
var osuGame = game as OsuGameBase;
if (osuGame != null)
{ {
fullscreen.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.Fullscreen); new SpriteText { Text = "Resolution: TODO dropdown" },
letterboxing.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.Letterboxing); new CheckBoxOption
} {
LabelText = "Fullscreen mode",
Bindable = config.GetBindable<bool>(OsuConfig.Fullscreen),
},
new CheckBoxOption
{
LabelText = "Letterboxing",
Bindable = config.GetBindable<bool>(OsuConfig.Letterboxing),
},
new SpriteText { Text = "Horizontal position" },
new SpriteText { Text = "TODO: slider" },
new SpriteText { Text = "Vertical position" },
new SpriteText { Text = "TODO: slider" },
};
} }
} }
} }

View File

@ -1,39 +1,45 @@
using osu.Framework; using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration; using osu.Game.Configuration;
namespace osu.Game.Overlays.Options.Graphics namespace osu.Game.Overlays.Options.Graphics
{ {
public class MainMenuOptions : OptionsSubsection public class MainMenuOptions : OptionsSubsection
{ {
protected override string Header => "Main Menu"; protected override string Header => "Main Menu";
private CheckBoxOption snow, parallax, tips, voices, musicTheme; [Initializer]
private void Load(OsuConfigManager config)
public MainMenuOptions()
{
Children = new[]
{
snow = new CheckBoxOption { LabelText = "Snow" },
parallax = new CheckBoxOption { LabelText = "Parallax" },
tips = new CheckBoxOption { LabelText = "Menu tips" },
voices = new CheckBoxOption { LabelText = "Interface voices" },
musicTheme = new CheckBoxOption { LabelText = "osu! music theme" },
};
}
protected override void Load(BaseGame game)
{ {
base.Load(game); Children = new[]
var osuGame = game as OsuGameBase;
if (osuGame != null)
{ {
snow.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.MenuSnow); new CheckBoxOption
parallax.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.MenuParallax); {
tips.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.ShowMenuTips); LabelText = "Snow",
voices.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.MenuVoice); Bindable = config.GetBindable<bool>(OsuConfig.MenuSnow)
musicTheme.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.MenuMusic); },
} new CheckBoxOption
} {
} LabelText = "Parallax",
Bindable = config.GetBindable<bool>(OsuConfig.MenuParallax)
},
new CheckBoxOption
{
LabelText = "Menu tips",
Bindable = config.GetBindable<bool>(OsuConfig.ShowMenuTips)
},
new CheckBoxOption
{
LabelText = "Interface voices",
Bindable = config.GetBindable<bool>(OsuConfig.MenuVoice)
},
new CheckBoxOption
{
LabelText = "osu! music theme",
Bindable = config.GetBindable<bool>(OsuConfig.MenuMusic)
},
};
}
}
} }

View File

@ -1,4 +1,5 @@
using osu.Framework; using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
@ -10,30 +11,29 @@ namespace osu.Game.Overlays.Options.Graphics
{ {
protected override string Header => "Renderer"; protected override string Header => "Renderer";
private CheckBoxOption fpsCounter, reduceDroppedFrames, detectPerformanceIssues; [Initializer]
private void Load(OsuConfigManager config)
public RendererOptions()
{
// NOTE: Compatability mode omitted
Children = new Drawable[]
{
new SpriteText { Text = "Frame limiter: TODO dropdown" },
fpsCounter = new CheckBoxOption { LabelText = "Show FPS counter" },
reduceDroppedFrames = new CheckBoxOption { LabelText = "Reduce dropped frames" },
detectPerformanceIssues = new CheckBoxOption { LabelText = "Detect performance issues" },
};
}
protected override void Load(BaseGame game)
{ {
base.Load(game); // NOTE: Compatability mode omitted
var osuGame = game as OsuGameBase; Children = new Drawable[]
if (osuGame != null)
{ {
fpsCounter.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.FpsCounter); new SpriteText { Text = "Frame limiter: TODO dropdown" },
reduceDroppedFrames.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.ForceFrameFlush); new CheckBoxOption
detectPerformanceIssues.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.DetectPerformanceIssues); {
} LabelText = "Show FPS counter",
Bindable = config.GetBindable<bool>(OsuConfig.FpsCounter),
},
new CheckBoxOption
{
LabelText = "Reduce dropped frames",
Bindable = config.GetBindable<bool>(OsuConfig.ForceFrameFlush),
},
new CheckBoxOption
{
LabelText = "Detect performance issues",
Bindable = config.GetBindable<bool>(OsuConfig.DetectPerformanceIssues),
},
};
} }
} }
} }

View File

@ -1,31 +1,25 @@
using osu.Framework; using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration; using osu.Game.Configuration;
namespace osu.Game.Overlays.Options.Graphics namespace osu.Game.Overlays.Options.Graphics
{ {
public class SongSelectGraphicsOptions : OptionsSubsection public class SongSelectGraphicsOptions : OptionsSubsection
{ {
protected override string Header => "Song Select"; protected override string Header => "Song Select";
private CheckBoxOption showThumbs;
public SongSelectGraphicsOptions()
{
Children = new[]
{
showThumbs = new CheckBoxOption { LabelText = "Show thumbnails" }
};
}
protected override void Load(BaseGame game) [Initializer]
private void Load(OsuConfigManager config)
{ {
base.Load(game); Children = new[]
var osuGame = game as OsuGameBase;
if (osuGame != null)
{ {
showThumbs.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.SongSelectThumbnails); new CheckBoxOption
} {
} LabelText = "Show thumbnails",
} Bindable = config.GetBindable<bool>(OsuConfig.SongSelectThumbnails)
}
};
}
}
} }

View File

@ -1,43 +1,55 @@
using osu.Framework; using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration; using osu.Game.Configuration;
namespace osu.Game.Overlays.Options.Input namespace osu.Game.Overlays.Options.Input
{ {
public class MouseOptions : OptionsSubsection public class MouseOptions : OptionsSubsection
{ {
protected override string Header => "Mouse"; protected override string Header => "Mouse";
private CheckBoxOption rawInput, mapRawInput, disableWheel, disableButtons, enableRipples; private CheckBoxOption rawInput, mapRawInput, disableWheel, disableButtons, enableRipples;
public MouseOptions() public MouseOptions()
{ {
Children = new Drawable[]
{
new SpriteText { Text = "Sensitivity: TODO slider" },
rawInput = new CheckBoxOption { LabelText = "Raw input" },
mapRawInput = new CheckBoxOption { LabelText = "Map absolute raw input to the osu! window" },
new SpriteText { Text = "Confine mouse cursor: TODO dropdown" },
disableWheel = new CheckBoxOption { LabelText = "Disable mouse wheel in play mode" },
disableButtons = new CheckBoxOption { LabelText = "Disable mouse buttons in play mode" },
enableRipples = new CheckBoxOption { LabelText = "Cursor ripples" },
};
} }
protected override void Load(BaseGame game) [Initializer]
private void Load(OsuConfigManager config)
{ {
base.Load(game); Children = new Drawable[]
var osuGame = game as OsuGameBase;
if (osuGame != null)
{ {
rawInput.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.RawInput); new SpriteText { Text = "Sensitivity: TODO slider" },
mapRawInput.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.AbsoluteToOsuWindow); new CheckBoxOption
disableWheel.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.MouseDisableWheel); {
disableButtons.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.MouseDisableButtons); LabelText = "Raw input",
enableRipples.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.CursorRipple); Bindable = config.GetBindable<bool>(OsuConfig.RawInput)
} },
} new CheckBoxOption
} {
LabelText = "Map absolute raw input to the osu! window",
Bindable = config.GetBindable<bool>(OsuConfig.AbsoluteToOsuWindow)
},
new SpriteText { Text = "Confine mouse cursor: TODO dropdown" },
new CheckBoxOption
{
LabelText = "Disable mouse wheel in play mode",
Bindable = config.GetBindable<bool>(OsuConfig.MouseDisableWheel)
},
new CheckBoxOption
{
LabelText = "Disable mouse buttons in play mode",
Bindable = config.GetBindable<bool>(OsuConfig.MouseDisableButtons)
},
new CheckBoxOption
{
LabelText = "Cursor ripples",
Bindable = config.GetBindable<bool>(OsuConfig.CursorRipple)
},
};
}
}
} }

View File

@ -1,35 +1,32 @@
using osu.Framework; using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration; using osu.Game.Configuration;
namespace osu.Game.Overlays.Options.Input namespace osu.Game.Overlays.Options.Input
{ {
public class OtherInputOptions : OptionsSubsection public class OtherInputOptions : OptionsSubsection
{ {
protected override string Header => "Other"; protected override string Header => "Other";
private CheckBoxOption tabletSupport, wiimoteSupport; [Initializer]
private void Load(OsuConfigManager config)
public OtherInputOptions()
{
Children = new Drawable[]
{
tabletSupport = new CheckBoxOption { LabelText = "OS TabletPC support" },
wiimoteSupport = new CheckBoxOption { LabelText = "Wiimote/TaTaCon Drum Support" },
};
}
protected override void Load(BaseGame game)
{ {
base.Load(game); Children = new Drawable[]
var osuGame = game as OsuGameBase;
if (osuGame != null)
{ {
tabletSupport.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.Tablet); new CheckBoxOption
wiimoteSupport.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.Wiimote); {
} LabelText = "OS TabletPC support",
} Bindable = config.GetBindable<bool>(OsuConfig.Tablet)
} },
} new CheckBoxOption
{
LabelText = "Wiimote/TaTaCon Drum Support",
Bindable = config.GetBindable<bool>(OsuConfig.Wiimote)
},
};
}
}
}

View File

@ -1,43 +1,46 @@
using osu.Framework; using osu.Framework;
using osu.Framework.Graphics; using osu.Framework.Allocation;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.Sprites;
using osu.Game.Configuration; using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration;
namespace osu.Game.Overlays.Options.Online namespace osu.Game.Overlays.Options.Online
{ {
public class InGameChatOptions : OptionsSubsection public class InGameChatOptions : OptionsSubsection
{ {
protected override string Header => "In-game Chat"; protected override string Header => "In-game Chat";
private CheckBoxOption filterWords, filterForeign, logPMs, blockPMs;
public InGameChatOptions() [Initializer]
private void Load(OsuConfigManager config)
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
filterWords = new CheckBoxOption { LabelText = "Filter offensive words" }, new CheckBoxOption
filterForeign = new CheckBoxOption { LabelText = "Filter foreign characters" }, {
logPMs = new CheckBoxOption { LabelText = "Log private messages" }, LabelText = "Filter offensive words",
blockPMs = new CheckBoxOption { LabelText = "Block private messages from non-friends" }, Bindable = config.GetBindable<bool>(OsuConfig.ChatFilter)
},
new CheckBoxOption
{
LabelText = "Filter foreign characters",
Bindable = config.GetBindable<bool>(OsuConfig.ChatRemoveForeign)
},
new CheckBoxOption
{
LabelText = "Log private messages",
Bindable = config.GetBindable<bool>(OsuConfig.LogPrivateMessages)
},
new CheckBoxOption
{
LabelText = "Block private messages from non-friends",
Bindable = config.GetBindable<bool>(OsuConfig.BlockNonFriendPM)
},
new SpriteText { Text = "Chat ignore list (space-seperated list)" }, new SpriteText { Text = "Chat ignore list (space-seperated list)" },
new TextBox { Height = 20, RelativeSizeAxes = Axes.X }, new TextBox { Height = 20, RelativeSizeAxes = Axes.X },
new SpriteText { Text = "Chat highlight words (space-seperated list)" }, new SpriteText { Text = "Chat highlight words (space-seperated list)" },
new TextBox { Height = 20, RelativeSizeAxes = Axes.X }, new TextBox { Height = 20, RelativeSizeAxes = Axes.X },
}; };
}
protected override void Load(BaseGame game)
{
base.Load(game);
var osuGame = game as OsuGameBase;
if (osuGame != null)
{
filterWords.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.ChatFilter);
filterForeign.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.ChatRemoveForeign);
logPMs.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.LogPrivateMessages);
blockPMs.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.BlockNonFriendPM);
}
} }
} }
} }

View File

@ -1,4 +1,5 @@
using osu.Framework; using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration; using osu.Game.Configuration;
@ -9,35 +10,42 @@ namespace osu.Game.Overlays.Options.Online
{ {
protected override string Header => "Notifications"; protected override string Header => "Notifications";
private CheckBoxOption chatTicker, notifyMention, notifyChat, audibleNotification, [Initializer]
notificationsDuringGameplay, notifyFriendStatus; private void Load(OsuConfigManager config)
public NotificationsOptions()
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
chatTicker = new CheckBoxOption { LabelText = "Enable chat ticker" }, new CheckBoxOption
notifyMention = new CheckBoxOption { LabelText = "Show a notification popup when someone says your name" }, {
notifyChat = new CheckBoxOption { LabelText = "Show chat message notifications" }, LabelText = "Enable chat ticker",
audibleNotification = new CheckBoxOption { LabelText = "Play a sound when someone says your name" }, Bindable = config.GetBindable<bool>(OsuConfig.Ticker)
notificationsDuringGameplay = new CheckBoxOption { LabelText = "Show notification popups instantly during gameplay" }, },
notifyFriendStatus = new CheckBoxOption { LabelText = "Show notification popups when friends change status" }, new CheckBoxOption
{
LabelText = "Show a notification popup when someone says your name",
Bindable = config.GetBindable<bool>(OsuConfig.ChatHighlightName)
},
new CheckBoxOption
{
LabelText = "Show chat message notifications",
Bindable = config.GetBindable<bool>(OsuConfig.ChatMessageNotification)
},
new CheckBoxOption
{
LabelText = "Play a sound when someone says your name",
Bindable = config.GetBindable<bool>(OsuConfig.ChatAudibleHighlight)
},
new CheckBoxOption
{
LabelText = "Show notification popups instantly during gameplay",
Bindable = config.GetBindable<bool>(OsuConfig.PopupDuringGameplay)
},
new CheckBoxOption
{
LabelText = "Show notification popups when friends change status",
Bindable = config.GetBindable<bool>(OsuConfig.NotifyFriends)
},
}; };
} }
protected override void Load(BaseGame game)
{
base.Load(game);
var osuGame = game as OsuGameBase;
if (osuGame != null)
{
chatTicker.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.Ticker);
notifyMention.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.ChatHighlightName);
notifyChat.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.ChatMessageNotification);
audibleNotification.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.ChatAudibleHighlight);
notificationsDuringGameplay.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.PopupDuringGameplay);
notifyFriendStatus.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.NotifyFriends);
}
}
} }
} }

View File

@ -1,38 +1,41 @@
using osu.Framework; using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration; using osu.Game.Configuration;
namespace osu.Game.Overlays.Options.Online namespace osu.Game.Overlays.Options.Online
{ {
public class OnlineIntegrationOptions : OptionsSubsection public class OnlineIntegrationOptions : OptionsSubsection
{ {
protected override string Header => "Integration"; protected override string Header => "Integration";
private CheckBoxOption yahoo, msn, autoDirect, noVideo; [Initializer]
private void Load(OsuConfigManager config)
public OnlineIntegrationOptions()
{
Children = new Drawable[]
{
yahoo = new CheckBoxOption { LabelText = "Integrate with Yahoo! status display" },
msn = new CheckBoxOption { LabelText = "Integrate with MSN Live status display" },
autoDirect = new CheckBoxOption { LabelText = "Automatically start osu!direct downloads" },
noVideo = new CheckBoxOption { LabelText = "Prefer no-video downloads" },
};
}
protected override void Load(BaseGame game)
{ {
base.Load(game); Children = new Drawable[]
var osuGame = game as OsuGameBase;
if (osuGame != null)
{ {
yahoo.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.YahooIntegration); new CheckBoxOption
msn.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.MsnIntegration); {
autoDirect.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.AutomaticDownload); LabelText = "Integrate with Yahoo! status display",
noVideo.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.AutomaticDownloadNoVideo); Bindable = config.GetBindable<bool>(OsuConfig.YahooIntegration)
} },
} new CheckBoxOption
} {
LabelText = "Integrate with MSN Live status display",
Bindable = config.GetBindable<bool>(OsuConfig.MsnIntegration)
},
new CheckBoxOption
{
LabelText = "Automatically start osu!direct downloads",
Bindable = config.GetBindable<bool>(OsuConfig.AutomaticDownload)
},
new CheckBoxOption
{
LabelText = "Prefer no-video downloads",
Bindable = config.GetBindable<bool>(OsuConfig.AutomaticDownloadNoVideo)
},
};
}
}
} }

View File

@ -1,4 +1,5 @@
using osu.Framework; using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration; using osu.Game.Configuration;
@ -8,27 +9,23 @@ namespace osu.Game.Overlays.Options.Online
public class PrivacyOptions : OptionsSubsection public class PrivacyOptions : OptionsSubsection
{ {
protected override string Header => "Privacy"; protected override string Header => "Privacy";
private CheckBoxOption shareCity, allowInvites;
public PrivacyOptions() [Initializer]
private void Load(OsuConfigManager config)
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
shareCity = new CheckBoxOption { LabelText = "Share your city location with others" }, new CheckBoxOption
allowInvites = new CheckBoxOption { LabelText = "Allow multiplayer game invites from all users" }, {
LabelText = "Share your city location with others",
Bindable = config.GetBindable<bool>(OsuConfig.DisplayCityLocation)
},
new CheckBoxOption
{
LabelText = "Allow multiplayer game invites from all users",
Bindable = config.GetBindable<bool>(OsuConfig.AllowPublicInvites)
},
}; };
} }
protected override void Load(BaseGame game)
{
base.Load(game);
var osuGame = game as OsuGameBase;
if (osuGame != null)
{
shareCity.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.DisplayCityLocation);
allowInvites.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.AllowPublicInvites);
}
}
} }
} }

View File

@ -1,22 +1,22 @@
using OpenTK; using OpenTK;
using osu.Framework; using osu.Framework;
using osu.Framework.Graphics; using osu.Framework.Allocation;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.Sprites;
using osu.Game.Configuration; using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics; using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options namespace osu.Game.Overlays.Options
{ {
public class SkinSection : OptionsSection public class SkinSection : OptionsSection
{ {
protected override string Header => "Skin"; protected override string Header => "Skin";
public override FontAwesome Icon => FontAwesome.fa_paint_brush; public override FontAwesome Icon => FontAwesome.fa_paint_brush;
private CheckBoxOption ignoreSkins, useSkinSoundSamples, useTaikoSkin, useSkinCursor, autoCursorSize; [Initializer]
private void Load(OsuConfigManager config)
public SkinSection()
{ {
content.Spacing = new Vector2(0, 5); content.Spacing = new Vector2(0, 5);
Children = new Drawable[] Children = new Drawable[]
@ -38,27 +38,33 @@ namespace osu.Game.Overlays.Options
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Text = "Export as .osk", Text = "Export as .osk",
}, },
ignoreSkins = new CheckBoxOption { LabelText = "Ignore all beatmap skins" }, new CheckBoxOption
useSkinSoundSamples = new CheckBoxOption { LabelText = "Use skin's sound samples" }, {
useTaikoSkin = new CheckBoxOption { LabelText = "Use Taiko skin for Taiko mode" }, LabelText = "Ignore all beatmap skins",
useSkinCursor = new CheckBoxOption { LabelText = "Always use skin cursor" }, Bindable = config.GetBindable<bool>(OsuConfig.IgnoreBeatmapSkins)
},
new CheckBoxOption
{
LabelText = "Use skin's sound samples",
Bindable = config.GetBindable<bool>(OsuConfig.SkinSamples)
},
new CheckBoxOption
{
LabelText = "Use Taiko skin for Taiko mode",
Bindable = config.GetBindable<bool>(OsuConfig.UseTaikoSkin)
},
new CheckBoxOption
{
LabelText = "Always use skin cursor",
Bindable = config.GetBindable<bool>(OsuConfig.UseSkinCursor)
},
new SpriteText { Text = "Cursor size: TODO slider" }, new SpriteText { Text = "Cursor size: TODO slider" },
autoCursorSize = new CheckBoxOption { LabelText = "Automatic cursor size" }, new CheckBoxOption
{
LabelText = "Automatic cursor size",
Bindable = config.GetBindable<bool>(OsuConfig.AutomaticCursorSizing)
},
}; };
}
protected override void Load(BaseGame game)
{
base.Load(game);
var osuGame = game as OsuGameBase;
if (osuGame != null)
{
ignoreSkins.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.IgnoreBeatmapSkins);
useSkinSoundSamples.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.SkinSamples);
useTaikoSkin.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.UseTaikoSkin);
useSkinCursor.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.UseSkinCursor);
autoCursorSize.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.AutomaticCursorSizing);
}
} }
} }
} }