Author: cazfi Date: Tue Mar 24 05:10:01 2015 New Revision: 28607 URL: http://svn.gna.org/viewcvs/freeciv?rev=28607&view=rev Log: Made "Cancel Treaty" and "Withdraw Vision" buttons insensitive between team members.
Reported by pepeto See bug #22993 Modified: branches/S2_5/client/gui-gtk-2.0/plrdlg.c branches/S2_5/client/gui-gtk-3.0/plrdlg.c branches/S2_5/client/gui-qt/plrdlg.cpp branches/S2_5/client/gui-sdl/diplodlg.c Modified: branches/S2_5/client/gui-gtk-2.0/plrdlg.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/gui-gtk-2.0/plrdlg.c?rev=28607&r1=28606&r2=28607&view=diff ============================================================================== --- branches/S2_5/client/gui-gtk-2.0/plrdlg.c (original) +++ branches/S2_5/client/gui-gtk-2.0/plrdlg.c Tue Mar 24 05:10:01 2015 @@ -159,7 +159,8 @@ default: gtk_widget_set_sensitive(players_war_command, can_client_issue_orders() - && player_by_number(plrno) != client.conn.playing); + && !players_on_same_team(player_by_number(plrno), + client.conn.playing)); } } else { gtk_widget_set_sensitive(players_war_command, FALSE); @@ -167,7 +168,8 @@ gtk_widget_set_sensitive(players_vision_command, can_client_issue_orders() - && gives_shared_vision(client.conn.playing, plr)); + && gives_shared_vision(client.conn.playing, plr) + && !players_on_same_team(client.conn.playing, plr)); gtk_widget_set_sensitive(players_meet_command, can_meet_with_player(plr)); gtk_widget_set_sensitive(players_int_command, can_intel_with_player(plr)); Modified: branches/S2_5/client/gui-gtk-3.0/plrdlg.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/gui-gtk-3.0/plrdlg.c?rev=28607&r1=28606&r2=28607&view=diff ============================================================================== --- branches/S2_5/client/gui-gtk-3.0/plrdlg.c (original) +++ branches/S2_5/client/gui-gtk-3.0/plrdlg.c Tue Mar 24 05:10:01 2015 @@ -166,7 +166,8 @@ default: gtk_widget_set_sensitive(players_war_command, can_client_issue_orders() - && player_by_number(plrno) != client.conn.playing); + && !players_on_same_team(player_by_number(plrno), + client.conn.playing)); } } else { gtk_widget_set_sensitive(players_war_command, FALSE); @@ -174,7 +175,8 @@ gtk_widget_set_sensitive(players_vision_command, can_client_issue_orders() - && gives_shared_vision(client.conn.playing, plr)); + && gives_shared_vision(client.conn.playing, plr) + && !players_on_same_team(client.conn.playing, plr)); gtk_widget_set_sensitive(players_meet_command, can_meet_with_player(plr)); gtk_widget_set_sensitive(players_int_command, can_intel_with_player(plr)); Modified: branches/S2_5/client/gui-qt/plrdlg.cpp URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/gui-qt/plrdlg.cpp?rev=28607&r1=28606&r2=28607&view=diff ============================================================================== --- branches/S2_5/client/gui-qt/plrdlg.cpp (original) +++ branches/S2_5/client/gui-qt/plrdlg.cpp Tue Mar 24 05:10:01 2015 @@ -652,11 +652,13 @@ if (NULL != client.conn.playing && other_player != client.conn.playing) { ds = player_diplstate_get(client_player(), other_player); - if (ds->type != DS_WAR && ds->type != DS_NO_CONTACT) { - cancel_but->setEnabled(true); - } - } - if (gives_shared_vision(client_player(), other_player)) { + if (ds->type != DS_WAR && ds->type != DS_NO_CONTACT + && !players_on_same_team(client_player(), other_player)) { + cancel_but->setEnabled(true); + } + } + if (gives_shared_vision(client_player(), other_player) + && !players_on_same_team(client_player(), other_player)) { withdraw_but->setEnabled(true); } if (can_meet_with_player(other_player) == true) { Modified: branches/S2_5/client/gui-sdl/diplodlg.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/gui-sdl/diplodlg.c?rev=28607&r1=28606&r2=28607&view=diff ============================================================================== --- branches/S2_5/client/gui-sdl/diplodlg.c (original) +++ branches/S2_5/client/gui-sdl/diplodlg.c Tue Mar 24 05:10:01 2015 @@ -1526,7 +1526,8 @@ area.w = MAX(area.w , pText->w); area.h += pText->h + adj_size(15); - if (type != DS_WAR && can_client_issue_orders()) { + if (type != DS_WAR && can_client_issue_orders() + && !players_on_same_team(client.conn.playing, pPlayer)) { if (type == DS_ARMISTICE) { fc_snprintf(cBuf, sizeof(cBuf), _("Declare WAR")); } else { _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits