1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 15:03:13 +08:00

Fix incorrect line endings.

This commit is contained in:
Dean Herbert 2017-02-07 13:52:19 +09:00
parent db8e44c715
commit 756fd78a88
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49
30 changed files with 1067 additions and 1067 deletions

View File

@ -1,29 +1,29 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework;
using osu.Framework.Desktop.Platform;
using SQLite.Net;
using SQLite.Net.Interop;
using SQLite.Net.Platform.Generic;
using SQLite.Net.Platform.Win32;
namespace osu.Desktop.VisualTests.Platform
{
public class TestStorage : DesktopStorage
{
public TestStorage(string baseName) : base(baseName)
{
}
public override SQLiteConnection GetDatabase(string name)
{
ISQLitePlatform platform;
if (RuntimeInfo.IsWindows)
platform = new SQLitePlatformWin32();
else
platform = new SQLitePlatformGeneric();
return new SQLiteConnection(platform, $@":memory:");
}
}
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework;
using osu.Framework.Desktop.Platform;
using SQLite.Net;
using SQLite.Net.Interop;
using SQLite.Net.Platform.Generic;
using SQLite.Net.Platform.Win32;
namespace osu.Desktop.VisualTests.Platform
{
public class TestStorage : DesktopStorage
{
public TestStorage(string baseName) : base(baseName)
{
}
public override SQLiteConnection GetDatabase(string name)
{
ISQLitePlatform platform;
if (RuntimeInfo.IsWindows)
platform = new SQLitePlatformWin32();
else
platform = new SQLitePlatformGeneric();
return new SQLiteConnection(platform, $@":memory:");
}
}
}

View File

@ -1,44 +1,44 @@
using System;
using OpenTK.Graphics;
using osu.Framework.Logging;
using osu.Framework.Graphics;
using osu.Game.Overlays.Pause;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Colour;
using System;
using OpenTK.Graphics;
using osu.Framework.Logging;
using osu.Framework.Graphics;
using osu.Game.Overlays.Pause;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Colour;
using osu.Framework.GameModes.Testing;
using osu.Framework.Graphics.UserInterface;
namespace osu.Desktop.VisualTests.Tests
{
class TestCasePauseOverlay : TestCase
{
public override string Name => @"PauseOverlay";
public override string Description => @"Tests the pause overlay";
private PauseOverlay pauseOverlay;
private int retryCount;
public override void Reset()
{
base.Reset();
Add(pauseOverlay = new PauseOverlay
{
Depth = -1,
OnResume = () => Logger.Log(@"Resume"),
OnRetry = () => Logger.Log(@"Retry"),
OnQuit = () => Logger.Log(@"Quit")
});
AddButton("Pause", pauseOverlay.Show);
namespace osu.Desktop.VisualTests.Tests
{
class TestCasePauseOverlay : TestCase
{
public override string Name => @"PauseOverlay";
public override string Description => @"Tests the pause overlay";
private PauseOverlay pauseOverlay;
private int retryCount;
public override void Reset()
{
base.Reset();
Add(pauseOverlay = new PauseOverlay
{
Depth = -1,
OnResume = () => Logger.Log(@"Resume"),
OnRetry = () => Logger.Log(@"Retry"),
OnQuit = () => Logger.Log(@"Quit")
});
AddButton("Pause", pauseOverlay.Show);
AddButton("Add Retry", delegate
{
retryCount++;
pauseOverlay.Retries = retryCount;
});
retryCount = 0;
});
retryCount = 0;
}
}
}
}
}

View File

@ -1,55 +1,55 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
using osu.Game.Database;
using osu.Game.Graphics;
using osu.Game.Modes;
using OpenTK;
using OpenTK.Graphics;
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
using osu.Game.Database;
using osu.Game.Graphics;
using osu.Game.Modes;
using OpenTK;
using OpenTK.Graphics;
namespace osu.Game.Beatmaps.Drawables
{
class DifficultyIcon : Container
{
private readonly BeatmapInfo beatmap;
private OsuColour palette;
public DifficultyIcon(BeatmapInfo beatmap)
{
this.beatmap = beatmap;
const float size = 20;
Size = new Vector2(size);
}
[BackgroundDependencyLoader]
class DifficultyIcon : Container
{
private readonly BeatmapInfo beatmap;
private OsuColour palette;
public DifficultyIcon(BeatmapInfo beatmap)
{
this.beatmap = beatmap;
const float size = 20;
Size = new Vector2(size);
}
[BackgroundDependencyLoader]
private void load(OsuColour palette)
{
this.palette = palette;
Children = new[]
{
new TextAwesome
{
Anchor = Anchor.Centre,
TextSize = Size.X,
Colour = getColour(beatmap),
Icon = FontAwesome.fa_circle
},
new TextAwesome
{
Anchor = Anchor.Centre,
TextSize = Size.X,
Colour = Color4.White,
Icon = Ruleset.GetRuleset(beatmap.Mode).Icon
}
{
new TextAwesome
{
Anchor = Anchor.Centre,
TextSize = Size.X,
Colour = getColour(beatmap),
Icon = FontAwesome.fa_circle
},
new TextAwesome
{
Anchor = Anchor.Centre,
TextSize = Size.X,
Colour = Color4.White,
Icon = Ruleset.GetRuleset(beatmap.Mode).Icon
}
};
}
}
enum DifficultyRating
{
Easy,
@ -57,35 +57,35 @@ namespace osu.Game.Beatmaps.Drawables
Hard,
Insane,
Expert
}
}
private DifficultyRating getDifficultyRating(BeatmapInfo beatmap)
{
var rating = beatmap.StarDifficulty;
if (rating < 1.5) return DifficultyRating.Easy;
if (rating < 2.25) return DifficultyRating.Normal;
if (rating < 3.75) return DifficultyRating.Hard;
if (rating < 5.25) return DifficultyRating.Insane;
return DifficultyRating.Expert;
}
private Color4 getColour(BeatmapInfo beatmap)
if (rating < 1.5) return DifficultyRating.Easy;
if (rating < 2.25) return DifficultyRating.Normal;
if (rating < 3.75) return DifficultyRating.Hard;
if (rating < 5.25) return DifficultyRating.Insane;
return DifficultyRating.Expert;
}
private Color4 getColour(BeatmapInfo beatmap)
{
switch (getDifficultyRating(beatmap))
{
case DifficultyRating.Easy:
switch (getDifficultyRating(beatmap))
{
case DifficultyRating.Easy:
return palette.Green;
default:
case DifficultyRating.Normal:
return palette.Yellow;
case DifficultyRating.Hard:
return palette.Pink;
case DifficultyRating.Insane:
return palette.Purple;
case DifficultyRating.Expert:
return palette.Gray0;
default:
case DifficultyRating.Normal:
return palette.Yellow;
case DifficultyRating.Hard:
return palette.Pink;
case DifficultyRating.Insane:
return palette.Purple;
case DifficultyRating.Expert:
return palette.Gray0;
}
}
}
}
}

