Skip to content

Commit

Permalink
Hostile lollipops in colorblind mode (#462)
Browse files Browse the repository at this point in the history
Hostile lollipops in colorblind mode are drawn as X shapes. This ensures easier recognition and enhances accessibility.
  • Loading branch information
AnotherCommander committed Nov 18, 2023
1 parent 2d109b1 commit f936606
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Doc/CHANGELOG.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ General:
screen to be displayed.
* Added new visual effect when cloaked.
* Added colourblind support, available in game options screen.
* In colorblind mode, scanner blips of hostile ships are now drawn as X
shapes instead of squares, to ensure easier recognition and enhance
accessibility.
* Full keyboard configuration now available in game.
* In-game handling of non-US keyboard layouts.
* Added ability to assign any key or joystick button to the "activate" or
Expand Down
18 changes: 16 additions & 2 deletions src/Core/HeadUpDisplay.m
Original file line number Diff line number Diff line change
Expand Up @@ -1186,6 +1186,8 @@ - (void) drawScanner:(NSDictionary *)info
BOOL emptyDial = ([info oo_floatForKey:ALPHA_KEY] == 0.0f);

BOOL isHostile = NO;

BOOL inColorBlindMode = [UNIVERSE colorblindMode] != OO_POSTFX_NONE;

if (emptyDial)
{
Expand Down Expand Up @@ -1449,9 +1451,21 @@ - (void) drawScanner:(NSDictionary *)info
OODrawString([(ShipEntity *)scannedEntity displayName], x1 + 2, y2 + 2, z1, NSMakeSize(8, 8));
}
#endif
OOGLBEGIN(GL_QUADS);
glColor4fv(col);
glColor4fv(col);
if (inColorBlindMode && isHostile)
{
// in colorblind mode turn hostile blips into X shapes for easier recognition
OOGLBEGIN(GL_LINES);
glVertex3f(x1+2, y2+3, z1); glVertex3f(x1-3, y2, z1); glVertex3f(x1+2, y2, z1); glVertex3f(x1-3, y2+3, z1);
OOGLEND();
}
else
{
OOGLBEGIN(GL_QUADS);
glVertex3f(x1-3, y2, z1); glVertex3f(x1+2, y2, z1); glVertex3f(x1+2, y2+3, z1); glVertex3f(x1-3, y2+3, z1);
OOGLEND();
}
OOGLBEGIN(GL_QUADS); // lollipop tail
col[3] *= 0.3333; // one third the alpha
glColor4fv(col);
glVertex3f(x1, y1, z1); glVertex3f(x1+2, y1, z1); glVertex3f(x1+2, y2, z1); glVertex3f(x1, y2, z1);
Expand Down

0 comments on commit f936606

Please sign in to comment.