Multiplayer Setup Menu -- Colour bar
Moderator: InsideQC Admins
2 posts
• Page 1 of 1
Multiplayer Setup Menu -- Colour bar
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);
}
And in M_Setup_Draw change these:
- Code: Select all
M_Print (64, 80, "Shirt color");
M_Print (64, 104, "Pants color");
To these:
- 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);
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.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
-

mh - Posts: 2292
- Joined: Sat Jan 12, 2008 1:38 am
2 posts
• Page 1 of 1
Return to Programming Tutorials
Who is online
Users browsing this forum: No registered users and 1 guest