View File

@ -63,4 +63,4 @@ namespace osu.Game.Beatmaps.Formats
}
}
}
}
}

View File

@ -1,16 +1,16 @@
using System;
using System.ComponentModel;
namespace osu.Game.Configuration
{
public enum ProgressBarType
{
Off,
Pie,
[Description("Top Right")]
TopRight,
[Description("Bottom Right")]
BottomRight,
Bottom
}
namespace osu.Game.Configuration
{
public enum ProgressBarType
{
Off,
Pie,
[Description("Top Right")]
TopRight,
[Description("Bottom Right")]
BottomRight,
Bottom
}
}

View File

@ -1,16 +1,16 @@
using System;
using System;
using System.ComponentModel;
namespace osu.Game.Configuration
{
public enum RankingType
{
Local,
[Description("Global")]
Top,
[Description("Selected Mods")]
SelectedMod,
Friends,
Country
}
namespace osu.Game.Configuration
{
public enum RankingType
{
Local,
[Description("Global")]
Top,
[Description("Selected Mods")]
SelectedMod,
Friends,
Country
}
}

View File

@ -1,11 +1,11 @@
using System;
namespace osu.Game.Configuration
{
public enum ReleaseStream
{
Lazer,
//Stable40,
//Beta40,
//Stable
}
using System;
namespace osu.Game.Configuration
{
public enum ReleaseStream
{
Lazer,
//Stable40,
//Beta40,
//Stable
}
}

View File

@ -1,10 +1,10 @@
using System;
namespace osu.Game.Configuration
{
public enum ScoreMeterType
{
None,
Colour,
Error
}
using System;
namespace osu.Game.Configuration
{
public enum ScoreMeterType
{
None,
Colour,
Error
}
}

View File

@ -1,32 +1,32 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Collections.Generic;
using SQLite.Net.Attributes;
using SQLiteNetExtensions.Attributes;
namespace osu.Game.Database
{
public class BeatmapSetInfo
{
[PrimaryKey, AutoIncrement]
public int ID { get; set; }
public int? OnlineBeatmapSetID { get; set; } = null;
[OneToOne(CascadeOperations = CascadeOperation.All)]
public BeatmapMetadata Metadata { get; set; }
[NotNull, ForeignKey(typeof(BeatmapMetadata))]
public int BeatmapMetadataID { get; set; }
[OneToMany(CascadeOperations = CascadeOperation.All)]
public List<BeatmapInfo> Beatmaps { get; set; }
public string Hash { get; set; }
public string Path { get; set; }
}
}
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Collections.Generic;
using SQLite.Net.Attributes;
using SQLiteNetExtensions.Attributes;
namespace osu.Game.Database
{
public class BeatmapSetInfo
{
[PrimaryKey, AutoIncrement]
public int ID { get; set; }
public int? OnlineBeatmapSetID { get; set; } = null;
[OneToOne(CascadeOperations = CascadeOperation.All)]
public BeatmapMetadata Metadata { get; set; }
[NotNull, ForeignKey(typeof(BeatmapMetadata))]
public int BeatmapMetadataID { get; set; }
[OneToMany(CascadeOperations = CascadeOperation.All)]
public List<BeatmapInfo> Beatmaps { get; set; }
public string Hash { get; set; }
public string Path { get; set; }
}
}

View File

@ -1,16 +1,16 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Graphics.Sprites;
namespace osu.Game.Graphics.UserInterface
{
public class LoadingAnimation : SpriteText
{
public LoadingAnimation()
{
Text = "Loading";
}
}
namespace osu.Game.Graphics.UserInterface
{
public class LoadingAnimation : SpriteText
{
public LoadingAnimation()
{
Text = "Loading";
}
}
}

View File

@ -1,27 +1,27 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using OpenTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transformations;
using osu.Framework.Graphics.UserInterface;
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using OpenTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transformations;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input;
using osu.Game.Graphics.Backgrounds;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays;
namespace osu.Game.Graphics.UserInterface
{
public class OsuButton : Button
{
private Box hover;
public OsuButton()
{
Height = 40;
using osu.Game.Graphics.Backgrounds;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays;
namespace osu.Game.Graphics.UserInterface
{
public class OsuButton : Button
{
private Box hover;
public OsuButton()
{
Height = 40;
}
protected override SpriteText CreateText() => new OsuSpriteText
@ -32,14 +32,14 @@ namespace osu.Game.Graphics.UserInterface
Font = @"Exo2.0-Bold",
};
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Colour = colours.BlueDark;
Content.Masking = true;
Content.CornerRadius = 5;
Content.Masking = true;
Content.CornerRadius = 5;
Add(new Drawable[]
{
new Triangles
@ -55,31 +55,31 @@ namespace osu.Game.Graphics.UserInterface
Colour = Color4.White.Opacity(0.1f),
Alpha = 0,
},
});
}
});
}
protected override bool OnHover(InputState state)
{
hover.FadeIn(200);
return base.OnHover(state);
}
}
protected override void OnHoverLost(InputState state)
{
hover.FadeOut(200);
base.OnHoverLost(state);
}
}
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
{
Content.ScaleTo(0.9f, 4000, EasingTypes.OutQuint);
return base.OnMouseDown(state, args);
}
}
protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
{
Content.ScaleTo(1, 1000, EasingTypes.OutElastic);
return base.OnMouseUp(state, args);
}
}
}
}
}

