Play menu sounds.
This commit is contained in:
parent
b3e87f8cfb
commit
a13e22fb85
|
@ -62,6 +62,7 @@ void doStats(void)
|
||||||
{
|
{
|
||||||
if (isControl(CONTROL_LEFT) || app.keyboard[SDL_SCANCODE_LEFT])
|
if (isControl(CONTROL_LEFT) || app.keyboard[SDL_SCANCODE_LEFT])
|
||||||
{
|
{
|
||||||
|
playSound(SND_MENU_NAV, 0);
|
||||||
page = limit(page - 1, 0, maxPages - 1);
|
page = limit(page - 1, 0, maxPages - 1);
|
||||||
app.keyboard[SDL_SCANCODE_LEFT] = 0;
|
app.keyboard[SDL_SCANCODE_LEFT] = 0;
|
||||||
clearControl(CONTROL_LEFT);
|
clearControl(CONTROL_LEFT);
|
||||||
|
@ -69,6 +70,7 @@ void doStats(void)
|
||||||
|
|
||||||
if (isControl(CONTROL_RIGHT) || app.keyboard[SDL_SCANCODE_RIGHT])
|
if (isControl(CONTROL_RIGHT) || app.keyboard[SDL_SCANCODE_RIGHT])
|
||||||
{
|
{
|
||||||
|
playSound(SND_MENU_NAV, 0);
|
||||||
page = limit(page + 1, 0, maxPages - 1);
|
page = limit(page + 1, 0, maxPages - 1);
|
||||||
app.keyboard[SDL_SCANCODE_RIGHT] = 0;
|
app.keyboard[SDL_SCANCODE_RIGHT] = 0;
|
||||||
clearControl(CONTROL_RIGHT);
|
clearControl(CONTROL_RIGHT);
|
||||||
|
|
|
@ -34,6 +34,7 @@ extern Atlas *getImageFromAtlas(char *filename);
|
||||||
extern Texture *getTexture(const char *filename);
|
extern Texture *getTexture(const char *filename);
|
||||||
extern void blitRect(SDL_Texture *texture, int x, int y, SDL_Rect *srcRect, int center);
|
extern void blitRect(SDL_Texture *texture, int x, int y, SDL_Rect *srcRect, int center);
|
||||||
extern void doWidgets(void);
|
extern void doWidgets(void);
|
||||||
|
extern void playSound(int snd, int ch);
|
||||||
|
|
||||||
extern App app;
|
extern App app;
|
||||||
extern Colors colors;
|
extern Colors colors;
|
||||||
|
|
|
@ -81,6 +81,7 @@ void doTrophies(void)
|
||||||
{
|
{
|
||||||
if (isControl(CONTROL_LEFT) || app.keyboard[SDL_SCANCODE_LEFT])
|
if (isControl(CONTROL_LEFT) || app.keyboard[SDL_SCANCODE_LEFT])
|
||||||
{
|
{
|
||||||
|
playSound(SND_MENU_NAV, 0);
|
||||||
page = limit(page - 1, 0, maxPages - 1);
|
page = limit(page - 1, 0, maxPages - 1);
|
||||||
app.keyboard[SDL_SCANCODE_LEFT] = 0;
|
app.keyboard[SDL_SCANCODE_LEFT] = 0;
|
||||||
clearControl(CONTROL_LEFT);
|
clearControl(CONTROL_LEFT);
|
||||||
|
@ -88,6 +89,7 @@ void doTrophies(void)
|
||||||
|
|
||||||
if (isControl(CONTROL_RIGHT) || app.keyboard[SDL_SCANCODE_RIGHT])
|
if (isControl(CONTROL_RIGHT) || app.keyboard[SDL_SCANCODE_RIGHT])
|
||||||
{
|
{
|
||||||
|
playSound(SND_MENU_NAV, 0);
|
||||||
page = limit(page + 1, 0, maxPages - 1);
|
page = limit(page + 1, 0, maxPages - 1);
|
||||||
app.keyboard[SDL_SCANCODE_RIGHT] = 0;
|
app.keyboard[SDL_SCANCODE_RIGHT] = 0;
|
||||||
clearControl(CONTROL_RIGHT);
|
clearControl(CONTROL_RIGHT);
|
||||||
|
|
|
@ -44,6 +44,7 @@ extern int isControl(int type);
|
||||||
extern void clearControl(int type);
|
extern void clearControl(int type);
|
||||||
extern void doWidgets(void);
|
extern void doWidgets(void);
|
||||||
extern char *timeToDate(long millis);
|
extern char *timeToDate(long millis);
|
||||||
|
extern void playSound(int snd, int ch);
|
||||||
|
|
||||||
extern App app;
|
extern App app;
|
||||||
extern Colors colors;
|
extern Colors colors;
|
||||||
|
|
|
@ -236,6 +236,7 @@ static void logic(void)
|
||||||
doWidgets();
|
doWidgets();
|
||||||
if (app.keyboard[SDL_SCANCODE_ESCAPE])
|
if (app.keyboard[SDL_SCANCODE_ESCAPE])
|
||||||
{
|
{
|
||||||
|
playSound(SND_MENU_BACK, 0);
|
||||||
showing = SHOW_NONE;
|
showing = SHOW_NONE;
|
||||||
app.keyboard[SDL_SCANCODE_ESCAPE] = 0;
|
app.keyboard[SDL_SCANCODE_ESCAPE] = 0;
|
||||||
}
|
}
|
||||||
|
@ -245,6 +246,7 @@ static void logic(void)
|
||||||
doStats();
|
doStats();
|
||||||
if (app.keyboard[SDL_SCANCODE_ESCAPE])
|
if (app.keyboard[SDL_SCANCODE_ESCAPE])
|
||||||
{
|
{
|
||||||
|
playSound(SND_MENU_BACK, 0);
|
||||||
returnFromTrophyStats();
|
returnFromTrophyStats();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -253,6 +255,7 @@ static void logic(void)
|
||||||
doTrophies();
|
doTrophies();
|
||||||
if (app.keyboard[SDL_SCANCODE_ESCAPE])
|
if (app.keyboard[SDL_SCANCODE_ESCAPE])
|
||||||
{
|
{
|
||||||
|
playSound(SND_MENU_BACK, 0);
|
||||||
returnFromTrophyStats();
|
returnFromTrophyStats();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -301,6 +304,7 @@ static void doMissionSelect(void)
|
||||||
|
|
||||||
if (app.keyboard[SDL_SCANCODE_ESCAPE])
|
if (app.keyboard[SDL_SCANCODE_ESCAPE])
|
||||||
{
|
{
|
||||||
|
playSound(SND_MENU_BACK, 0);
|
||||||
showWidgetGroup("hub");
|
showWidgetGroup("hub");
|
||||||
showing = SHOW_WIDGETS;
|
showing = SHOW_WIDGETS;
|
||||||
app.keyboard[SDL_SCANCODE_ESCAPE] = 0;
|
app.keyboard[SDL_SCANCODE_ESCAPE] = 0;
|
||||||
|
@ -422,15 +426,9 @@ static void drawInfoBar(void)
|
||||||
|
|
||||||
static void drawHudWidgets(void)
|
static void drawHudWidgets(void)
|
||||||
{
|
{
|
||||||
int w, h;
|
|
||||||
|
|
||||||
w = 300;
|
|
||||||
h = 420;
|
|
||||||
|
|
||||||
drawRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0, 0, 128);
|
drawRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0, 0, 128);
|
||||||
|
|
||||||
drawRect((SCREEN_WIDTH - w) / 2, (SCREEN_HEIGHT - h) / 2, w, h, 0, 0, 0, 192);
|
drawWidgetFrame();
|
||||||
drawOutlineRect((SCREEN_WIDTH - w) / 2, (SCREEN_HEIGHT - h) / 2, w, h, 255, 255, 255, 255);
|
|
||||||
|
|
||||||
drawWidgets();
|
drawWidgets();
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,6 +69,8 @@ extern void doTrophies(void);
|
||||||
extern void drawTrophies(void);
|
extern void drawTrophies(void);
|
||||||
extern void initOptions(void (*callback)(void));
|
extern void initOptions(void (*callback)(void));
|
||||||
extern int getMissionStatus(char *id);
|
extern int getMissionStatus(char *id);
|
||||||
|
extern void drawWidgetFrame(void);
|
||||||
|
extern void playSound(int snd, int ch);
|
||||||
|
|
||||||
extern App app;
|
extern App app;
|
||||||
extern Colors colors;
|
extern Colors colors;
|
||||||
|
|
Loading…
Reference in New Issue