mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Enforce readonly private members where possible.
This commit is contained in:
@ -26,13 +26,13 @@ namespace osu.Game.Screens.Menu
|
||||
/// </summary>
|
||||
public class Button : Container, IStateful<ButtonState>
|
||||
{
|
||||
private Container iconText;
|
||||
private Container box;
|
||||
private Box boxHoverLayer;
|
||||
private TextAwesome icon;
|
||||
private string internalName;
|
||||
private Action clickAction;
|
||||
private Key triggerKey;
|
||||
private readonly Container iconText;
|
||||
private readonly Container box;
|
||||
private readonly Box boxHoverLayer;
|
||||
private readonly TextAwesome icon;
|
||||
private readonly string internalName;
|
||||
private readonly Action clickAction;
|
||||
private readonly Key triggerKey;
|
||||
private SampleChannel sampleClick;
|
||||
|
||||
protected override bool InternalContains(Vector2 screenSpacePos) => box.Contains(screenSpacePos);
|
||||
|
@ -32,7 +32,7 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
private Toolbar toolbar;
|
||||
|
||||
private FlowContainerWithOrigin buttonFlow;
|
||||
private readonly FlowContainerWithOrigin buttonFlow;
|
||||
|
||||
//todo: make these non-internal somehow.
|
||||
internal const float BUTTON_AREA_HEIGHT = 100;
|
||||
@ -41,16 +41,16 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
public const int EXIT_DELAY = 3000;
|
||||
|
||||
private OsuLogo osuLogo;
|
||||
private Drawable iconFacade;
|
||||
private Container buttonArea;
|
||||
private Box buttonAreaBackground;
|
||||
private readonly OsuLogo osuLogo;
|
||||
private readonly Drawable iconFacade;
|
||||
private readonly Container buttonArea;
|
||||
private readonly Box buttonAreaBackground;
|
||||
|
||||
private Button backButton;
|
||||
private Button settingsButton;
|
||||
private readonly Button backButton;
|
||||
private readonly Button settingsButton;
|
||||
|
||||
private List<Button> buttonsTopLevel = new List<Button>();
|
||||
private List<Button> buttonsPlay = new List<Button>();
|
||||
private readonly List<Button> buttonsTopLevel = new List<Button>();
|
||||
private readonly List<Button> buttonsPlay = new List<Button>();
|
||||
|
||||
public ButtonSystem()
|
||||
{
|
||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Screens.Menu
|
||||
internal class Disclaimer : OsuScreen
|
||||
{
|
||||
private Intro intro;
|
||||
private TextAwesome icon;
|
||||
private readonly TextAwesome icon;
|
||||
private Color4 iconColour;
|
||||
|
||||
internal override bool ShowOverlays => false;
|
||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Screens.Menu
|
||||
{
|
||||
public class Intro : OsuScreen
|
||||
{
|
||||
private OsuLogo logo;
|
||||
private readonly OsuLogo logo;
|
||||
|
||||
/// <summary>
|
||||
/// Whether we have loaded the menu previously.
|
||||
|
@ -22,11 +22,11 @@ namespace osu.Game.Screens.Menu
|
||||
{
|
||||
public class MainMenu : OsuScreen
|
||||
{
|
||||
private ButtonSystem buttons;
|
||||
private readonly ButtonSystem buttons;
|
||||
|
||||
internal override bool ShowOverlays => buttons.State != MenuState.Initial;
|
||||
|
||||
private BackgroundScreen background;
|
||||
private readonly BackgroundScreen background;
|
||||
private Screen songSelect;
|
||||
|
||||
protected override BackgroundScreen CreateBackground() => background;
|
||||
|
@ -25,22 +25,22 @@ namespace osu.Game.Screens.Menu
|
||||
{
|
||||
public Color4 OsuPink = OsuColour.FromHex(@"e967a1");
|
||||
|
||||
private Sprite logo;
|
||||
private CircularContainer logoContainer;
|
||||
private Container logoBounceContainer;
|
||||
private Container logoHoverContainer;
|
||||
private readonly Sprite logo;
|
||||
private readonly CircularContainer logoContainer;
|
||||
private readonly Container logoBounceContainer;
|
||||
private readonly Container logoHoverContainer;
|
||||
|
||||
private SampleChannel sampleClick;
|
||||
|
||||
private Container colourAndTriangles;
|
||||
private readonly Container colourAndTriangles;
|
||||
|
||||
public Action Action;
|
||||
|
||||
public float SizeForFlow => logo == null ? 0 : logo.DrawSize.X * logo.Scale.X * logoBounceContainer.Scale.X * logoHoverContainer.Scale.X * 0.78f;
|
||||
|
||||
private Sprite ripple;
|
||||
private readonly Sprite ripple;
|
||||
|
||||
private Container rippleContainer;
|
||||
private readonly Container rippleContainer;
|
||||
|
||||
public bool Triangles
|
||||
{
|
||||
@ -62,7 +62,7 @@ namespace osu.Game.Screens.Menu
|
||||
}
|
||||
|
||||
public bool Interactive = true;
|
||||
private Box flashLayer;
|
||||
private readonly Box flashLayer;
|
||||
|
||||
public OsuLogo()
|
||||
{
|
||||
|
Reference in New Issue
Block a user