Added the color flag to the menu_label elements.

origin
stpohle 22 years ago
parent dda7bc91e4
commit 0581b18c89

@ -1,4 +1,4 @@
/* $Id: menu.h,v 1.8 2004/02/07 13:35:28 stpohle Exp $ /* $Id: menu.h,v 1.9 2004/02/07 15:03:24 stpohle Exp $
* GUI for menuhandling * GUI for menuhandling
*/ */
@ -68,8 +68,8 @@ extern void menu_new (char *title, int x, int y);
extern void menu_delete (); extern void menu_delete ();
extern void menu_create_list (char *name, int x, int y, int w, int h, _charlist *data, _charlist **selected, int id); extern void menu_create_list (char *name, int x, int y, int w, int h, _charlist *data, _charlist **selected, int id);
extern void menu_create_entry (char *name, int x, int y, int w, void *data, int len, int typ, int id); extern void menu_create_entry (char *name, int x, int y, int w, void *data, int len, int typ, int id);
extern void menu_create_label (char *name, int x, int y, int fontsize); extern void menu_create_label (char *name, int x, int y, int fontsize, int fontcolor);
extern void menu_create_text (char *name, int x, int y, int maxlen, int maxlines, char *fmt,...); extern void menu_create_text (char *name, int x, int y, int maxlen, int maxlines, int fontcolor, char *fmt,...);
extern void menu_create_button (char *name, int x, int y, int w, int id); extern void menu_create_button (char *name, int x, int y, int w, int id);
extern void menu_create_bool (char *name, int x, int y, int w, int *data, int id); extern void menu_create_bool (char *name, int x, int y, int w, int *data, int id);
extern void menu_create_image (char *name, int x, int y, int layer, SDL_Surface *img, SDL_Rect *rect); extern void menu_create_image (char *name, int x, int y, int layer, SDL_Surface *img, SDL_Rect *rect);

