fixed so that the join red and join blue buttons isn't displayed in dm

This commit is contained in:
Magnus Auvinen 2007-12-16 09:53:57 +00:00
parent 27a24b361b
commit d9ad96384b
2 changed files with 25 additions and 22 deletions

View file

@ -30,8 +30,6 @@ enum
data_container *data = 0x0;
int gametype = GAMETYPE_DM;
extern void modmenu_render();
enum
@ -61,7 +59,7 @@ static const obj_player_character *local_character = 0;
static const obj_player_character *local_prev_character = 0;
const obj_player_info *local_info = 0;
static const obj_flag *flags[2] = {0,0};
static const obj_game *gameobj = 0;
const obj_game *gameobj = 0;
static int picked_up_weapon = 0;
@ -2739,7 +2737,7 @@ void render_game()
// render goals
if(gameobj)
{
gametype = gameobj->gametype;
int gametype = gameobj->gametype;
float whole = 300*gfx_screenaspect();
float half = whole/2.0f;

View file

@ -30,6 +30,8 @@ extern data_container *data;
// abit uglyness
extern const obj_player_info *local_info;
extern const obj_game *gameobj;
extern bool menu_active;
extern bool menu_game_active;
@ -1622,7 +1624,7 @@ static void menu2_render_game(RECT main_view)
if(ui2_do_button(&disconnect_button, "Disconnect", 0, &button, ui2_draw_menu_button, 0))
client_disconnect();
if(local_info)
if(local_info && gameobj)
{
if(local_info->team != -1)
{
@ -1635,28 +1637,31 @@ static void menu2_render_game(RECT main_view)
menu_active = false;
}
}
if(local_info->team != 0)
if(gameobj->gametype != GAMETYPE_DM)
{
ui2_vsplit_l(&main_view, 10.0f, &button, &main_view);
ui2_vsplit_l(&main_view, 120.0f, &button, &main_view);
static int spectate_button = 0;
if(ui2_do_button(&spectate_button, "Join Red", 0, &button, ui2_draw_menu_button, 0))
if(local_info->team != 0)
{
config.cl_team = 0;
menu_active = false;
ui2_vsplit_l(&main_view, 10.0f, &button, &main_view);
ui2_vsplit_l(&main_view, 120.0f, &button, &main_view);
static int spectate_button = 0;
if(ui2_do_button(&spectate_button, "Join Red", 0, &button, ui2_draw_menu_button, 0))
{
config.cl_team = 0;
menu_active = false;
}
}
}
if(local_info->team != 1)
{
ui2_vsplit_l(&main_view, 10.0f, &button, &main_view);
ui2_vsplit_l(&main_view, 120.0f, &button, &main_view);
static int spectate_button = 0;
if(ui2_do_button(&spectate_button, "Join Blue", 0, &button, ui2_draw_menu_button, 0))
if(local_info->team != 1)
{
config.cl_team = 1;
menu_active = false;
ui2_vsplit_l(&main_view, 10.0f, &button, &main_view);
ui2_vsplit_l(&main_view, 120.0f, &button, &main_view);
static int spectate_button = 0;
if(ui2_do_button(&spectate_button, "Join Blue", 0, &button, ui2_draw_menu_button, 0))
{
config.cl_team = 1;
menu_active = false;
}
}
}
}