View File

@ -1,53 +1,53 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Configuration;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options
{
public class OptionTextBox : OsuTextBox
{
private Bindable<string> bindable;
public Bindable<string> Bindable
{
set
{
if (bindable != null)
bindable.ValueChanged -= bindableValueChanged;
bindable = value;
if (bindable != null)
{
base.Text = bindable.Value;
bindable.ValueChanged += bindableValueChanged;
}
}
}
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Configuration;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options
{
public class OptionTextBox : OsuTextBox
{
private Bindable<string> bindable;
public Bindable<string> Bindable
{
set
{
if (bindable != null)
bindable.ValueChanged -= bindableValueChanged;
bindable = value;
if (bindable != null)
{
base.Text = bindable.Value;
bindable.ValueChanged += bindableValueChanged;
}
}
}
protected override string InternalText
{
get { return base.InternalText; }
set
{
base.InternalText = value;
if (bindable != null)
base.InternalText = value;
if (bindable != null)
bindable.Value = value;
}
}
private void bindableValueChanged(object sender, EventArgs e)
{
Text = bindable.Value;
}
protected override void Dispose(bool isDisposing)
{
if (bindable != null)
bindable.ValueChanged -= bindableValueChanged;
base.Dispose(isDisposing);
}
}
}
private void bindableValueChanged(object sender, EventArgs e)
{
Text = bindable.Value;
}
protected override void Dispose(bool isDisposing)
{
if (bindable != null)
bindable.ValueChanged -= bindableValueChanged;
base.Dispose(isDisposing);
}
}
}

View File

@ -1,44 +1,44 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays.Options
{
public abstract class OptionsSubsection : FlowContainer
{
private Container<Drawable> content;
protected override Container<Drawable> Content => content;
protected abstract string Header { get; }
public OptionsSubsection()
{
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Direction = FlowDirection.VerticalOnly;
AddInternal(new Drawable[]
{
new OsuSpriteText
{
Text = Header.ToUpper(),
Margin = new MarginPadding { Bottom = 10 },
Font = @"Exo2.0-Black",
},
content = new FlowContainer
{
Direction = FlowDirection.VerticalOnly,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Spacing = new Vector2(0, 5),
},
});
}
}
}
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Overlays.Options
{
public abstract class OptionsSubsection : FlowContainer
{
private Container<Drawable> content;
protected override Container<Drawable> Content => content;
protected abstract string Header { get; }
public OptionsSubsection()
{
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Direction = FlowDirection.VerticalOnly;
AddInternal(new Drawable[]
{
new OsuSpriteText
{
Text = Header.ToUpper(),
Margin = new MarginPadding { Bottom = 10 },
Font = @"Exo2.0-Black",
},
content = new FlowContainer
{
Direction = FlowDirection.VerticalOnly,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Spacing = new Vector2(0, 5),
},
});
}
}
}

View File

@ -1,18 +1,18 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
namespace osu.Game.Overlays.Options.Sections.Audio
{
public class AudioDevicesOptions : OptionsSubsection
{
protected override string Header => "Devices";
public AudioDevicesOptions()
{
Children = new[]
{
new OptionLabel { Text = "Output device: TODO dropdown" }
};
}
}
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
namespace osu.Game.Overlays.Options.Sections.Audio
{
public class AudioDevicesOptions : OptionsSubsection
{
protected override string Header => "Devices";
public AudioDevicesOptions()
{
Children = new[]
{
new OptionLabel { Text = "Output device: TODO dropdown" }
};
}
}
}

View File

@ -1,17 +1,17 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.Sections.Audio
{
public class OffsetOptions : OptionsSubsection
{
protected override string Header => "Offset Adjustment";
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.Sections.Audio
{
public class OffsetOptions : OptionsSubsection
{
protected override string Header => "Offset Adjustment";
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
@ -29,6 +29,6 @@ namespace osu.Game.Overlays.Options.Sections.Audio
Text = "Offset wizard"
}
};
}
}
}
}
}
}

