From 8cb417bd5b661b6d26d6dfc1f4bc5d86d7f5f9ff Mon Sep 17 00:00:00 2001 From: parasti Date: Wed, 24 Jun 2009 18:25:07 +0000 Subject: [PATCH] ball/st_ball: show a name label git-svn-id: https://s.snth.net/svn/neverball/trunk@2912 78b8d119-cf0a-0410-b17c-f493084dd1d7 --- ball/st_ball.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/ball/st_ball.c b/ball/st_ball.c index e7afbe5..7c16f50 100644 --- a/ball/st_ball.c +++ b/ball/st_ball.c @@ -47,6 +47,20 @@ void free_balls(void) balls = NULL; } +static int make_ball_label(void) +{ + int id; + + if ((id = gui_label(0, base_name(ball_file, NULL), + GUI_SML, GUI_NW, gui_wht, gui_wht))) + { + gui_layout(id, 0, -1); + gui_pulse(id, 1.2f); + } + + return id; +} + static void set_curr_ball(void) { sprintf(ball_file, "%s/%s", @@ -57,6 +71,9 @@ static void set_curr_ball(void) ball_free(); ball_init(); + + gui_delete(st_ball.gui_id); + st_ball.gui_id = make_ball_label(); } static void next_ball(void) @@ -83,16 +100,18 @@ static int ball_enter(void) game_set_fly(0, game_client_file()); game_client_step(NULL); - return 0; + return make_ball_label(); } static void ball_leave(int id) { + gui_delete(id); free_balls(); } static void ball_timer(int id, float dt) { + gui_timer(id, dt); game_step_fade(dt); } -- 1.7.9.5