More code tidying.

This commit is contained in:
Dean Herbert 2017-03-02 17:14:05 +09:00
parent c4871bbbf3
commit 68857b573d
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49
1 changed files with 14 additions and 35 deletions

View File

@ -3,9 +3,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Input;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Primitives;
@ -14,6 +11,9 @@
using osu.Framework.Input; using osu.Framework.Input;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Backgrounds; using osu.Game.Graphics.Backgrounds;
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Input;
namespace osu.Game.Overlays.Dialog namespace osu.Game.Overlays.Dialog
{ {
@ -32,46 +32,25 @@ public class PopupDialog : FocusedOverlayContainer
public FontAwesome Icon public FontAwesome Icon
{ {
get get { return iconText.Icon; }
{ set { iconText.Icon = value; }
return iconText.Icon;
}
set
{
iconText.Icon = value;
}
} }
public string HeaderText public string HeaderText
{ {
get get { return header.Text; }
{ set { header.Text = value; }
return header.Text;
}
set
{
header.Text = value;
}
} }
public string BodyText public string BodyText
{ {
get get { return body.Text; }
{ set { body.Text = value; }
return body.Text;
}
set
{
body.Text = value;
}
} }
public PopupDialogButton[] Buttons public IEnumerable<PopupDialogButton> Buttons
{ {
get get { return buttonsContainer.Children; }
{
return buttonsContainer.Children.ToArray();
}
set set
{ {
buttonsContainer.Children = value; buttonsContainer.Children = value;
@ -89,8 +68,8 @@ public PopupDialogButton[] Buttons
private void pressButtonAtIndex(int index) private void pressButtonAtIndex(int index)
{ {
if (index < Buttons.Length) if (index < Buttons.Count())
Buttons[index].TriggerClick(); Buttons.Skip(index).First().TriggerClick();
} }
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)