From 17a58c727581e962d6c13815abebadef21cc22c0 Mon Sep 17 00:00:00 2001 From: Sveinung Kvilhaugsvik Date: Tue, 16 Feb 2021 05:48:06 +0100 Subject: [PATCH] GTK clients: improve button number macros. The non action buttons in the action selection dialog has assigned numbers so they can be looked up "by action id". Number them relative to the previous non action buttons rather than "Keep Moving" so it becomes less work to insert or to remove non action buttons. Add parentheses around the counting just in case. See osdn #41586 --- client/gui-gtk-2.0/action_dialog.c | 8 ++++---- client/gui-gtk-3.0/action_dialog.c | 10 +++++----- client/gui-gtk-3.22/action_dialog.c | 10 +++++----- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/client/gui-gtk-2.0/action_dialog.c b/client/gui-gtk-2.0/action_dialog.c index 90dca2074a..9182993101 100644 --- a/client/gui-gtk-2.0/action_dialog.c +++ b/client/gui-gtk-2.0/action_dialog.c @@ -51,10 +51,10 @@ /* Locations for non action enabler controlled buttons. */ #define BUTTON_MOVE ACTION_COUNT -#define BUTTON_LOCATION BUTTON_MOVE + 1 -#define BUTTON_WAIT BUTTON_MOVE + 2 -#define BUTTON_CANCEL BUTTON_MOVE + 3 -#define BUTTON_COUNT BUTTON_MOVE + 4 +#define BUTTON_LOCATION (BUTTON_MOVE + 1) +#define BUTTON_WAIT (BUTTON_LOCATION + 1) +#define BUTTON_CANCEL (BUTTON_WAIT + 1) +#define BUTTON_COUNT (BUTTON_CANCEL + 1) #define BUTTON_NOT_THERE -1 diff --git a/client/gui-gtk-3.0/action_dialog.c b/client/gui-gtk-3.0/action_dialog.c index c09fc3b766..380e4d24f0 100644 --- a/client/gui-gtk-3.0/action_dialog.c +++ b/client/gui-gtk-3.0/action_dialog.c @@ -52,11 +52,11 @@ /* Locations for non action enabler controlled buttons. */ #define BUTTON_MOVE ACTION_COUNT -#define BUTTON_NEW_UNIT_TGT BUTTON_MOVE + 1 -#define BUTTON_LOCATION BUTTON_MOVE + 2 -#define BUTTON_WAIT BUTTON_MOVE + 3 -#define BUTTON_CANCEL BUTTON_MOVE + 4 -#define BUTTON_COUNT BUTTON_MOVE + 5 +#define BUTTON_NEW_UNIT_TGT (BUTTON_MOVE + 1) +#define BUTTON_LOCATION (BUTTON_NEW_UNIT_TGT + 1) +#define BUTTON_WAIT (BUTTON_LOCATION + 1) +#define BUTTON_CANCEL (BUTTON_WAIT + 1) +#define BUTTON_COUNT (BUTTON_CANCEL + 1) #define BUTTON_NOT_THERE -1 diff --git a/client/gui-gtk-3.22/action_dialog.c b/client/gui-gtk-3.22/action_dialog.c index ec86f0fbc9..345c10d2a1 100644 --- a/client/gui-gtk-3.22/action_dialog.c +++ b/client/gui-gtk-3.22/action_dialog.c @@ -52,11 +52,11 @@ /* Locations for non action enabler controlled buttons. */ #define BUTTON_MOVE ACTION_COUNT -#define BUTTON_NEW_UNIT_TGT BUTTON_MOVE + 1 -#define BUTTON_LOCATION BUTTON_MOVE + 2 -#define BUTTON_WAIT BUTTON_MOVE + 3 -#define BUTTON_CANCEL BUTTON_MOVE + 4 -#define BUTTON_COUNT BUTTON_MOVE + 5 +#define BUTTON_NEW_UNIT_TGT (BUTTON_MOVE + 1) +#define BUTTON_LOCATION (BUTTON_NEW_UNIT_TGT + 1) +#define BUTTON_WAIT (BUTTON_LOCATION + 1) +#define BUTTON_CANCEL (BUTTON_WAIT + 1) +#define BUTTON_COUNT (BUTTON_CANCEL + 1) #define BUTTON_NOT_THERE -1 -- 2.20.1