Integrate fighter DB into challenges and galactic map.

This commit is contained in:
Steve 2017-08-12 08:33:06 +01:00
parent f49c77f193
commit a4f9fa8be4
7 changed files with 87 additions and 19 deletions

View File

@ -15,7 +15,17 @@
"type" : "WT_BUTTON", "type" : "WT_BUTTON",
"text" : "Stats", "text" : "Stats",
"x" : -1, "x" : -1,
"y" : 270, "y" : 250,
"w" : 200,
"h": 34
},
{
"name" : "fighterDB",
"group" : "challengesMenu",
"type" : "WT_BUTTON",
"text" : "Fighter Database",
"x" : -1,
"y" : 330,
"w" : 200, "w" : 200,
"h": 34 "h": 34
}, },
@ -25,7 +35,7 @@
"type" : "WT_BUTTON", "type" : "WT_BUTTON",
"text" : "Trophies", "text" : "Trophies",
"x" : -1, "x" : -1,
"y" : 370, "y" : 410,
"w" : 200, "w" : 200,
"h": 34 "h": 34
}, },
@ -35,7 +45,7 @@
"type" : "WT_BUTTON", "type" : "WT_BUTTON",
"text" : "Options", "text" : "Options",
"x" : -1, "x" : -1,
"y" : 470, "y" : 490,
"w" : 200, "w" : 200,
"h": 34 "h": 34
}, },

View File

@ -15,7 +15,17 @@
"type" : "WT_BUTTON", "type" : "WT_BUTTON",
"text" : "Stats", "text" : "Stats",
"x" : -1, "x" : -1,
"y" : 270, "y" : 250,
"w" : 200,
"h": 34
},
{
"name" : "fighterDB",
"group" : "galacticMap",
"type" : "WT_BUTTON",
"text" : "Fighter Database",
"x" : -1,
"y" : 330,
"w" : 200, "w" : 200,
"h": 34 "h": 34
}, },
@ -25,7 +35,7 @@
"type" : "WT_BUTTON", "type" : "WT_BUTTON",
"text" : "Trophies", "text" : "Trophies",
"x" : -1, "x" : -1,
"y" : 370, "y" : 410,
"w" : 200, "w" : 200,
"h": 34 "h": 34
}, },
@ -35,7 +45,7 @@
"type" : "WT_BUTTON", "type" : "WT_BUTTON",
"text" : "Options", "text" : "Options",
"x" : -1, "x" : -1,
"y" : 470, "y" : 490,
"w" : 200, "w" : 200,
"h": 34 "h": 34
}, },

View File

@ -15,7 +15,7 @@
"type" : "WT_BUTTON", "type" : "WT_BUTTON",
"text" : "Challenges", "text" : "Challenges",
"x" : -1, "x" : -1,
"y" : 260, "y" : 265,
"w" : 200, "w" : 200,
"h": 34 "h": 34
}, },
@ -25,7 +25,7 @@
"type" : "WT_BUTTON", "type" : "WT_BUTTON",
"text" : "Trophies", "text" : "Trophies",
"x" : -1, "x" : -1,
"y" : 320, "y" : 330,
"w" : 200, "w" : 200,
"h": 34 "h": 34
}, },
@ -35,7 +35,7 @@
"type" : "WT_BUTTON", "type" : "WT_BUTTON",
"text" : "Stats", "text" : "Stats",
"x" : -1, "x" : -1,
"y" : 380, "y" : 395,
"w" : 200, "w" : 200,
"h": 34 "h": 34
}, },
@ -45,7 +45,7 @@
"type" : "WT_BUTTON", "type" : "WT_BUTTON",
"text" : "Fighter Database", "text" : "Fighter Database",
"x" : -1, "x" : -1,
"y" : 440, "y" : 460,
"w" : 200, "w" : 200,
"h": 34 "h": 34
}, },
@ -55,7 +55,7 @@
"type" : "WT_BUTTON", "type" : "WT_BUTTON",
"text" : "Options", "text" : "Options",
"x" : -1, "x" : -1,
"y" : 500, "y" : 525,
"w" : 200, "w" : 200,
"h": 34 "h": 34
}, },
@ -65,7 +65,7 @@
"type" : "WT_BUTTON", "type" : "WT_BUTTON",
"text" : "Credits", "text" : "Credits",
"x" : -1, "x" : -1,
"y" : 560, "y" : 590,
"w" : 200, "w" : 200,
"h": 34 "h": 34
}, },
@ -75,7 +75,7 @@
"type" : "WT_BUTTON", "type" : "WT_BUTTON",
"text" : "Quit", "text" : "Quit",
"x" : -1, "x" : -1,
"y" : 620, "y" : 655,
"w" : 200, "w" : 200,
"h": 34 "h": 34
} }

