Skip to content

Commit

Permalink
use PALETTE_MODE_STRING directly to set up palette combobox to avoid …
Browse files Browse the repository at this point in the history
…duplicate definitions
  • Loading branch information
bbbradsmith committed Oct 15, 2024
1 parent f399587 commit eca689a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
6 changes: 0 additions & 6 deletions BinxelviewForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions BinxelviewForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ enum PaletteMode
PALETTE_GREY,
PALETTE_CUBEHELIX,
};
static readonly string[] PaletteModeString =
static readonly string[] PALETTE_MODE_STRING =
{
"Custom",
"RGB",
Expand Down Expand Up @@ -437,9 +437,9 @@ string parseOption(string optline, string base_path, bool ini_file)
}
if (opt == "AUTOPAL")
{
for (int i=1; i<PaletteModeString.Length; ++i)
for (int i=1; i<PALETTE_MODE_STRING.Length; ++i)
{
if (valu == PaletteModeString[i].ToUpperInvariant())
if (valu == PALETTE_MODE_STRING[i].ToUpperInvariant())
{
palette_mode = (PaletteMode)i;
return "";
Expand Down Expand Up @@ -590,7 +590,7 @@ string saveIni(string path)
}
else if (palette_mode != PaletteMode.PALETTE_CUSTOM)
{
sw.WriteLine("autopal=" + PaletteModeString[(int)palette_mode]);
sw.WriteLine("autopal=" + PALETTE_MODE_STRING[(int)palette_mode]);
}
sw.WriteLine(string.Format("background={0:X6}",background_raw & 0x00FFFFFF));
sw.WriteLine(string.Format("zoom={0}",zoom));
Expand Down Expand Up @@ -2727,6 +2727,7 @@ private void BinxelviewForm_Load(object sender, EventArgs e)
split_view_form = new ViewForm(this,pixelBox.ContextMenuStrip);
posfont_regular = new Font(numericPosByte.Font, FontStyle.Regular);
posfont_bold = new Font(numericPosByte.Font, FontStyle.Bold);
comboBoxPalette.Items.AddRange(PALETTE_MODE_STRING);
comboBoxPalette.SelectedIndex = (int)PaletteMode.PALETTE_RGB - 1;
numericZoom.Minimum = 1;
numericZoom.Maximum = ZOOM_MAX;
Expand Down

0 comments on commit eca689a

Please sign in to comment.