Revert previous fix which didn't work and set DisplayName properly

fixup e22c2ae11
This commit is contained in:
YoshiRulz 2020-03-31 23:42:43 +10:00
parent e22c2ae115
commit 69aa909fc5
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
2 changed files with 4 additions and 7 deletions

View File

@ -53,11 +53,7 @@ namespace BizHawk.Client.EmuHawk
var buttonControl = new VirtualPadButton
{
Name = button.Name,
Text = button.Icon != null
? null
: string.IsNullOrWhiteSpace(button.DisplayName)
? button.Name
: button.DisplayName,
Text = button.Icon != null ? null : button.DisplayName,
Location = UIHelper.Scale(button.Location),
Image = button.Icon
};

View File

@ -25,7 +25,7 @@ namespace BizHawk.Client.EmuHawk
/// <summary>A single on/off button</summary>
public sealed class ButtonSchema : PadSchemaControl
{
public string? DisplayName { get; set; }
public string DisplayName { get; set; }
public Bitmap? Icon { get; set; }
@ -34,7 +34,8 @@ namespace BizHawk.Client.EmuHawk
=> DisplayName = name;
public ButtonSchema(int x, int y, int controller, string name)
: base(new Point(x, y), $"P{controller} {name}") {}
: base(new Point(x, y), $"P{controller} {name}")
=> DisplayName = name;
public static ButtonSchema Up(int x, int y, string? name = null)
=> new ButtonSchema(x, y, name ?? "Up") { Icon = Resources.BlueUp };