1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-10-31 19:04:44 +00:00

Minor tweaks

This commit is contained in:
Andy McFadden 2023-04-17 09:48:01 -07:00
parent ca50730611
commit 72d8498fe0
2 changed files with 6 additions and 1 deletions

View File

@ -186,7 +186,7 @@ namespace PluginCommon {
/// <remarks> /// <remarks>
/// Might want a way to specify that the background shouldn't be drawn at all. /// Might want a way to specify that the background shouldn't be drawn at all.
/// </remarks> /// </remarks>
/// <param name="vb">Bitma to draw on.</param> /// <param name="vb">Bitmap to draw on.</param>
/// <param name="ch">Character to draw.</param> /// <param name="ch">Character to draw.</param>
/// <param name="xc">X coord of upper-left pixel.</param> /// <param name="xc">X coord of upper-left pixel.</param>
/// <param name="yc">Y coord of upper-left pixel.</param> /// <param name="yc">Y coord of upper-left pixel.</param>

View File

@ -315,6 +315,11 @@ namespace SourceGen {
/// <param name="value">Setting value (integer enum index).</param> /// <param name="value">Setting value (integer enum index).</param>
public void SetEnum(string name, Type enumType, int value) { public void SetEnum(string name, Type enumType, int value) {
string newVal = Enum.GetName(enumType, value); string newVal = Enum.GetName(enumType, value);
if (newVal == null) {
// Shouldn't be possible if an enum value of the correct type is passed in.
Debug.WriteLine("Unable to get enum name type=" + enumType + " value=" + value);
return;
}
if (!mSettings.TryGetValue(name, out string oldValue) || oldValue != newVal) { if (!mSettings.TryGetValue(name, out string oldValue) || oldValue != newVal) {
mSettings[name] = newVal; mSettings[name] = newVal;
Dirty = true; Dirty = true;