Skip to content

Commit

Permalink
Editor: hotfix default ListBox.SelectedBackgroundColor
Browse files Browse the repository at this point in the history
After we changed to storing full RGB as color indexes, controls no longer store palette indexes in their properties in 32-bit games, but encoded R8G8B8.
Unfortunately, there's still some old logic in AGS engine, where it will consider color value 0 to be transparent.

Either we need to revise that logic, or store color properties as A8R8G8B8 with opaque alpha.
In regards to the second approach, first will need to investigate what more changes that will require, and if there are any potential problems.
But even if we do that, there's still a need to distinguish black and transparent color for GUI elements.
  • Loading branch information
ivan-mogilko committed Dec 20, 2024
1 parent 09c6ed0 commit 61d8c3e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Editor/AGS.Types/GUIListBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ public GUIListBox(int x, int y, int width, int height)
_showScrollArrows = true;
_textColor = 0;
_selectedTextColor = 7;
_selectedBackgroundColor = 16;
// FIXME: selected bg color was 16, but had to change to 17 as a temp hotfix,
// because 16 is pure black (ags color property = 0), and ListBox refuses to
// paint selection if property eq 0.
_selectedBackgroundColor = 17;
_textAlignment = HorizontalAlignment.Left;
}

Expand Down

0 comments on commit 61d8c3e

Please sign in to comment.