Multiplayer Setup Menu -- Colour bar
Posted: Tue Oct 12, 2010 1:26 am
Simple but effective, let's add a colour selection bar to the multiplayer setup menu so that you can see what options are available. Pop this somewhere in menu.c:
And in M_Setup_Draw change these:
To these:
You'll need to nudge the bigbox.lmp and menuplyr.lmp a little to the right; about 16 is enough.
Job's a good 'un.
Code: Select all
void M_DrawColorBar (int x, int y, int highlight)
{
int i;
int intense = highlight * 16 + (highlight < 8 ? 11 : 4);
// position correctly
x = x + ((vid.width - 320) >> 1);
for (i = 0; i < 14; i++)
{
// take the approximate midpoint colour (handle backward ranges)
int c = i * 16 + (i < 8 ? 8 : 7);
// braw baseline colour (offset downwards a little so that it fits correctly
Draw_Fill (x + i * 8, y + 4, 8, 8, c);
}
// draw the highlight rectangle
Draw_Fill (x - 1 + highlight * 8, y + 3, 10, 10, 15);
// redraw the highlighted color at brighter intensity
Draw_Fill (x + highlight * 8, y + 4, 8, 8, intense);
}Code: Select all
M_Print (64, 80, "Shirt color");
M_Print (64, 104, "Pants color");Code: Select all
M_Print (64, 80, "Shirt color");
M_DrawColorBar (64, 88, setup_top);
M_Print (64, 104, "Pants color");
M_DrawColorBar (64, 112, setup_bottom);Job's a good 'un.