1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-22 21:00:33 +08:00

Refactor options header and layout stuff

This commit is contained in:
Drew DeVault 2016-11-03 23:01:11 -04:00
parent cb40b7079f
commit 408173319b
30 changed files with 122 additions and 121 deletions

View File

@ -6,10 +6,11 @@ namespace osu.Game.Overlays.Options
{
public class AlertsPrivacyOptions : OptionsSubsection
{
protected override string Header => "Alerts & Privacy";
public AlertsPrivacyOptions()
{
// TODO: this should probably be split into Alerts and Privacy
Header = "Alerts & Privacy";
Children = new Drawable[]
{
new BasicCheckBox { LabelText = "Chat ticker" },

View File

@ -5,9 +5,10 @@ namespace osu.Game.Overlays.Options
{
public class AudioDevicesOptions : OptionsSubsection
{
protected override string Header => "Devices";
public AudioDevicesOptions()
{
Header = "Devices";
Children = new[]
{
new SpriteText { Text = "Output device: TODO dropdown" }

View File

@ -5,9 +5,10 @@ namespace osu.Game.Overlays.Options
{
public class AudioOptions : OptionsSection
{
protected override string Header => "Audio";
public AudioOptions()
{
Header = "Audio";
Children = new Drawable[]
{
new AudioDevicesOptions(),

View File

@ -7,9 +7,10 @@ namespace osu.Game.Overlays.Options
{
public class DetailOptions : OptionsSubsection
{
protected override string Header => "Detail Settings";
public DetailOptions()
{
Header = "Detail Settings";
Children = new Drawable[]
{
new BasicCheckBox { LabelText = "Snaking sliders" },

View File

@ -1,4 +1,5 @@
using System;
using OpenTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface;
@ -6,24 +7,19 @@ namespace osu.Game.Overlays.Options
{
public class EditorOptions : OptionsSection
{
protected override string Header => "Editor";
public EditorOptions()
{
Header = "Editor";
content.Spacing = new Vector2(0, 5);
Children = new Drawable[]
{
new OptionsSubsection
{
Header = "General",
Children = new Drawable[]
{
new BasicCheckBox { LabelText = "Background video" },
new BasicCheckBox { LabelText = "Always use default skin" },
new BasicCheckBox { LabelText = "Snaking sliders" },
new BasicCheckBox { LabelText = "Hit animations" },
new BasicCheckBox { LabelText = "Follow points" },
new BasicCheckBox { LabelText = "Stacking" },
}
}
new BasicCheckBox { LabelText = "Background video" },
new BasicCheckBox { LabelText = "Always use default skin" },
new BasicCheckBox { LabelText = "Snaking sliders" },
new BasicCheckBox { LabelText = "Hit animations" },
new BasicCheckBox { LabelText = "Follow points" },
new BasicCheckBox { LabelText = "Stacking" },
};
}
}

View File

@ -5,9 +5,10 @@ namespace osu.Game.Overlays.Options
{
public class GameplayOptions : OptionsSection
{
protected override string Header => "Gameplay";
public GameplayOptions()
{
Header = "Gameplay";
Children = new Drawable[]
{
new GeneralGameplayOptions(),

View File

@ -7,9 +7,10 @@ namespace osu.Game.Overlays.Options
{
public class GeneralGameplayOptions : OptionsSubsection
{
protected override string Header => "General";
public GeneralGameplayOptions()
{
Header = "General";
Children = new Drawable[]
{
new SpriteText { Text = "Background dim: TODO slider" },

View File

@ -10,9 +10,10 @@ namespace osu.Game.Overlays.Options
{
public class GeneralOptions : OptionsSection
{
protected override string Header => "General";
public GeneralOptions()
{
Header = "General";
Children = new Drawable[]
{
new LoginOptions(),

View File

@ -5,9 +5,10 @@ namespace osu.Game.Overlays.Options
{
public class GraphicsOptions : OptionsSection
{
protected override string Header => "Graphics";
public GraphicsOptions()
{
Header = "Graphics";
Children = new Drawable[]
{
new RendererOptions(),

View File

@ -7,9 +7,10 @@ namespace osu.Game.Overlays.Options
{
public class InGameChatOptions : OptionsSubsection
{
protected override string Header => "In-game Chat";
public InGameChatOptions()
{
Header = "In-game Chat";
Children = new Drawable[]
{
new BasicCheckBox { LabelText = "Filter offensive words" },

View File

@ -5,9 +5,10 @@ namespace osu.Game.Overlays.Options
{
public class InputOptions : OptionsSection
{
protected override string Header => "Input";
public InputOptions()
{
Header = "Input";
Children = new Drawable[]
{
new MouseOptions(),

View File

@ -6,9 +6,10 @@ namespace osu.Game.Overlays.Options
{
public class KeyboardOptions : OptionsSubsection
{
protected override string Header => "Keyboard";
public KeyboardOptions()
{
Header = "Keyboard";
Children = new Drawable[]
{
new OsuButton

View File

@ -7,9 +7,10 @@ namespace osu.Game.Overlays.Options
{
public class LanguageOptions : OptionsSubsection
{
protected override string Header => "Language";
public LanguageOptions()
{
Header = "Language";
Children = new Drawable[]
{
new SpriteText { Text = "TODO: Dropdown" },

View File

@ -7,9 +7,10 @@ namespace osu.Game.Overlays.Options
{
public class LayoutOptions : OptionsSubsection
{
protected override string Header => "Layout";
public LayoutOptions()
{
Header = "Layout";
Children = new Drawable[]
{
new SpriteText { Text = "Resolution: TODO dropdown" },

View File

@ -14,10 +14,10 @@ namespace osu.Game.Overlays.Options
public class LoginOptions : OptionsSubsection
{
private Container loginForm;
protected override string Header => "Sign In";
public LoginOptions()
{
Header = "Sign In";
Children = new[]
{
loginForm = new Container

View File

@ -5,9 +5,10 @@ namespace osu.Game.Overlays.Options
{
public class MainMenuOptions : OptionsSubsection
{
protected override string Header => "Main Menu";
public MainMenuOptions()
{
Header = "Main Menu";
Children = new[]
{
new BasicCheckBox { LabelText = "Snow" },

View File

@ -1,4 +1,5 @@
using System;
using OpenTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
@ -7,44 +8,39 @@ namespace osu.Game.Overlays.Options
{
public class MaintenanceOptions : OptionsSection
{
protected override string Header => "Maintenance";
public MaintenanceOptions()
{
Header = "Maintenance";
content.Spacing = new Vector2(0, 5);
Children = new Drawable[]
{
new OptionsSubsection
new OsuButton
{
Header = "General",
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 SpriteText
{
Text = "TODO: osu version here",
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
},
}
}
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 SpriteText
{
Text = "TODO: osu version here",
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
},
};
}
}

View File

@ -7,9 +7,10 @@ namespace osu.Game.Overlays.Options
{
public class MouseOptions : OptionsSubsection
{
protected override string Header => "Mouse";
public MouseOptions()
{
Header = "Mouse";
Children = new Drawable[]
{
new SpriteText { Text = "Sensitivity: TODO slider" },

View File

@ -7,9 +7,10 @@ namespace osu.Game.Overlays.Options
{
public class OffsetAdjustmentOptions : OptionsSubsection
{
protected override string Header => "Offset Adjustment";
public OffsetAdjustmentOptions()
{
Header = "Offset Adjustment";
Children = new Drawable[]
{
new SpriteText { Text = "Universal Offset: TODO slider" },

View File

@ -6,9 +6,10 @@ namespace osu.Game.Overlays.Options
{
public class OnlineIntegrationOptions : OptionsSubsection
{
protected override string Header => "Integration";
public OnlineIntegrationOptions()
{
Header = "Integration";
Children = new Drawable[]
{
new BasicCheckBox { LabelText = "Integrate with Yahoo! status display" },

View File

@ -5,9 +5,10 @@ namespace osu.Game.Overlays.Options
{
public class OnlineOptions : OptionsSection
{
protected override string Header => "Online";
public OnlineOptions()
{
Header = "Online";
Children = new Drawable[]
{
new AlertsPrivacyOptions(),

View File

@ -8,19 +8,12 @@ using osu.Framework.Graphics.Sprites;
namespace osu.Game.Overlays.Options
{
public class OptionsSection : Container
public abstract class OptionsSection : Container
{
private SpriteText header;
private FlowContainer content;
protected FlowContainer content;
protected override Container Content => content;
public string Header
{
get { return header.Text; }
set { header.Text = value; }
}
protected abstract string Header { get; }
public OptionsSection()
{
@ -49,10 +42,11 @@ namespace osu.Game.Overlays.Options
AutoSizeAxes = Axes.Y,
Children = new[]
{
header = new SpriteText
new SpriteText
{
TextSize = headerSize,
Colour = new Color4(247, 198, 35, 255),
Text = Header,
},
content = new FlowContainer
{

View File

@ -6,17 +6,12 @@ using osu.Framework.Graphics.Sprites;
namespace osu.Game.Overlays.Options
{
public class OptionsSubsection : Container
public abstract class OptionsSubsection : Container
{
private SpriteText header;
private Container content;
protected override Container Content => content;
public string Header
{
get { return header.Text; }
set { header.Text = value.ToUpper(); }
}
protected abstract string Header { get; }
public OptionsSubsection()
{
@ -32,9 +27,10 @@ namespace osu.Game.Overlays.Options
Spacing = new Vector2(0, 5),
Children = new[]
{
header = new SpriteText
new SpriteText
{
TextSize = 25,
Text = Header,
// TODO: Bold
}
}

View File

@ -6,9 +6,10 @@ namespace osu.Game.Overlays.Options
{
public class OtherInputOptions : OptionsSubsection
{
protected override string Header => "Other";
public OtherInputOptions()
{
Header = "Other";
Children = new Drawable[]
{
new BasicCheckBox { LabelText = "OS TabletPC support" },

View File

@ -7,9 +7,10 @@ namespace osu.Game.Overlays.Options
{
public class RendererOptions : OptionsSubsection
{
protected override string Header => "Renderer";
public RendererOptions()
{
Header = "Renderer";
// NOTE: Compatability mode omitted
Children = new Drawable[]
{

View File

@ -1,4 +1,5 @@
using System;
using OpenTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
@ -8,41 +9,36 @@ namespace osu.Game.Overlays.Options
{
public class SkinOptions : OptionsSection
{
protected override string Header => "Skin";
public SkinOptions()
{
Header = "Skin";
content.Spacing = new Vector2(0, 5);
Children = new Drawable[]
{
new OptionsSubsection
new SpriteText { Text = "TODO: Skin preview textures" },
new SpriteText { Text = "Current skin: TODO dropdown" },
new OsuButton
{
Header = "Skin",
Children = new Drawable[]
{
new SpriteText { Text = "TODO: Skin preview textures" },
new SpriteText { 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 BasicCheckBox { LabelText = "Ignore all beatmap skins" },
new BasicCheckBox { LabelText = "Use skin's sound samples" },
new BasicCheckBox { LabelText = "Use Taiko skin for Taiko mode" },
new BasicCheckBox { LabelText = "Always use skin cursor" },
new SpriteText { Text = "Cursor size: TODO slider" },
new BasicCheckBox { LabelText = "Automatic cursor size" },
}
}
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 BasicCheckBox { LabelText = "Ignore all beatmap skins" },
new BasicCheckBox { LabelText = "Use skin's sound samples" },
new BasicCheckBox { LabelText = "Use Taiko skin for Taiko mode" },
new BasicCheckBox { LabelText = "Always use skin cursor" },
new SpriteText { Text = "Cursor size: TODO slider" },
new BasicCheckBox { LabelText = "Automatic cursor size" },
};
}
}

View File

@ -6,9 +6,10 @@ namespace osu.Game.Overlays.Options
{
public class SongSelectGameplayOptions : OptionsSubsection
{
protected override string Header => "Song Select";
public SongSelectGameplayOptions()
{
Header = "Song Select";
Children = new Drawable[]
{
new SpriteText { Text = "Display beatmaps from: TODO slider" },

View File

@ -5,9 +5,10 @@ namespace osu.Game.Overlays.Options
{
public class SongSelectGraphicsOptions : OptionsSubsection
{
protected override string Header => "Song Select";
public SongSelectGraphicsOptions()
{
Header = "Song Select";
Children = new[]
{
new BasicCheckBox { LabelText = "Show thumbnails" }

View File

@ -12,10 +12,10 @@ namespace osu.Game.Overlays.Options
public class UpdateOptions : OptionsSubsection
{
private BasicStorage storage;
protected override string Header => "Updates";
public UpdateOptions()
{
Header = "Updates";
Children = new Drawable[]
{
new SpriteText { Text = "TODO: Dropdown" },

View File

@ -7,9 +7,10 @@ namespace osu.Game.Overlays.Options
{
public class VolumeOptions : OptionsSubsection
{
protected override string Header => "Volume";
public VolumeOptions()
{
Header = "Volume";
Children = new Drawable[]
{
new SpriteText { Text = "Master: TODO slider" },