From 23d90877ed7a58571e8e8dfc141e467111f81fa3 Mon Sep 17 00:00:00 2001 From: Jordi Albornoz Date: Sun, 5 Jan 2003 20:15:14 +0000 Subject: [PATCH] Adapt patch from Jan Bretschneider with some UI improvements that mimic windows tetrinet's behaviour. Switch to partyline on successful connect and on game end, and to fields on game start. --- ChangeLog | 11 +++++++++++ src/gtetrinet.c | 12 ++++++++++++ src/gtetrinet.h | 2 ++ src/tetrinet.c | 6 ++++++ 4 files changed, 31 insertions(+) diff --git a/ChangeLog b/ChangeLog index f0e9be5..186fb8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2003-01-05 Jordi Mallach + + * Adapt patch from Jan Bretschneider with some UI improvements that + mimic windows tetrinet's behaviour. + * src/gtetrinet.c (show_fields_page): new function, switches to fields + notebook tab. + (show_partyline_page): new funtion, switches to partyline notebook + tab. + * src/tetrinet.c (tetrinet_inmessage): switch to partyline on + successful connect and on game end, and to fields on game start. + 2003-01-05 Jordi Mallach * src/commands.c (about_command): fix segfault when calling two about diff --git a/src/gtetrinet.c b/src/gtetrinet.c index f0343a9..1d6ac5e 100644 --- a/src/gtetrinet.c +++ b/src/gtetrinet.c @@ -489,3 +489,15 @@ void move_current_page_to_window (void) fields_gmsginput(FALSE); } + +/* show the fields notebook tab */ +void show_fields_page (void) +{ + gtk_notebook_set_page (GTK_NOTEBOOK(notebook), 0); +} + +/* show the partyline notebook tab */ +void show_partyline_page (void) +{ + gtk_notebook_set_page (GTK_NOTEBOOK(notebook), 1); +} diff --git a/src/gtetrinet.h b/src/gtetrinet.h index 05d5d45..40e75d3 100644 --- a/src/gtetrinet.h +++ b/src/gtetrinet.h @@ -11,3 +11,5 @@ extern void destroymain (GtkWidget *widget, gpointer data); extern gint keypress (GtkWidget *widget, GdkEventKey *key); extern gint keyrelease (GtkWidget *widget, GdkEventKey *key); extern void move_current_page_to_window (void); +extern void show_fields_page (void); +extern void show_partyline_page (void); diff --git a/src/tetrinet.c b/src/tetrinet.c index b341914..909bbc8 100644 --- a/src/tetrinet.c +++ b/src/tetrinet.c @@ -264,6 +264,8 @@ void tetrinet_inmessage (enum inmsg_type msgtype, char *data) partylineupdate_team (nick, team); } } + /* show partyline on successful connect */ + show_partyline_page (); break; case IN_PLAYERJOIN: { @@ -494,6 +496,8 @@ void tetrinet_inmessage (enum inmsg_type msgtype, char *data) commands_checkstate (); partyline_fmt (_("%c*** The game has %cstarted"), TETRI_TB_C_BRIGHT_RED, TETRI_TB_BOLD); + /* switch to playerfields when game starts */ + show_fields_page (); } break; case IN_INGAME: @@ -546,6 +550,8 @@ void tetrinet_inmessage (enum inmsg_type msgtype, char *data) commands_checkstate (); partyline_fmt (_("%c*** The game has %cended"), TETRI_TB_C_BRIGHT_RED, TETRI_TB_BOLD); + /* go back to partyline when game ends */ + show_partyline_page (); break; case IN_F: { -- 2.50.1