View File

@ -1,26 +1,26 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework;
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Overlays.Options.Sections.Audio;
namespace osu.Game.Overlays.Options.Sections
{
public class AudioSection : OptionsSection
{
public override string Header => "Audio";
public override FontAwesome Icon => FontAwesome.fa_headphones;
public AudioSection()
{
Children = new Drawable[]
{
new AudioDevicesOptions { Alpha = RuntimeInfo.IsWindows ? 1 : 0 },
new VolumeOptions(),
new OffsetOptions(),
};
}
}
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework;
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Overlays.Options.Sections.Audio;
namespace osu.Game.Overlays.Options.Sections
{
public class AudioSection : OptionsSection
{
public override string Header => "Audio";
public override FontAwesome Icon => FontAwesome.fa_headphones;
public AudioSection()
{
Children = new Drawable[]
{
new AudioDevicesOptions { Alpha = RuntimeInfo.IsWindows ? 1 : 0 },
new VolumeOptions(),
new OffsetOptions(),
};
}
}
}

View File

@ -1,16 +1,16 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Game.Configuration;
namespace osu.Game.Overlays.Options.Sections.Gameplay
{
public class SongSelectOptions : OptionsSubsection
{
protected override string Header => "Song Select";
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Game.Configuration;
namespace osu.Game.Overlays.Options.Sections.Gameplay
{
public class SongSelectOptions : OptionsSubsection
{
protected override string Header => "Song Select";
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
@ -29,6 +29,6 @@ namespace osu.Game.Overlays.Options.Sections.Gameplay
},
};
}
}
}
}
}

View File