@ -375,9 +375,9 @@ config_video ()
while (!done && bman.state != GS_quit) { while (!done && bman.state != GS_quit) {
menu_new ("Video Setup", 325, 300); menu_new ("Video Setup", 325, 300);
menu_create_label ("Resolution", 25, 70, 0); menu_create_label ("Resolution", 25, 70, 0, COLOR_brown);
menu_create_list ("res", 155, 55, 150, 70, screenres, &selres, 1); menu_create_list ("res", 155, 55, 150, 70, screenres, &selres, 1);
menu_create_label ("Colors", 65, 160, 0); menu_create_label ("Colors", 65, 160, 0, COLOR_brown);
menu_create_list ("bpp", 195, 145, 50, 55, screenbpp, &selbpp, 2); menu_create_list ("bpp", 195, 145, 50, 55, screenbpp, &selbpp, 2);
menu_create_bool ("Fullscreen", -1, 210, 150, &gfx.fullscreen, 3); menu_create_bool ("Fullscreen", -1, 210, 150, &gfx.fullscreen, 3);
menu_create_button ("OK", -1, 250, 100, 0); menu_create_button ("OK", -1, 250, 100, 0);
@ -426,14 +426,14 @@ config_menu ()
while (menuselect != -1 && bman.state != GS_quit) { while (menuselect != -1 && bman.state != GS_quit) {
menu_new ("Configuration", 400, 300); menu_new ("Configuration", 400, 300);
menu_create_label ("General Option", -1, 50, 1); menu_create_label ("General Option", -1, 50, 1, COLOR_brown);
menu_create_entry ("Name", -1, 85, 200, bman.playername, LEN_PLAYERNAME, MENU_entrytext, 1); menu_create_entry ("Name", -1, 85, 200, bman.playername, LEN_PLAYERNAME, MENU_entrytext, 1);
menu_create_button ("Video Setup", -1, 120, 200, 2); menu_create_button ("Video Setup", -1, 120, 200, 2);
menu_create_label ("Sound", 25, 154, 0); menu_create_label ("Sound", 25, 154, 0, COLOR_brown);
menu_create_bool ("ON", 100, 150, 50, &snd.playsound, 3); menu_create_bool ("ON", 100, 150, 50, &snd.playsound, 3);
menu_create_label ("Music", 250, 154, 0); menu_create_label ("Music", 250, 154, 0, COLOR_brown);
menu_create_bool ("ON", 325, 150, 50, &snd.playmusic, 4); menu_create_bool ("ON", 325, 150, 50, &snd.playmusic, 4);
menu_create_label ("Extended Option", -1, 200, 1); menu_create_label ("Extended Option", -1, 200, 1, COLOR_brown);
menu_create_bool ("Debug", 25, 230, 150, &debug, 5); menu_create_bool ("Debug", 25, 230, 150, &debug, 5);
menu_create_bool ("Ask Playername", 250, 230, 150, &bman.askplayername, 6); menu_create_bool ("Ask Playername", 250, 230, 150, &bman.askplayername, 6);
menu_create_button ("Ok", -1, 270, 150, 0); menu_create_button ("Ok", -1, 270, 150, 0);

@ -1,11 +1,20 @@
/* $Id: help.c,v 1.2 2004/02/07 13:52:50 stpohle Exp $ /* $Id: help.c,v 1.3 2004/02/07 15:03:25 stpohle Exp $
* Display complex help text and information screen about the game * Display complex help text and information screen about the game
*/ */
#include "bomberclone.h" #include "bomberclone.h"
#include "menu.h" #include "menu.h"
#define HELP_MAXPAGES 3 enum _help_page {
HP_howto0 = 0,
HP_powerup0,
HP_powerup1,
HP_powerup2,
HP_keyboard0,
HP_credits0,
HP_max
};
void help () { void help () {
int page = 0, menuselect = 2, y = 0; int page = 0, menuselect = 2, y = 0;
@ -17,10 +26,10 @@ void help () {
gfx_load_players (gfx.block.x, gfx.block.y); gfx_load_players (gfx.block.x, gfx.block.y);
while (menuselect != -1 && menuselect != 1 && bman.state != GS_quit) { while (menuselect != -1 && menuselect != 1 && bman.state != GS_quit) {
if (page == 0) { if (page == HP_howto0) {
sprintf (title, "How To Play (%d/%d)", page + 1, HELP_MAXPAGES); sprintf (title, "How To Play (%d/%d)", page + 1, HP_max);
menu_new (title, 500, 400); menu_new (title, 500, 400);
menu_create_text ("help", -1, 55, 53, 20, menu_create_text ("help", 5, 55, 53, 20, COLOR_brown,
"The goal of the game is to be the last one, " "The goal of the game is to be the last one, "
"who is alive. You can drop bombs which will explode after " "who is alive. You can drop bombs which will explode after "
"a certain time and destroy everything in horizontal and vertical " "a certain time and destroy everything in horizontal and vertical "
@ -30,13 +39,13 @@ void help () {
"running faster than your opponent and you have many bombs, you can catch " "running faster than your opponent and you have many bombs, you can catch "
"him within lots of bombs and he has no chance to escape."); "him within lots of bombs and he has no chance to escape.");
menu_create_text ("help", -1, 255, 53, 10, menu_create_text ("help", 5, 255, 53, 10, COLOR_brown,
"You will get points for every player you have killed. " "You will get points for every player you have killed. "
"If you win the game, you can earn additional points " "If you win the game, you can earn additional points "
"depending on how many players played the game. "); "depending on how many players played the game. ");
} }
else if (page == 1) { else if (page == HP_powerup0) {
sprintf (title, "Powerups (%d/%d)", page + 1, HELP_MAXPAGES); sprintf (title, "Powerups (%d/%d)", page + 1, HP_max);
menu_new (title, 500, 400); menu_new (title, 500, 400);
y = 50; y = 50;
@ -46,81 +55,191 @@ void help () {
rect.h = gfx.block.y; rect.h = gfx.block.y;
menu_create_text ("help", -1, y, 53, 10, menu_create_text ("help", 5, y, 53, 10, COLOR_brown,
"In the game you will find some diffend kind of powerups. " "In the game you will find some diffend kind of powerups. "
"There are the powerups who give you more power for the whole game " "There are the powerups who give you more power for the whole game "
"and the special powerups which will hold only for a certain time."); "and the special powerups which will hold only for a certain time.");
y += 80; y += 75;
menu_create_label ("Permanent Powerups", -1, y, 2); menu_create_label ("Permanent Powerups", -1, y, 2, COLOR_brown);
y += (5 + font[2].size.y); y += (5 + font[2].size.y);
menu_create_image ("pwback", 5, y, 0, gfx.powerup[0].image, &rect); menu_create_image ("pwback", 5, y, 0, gfx.powerup[0].image, &rect);
menu_create_image ("bomb", 5, y, 1, gfx.field[FT_bomb].image, &rect); menu_create_image ("bomb", 5, y, 1, gfx.field[FT_bomb].image, &rect);
menu_create_text ("help", 55, y, 45, 10, menu_create_text ("help", 55, y, 45, 10, COLOR_brown,
"Give you another bomb to drop. Maximum number of bombs is %d.", MAX_BOMBS); "Give you another bomb to drop. Maximum number of bombs is %d.", MAX_BOMBS);
y += 40; y += 40;
menu_create_image ("pwback", 5, y, 0, gfx.powerup[0].image, &rect); menu_create_image ("pwback", 5, y, 0, gfx.powerup[0].image, &rect);
menu_create_image ("fire", 5, y, 1, gfx.field[FT_fire].image, &rect); menu_create_image ("fire", 5, y, 1, gfx.field[FT_fire].image, &rect);
menu_create_text ("help", 55, y, 45, 10, menu_create_text ("help", 55, y, 45, 10, COLOR_brown,
"The range of your bombs will be increased. Maximum range is %d.", MAX_RANGE); "The range of your bombs will be increased. Maximum range is %d.", MAX_RANGE);
y += 40; y += 40;
menu_create_image ("pwback", 5, y, 0, gfx.powerup[0].image, &rect); menu_create_image ("pwback", 5, y, 0, gfx.powerup[0].image, &rect);
menu_create_image ("shoe", 5, y, 1, gfx.field[FT_shoe].image, &rect); menu_create_image ("shoe", 5, y, 1, gfx.field[FT_shoe].image, &rect);
menu_create_text ("help", 55, y, 45, 10, menu_create_text ("help", 55, y, 45, 10, COLOR_brown,
"This will make your player run faster. The maximum speed will be %1.2f.", MAX_SPEED); "This will make your player run faster. The maximum speed will be %1.2f.", MAX_SPEED);
y += 40; y += 40;
menu_create_text ("help", -1, y, 53, 10, menu_create_text ("help", 5, y, 53, 10, COLOR_brown,
"Depends how the game is set up, you'll lose " "Depends how the game is set up, you'll lose "
"these powerups if you die. Other players can collect them. " "these powerups if you die. Other players can collect them. "
"In the deathmatch mode you can keep the powerups you collected, " "In the deathmatch mode you can keep the powerups you collected, "
"but this depends on the Game if you drop them or not."); "but this depends on the Game if you drop them or not.");
y += 40; y += 40;
} }
else if (page == 2) { else if (page == HP_powerup1) {
sprintf (title, "Powerups (%d/%d)", page + 1, HELP_MAXPAGES); sprintf (title, "Powerups (%d/%d)", page + 1, HP_max);
menu_new (title, 500, 400); menu_new (title, 500, 400);
y = 50; y = 45;
rect.x = rect.y = 0; rect.x = rect.y = 0;
rect.w = gfx.block.x; rect.w = gfx.block.x;
rect.h = gfx.block.y; rect.h = gfx.block.y;
menu_create_label ("Special Powerups", -1, y, 2); menu_create_label ("Special Powerups", -1, y, 2, COLOR_brown);
y += (10 + font[2].size.y); y += (5 + font[2].size.y);
menu_create_image ("pwback", 5, y, 0, gfx.powerup[2].image, &rect); menu_create_image ("pwback", 5, y, 0, gfx.powerup[2].image, &rect);
menu_create_image ("kick", 5, y, 1, gfx.field[FT_sp_kick].image, &rect); menu_create_image ("kick", 5, y, 1, gfx.field[FT_sp_kick].image, &rect);
menu_create_text ("help", 55, y, 45, 10, menu_create_text ("help", 55, y, 48, 10, COLOR_brown,
"Allowes you to kick some bombs around the level. This will hold " "Allowes you to kick some bombs around the level. This will hold "
"just a short time of %d seconds. The maximum distance you can " "just a short time of %d seconds. The maximum distance you can "
"kick the bombs is %d fields.", SPECIAL_KICK_TIME, SPECIAL_KICK_MAXDIST); "kick the bombs is %d fields.", SPECIAL_KICK_TIME, SPECIAL_KICK_MAXDIST);
y += 40; y += 70;
menu_create_image ("pwback", 5, y, 0, gfx.powerup[2].image, &rect); menu_create_image ("pwback", 5, y, 0, gfx.powerup[2].image, &rect);
menu_create_image ("push", 5, y, 1, gfx.field[FT_sp_push].image, &rect); menu_create_image ("push", 5, y, 1, gfx.field[FT_sp_push].image, &rect);
menu_create_text ("help", 55, y, 45, 10, menu_create_text ("help", 55, y, 48, 10, COLOR_brown,
"Give you another bomb to drop. Maximum number of bombs is %d.", MAX_BOMBS); "Push bombs one field, as long as nothing is behind this bomb.");
y += 40;
menu_create_image ("pwback", 5, y, 0, gfx.powerup[2].image, &rect);
menu_create_image ("droprow", 5, y, 1, gfx.field[FT_sp_row].image, &rect);
menu_create_text ("help", 55, y, 48, 10, COLOR_brown,
"You can drop a row of that many bombs you have still left to drop.");
y += 40;
menu_create_image ("pwback", 5, y, 0, gfx.powerup[2].image, &rect);
menu_create_image ("dropliquid", 5, y, 1, gfx.field[FT_sp_liquid].image, &rect);
menu_create_text ("help", 55, y, 48, 10, COLOR_brown,
"The bomb you push now won't stop moving untill they explode.");
y += 40;
menu_create_image ("pwback", 5, y, 0, gfx.powerup[2].image, &rect);
menu_create_image ("dropliquid", 5, y, 1, gfx.field[FT_sp_moved].image, &rect);
menu_create_text ("help", 55, y, 45, 10, COLOR_brown,
"The bomb you push will stop moving on the next border or bomb.");
y += 40;
menu_create_image ("pwback", 5, y, 0, gfx.powerup[2].image, &rect);
menu_create_image ("dropltrigger", 5, y, 1, gfx.field[FT_sp_trigger].image, &rect);
menu_create_text ("help", 55, y, 45, 10, COLOR_brown,
"You will be able to drop triggered bombs. Use "
"the special key to let all your bombs explode. "
"at the time where you want it.");
y += 40; y += 40;
} }
else if (page == HP_powerup2) {
sprintf (title, "Powerups (%d/%d)", page + 1, HP_max);
menu_new (title, 500, 400);
y = 50;
rect.x = rect.y = 0;
rect.w = gfx.block.x;
rect.h = gfx.block.y;
menu_create_text ("help", 5, y, 53, 10, COLOR_brown,
"In the game you will find another type of item to collect. "
"This item is not a powerup at all. If you collect it you will "
"get a random illness. This illness will hold for %dseconds. "
"If you have contact to another player the other player will "
"get all the illnesses you have too.", ILL_TIMEOUT);
y += 100;
menu_create_image ("pwback", 12, y+8, 0, gfx.powerup[1].image, &rect);
menu_create_image ("pwdeath", 12, y+8, 1, gfx.field[FT_death].image, &rect);
menu_create_text ("help", 55, y, 45, 10, COLOR_brown,
"This will make your player ill. We have at the moment %d diffrent "
"types of illnesses for you to collect. To make the game more", PI_max);
y += 3*font[0].size.y;
menu_create_text ("help", 5, y, 53, 10, COLOR_brown,
"interesting we won't put here a list of all types there are.");
}
else if (page == HP_keyboard0) {
sprintf (title, "Keyboard (%d/%d)", page + 1, HP_max);
menu_new (title, 500, 400);
y = 50;
rect.x = rect.y = 0;
rect.w = gfx.block.x;
rect.h = gfx.block.y;
menu_create_label ("During a Game", -1, y, 2, COLOR_brown);
y += font[2].size.y;
menu_create_text ("help", 5, y, 53, 10, COLOR_brown,
"Arrow Keys - Moving of the Player\n"
"STRG/CTRL - Dropping bombs\n"
"Shift - Special Use Key\n"
"F4 - Start the Game (only Server)\n"
"F8 - Fullscreen (not in Windows)\n"
"Return - Send Entered Text Message\n"
"ESC - Exit Game\n");
y += 7*font[0].size.y;
menu_create_label ("Player Selection", -1, y, 2, COLOR_brown);
y += font[2].size.y;
menu_create_text ("help", 5, y, 53, 10, COLOR_brown,
"Left/Right - Select and Deselect a Player\n"
"F1 - Mini Help Screen\n"
"F2 - Map and Game Settings\n"
"F3 - Create a AI Player\n"
"Shift-F3 - Delete a AI Player\n"
"F4 - Start the Game if at last 2 Players\n"
" are selected. (only Server)\n"
"ESC - Exit Game\n");
}
else if (page == HP_credits0) {
sprintf (title, "Credits (%d/%d)", page + 1, HP_max);
menu_new (title, 500, 400);
y = 50;
rect.x = rect.y = 0;
rect.w = gfx.block.x;
rect.h = gfx.block.y;
}
else if (page == HP_keyboard0) {
sprintf (title, "Keyboard (%d/%d)", page + 1, HP_max);
menu_new (title, 500, 400);
y = 50;
rect.x = rect.y = 0;
rect.w = gfx.block.x;
rect.h = gfx.block.y;
}
else break; else break;
if (page > 0) menu_create_button ("Previous Page", 20, 370, 150, 0); if (page > 0) menu_create_button ("Previous Page", 20, 370, 150, 0);
else if (menuselect == 0) else if (menuselect == 0)
menuselect = 2; menuselect = 2;
menu_create_button ("Main Menu", -1, 370, 150, 1); menu_create_button ("Main Menu", -1, 370, 150, 1);
if (page < HELP_MAXPAGES-1) menu_create_button ("Next Page", 350, 370, 150, 2); if (page < HP_max-1) menu_create_button ("Next Page", 350, 370, 150, 2);
menu_focus_id (menuselect); menu_focus_id (menuselect);
menuselect = menu_loop (); menuselect = menu_loop ();
if (menuselect == 0 && page > 0) if (menuselect == 0 && page > 0)
page--; page--;
if (menuselect == 2 && page < HELP_MAXPAGES - 1) if (menuselect == 2 && page < HP_max - 1)
page++; page++;
menu_delete (); menu_delete ();
} }

@ -1,4 +1,4 @@
/* $Id: mapmenu.c,v 1.21 2004/01/27 22:17:22 stpohle Exp $ */ /* $Id: mapmenu.c,v 1.22 2004/02/07 15:03:25 stpohle Exp $ */
/* map/tileset selection menu */ /* map/tileset selection menu */
#include "bomberclone.h" #include "bomberclone.h"
@ -40,7 +40,7 @@ mapmenu ()
sprintf (mname, "< undefined >"); sprintf (mname, "< undefined >");
else else
sprintf (mname, "%s", getfilename (map.map)); sprintf (mname, "%s", getfilename (map.map));
menu_create_label ("Selected Map:", 20, 160, 0); menu_create_label ("Selected Map:", 20, 160, 0, COLOR_brown);
menu_create_button (mname, 10, 180, 170, 2); menu_create_button (mname, 10, 180, 170, 2);
break; break;
case (MAPS_randmap): // Random Map case (MAPS_randmap): // Random Map
@ -63,7 +63,7 @@ mapmenu ()
sprintf (mname, "< undefined >"); sprintf (mname, "< undefined >");
else else
sprintf (mname, "%s", map.tileset); sprintf (mname, "%s", map.tileset);
menu_create_label ("Selected Tileset:", 250, 140, 0); menu_create_label ("Selected Tileset:", 250, 140, 0, COLOR_brown);
menu_create_button (mname, 250, 160, 170, 5); menu_create_button (mname, 250, 160, 170, 5);
switch (map.type) { switch (map.type) {
@ -78,9 +78,9 @@ mapmenu ()
break; break;
} }
menu_create_label ("Map Type:", 10, 50, 1); menu_create_label ("Map Type:", 10, 50, 1, COLOR_brown);
menu_create_label ("Tileset:", 250, 50, 1); menu_create_label ("Tileset:", 250, 50, 1, COLOR_brown);
menu_create_label ("Items:", 220, 200, 1); menu_create_label ("Items:", 220, 200, 1, COLOR_brown);
menu_create_list ("mt", 10, 85, 170, 60, maptypes, &selmt, 1); menu_create_list ("mt", 10, 85, 170, 60, maptypes, &selmt, 1);
menu_create_list ("ts", 250, 85, 170, 40, tiletypes, &selts, 4); menu_create_list ("ts", 250, 85, 170, 40, tiletypes, &selts, 4);
menu_create_list ("tt", 10, 220, 100, 60, tunneltypes, &seltt, 6); menu_create_list ("tt", 10, 220, 100, 60, tunneltypes, &seltt, 6);
@ -333,17 +333,17 @@ void mapgamesetting () {
while (menuselect != -1 && bman.state != GS_quit) { while (menuselect != -1 && bman.state != GS_quit) {
menu_new ("Game Options", 420, 400); menu_new ("Game Options", 420, 400);
menu_create_label ("Start Values", 25, 50, 0); menu_create_label ("Start Values", 25, 50, 0, COLOR_brown);
menu_create_entry ("Bombs:", 25, 80, 150, &bman.start_bombs, MAX_BOMBS, MENU_entryint32, 1); menu_create_entry ("Bombs:", 25, 80, 150, &bman.start_bombs, MAX_BOMBS, MENU_entryint32, 1);
menu_create_entry ("Speed:", 25,110, 150, &bman.start_speed, MAX_SPEED, MENU_entryfloat, 2); menu_create_entry ("Speed:", 25,110, 150, &bman.start_speed, MAX_SPEED, MENU_entryfloat, 2);
menu_create_entry ("Range:", 25,140, 150, &bman.start_range, MAX_RANGE, MENU_entryint32, 3); menu_create_entry ("Range:", 25,140, 150, &bman.start_range, MAX_RANGE, MENU_entryint32, 3);
menu_create_label ("Other Values", 200, 50, 0); menu_create_label ("Other Values", 200, 50, 0, COLOR_brown);
menu_create_entry ("Gametime:", 200, 80, 150, &bman.init_timeout, 1200, MENU_entryint32, 4); menu_create_entry ("Gametime:", 200, 80, 150, &bman.init_timeout, 1200, MENU_entryint32, 4);
menu_create_label ("Game Parameter", 25, 180, 1); menu_create_label ("Game Parameter", 25, 180, 1, COLOR_brown);
menu_create_entry ("Bomb Time:", 25, 220, 200, &bman.bomb_tickingtime, 1200, MENU_entryfloat, 5); menu_create_entry ("Bomb Time:", 25, 220, 200, &bman.bomb_tickingtime, 1200, MENU_entryfloat, 5);
menu_create_label ("Gametype", 25, 250, 0); menu_create_label ("Gametype", 25, 250, 0, COLOR_brown);
menu_create_list ("GameType", 25, 280, 150, 50, gametype, &gametype_sel, 6); menu_create_list ("GameType", 25, 280, 150, 50, gametype, &gametype_sel, 6);
menu_create_bool ("Drop Items", 200, 280, 150, &bman.dropitemsondeath, 7); menu_create_bool ("Drop Items", 200, 280, 150, &bman.dropitemsondeath, 7);

@ -1,4 +1,4 @@
/* $Id: menu.c,v 1.41 2004/02/07 13:35:28 stpohle Exp $ /* $Id: menu.c,v 1.42 2004/02/07 15:03:25 stpohle Exp $
* Menuhandling */ * Menuhandling */
#include "basic.h" #include "basic.h"
@ -589,7 +589,7 @@ menu_displaymessage (char *title, char *fmt,...)
menu_new (title, i , linenr * font[0].size.y + 75); menu_new (title, i , linenr * font[0].size.y + 75);
for (i = 0; (i <= linenr && i < MENU_MESSAGES_MAXLINES); i++) for (i = 0; (i <= linenr && i < MENU_MESSAGES_MAXLINES); i++)
menu_create_label (lines[i], -1, 55 + i * font[0].size.y, 0); menu_create_label (lines[i], -1, 55 + i * font[0].size.y, 0, COLOR_brown);
menu_loop (); menu_loop ();
menu_delete (); menu_delete ();
}; };
@ -673,7 +673,7 @@ menu_displaytext (char *title, char *fmt,...)
i = strlen (title) * font[2].size.x + 16; i = strlen (title) * font[2].size.x + 16;
menu_new (title, i , linenr * font[0].size.y + 75); menu_new (title, i , linenr * font[0].size.y + 75);
for (i = 0; (i <= linenr && i < MENU_MESSAGES_MAXLINES); i++) for (i = 0; (i <= linenr && i < MENU_MESSAGES_MAXLINES); i++)
menu_create_label (lines[i], -1, 55 + i * font[0].size.y, 0); menu_create_label (lines[i], -1, 55 + i * font[0].size.y, 0, COLOR_brown);
menu_looprunning = 1; menu_looprunning = 1;
menu_draw (); menu_draw ();
gfx_blitdraw (); gfx_blitdraw ();

@ -1,4 +1,4 @@
/* $Id: menulabels.c,v 1.3 2004/02/07 13:35:28 stpohle Exp $ /* $Id: menulabels.c,v 1.4 2004/02/07 15:03:25 stpohle Exp $
* Menuhandling: labels */ * Menuhandling: labels */
#include "basic.h" #include "basic.h"
@ -27,11 +27,11 @@ void menu_draw_label (_menuitem *mi) {
else else
dy = mi->pos.y; dy = mi->pos.y;
font_gfxdraw (menu.oldscreenpos.x + menu.images[0]->w + dx, menu.oldscreenpos.y + menu.images[0]->h + dy, mi->label, mi->pos.w, 5, 10000); font_gfxdraw (menu.oldscreenpos.x + menu.images[0]->w + dx, menu.oldscreenpos.y + menu.images[0]->h + dy, mi->label, mi->pos.w, mi->pos.h, 10000);
}; };
void menu_create_label (char *name, int x, int y, int fontsize) { void menu_create_label (char *name, int x, int y, int fontsize, int fontcolor) {
int i = menu_getlastitem(menu.items); int i = menu_getlastitem(menu.items);
if (i == -1) { /* first entry in the itemslist */ if (i == -1) { /* first entry in the itemslist */
@ -50,13 +50,14 @@ void menu_create_label (char *name, int x, int y, int fontsize) {
menuitems[i].pos.x = x; menuitems[i].pos.x = x;
menuitems[i].pos.y = y; menuitems[i].pos.y = y;
menuitems[i].pos.w = fontsize; menuitems[i].pos.w = fontsize;
menuitems[i].pos.h = fontcolor;
menuitems[i].type = MENU_label; menuitems[i].type = MENU_label;
strncpy (menuitems[i].label, name, MENU_TITLELEN); strncpy (menuitems[i].label, name, MENU_TITLELEN);
}; };
/* this will wrap a text into more labels */ /* this will wrap a text into more labels */
void menu_create_text (char *name, int x, int y, int maxlen, int maxlines, char *fmt,...) { void menu_create_text (char *name, int x, int y, int maxlen, int maxlines, int fontcolor, char *fmt,...) {
char text[1024]; char text[1024];
char out[1024]; char out[1024];
char *lineptr[maxlines+1]; char *lineptr[maxlines+1];
@ -72,5 +73,5 @@ void menu_create_text (char *name, int x, int y, int maxlen, int maxlines, char
menu_formattext (text, out, lineptr, &linecnt, &maxchar, maxlen, maxlines); menu_formattext (text, out, lineptr, &linecnt, &maxchar, maxlen, maxlines);
for (i = 0; (i <= linecnt && i < maxlines); i++) for (i = 0; (i <= linecnt && i < maxlines); i++)
menu_create_label (lineptr[i], x, y + i * font[0].size.y, 0); menu_create_label (lineptr[i], x, y + i * font[0].size.y, 0, fontcolor);
}; };

@ -61,7 +61,7 @@ network_options ()
/* fill in net_ai_typ */ /* fill in net_ai_typ */
net_ai_typ = (PF_INET != bman.net_ai_family); net_ai_typ = (PF_INET != bman.net_ai_family);
menu_new ("Network Options", 400, 380); menu_new ("Network Options", 400, 380);
menu_create_label ("Number Of Players", 60, 75, 0); menu_create_label ("Number Of Players", 60, 75, 0, COLOR_brown);
menu_create_list ("Players", 270, 55, 55, 70, nrplayerlist, &selnrplayer, 1); menu_create_list ("Players", 270, 55, 55, 70, nrplayerlist, &selnrplayer, 1);
menu_create_entry ("Gamename", -1, 150, 300, &bman.gamename, LEN_GAMENAME, MENU_entrytext, 2); menu_create_entry ("Gamename", -1, 150, 300, &bman.gamename, LEN_GAMENAME, MENU_entrytext, 2);
menu_create_entry ("UDP Port:", -1, 180, 200, &bman.port, LEN_PORT, MENU_entrytext,3); menu_create_entry ("UDP Port:", -1, 180, 200, &bman.port, LEN_PORT, MENU_entrytext,3);
@ -253,20 +253,20 @@ join_multiplayer_game ()
/* Network Help Screen */ /* Network Help Screen */
void network_helpscreen () { void network_helpscreen () {
menu_new ("Network Help Screen", 400, 380); menu_new ("Network Help Screen", 400, 380);
menu_create_label ("F1", 60, 50, 1); menu_create_label ("F1", 60, 50, 1, COLOR_brown);
menu_create_label ("Display this Helpscreen", 180, 54, 0); menu_create_label ("Display this Helpscreen", 180, 54, 0, COLOR_brown);
menu_create_label ("F2", 60, 80, 1); menu_create_label ("F2", 60, 80, 1, COLOR_brown);
menu_create_label ("Change/Show Mapsettings", 180, 84, 0); menu_create_label ("Change/Show Mapsettings", 180, 84, 0, COLOR_brown);
menu_create_label ("F3", 60, 110, 1); menu_create_label ("F3", 60, 110, 1, COLOR_brown);
menu_create_label ("Add one AI Player", 180, 114, 0); menu_create_label ("Add one AI Player", 180, 114, 0, COLOR_brown);
menu_create_label ("Shift-F3", 10, 140, 1); menu_create_label ("Shift-F3", 10, 140, 1, COLOR_brown);
menu_create_label ("Delete one AI P.", 180, 144, 0); menu_create_label ("Delete one AI P.", 180, 144, 0, COLOR_brown);
menu_create_label ("F4", 60, 170, 1); menu_create_label ("F4", 60, 170, 1, COLOR_brown);
menu_create_label ("Start the Game", 180, 174, 0); menu_create_label ("Start the Game", 180, 174, 0, COLOR_brown);
menu_loop (); menu_loop ();
menu_delete (); menu_delete ();

@ -1,4 +1,4 @@
/* $Id: single.c,v 1.59 2004/02/07 11:47:11 stpohle Exp $ */ /* $Id: single.c,v 1.60 2004/02/07 15:03:25 stpohle Exp $ */
/* single player */ /* single player */
#include "basic.h" #include "basic.h"
@ -736,7 +736,7 @@ single_menu ()
while (!done && bman.state != GS_quit) { while (!done && bman.state != GS_quit) {
menu_new ("Single Player", 300, 250); menu_new ("Single Player", 300, 250);
menu_create_label ("Number Of AI Players", -1, 55, 0); menu_create_label ("Number Of AI Players", -1, 55, 0, COLOR_brown);
menu_create_list ("Players", -1, 80, 70, 70, nrplayerlist, &selnrplayer, 1); menu_create_list ("Players", -1, 80, 70, 70, nrplayerlist, &selnrplayer, 1);
menu_create_button ("Map Setting", -1, 180, 150, 2); menu_create_button ("Map Setting", -1, 180, 150, 2);
menu_create_button ("OK", -1, 220, 150, 0); menu_create_button ("OK", -1, 220, 150, 0);

Loading…
Cancel
Save