Author: cazfi
Date: Tue Mar  3 18:56:36 2015
New Revision: 28382

URL: http://svn.gna.org/viewcvs/freeciv?rev=28382&view=rev
Log:
Made "Cancel Treaty" and "Withdraw Vision" buttons insensitive between team 
members.

Reported by pepeto <pepeto>

See bug #22993

Modified:
    trunk/client/gui-gtk-2.0/plrdlg.c
    trunk/client/gui-gtk-3.0/plrdlg.c
    trunk/client/gui-qt/plrdlg.cpp
    trunk/client/gui-sdl/diplodlg.c
    trunk/client/gui-sdl2/diplodlg.c

Modified: trunk/client/gui-gtk-2.0/plrdlg.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-2.0/plrdlg.c?rev=28382&r1=28381&r2=28382&view=diff
==============================================================================
--- trunk/client/gui-gtk-2.0/plrdlg.c   (original)
+++ trunk/client/gui-gtk-2.0/plrdlg.c   Tue Mar  3 18:56:36 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: trunk/client/gui-gtk-3.0/plrdlg.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.0/plrdlg.c?rev=28382&r1=28381&r2=28382&view=diff
==============================================================================
--- trunk/client/gui-gtk-3.0/plrdlg.c   (original)
+++ trunk/client/gui-gtk-3.0/plrdlg.c   Tue Mar  3 18:56:36 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: trunk/client/gui-qt/plrdlg.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/plrdlg.cpp?rev=28382&r1=28381&r2=28382&view=diff
==============================================================================
--- trunk/client/gui-qt/plrdlg.cpp      (original)
+++ trunk/client/gui-qt/plrdlg.cpp      Tue Mar  3 18:56:36 2015
@@ -660,11 +660,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: trunk/client/gui-sdl/diplodlg.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-sdl/diplodlg.c?rev=28382&r1=28381&r2=28382&view=diff
==============================================================================
--- trunk/client/gui-sdl/diplodlg.c     (original)
+++ trunk/client/gui-sdl/diplodlg.c     Tue Mar  3 18:56:36 2015
@@ -1534,7 +1534,9 @@
     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 {

Modified: trunk/client/gui-sdl2/diplodlg.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-sdl2/diplodlg.c?rev=28382&r1=28381&r2=28382&view=diff
==============================================================================
--- trunk/client/gui-sdl2/diplodlg.c    (original)
+++ trunk/client/gui-sdl2/diplodlg.c    Tue Mar  3 18:56:36 2015
@@ -1542,7 +1542,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

Reply via email to