@ -1,24 +1,24 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Overlays.Options.Sections.Gameplay;
namespace osu.Game.Overlays.Options.Sections
{
public class GameplaySection : OptionsSection
{
public override string Header => "Gameplay";
public override FontAwesome Icon => FontAwesome.fa_circle_o;
public GameplaySection()
{
base.Children = new Drawable[]
{
new Gameplay.GeneralOptions(),
new SongSelectOptions(),
};
}
}
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Overlays.Options.Sections.Gameplay;
namespace osu.Game.Overlays.Options.Sections
{
public class GameplaySection : OptionsSection
{
public override string Header => "Gameplay";
public override FontAwesome Icon => FontAwesome.fa_circle_o;
public GameplaySection()
{
base.Children = new Drawable[]
{
new Gameplay.GeneralOptions(),
new SongSelectOptions(),
};
}
}
}

View File

@ -1,148 +1,148 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Online.API;
using OpenTK;
namespace osu.Game.Overlays.Options.Sections.General
{
public class LoginOptions : OptionsSubsection, IOnlineComponent
{
private bool bounding = true;
protected override string Header => "Sign In";
public override RectangleF BoundingBox => bounding ? base.BoundingBox : RectangleF.Empty;
public bool Bounding
{
get { return bounding; }
set
{
bounding = value;
Invalidate(Invalidation.Geometry);
}
}
[BackgroundDependencyLoader(permitNulls: true)]
private void load(APIAccess api)
{
api?.Register(this);
}
public void APIStateChanged(APIAccess api, APIState state)
{
switch (state)
{
case APIState.Offline:
Children = new Drawable[]
{
new LoginForm()
};
break;
case APIState.Failing:
Children = new Drawable[]
{
new OsuSpriteText
{
Text = "Connection failing :(",
},
};
break;
case APIState.Connecting:
Children = new Drawable[]
{
new OsuSpriteText
{
Text = "Connecting...",
},
};
break;
case APIState.Online:
Children = new Drawable[]
{
new OsuSpriteText
{
Text = $"Connected as {api.Username}!",
},
new OsuButton
{
RelativeSizeAxes = Axes.X,
Text = "Sign out",
Action = api.Logout
}
};
break;
}
}
class LoginForm : FlowContainer
{
private TextBox username;
private TextBox password;
private APIAccess api;
private OsuCheckbox saveUsername;
private OsuCheckbox savePassword;
private void performLogin()
{
if (!string.IsNullOrEmpty(username.Text) && !string.IsNullOrEmpty(password.Text))
api.Login(username.Text, password.Text);
}
[BackgroundDependencyLoader(permitNulls: true)]
private void load(APIAccess api, OsuConfigManager config)
{
this.api = api;
Direction = FlowDirection.VerticalOnly;
AutoSizeAxes = Axes.Y;
RelativeSizeAxes = Axes.X;
Spacing = new Vector2(0, 5);
Children = new Drawable[]
{
username = new OsuTextBox
{
RelativeSizeAxes = Axes.X,
Text = api?.Username ?? string.Empty
},
password = new OsuPasswordTextBox
{
RelativeSizeAxes = Axes.X
},
saveUsername = new OsuCheckbox
{
LabelText = "Remember username",
Bindable = config.GetBindable<bool>(OsuConfig.SaveUsername),
},
savePassword = new OsuCheckbox
{
LabelText = "Stay logged in",
Bindable = config.GetBindable<bool>(OsuConfig.SavePassword),
},
new OsuButton
{
RelativeSizeAxes = Axes.X,
Text = "Sign in",
Action = performLogin
},
new OsuButton
{
RelativeSizeAxes = Axes.X,
Text = "Register new account",
//Action = registerLink
}
};
}
}
}
}
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Configuration;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Online.API;
using OpenTK;
namespace osu.Game.Overlays.Options.Sections.General
{
public class LoginOptions : OptionsSubsection, IOnlineComponent
{
private bool bounding = true;
protected override string Header => "Sign In";
public override RectangleF BoundingBox => bounding ? base.BoundingBox : RectangleF.Empty;
public bool Bounding
{
get { return bounding; }
set
{
bounding = value;
Invalidate(Invalidation.Geometry);
}
}
[BackgroundDependencyLoader(permitNulls: true)]
private void load(APIAccess api)
{
api?.Register(this);
}
public void APIStateChanged(APIAccess api, APIState state)
{
switch (state)
{
case APIState.Offline:
Children = new Drawable[]
{
new LoginForm()
};
break;
case APIState.Failing:
Children = new Drawable[]
{
new OsuSpriteText
{
Text = "Connection failing :(",
},
};
break;
case APIState.Connecting:
Children = new Drawable[]
{
new OsuSpriteText
{
Text = "Connecting...",
},
};
break;
case APIState.Online:
Children = new Drawable[]
{
new OsuSpriteText
{
Text = $"Connected as {api.Username}!",
},
new OsuButton
{
RelativeSizeAxes = Axes.X,
Text = "Sign out",
Action = api.Logout
}
};
break;
}
}
class LoginForm : FlowContainer
{
private TextBox username;
private TextBox password;
private APIAccess api;
private OsuCheckbox saveUsername;
private OsuCheckbox savePassword;
private void performLogin()
{
if (!string.IsNullOrEmpty(username.Text) && !string.IsNullOrEmpty(password.Text))
api.Login(username.Text, password.Text);
}
[BackgroundDependencyLoader(permitNulls: true)]
private void load(APIAccess api, OsuConfigManager config)
{
this.api = api;
Direction = FlowDirection.VerticalOnly;
AutoSizeAxes = Axes.Y;
RelativeSizeAxes = Axes.X;
Spacing = new Vector2(0, 5);
Children = new Drawable[]
{
username = new OsuTextBox
{
RelativeSizeAxes = Axes.X,
Text = api?.Username ?? string.Empty
},
password = new OsuPasswordTextBox
{
RelativeSizeAxes = Axes.X
},
saveUsername = new OsuCheckbox
{
LabelText = "Remember username",
Bindable = config.GetBindable<bool>(OsuConfig.SaveUsername),
},
savePassword = new OsuCheckbox
{
LabelText = "Stay logged in",
Bindable = config.GetBindable<bool>(OsuConfig.SavePassword),
},
new OsuButton
{
RelativeSizeAxes = Axes.X,
Text = "Sign in",
Action = performLogin
},
new OsuButton
{
RelativeSizeAxes = Axes.X,
Text = "Register new account",
//Action = registerLink
}
};
}
}
}
}

View File

@ -1,25 +1,25 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Overlays.Options.Sections.General;
namespace osu.Game.Overlays.Options.Sections
{
public class GeneralSection : OptionsSection
{
public override string Header => "General";
public override FontAwesome Icon => FontAwesome.fa_gear;
public GeneralSection()
{
Children = new Drawable[]
{
new LanguageOptions(),
new UpdateOptions(),
};
}
}
}
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Overlays.Options.Sections.General;
namespace osu.Game.Overlays.Options.Sections
{
public class GeneralSection : OptionsSection
{
public override string Header => "General";
public override FontAwesome Icon => FontAwesome.fa_gear;
public GeneralSection()
{
Children = new Drawable[]
{
new LanguageOptions(),
new UpdateOptions(),
};
}
}
}

View File

@ -1,28 +1,28 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Overlays.Options.Sections.Graphics;
namespace osu.Game.Overlays.Options.Sections
{
public class GraphicsSection : OptionsSection
{
public override string Header => "Graphics";
public override FontAwesome Icon => FontAwesome.fa_laptop;
public GraphicsSection()
{
Children = new Drawable[]
{
new RendererOptions(),
new LayoutOptions(),
new DetailOptions(),
new MainMenuOptions(),
new SongSelectGraphicsOptions(),
};
}
}
}
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Overlays.Options.Sections.Graphics;
namespace osu.Game.Overlays.Options.Sections
{
public class GraphicsSection : OptionsSection
{
public override string Header => "Graphics";
public override FontAwesome Icon => FontAwesome.fa_laptop;
public GraphicsSection()
{
Children = new Drawable[]
{
new RendererOptions(),
new LayoutOptions(),
new DetailOptions(),
new MainMenuOptions(),
new SongSelectGraphicsOptions(),
};
}
}
}

View File

@ -1,30 +1,30 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.Sections.Input
{
public class KeyboardOptions : OptionsSubsection
{
protected override string Header => "Keyboard";
public KeyboardOptions()
{
Children = new Drawable[]
{
new OsuButton
{
RelativeSizeAxes = Axes.X,
Text = "Change keyboard bindings"
},
new OsuButton
{
RelativeSizeAxes = Axes.X,
Text = "osu!mania layout"
}
};
}
}
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.Sections.Input
{
public class KeyboardOptions : OptionsSubsection
{
protected override string Header => "Keyboard";
public KeyboardOptions()
{
Children = new Drawable[]
{
new OsuButton
{
RelativeSizeAxes = Axes.X,
Text = "Change keyboard bindings"
},
new OsuButton
{
RelativeSizeAxes = Axes.X,
Text = "osu!mania layout"
}
};
}
}
}

View File

@ -1,26 +1,26 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Overlays.Options.Sections.Input;
namespace osu.Game.Overlays.Options.Sections
{
public class InputSection : OptionsSection
{
public override string Header => "Input";
public override FontAwesome Icon => FontAwesome.fa_keyboard_o;
public InputSection()
{
Children = new Drawable[]
{
new MouseOptions(),
new KeyboardOptions(),
new OtherInputOptions(),
};
}
}
}
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Overlays.Options.Sections.Input;
namespace osu.Game.Overlays.Options.Sections
{
public class InputSection : OptionsSection
{
public override string Header => "Input";
public override FontAwesome Icon => FontAwesome.fa_keyboard_o;
public InputSection()
{
Children = new Drawable[]
{
new MouseOptions(),
new KeyboardOptions(),
new OtherInputOptions(),
};
}
}
}

View File

@ -1,50 +1,50 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using OpenTK;
namespace osu.Game.Overlays.Options.Sections
{
public class MaintenanceSection : OptionsSection
{
public override string Header => "Maintenance";
public override FontAwesome Icon => FontAwesome.fa_wrench;
public MaintenanceSection()
{
content.Spacing = new Vector2(0, 5);
Children = new Drawable[]
{
new OsuButton
{
RelativeSizeAxes = Axes.X,
Text = "Delete all unranked maps",
},
new OsuButton
{
RelativeSizeAxes = Axes.X,
Text = "Repair folder permissions",
},
new OsuButton
{
RelativeSizeAxes = Axes.X,
Text = "Mark all maps as played",
},
new OsuButton
{
RelativeSizeAxes = Axes.X,
Text = "Run osu! updater",
},
new OptionLabel
{
Text = "TODO: osu version here",
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
},
};
}
}
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using OpenTK;
namespace osu.Game.Overlays.Options.Sections
{
public class MaintenanceSection : OptionsSection
{
public override string Header => "Maintenance";
public override FontAwesome Icon => FontAwesome.fa_wrench;
public MaintenanceSection()
{
content.Spacing = new Vector2(0, 5);
Children = new Drawable[]
{
new OsuButton
{
RelativeSizeAxes = Axes.X,
Text = "Delete all unranked maps",
},
new OsuButton
{
RelativeSizeAxes = Axes.X,
Text = "Repair folder permissions",
},
new OsuButton
{
RelativeSizeAxes = Axes.X,
Text = "Mark all maps as played",
},
new OsuButton
{
RelativeSizeAxes = Axes.X,
Text = "Run osu! updater",
},
new OptionLabel
{
Text = "TODO: osu version here",
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
},
};
}
}
}

View File

@ -1,55 +1,55 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.Sections.Online
{
public class InGameChatOptions : OptionsSubsection
{
private OptionTextBox chatIgnoreList;
private OptionTextBox chatHighlightWords;
protected override string Header => "Chat";
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
Children = new Drawable[]
{
new OsuCheckbox
{
LabelText = "Filter offensive words",
Bindable = config.GetBindable<bool>(OsuConfig.ChatFilter)
},
new OsuCheckbox
{
LabelText = "Filter foreign characters",
Bindable = config.GetBindable<bool>(OsuConfig.ChatRemoveForeign)
},
new OsuCheckbox
{
LabelText = "Log private messages",
Bindable = config.GetBindable<bool>(OsuConfig.LogPrivateMessages)
},
new OsuCheckbox
{
LabelText = "Block private messages from non-friends",
Bindable = config.GetBindable<bool>(OsuConfig.BlockNonFriendPM)
},
new OptionLabel { Text = "Chat ignore list (space-seperated list)" },
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Options.Sections.Online
{
public class InGameChatOptions : OptionsSubsection
{
private OptionTextBox chatIgnoreList;
private OptionTextBox chatHighlightWords;
protected override string Header => "Chat";
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
Children = new Drawable[]
{
new OsuCheckbox
{
LabelText = "Filter offensive words",
Bindable = config.GetBindable<bool>(OsuConfig.ChatFilter)
},
new OsuCheckbox
{
LabelText = "Filter foreign characters",
Bindable = config.GetBindable<bool>(OsuConfig.ChatRemoveForeign)
},
new OsuCheckbox
{
LabelText = "Log private messages",
Bindable = config.GetBindable<bool>(OsuConfig.LogPrivateMessages)
},
new OsuCheckbox
{
LabelText = "Block private messages from non-friends",
Bindable = config.GetBindable<bool>(OsuConfig.BlockNonFriendPM)
},
new OptionLabel { Text = "Chat ignore list (space-seperated list)" },
chatIgnoreList = new OptionTextBox {
RelativeSizeAxes = Axes.X,
Bindable = config.GetBindable<string>(OsuConfig.IgnoreList)
},
new OptionLabel { Text = "Chat highlight words (space-seperated list)" },
},
new OptionLabel { Text = "Chat highlight words (space-seperated list)" },
chatHighlightWords = new OptionTextBox {
RelativeSizeAxes = Axes.X,
Bindable = config.GetBindable<string>(OsuConfig.HighlightWords)
},
};
},
};
}
}
}
}

View File

@ -1,26 +1,26 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Overlays.Options.Sections.Online;
namespace osu.Game.Overlays.Options.Sections
{
public class OnlineSection : OptionsSection
{
public override string Header => "Online";
public override FontAwesome Icon => FontAwesome.fa_globe;
public OnlineSection()
{
Children = new Drawable[]
{
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Overlays.Options.Sections.Online;
namespace osu.Game.Overlays.Options.Sections
{
public class OnlineSection : OptionsSection
{
public override string Header => "Online";
public override FontAwesome Icon => FontAwesome.fa_globe;
public OnlineSection()
{
Children = new Drawable[]
{
new InGameChatOptions(),
new PrivacyOptions(),
new NotificationsOptions(),
new IntegrationOptions(),
};
}
}
new PrivacyOptions(),
new NotificationsOptions(),
new IntegrationOptions(),
};
}
}
}

View File

@ -1,75 +1,75 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Game.Configuration;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using OpenTK;
namespace osu.Game.Overlays.Options.Sections
{
public class SkinSection : OptionsSection
{
public override string Header => "Skin";
public override FontAwesome Icon => FontAwesome.fa_paint_brush;
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
content.Spacing = new Vector2(0, 5);
Children = new Drawable[]
{
new OptionLabel { Text = "TODO: Skin preview textures" },
new OptionLabel { Text = "Current skin: TODO dropdown" },
new OsuButton
{
RelativeSizeAxes = Axes.X,
Text = "Preview gameplay",
},
new OsuButton
{
RelativeSizeAxes = Axes.X,
Text = "Open skin folder",
},
new OsuButton
{
RelativeSizeAxes = Axes.X,
Text = "Export as .osk",
},
new OsuCheckbox
{
LabelText = "Ignore all beatmap skins",
Bindable = config.GetBindable<bool>(OsuConfig.IgnoreBeatmapSkins)
},
new OsuCheckbox
{
LabelText = "Use skin's sound samples",
Bindable = config.GetBindable<bool>(OsuConfig.SkinSamples)
},
new OsuCheckbox
{
LabelText = "Use Taiko skin for Taiko mode",
Bindable = config.GetBindable<bool>(OsuConfig.UseTaikoSkin)
},
new OsuCheckbox
{
LabelText = "Always use skin cursor",
Bindable = config.GetBindable<bool>(OsuConfig.UseSkinCursor)
},
new OptionSlider<double>
{
LabelText = "Cursor size",
Bindable = (BindableDouble)config.GetBindable<double>(OsuConfig.CursorSize)
},
new OsuCheckbox
{
LabelText = "Automatic cursor size",
Bindable = config.GetBindable<bool>(OsuConfig.AutomaticCursorSizing)
},
};
}
}
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Game.Configuration;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using OpenTK;
namespace osu.Game.Overlays.Options.Sections
{
public class SkinSection : OptionsSection
{
public override string Header => "Skin";
public override FontAwesome Icon => FontAwesome.fa_paint_brush;
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
content.Spacing = new Vector2(0, 5);
Children = new Drawable[]
{
new OptionLabel { Text = "TODO: Skin preview textures" },
new OptionLabel { Text = "Current skin: TODO dropdown" },
new OsuButton
{
RelativeSizeAxes = Axes.X,
Text = "Preview gameplay",
},
new OsuButton
{
RelativeSizeAxes = Axes.X,
Text = "Open skin folder",
},
new OsuButton
{
RelativeSizeAxes = Axes.X,
Text = "Export as .osk",
},
new OsuCheckbox
{
LabelText = "Ignore all beatmap skins",
Bindable = config.GetBindable<bool>(OsuConfig.IgnoreBeatmapSkins)
},
new OsuCheckbox
{
LabelText = "Use skin's sound samples",
Bindable = config.GetBindable<bool>(OsuConfig.SkinSamples)
},
new OsuCheckbox
{
LabelText = "Use Taiko skin for Taiko mode",
Bindable = config.GetBindable<bool>(OsuConfig.UseTaikoSkin)
},
new OsuCheckbox
{
LabelText = "Always use skin cursor",
Bindable = config.GetBindable<bool>(OsuConfig.UseSkinCursor)
},
new OptionSlider<double>
{
LabelText = "Cursor size",
Bindable = (BindableDouble)config.GetBindable<double>(OsuConfig.CursorSize)
},
new OsuCheckbox
{
LabelText = "Automatic cursor size",
Bindable = config.GetBindable<bool>(OsuConfig.AutomaticCursorSizing)
},
};
}
}
}

View File

@ -1,147 +1,147 @@
using OpenTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Containers;
using OpenTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Containers;
using osu.Game.Beatmaps;
using osu.Framework.Graphics.Primitives;
namespace osu.Game.Overlays.Pause
{
public class PauseProgressBar : Container
{
private Color4 fillColour = new Color4(221, 255, 255, 255);
private Color4 glowColour = new Color4(221, 255, 255, 150);
private Container fill;
private WorkingBeatmap current;
[BackgroundDependencyLoader]
private void load(OsuGameBase osuGame)
{
current = osuGame.Beatmap.Value;
}
protected override void Update()
{
base.Update();
if (current?.TrackLoaded ?? false)
{
fill.Width = (float)(current.Track.CurrentTime / current.Track.Length);
}
}
public PauseProgressBar()
{
RelativeSizeAxes = Axes.X;
Height = 60;
Children = new Drawable[]
{
new PauseProgressGraph
{
RelativeSizeAxes = Axes.X,
Origin = Anchor.BottomCentre,
Anchor = Anchor.BottomCentre,
Height = 35,
Margin = new MarginPadding
{
Bottom = 5
}
},
new Container
{
Origin = Anchor.BottomRight,
Anchor = Anchor.BottomRight,
RelativeSizeAxes = Axes.X,
Height = 5,
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black,
Alpha = 0.5f
}
}
},
fill = new Container
{
namespace osu.Game.Overlays.Pause
{
public class PauseProgressBar : Container
{
private Color4 fillColour = new Color4(221, 255, 255, 255);
private Color4 glowColour = new Color4(221, 255, 255, 150);
private Container fill;
private WorkingBeatmap current;
[BackgroundDependencyLoader]
private void load(OsuGameBase osuGame)
{
current = osuGame.Beatmap.Value;
}
protected override void Update()
{
base.Update();
if (current?.TrackLoaded ?? false)
{
fill.Width = (float)(current.Track.CurrentTime / current.Track.Length);
}
}
public PauseProgressBar()
{
RelativeSizeAxes = Axes.X;
Height = 60;
Children = new Drawable[]
{
new PauseProgressGraph
{
RelativeSizeAxes = Axes.X,
Origin = Anchor.BottomLeft,
Anchor = Anchor.BottomLeft,
Width = 0,
Height = 60,
Children = new Drawable[]
{
new Container
{
RelativeSizeAxes = Axes.Both,
Origin = Anchor.BottomLeft,
Anchor = Anchor.BottomLeft,
Masking = true,
Children = new Drawable[]
{
new Container
{
Origin = Anchor.BottomLeft,
Anchor = Anchor.BottomLeft,
RelativeSizeAxes = Axes.X,
Height = 5,
Masking = true,
EdgeEffect = new EdgeEffect
{
Type = EdgeEffectType.Glow,
Colour = glowColour,
Radius = 5
},
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = fillColour
}
}
}
}
},
new Container
{
Origin = Anchor.BottomRight,
Anchor = Anchor.BottomRight,
Width = 2,
Height = 35,
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.White
},
new Container
{
Origin = Anchor.BottomCentre,
Anchor = Anchor.TopCentre,
Width = 14,
Height = 25,
CornerRadius = 5,
Masking = true,
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.White
}
}
}
}
}
}
}
Origin = Anchor.BottomCentre,
Anchor = Anchor.BottomCentre,
Height = 35,
Margin = new MarginPadding
{
Bottom = 5
}
},
new Container
{
Origin = Anchor.BottomRight,
Anchor = Anchor.BottomRight,
RelativeSizeAxes = Axes.X,
Height = 5,
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black,
Alpha = 0.5f
}
}
},
fill = new Container
{
RelativeSizeAxes = Axes.X,
Origin = Anchor.BottomLeft,
Anchor = Anchor.BottomLeft,
Width = 0,
Height = 60,
Children = new Drawable[]
{
new Container
{
RelativeSizeAxes = Axes.Both,
Origin = Anchor.BottomLeft,
Anchor = Anchor.BottomLeft,
Masking = true,
Children = new Drawable[]
{
new Container
{
Origin = Anchor.BottomLeft,
Anchor = Anchor.BottomLeft,
RelativeSizeAxes = Axes.X,
Height = 5,
Masking = true,
EdgeEffect = new EdgeEffect
{
Type = EdgeEffectType.Glow,
Colour = glowColour,
Radius = 5
},
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = fillColour
}
}
}
}
},
new Container
{
Origin = Anchor.BottomRight,
Anchor = Anchor.BottomRight,
Width = 2,
Height = 35,
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.White
},
new Container
{
Origin = Anchor.BottomCentre,
Anchor = Anchor.TopCentre,
Width = 14,
Height = 25,
CornerRadius = 5,
Masking = true,
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.White
}
}
}
}
}
}
}
};
}
}
}
}
}
}

