tClients no longer (incorrectly) display a "Deal" option when fighting the cops… | |
git clone git://src.adamsgaard.dk/vaccinewars | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 3d4bebd47358b56dfb6bf56587fb89a7195c4a74 | |
parent 465a428ba85ded0d990b43f54e12df35c4e44971 | |
Author: Ben Webb <[email protected]> | |
Date: Mon, 8 Jan 2001 00:34:39 +0000 | |
Clients no longer (incorrectly) display a "Deal" option when fighting the cops | |
Diffstat: | |
M src/curses_client.c | 5 +++-- | |
M src/gtk_client.c | 9 +++++++-- | |
2 files changed, 10 insertions(+), 4 deletions(-) | |
--- | |
diff --git a/src/curses_client.c b/src/curses_client.c | |
t@@ -1501,8 +1501,9 @@ static void Curses_DoGame(Player *Play) { | |
} | |
} | |
if (FightPoint!=F_LASTLEAVE) g_string_append(text,_("R>un, ")); | |
- dpg_string_sprintfa(text,_("D>eal %tde"),Names.Drugs); | |
- g_string_append(text,_(", or Q>uit? ")); | |
+ if (!RunHere || FightPoint==F_LASTLEAVE) | |
+ dpg_string_sprintfa(text,_("D>eal %tde, "),Names.Drugs); | |
+ g_string_append(text,_("or Q>uit? ")); | |
mvaddstr(22,40-strlen(text->str)/2,text->str); | |
attrset(TextAttr); | |
curs_set(1); | |
diff --git a/src/gtk_client.c b/src/gtk_client.c | |
t@@ -609,9 +609,11 @@ static void CreateFightDialog() { | |
gtk_widget_show(hsep); | |
hbbox=gtk_hbutton_box_new(); | |
+ | |
buf=dpg_strdup_printf(_("_Deal %Tde"),Names.Drugs); | |
button=AddFightButton(buf,accel_group,GTK_BOX(hbbox),'D'); | |
- gtk_widget_show(button); g_free(buf); | |
+ gtk_object_set_data(GTK_OBJECT(dialog),"deal",button); | |
+ g_free(buf); | |
button=AddFightButton(_("_Fight"),accel_group,GTK_BOX(hbbox),'F'); | |
gtk_object_set_data(GTK_OBJECT(dialog),"fight",button); | |
t@@ -633,7 +635,7 @@ static void CreateFightDialog() { | |
void DisplayFightMessage(char *Data) { | |
Player *Play; | |
gint EditPos; | |
- GtkWidget *Fight,*Stand,*Run,*Text; | |
+ GtkWidget *Deal,*Fight,*Stand,*Run,*Text; | |
char cr[] = "\n"; | |
gchar *AttackName,*DefendName,FightPoint,*Message; | |
int DefendHealth,DefendBitches,BitchesKilled,ArmPercent; | |
t@@ -652,6 +654,7 @@ void DisplayFightMessage(char *Data) { | |
} | |
if (!FightDialog) return; | |
+ Deal=GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(FightDialog),"deal")); | |
Fight=GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(FightDialog),"fight")); | |
Stand=GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(FightDialog),"stand")); | |
Run=GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(FightDialog),"run")); | |
t@@ -680,6 +683,8 @@ void DisplayFightMessage(char *Data) { | |
gtk_editable_insert_text(GTK_EDITABLE(Text),cr,strlen(cr),&EditPos); | |
} | |
+ if (!CanRunHere || FightPoint==F_LASTLEAVE) | |
+ gtk_widget_show(Deal); else gtk_widget_hide(Deal); | |
if (CanFire && TotalGunsCarried(Play)>0) | |
gtk_widget_show(Fight); else gtk_widget_hide(Fight); | |
if (CanFire && TotalGunsCarried(Play)==0) |