From cb90955194d5e66bbcb0968c475270bc2097daf8 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-3.0/action_dialog.c | 12 ++++++------ client/gui-gtk-3.22/action_dialog.c | 12 ++++++------ client/gui-gtk-4.0/action_dialog.c | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/client/gui-gtk-3.0/action_dialog.c b/client/gui-gtk-3.0/action_dialog.c index 27e877f412..a1ff8f1d5a 100644 --- a/client/gui-gtk-3.0/action_dialog.c +++ b/client/gui-gtk-3.0/action_dialog.c @@ -53,12 +53,12 @@ /* Locations for non action enabler controlled buttons. */ #define BUTTON_MOVE ACTION_COUNT -#define BUTTON_NEW_UNIT_TGT BUTTON_MOVE + 1 -#define BUTTON_NEW_EXTRA_TGT BUTTON_MOVE + 2 -#define BUTTON_LOCATION BUTTON_MOVE + 3 -#define BUTTON_WAIT BUTTON_MOVE + 4 -#define BUTTON_CANCEL BUTTON_MOVE + 5 -#define BUTTON_COUNT BUTTON_MOVE + 6 +#define BUTTON_NEW_UNIT_TGT (BUTTON_MOVE + 1) +#define BUTTON_NEW_EXTRA_TGT (BUTTON_NEW_UNIT_TGT + 1) +#define BUTTON_LOCATION (BUTTON_NEW_EXTRA_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 420661a959..575cb9e603 100644 --- a/client/gui-gtk-3.22/action_dialog.c +++ b/client/gui-gtk-3.22/action_dialog.c @@ -53,12 +53,12 @@ /* Locations for non action enabler controlled buttons. */ #define BUTTON_MOVE ACTION_COUNT -#define BUTTON_NEW_UNIT_TGT BUTTON_MOVE + 1 -#define BUTTON_NEW_EXTRA_TGT BUTTON_MOVE + 2 -#define BUTTON_LOCATION BUTTON_MOVE + 3 -#define BUTTON_WAIT BUTTON_MOVE + 4 -#define BUTTON_CANCEL BUTTON_MOVE + 5 -#define BUTTON_COUNT BUTTON_MOVE + 6 +#define BUTTON_NEW_UNIT_TGT (BUTTON_MOVE + 1) +#define BUTTON_NEW_EXTRA_TGT (BUTTON_NEW_UNIT_TGT + 1) +#define BUTTON_LOCATION (BUTTON_NEW_EXTRA_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-4.0/action_dialog.c b/client/gui-gtk-4.0/action_dialog.c index 61d3196687..135270a8a8 100644 --- a/client/gui-gtk-4.0/action_dialog.c +++ b/client/gui-gtk-4.0/action_dialog.c @@ -53,12 +53,12 @@ /* Locations for non action enabler controlled buttons. */ #define BUTTON_MOVE ACTION_COUNT -#define BUTTON_NEW_UNIT_TGT BUTTON_MOVE + 1 -#define BUTTON_NEW_EXTRA_TGT BUTTON_MOVE + 2 -#define BUTTON_LOCATION BUTTON_MOVE + 3 -#define BUTTON_WAIT BUTTON_MOVE + 4 -#define BUTTON_CANCEL BUTTON_MOVE + 5 -#define BUTTON_COUNT BUTTON_MOVE + 6 +#define BUTTON_NEW_UNIT_TGT (BUTTON_MOVE + 1) +#define BUTTON_NEW_EXTRA_TGT (BUTTON_NEW_UNIT_TGT + 1) +#define BUTTON_LOCATION (BUTTON_NEW_EXTRA_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