Skip to content

Commit

Permalink
-autopal fix mismatch between saved value and tested enums, use the s…
Browse files Browse the repository at this point in the history
…ame data for both (Grey != Greyscale)
  • Loading branch information
bbbradsmith committed Oct 13, 2024
1 parent fbe4305 commit 3376fa0
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions BinxelviewForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ enum PaletteMode
"Custom",
"RGB",
"Random",
"Grey",
"Greyscale",
"Cubehelix",
};

Expand Down Expand Up @@ -431,12 +431,15 @@ string parseOption(string optline, string base_path, bool ini_file)
}
if (opt == "AUTOPAL")
{
if (valu == "RGB" ) { palette_mode = PaletteMode.PALETTE_RGB; }
else if (valu == "RANDOM" ) { palette_mode = PaletteMode.PALETTE_RANDOM; }
else if (valu == "GREYSCALE") { palette_mode = PaletteMode.PALETTE_GREY; }
else if (valu == "CUBEHELIX") { palette_mode = PaletteMode.PALETTE_CUBEHELIX; }
else return "Unknown autopal value: "+val;
return "";
for (int i=1; i<PaletteModeString.Length; ++i)
{
if (valu == PaletteModeString[i].ToUpperInvariant())
{
palette_mode = (PaletteMode)i;
return "";
}
}
return "Unknown autopal value: "+val;
}
if (opt == "BACKGROUND")
{
Expand Down

0 comments on commit 3376fa0

Please sign in to comment.