From 9b15e83df67bc4019fa83477c7caf178d6424247 Mon Sep 17 00:00:00 2001 From: Steve Date: Tue, 7 Jun 2016 09:34:22 +0100 Subject: [PATCH] Allow viewing of credits from title screen. --- data/widgets/title.json | 20 +++++++++++++++----- src/game/title.c | 7 +++++++ src/game/title.h | 1 + 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/data/widgets/title.json b/data/widgets/title.json index 0fb2002..48d9b75 100644 --- a/data/widgets/title.json +++ b/data/widgets/title.json @@ -15,7 +15,7 @@ "type" : "WT_BUTTON", "text" : "Challenges", "x" : -1, - "y" : 290, + "y" : 280, "w" : 200, "h": 34 }, @@ -25,7 +25,7 @@ "type" : "WT_BUTTON", "text" : "Trophies", "x" : -1, - "y" : 380, + "y" : 360, "w" : 200, "h": 34 }, @@ -35,7 +35,7 @@ "type" : "WT_BUTTON", "text" : "Stats", "x" : -1, - "y" : 470, + "y" : 440, "w" : 200, "h": 34 }, @@ -45,7 +45,17 @@ "type" : "WT_BUTTON", "text" : "Options", "x" : -1, - "y" : 560, + "y" : 520, + "w" : 200, + "h": 34 + }, + { + "name" : "credits", + "group" : "title", + "type" : "WT_BUTTON", + "text" : "Credits", + "x" : -1, + "y" : 600, "w" : 200, "h": 34 }, @@ -55,7 +65,7 @@ "type" : "WT_BUTTON", "text" : "Quit", "x" : -1, - "y" : 650, + "y" : 680, "w" : 200, "h": 34 } diff --git a/src/game/title.c b/src/game/title.c index f7e19c6..66fdf9a 100644 --- a/src/game/title.c +++ b/src/game/title.c @@ -32,6 +32,7 @@ static void trophies(void); static void stats(void); static void ok(void); static void options(void); +static void credits(void); static void quit(void); static void returnFromOptions(void); @@ -82,6 +83,7 @@ void initTitle(void) getWidget("trophies", "title")->action = trophies; getWidget("stats", "title")->action = stats; getWidget("options", "title")->action = options; + getWidget("credits", "title")->action = credits; getWidget("quit", "title")->action = quit; getWidget("ok", "stats")->action = ok; @@ -278,6 +280,11 @@ static void returnFromOptions(void) show = SHOW_TITLE; } +static void credits(void) +{ + initCredits(); +} + static void quit(void) { exit(0); diff --git a/src/game/title.h b/src/game/title.h index 35ed3d2..8d21d4e 100644 --- a/src/game/title.h +++ b/src/game/title.h @@ -59,6 +59,7 @@ extern void updateAllMissions(void); extern void clearInput(void); extern void initTrophiesDisplay(void); extern void drawTrophies(void); +extern void initCredits(void); extern App app; extern Battle battle;