Auto select next available mission when clicking on a star system.
This commit is contained in:
parent
f5aa0b3f85
commit
a0c2b1e9f6
|
@ -47,6 +47,7 @@ static void returnFromOptions(void);
|
||||||
static void doStarSystemView(void);
|
static void doStarSystemView(void);
|
||||||
static void updatePandoranAdvance(void);
|
static void updatePandoranAdvance(void);
|
||||||
static void fallenOK(void);
|
static void fallenOK(void);
|
||||||
|
static Mission *nextAvailableMission(StarSystem *starSystem);
|
||||||
|
|
||||||
static StarSystem *selectedStarSystem;
|
static StarSystem *selectedStarSystem;
|
||||||
static SDL_Texture *background;
|
static SDL_Texture *background;
|
||||||
|
@ -556,11 +557,26 @@ static void selectStarSystem(void)
|
||||||
{
|
{
|
||||||
show = SHOW_STAR_SYSTEM;
|
show = SHOW_STAR_SYSTEM;
|
||||||
STRNCPY(game.selectedStarSystem, selectedStarSystem->name, MAX_NAME_LENGTH);
|
STRNCPY(game.selectedStarSystem, selectedStarSystem->name, MAX_NAME_LENGTH);
|
||||||
game.currentMission = selectedStarSystem->missionHead.next;
|
game.currentMission = nextAvailableMission(selectedStarSystem);
|
||||||
playSound(SND_GUI_SELECT);
|
playSound(SND_GUI_SELECT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static Mission *nextAvailableMission(StarSystem *starSystem)
|
||||||
|
{
|
||||||
|
Mission *m;
|
||||||
|
|
||||||
|
for (m = starSystem->missionHead.next ; m != NULL ; m = m->next)
|
||||||
|
{
|
||||||
|
if (m->available && !m->completed)
|
||||||
|
{
|
||||||
|
return m;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return starSystem->missionHead.next;
|
||||||
|
}
|
||||||
|
|
||||||
static void drawStarSystemDetail(void)
|
static void drawStarSystemDetail(void)
|
||||||
{
|
{
|
||||||
int y, start, i;
|
int y, start, i;
|
||||||
|
|
Loading…
Reference in New Issue