Skip to content

Commit

Permalink
Indicate use of automatic palette with bold Auto button.
Browse files Browse the repository at this point in the history
Only reseed random palette if Auto is clicked with random already selected.
  • Loading branch information
bbbradsmith committed Oct 15, 2024
1 parent 9c2e80c commit 9f1ac55
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 9 additions & 1 deletion BinxelviewForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ enum PaletteMode
int twiddle_cache_h = 0;
bool disable_pixel_redraw = false; // used to temporarily block redraws during repeated updates
Font posfont_regular, posfont_bold;
Font autopalfont_regular, autopalfont_bold;
Random random = new Random();
uint random_seed;
int preset_menu_fixed_items;
Expand Down Expand Up @@ -1647,6 +1648,7 @@ void redrawPalette()
buttonLoadPal.Enabled = palenable;
buttonSavePal.Enabled = palenable;
pixelsToPaletteContextItem.Enabled = palenable;
buttonAutoPal.Font = palette_mode == (PaletteMode.PALETTE_CUSTOM) ? posfont_regular : posfont_bold;

int bx = preset.bpp / 2;
int by = preset.bpp - bx;
Expand Down Expand Up @@ -2367,7 +2369,11 @@ private void bgBox_Click(object sender, EventArgs e)

private void buttonAutoPal_Click(object sender, EventArgs e)
{
randomColorSeed(); // reseed the random palette
palette_mode = (PaletteMode)(comboBoxPalette.SelectedIndex + 1);
if (palette_mode == PaletteMode.PALETTE_RANDOM)
{
randomColorSeed(); // reseed the random palette
}
comboBoxPalette_SelectedIndexChanged(sender, e);
}

Expand Down Expand Up @@ -2705,6 +2711,8 @@ 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);
autopalfont_regular = new Font(buttonAutoPal.Font, FontStyle.Regular);
autopalfont_bold = new Font(buttonAutoPal.Font, FontStyle.Bold);
comboBoxPalette.SelectedIndex = (int)PaletteMode.PALETTE_RGB - 1;
numericZoom.Minimum = 1;
numericZoom.Maximum = ZOOM_MAX;
Expand Down
4 changes: 4 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ Similarly, the VGA Palette preset may be able to find palettes in a format commo
After transferring the palette, you will need to select another preset to view other data in the file
using that palette.

If using the Random automatic palette, the "Auto" button can be used to generate a new random palette.


Other Notes
-----------
Expand Down Expand Up @@ -281,6 +283,8 @@ Changes
1.6.4.0 (unreleased beta)
- Use full color picker dialog by default.
- 16BPP palette support.
- Random palette now supported above 16BPP.
- Indicate use of automatic palette with bold Auto button.

1.6.3.0 (2024-10-14)
- Option persistence, INI file save and load.
Expand Down

0 comments on commit 9f1ac55

Please sign in to comment.