Skip to content

Commit

Permalink
rework firmware icons
Browse files Browse the repository at this point in the history
better tooltip for deal bind
  • Loading branch information
vadosnaprimer committed Dec 15, 2024
1 parent ab5d92f commit 9e9687f
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 12 deletions.
6 changes: 6 additions & 0 deletions src/BizHawk.Client.EmuHawk/Properties/Resources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ internal static class Resources
internal static readonly Bitmap Erase = ReadEmbeddedBitmap("Erase");
internal static readonly Bitmap ESE = ReadEmbeddedBitmap("ESE");
internal static readonly Bitmap ExclamationRed = ReadEmbeddedBitmap("ExclamationRed");
internal static readonly Bitmap FFaccept = ReadEmbeddedBitmap("Farm-Fresh_accept");
internal static readonly Bitmap FFcancel = ReadEmbeddedBitmap("Farm-Fresh_cancel");
internal static readonly Bitmap FFdelete = ReadEmbeddedBitmap("Farm-Fresh_delete");
internal static readonly Bitmap FFexclamation = ReadEmbeddedBitmap("Farm-Fresh_exclamation");
internal static readonly Bitmap FFhelp = ReadEmbeddedBitmap("Farm-Fresh_help");
internal static readonly Bitmap FFstar = ReadEmbeddedBitmap("Farm-Fresh_star");
internal static readonly Bitmap FastForward = ReadEmbeddedBitmap("FastForward");
internal static readonly Bitmap Find = ReadEmbeddedBitmap("FindHS");
internal static readonly Bitmap Forward = ReadEmbeddedBitmap("Forward");
Expand Down
33 changes: 21 additions & 12 deletions src/BizHawk.Client.EmuHawk/config/FirmwareConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ public partial class FirmwareConfig : Form, IDialogParent
[FirmwareOptionStatus.Unknown] = STATUS_DESC_UNUSED,
[FirmwareOptionStatus.Unacceptable] = "NO: This doesn't work on the core",
[FirmwareOptionStatus.Acceptable] = "OK: This works on the core",
[FirmwareOptionStatus.Ideal] = "PERFECT: Ideal for TASing and anything.",
[FirmwareOptionStatus.Ideal] = "PERFECT: Ideal for TASing and anything",
};

internal static readonly IReadOnlyDictionary<FirmwareOptionStatus, Image> StatusIcons = new Dictionary<FirmwareOptionStatus, Image>
{
[FirmwareOptionStatus.Unset] = Properties.Resources.ExclamationRed,
[FirmwareOptionStatus.Bad] = Properties.Resources.ThumbsDown, // in this main view, bad dumps use this thumbs down (to differentiate from unset); in a record's info view, they use unset's red '!' (to differentiate from unacceptable)
[FirmwareOptionStatus.Unknown] = Properties.Resources.RetroQuestion,
[FirmwareOptionStatus.Unacceptable] = Properties.Resources.ThumbsDown,
[FirmwareOptionStatus.Acceptable] = Properties.Resources.GreenCheck,
[FirmwareOptionStatus.Ideal] = Properties.Resources.Freeze,
[FirmwareOptionStatus.Unset] = Properties.Resources.FFhelp,
[FirmwareOptionStatus.Bad] = Properties.Resources.FFdelete,
[FirmwareOptionStatus.Unknown] = Properties.Resources.FFexclamation,
[FirmwareOptionStatus.Unacceptable] = Properties.Resources.FFcancel,
[FirmwareOptionStatus.Acceptable] = Properties.Resources.FFaccept,
[FirmwareOptionStatus.Ideal] = Properties.Resources.FFstar,
};

private readonly IDictionary<string, string> _firmwareUserSpecifications;
Expand Down Expand Up @@ -328,10 +328,19 @@ private void DoScan()
else
{
var fo = FirmwareDatabase.FirmwareOptions.FirstOrNull(fo => fo.Hash == hash);
lvi.ImageIndex = (int) (fo?.Status ?? FirmwareOptionStatus.Unset); // null here means it's an option for a different record, so use the red '!' like unset
lvi.ToolTipText = fo?.IsAcceptableOrIdeal == true
? "Good! This file has been bound to some kind of a decent choice"
: "Bad! This file has been bound to a choice which is known to be bad (details in right-click > Info)";
lvi.ImageIndex = (int) (fo?.Status ?? FirmwareOptionStatus.Unset);
if (fo?.Status == FirmwareOptionStatus.Ideal)
{
lvi.ToolTipText = "Perfect! This file has been bound to an ideal choice";
}
else if (fo?.Status == FirmwareOptionStatus.Acceptable)
{
lvi.ToolTipText = "Good! This file has been bound to some kind of a decent choice";
}
else
{
lvi.ToolTipText = "Bad! This file has been bound to a choice which is known to be bad (details in right-click -> Info)";
}
lvi.SubItems[4].Text = ri.KnownFirmwareFile.Value.Description;
}

Expand Down Expand Up @@ -545,7 +554,7 @@ private void TsmiInfo_Click(object sender, EventArgs e)
olvi.SubItems.Add(new ListViewItem.ListViewSubItem());
olvi.SubItems.Add(new ListViewItem.ListViewSubItem());
var ff = FirmwareDatabase.FirmwareFilesByOption[o];
olvi.ImageIndex = (int) (o.Status is FirmwareOptionStatus.Bad ? FirmwareOptionStatus.Unset : o.Status); // if bad, use unset's red '!' to differentiate from unacceptable
olvi.ImageIndex = (int) o.Status;
olvi.ToolTipText = StatusDescs[o.Status];
olvi.SubItems[0].Text = ff.Size.ToString();
olvi.SubItems[0].Font = Font; // why doesn't this work?
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions src/BizHawk.Client.EmuHawk/images/Farm-Fresh_readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Free FatCow-Farm Fresh Icons
http://www.fatcow.com/free-icons

These icons are licensed under a Creative Commons Attribution 3.0 License
http://creativecommons.org/licenses/by/3.0/us/

Size and colors adjusted by feos
https://github.com/TASEmulators/BizHawk
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

1 comment on commit 9e9687f

@YoshiRulz
Copy link
Member

@YoshiRulz YoshiRulz commented on 9e9687f Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broadly an improvement, but while these new icons look fine in an image viewer, in the firmware config they're aliased and cut off (probably only under Mono) and the result is terrible. I guess the old icons just coincidentally don't suffer as much with the same algorithm.
(edit: I initially thought these were being resized, but I realised it's probably just aliasing. Which may not be fixable, but I'll look into it myself.)
comparison

Is there an extant source?

Please sign in to comment.