View File

@ -39,6 +39,7 @@ static void updateChallengeMissionData(void);
static char *listRestrictions(void); static char *listRestrictions(void);
static void prevPage(void); static void prevPage(void);
static void nextPage(void); static void nextPage(void);
static void fighterDatabase(void);
static SDL_Texture *background; static SDL_Texture *background;
static SDL_Texture *planetTexture; static SDL_Texture *planetTexture;
@ -122,11 +123,13 @@ void initChallengeHome(void)
getWidget("resume", "challengesMenu")->action = resume; getWidget("resume", "challengesMenu")->action = resume;
getWidget("stats", "challengesMenu")->action = stats; getWidget("stats", "challengesMenu")->action = stats;
getWidget("trophies", "challengesMenu")->action = trophies; getWidget("trophies", "challengesMenu")->action = trophies;
getWidget("fighterDB", "challengesMenu")->action = fighterDatabase;
getWidget("options", "challengesMenu")->action = options; getWidget("options", "challengesMenu")->action = options;
getWidget("quit", "challengesMenu")->action = quit; getWidget("quit", "challengesMenu")->action = quit;
getWidget("ok", "stats")->action = ok; getWidget("ok", "stats")->action = ok;
getWidget("ok", "trophies")->action = ok; getWidget("ok", "trophies")->action = ok;
getWidget("ok", "fighterDB")->action = ok;
prev = getWidget("prev", "challenges"); prev = getWidget("prev", "challenges");
prev->action = prevPage; prev->action = prevPage;
@ -221,6 +224,11 @@ static void logic(void)
doWidgets(); doWidgets();
if (show == SHOW_FIGHTER_DB)
{
doFighterDatabase();
}
app.doTrophyAlerts = 1; app.doTrophyAlerts = 1;
} }
@ -327,6 +335,10 @@ static void draw(void)
case SHOW_OPTIONS: case SHOW_OPTIONS:
drawOptions(); drawOptions();
break; break;
case SHOW_FIGHTER_DB:
drawFighterDatabase();
break;
} }
} }
@ -470,6 +482,13 @@ static void stats(void)
initStatsDisplay(); initStatsDisplay();
} }
static void fighterDatabase(void)
{
show = SHOW_FIGHTER_DB;
initFighterDatabaseDisplay();
}
static void trophies(void) static void trophies(void)
{ {
selectWidget("ok", "trophies"); selectWidget("ok", "trophies");
@ -517,6 +536,7 @@ static void handleKeyboard(void)
case SHOW_OPTIONS: case SHOW_OPTIONS:
case SHOW_STATS: case SHOW_STATS:
case SHOW_TROPHIES: case SHOW_TROPHIES:
case SHOW_FIGHTER_DB:
show = SHOW_MENU; show = SHOW_MENU;
selectWidget("resume", "challengesMenu"); selectWidget("resume", "challengesMenu");
break; break;

View File

@ -20,13 +20,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../common.h" #include "../common.h"
#define CHALLENGES_PER_PAGE 14 #define CHALLENGES_PER_PAGE 14
#define SHOW_CHALLENGES 0 #define SHOW_CHALLENGES 0
#define SHOW_MENU 1 #define SHOW_MENU 1
#define SHOW_OPTIONS 2 #define SHOW_OPTIONS 2
#define SHOW_STATS 3 #define SHOW_STATS 3
#define SHOW_TROPHIES 4 #define SHOW_TROPHIES 4
#define SHOW_FIGHTER_DB 5
extern void startSectionTransition(void); extern void startSectionTransition(void);
extern void endSectionTransition(void); extern void endSectionTransition(void);
@ -64,6 +65,9 @@ extern void awardStatsTrophies(void);
extern void awardChallengeTrophies(void); extern void awardChallengeTrophies(void);
extern void initTrophiesDisplay(void); extern void initTrophiesDisplay(void);
extern void drawTrophies(void); extern void drawTrophies(void);
extern void doFighterDatabase(void);
extern void initFighterDatabaseDisplay(void);
extern void drawFighterDatabase(void);
extern App app; extern App app;
extern Battle battle; extern Battle battle;

View File

@ -50,6 +50,7 @@ static void fallenOK(void);
static void updateCampaignProgress(void); static void updateCampaignProgress(void);
static void campaignCompleteOK(void); static void campaignCompleteOK(void);
static Mission *nextAvailableMission(StarSystem *starSystem); static Mission *nextAvailableMission(StarSystem *starSystem);
static void fighterDatabase(void);
static StarSystem *selectedStarSystem; static StarSystem *selectedStarSystem;
static SDL_Texture *background; static SDL_Texture *background;
@ -134,11 +135,13 @@ void initGalacticMap(void)
getWidget("resume", "galacticMap")->action = resume; getWidget("resume", "galacticMap")->action = resume;
getWidget("stats", "galacticMap")->action = stats; getWidget("stats", "galacticMap")->action = stats;
getWidget("trophies", "galacticMap")->action = trophies; getWidget("trophies", "galacticMap")->action = trophies;
getWidget("fighterDB", "galacticMap")->action = fighterDatabase;
getWidget("options", "galacticMap")->action = options; getWidget("options", "galacticMap")->action = options;
getWidget("quit", "galacticMap")->action = quit; getWidget("quit", "galacticMap")->action = quit;
getWidget("ok", "stats")->action = ok; getWidget("ok", "stats")->action = ok;
getWidget("ok", "trophies")->action = ok; getWidget("ok", "trophies")->action = ok;
getWidget("ok", "fighterDB")->action = ok;
getWidget("ok", "fallen")->action = fallenOK; getWidget("ok", "fallen")->action = fallenOK;
@ -225,6 +228,11 @@ static void logic(void)
doWidgets(); doWidgets();
if (show == SHOW_FIGHTER_DB)
{
doFighterDatabase();
}
app.doTrophyAlerts = 1; app.doTrophyAlerts = 1;
} }
@ -442,6 +450,10 @@ static void draw(void)
case SHOW_OPTIONS: case SHOW_OPTIONS:
drawOptions(); drawOptions();
break; break;
case SHOW_FIGHTER_DB:
drawFighterDatabase();
break;
} }
} }
@ -739,6 +751,7 @@ static void handleKeyboard(void)
case SHOW_OPTIONS: case SHOW_OPTIONS:
case SHOW_STATS: case SHOW_STATS:
case SHOW_TROPHIES: case SHOW_TROPHIES:
case SHOW_FIGHTER_DB:
show = SHOW_MENU; show = SHOW_MENU;
selectWidget("resume", "galacticMap"); selectWidget("resume", "galacticMap");
break; break;
@ -808,6 +821,13 @@ static void options(void)
initOptions(returnFromOptions); initOptions(returnFromOptions);
} }
static void fighterDatabase(void)
{
show = SHOW_FIGHTER_DB;
initFighterDatabaseDisplay();
}
static void stats(void) static void stats(void)
{ {
selectWidget("ok", "stats"); selectWidget("ok", "stats");

View File

@ -26,6 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define SHOW_OPTIONS 3 #define SHOW_OPTIONS 3
#define SHOW_STATS 4 #define SHOW_STATS 4
#define SHOW_TROPHIES 5 #define SHOW_TROPHIES 5
#define SHOW_FIGHTER_DB 6
#define MAX_LISTED_MISSIONS 9 #define MAX_LISTED_MISSIONS 9
@ -67,6 +68,9 @@ extern void awardCampaignTrophies(void);
extern void awardStatsTrophies(void); extern void awardStatsTrophies(void);
extern void initTrophiesDisplay(void); extern void initTrophiesDisplay(void);
extern void drawTrophies(void); extern void drawTrophies(void);
extern void doFighterDatabase(void);
extern void initFighterDatabaseDisplay(void);
extern void drawFighterDatabase(void);
extern App app; extern App app;
extern Colors colors; extern Colors colors;