aboutsummaryrefslogtreecommitdiff
path: root/dat.h
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2024-11-07 21:23:15 +0000
committerrodri <rgl@antares-labs.eu>2024-11-07 21:23:15 +0000
commit1540dd58e53cbda25f8cd920e007aba3f9399da7 (patch)
tree83587482e52fe1b165808322693f95ccbc9e9702 /dat.h
parentdbf2640b573990cf3377dc65824fc6870a5ee3ff (diff)
downloadbattleship-1540dd58e53cbda25f8cd920e007aba3f9399da7.tar.gz
battleship-1540dd58e53cbda25f8cd920e007aba3f9399da7.tar.bz2
battleship-1540dd58e53cbda25f8cd920e007aba3f9399da7.zip
bts: use buttons to select the game mode (removes -a option).
now pressing q in a screen other than the main one (Waiting0) forces a reconnection, effectively resetting the game.
Diffstat (limited to 'dat.h')
-rw-r--r--dat.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/dat.h b/dat.h
index 07b7dd3..fba1c16 100644
--- a/dat.h
+++ b/dat.h
@@ -32,7 +32,12 @@ enum {
ACalibrating,
ABombing,
+ BRest = 0,
+ BHover,
+
Boardmargin = 50,
+ Btnborder = 4,
+ Btnpadding = 2,
TW = 16,
TH = TW,
MAPW = 17,
@@ -163,6 +168,16 @@ struct MatchInfo
char conclusion[16];
};
+typedef struct Button Button;
+
+struct Button
+{
+ char *label;
+ Rectangle r;
+ int status;
+ void (*handler)(Button*);
+};
+
typedef struct Mentry Mentry;
typedef struct Mlist Mlist;
typedef struct Menulist Menulist;