diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-03-23 14:23:07 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-03-23 14:23:07 +0000 |
| commit | efabdb169d3638713f622f15a447661688ace1ef (patch) | |
| tree | 08f354ccca72fa511469f1ff8583cfcc9378d9e8 /src/game/client/gc_client.cpp | |
| parent | e20e488d3d804972d777ed4cf094a54e5ebc5e7e (diff) | |
| download | zcatch-efabdb169d3638713f622f15a447661688ace1ef.tar.gz zcatch-efabdb169d3638713f622f15a447661688ace1ef.zip | |
fixed better motd
Diffstat (limited to 'src/game/client/gc_client.cpp')
| -rw-r--r-- | src/game/client/gc_client.cpp | 49 |
1 files changed, 44 insertions, 5 deletions
diff --git a/src/game/client/gc_client.cpp b/src/game/client/gc_client.cpp index eee038b9..f42aa9de 100644 --- a/src/game/client/gc_client.cpp +++ b/src/game/client/gc_client.cpp @@ -1489,11 +1489,50 @@ void render_game() gfx_text(0, 150, 50, 12, buf, -1); } - // render score board - if(scoreboard_active || // user requested - (!spectate && (!netobjects.local_character || netobjects.local_character->health < 0)) || // not spectating and is dead - (netobjects.gameobj && netobjects.gameobj->game_over) // game over - ) + + bool do_scoreboard = false; + + // if we are dead + if(!spectate && (!netobjects.local_character || netobjects.local_character->health < 0)) + do_scoreboard = true; + + // if we the game is over + if(netobjects.gameobj && netobjects.gameobj->game_over) + do_scoreboard = true; + + // showing motd, skip it + if(time_get() < server_motd_time) + do_scoreboard = false; + + // always show if we really want + if(scoreboard_active) + { + server_motd_time = 0; // disables the motd + do_scoreboard = true; + } + + // render motd + if(!do_scoreboard && time_get() < server_motd_time) + { + gfx_mapscreen(0, 0, width, height); + + float h = 800.0f; + float w = 650.0f; + float x = width/2 - w/2; + float y = 150.0f; + + gfx_blend_normal(); + gfx_texture_set(-1); + gfx_quads_begin(); + gfx_setcolor(0,0,0,0.5f); + draw_round_rect(x, y, w, h, 40.0f); + gfx_quads_end(); + + gfx_text(0, x+40.0f, y+40.0f, 32.0f, server_motd, (int)(w-80.0f)); + } + + // render scoreboard + if(do_scoreboard) { gfx_mapscreen(0, 0, width, height); |