View File

@ -1,9 +1,9 @@
using osu.Framework.Graphics.Containers;
namespace osu.Game.Overlays.Pause
{
public class PauseProgressGraph : Container
namespace osu.Game.Overlays.Pause
{
public class PauseProgressGraph : Container
{
// TODO: Implement the pause progress graph
}
}
// TODO: Implement the pause progress graph
}
}

View File

@ -1,22 +1,22 @@
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Game.Graphics;
namespace osu.Game.Overlays.Pause
{
public class ResumeButton : PauseButton
{
[BackgroundDependencyLoader]
private void load(AudioManager audio, OsuColour colours)
{
ButtonColour = colours.Green;
SampleHover = audio.Sample.Get(@"Menu/menuclick");
SampleClick = audio.Sample.Get(@"Menu/menuback");
}
public ResumeButton()
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Game.Graphics;
namespace osu.Game.Overlays.Pause
{
public class ResumeButton : PauseButton
{
[BackgroundDependencyLoader]
private void load(AudioManager audio, OsuColour colours)
{
Text = @"Continue";
}
}
}
ButtonColour = colours.Green;
SampleHover = audio.Sample.Get(@"Menu/menuclick");
SampleClick = audio.Sample.Get(@"Menu/menuback");
}
public ResumeButton()
{
Text = @"Continue";
}
}
}