Allow screenshot key to be configured.
This commit is contained in:
parent
95b7d7f589
commit
5d59f1f353
|
@ -16,7 +16,8 @@
|
|||
"CONTROL_GUNS" : 29,
|
||||
"CONTROL_RADAR" : 27,
|
||||
"CONTROL_PREV_FIGHTER" : 4,
|
||||
"CONTROL_NEXT_FIGHTER" : 7
|
||||
"CONTROL_NEXT_FIGHTER" : 7,
|
||||
"CONTROL_SCREENSHOT" : 69
|
||||
},
|
||||
"mouse" : {
|
||||
"CONTROL_FIRE" : 1,
|
||||
|
@ -29,7 +30,8 @@
|
|||
"CONTROL_GUNS" : 4,
|
||||
"CONTROL_RADAR" : 5,
|
||||
"CONTROL_PREV_FIGHTER" : 4,
|
||||
"CONTROL_NEXT_FIGHTER" : 5
|
||||
"CONTROL_NEXT_FIGHTER" : 5,
|
||||
"CONTROL_SCREENSHOT" : 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,6 +98,15 @@
|
|||
"w" : 175,
|
||||
"h": 34
|
||||
},
|
||||
{
|
||||
"name" : "CONTROL_SCREENSHOT",
|
||||
"group" : "controls",
|
||||
"type" : "WT_CONTROL_CONFIG",
|
||||
"x" : 0,
|
||||
"y" : 0,
|
||||
"w" : 175,
|
||||
"h": 34
|
||||
},
|
||||
{
|
||||
"name" : "ok",
|
||||
"group" : "controls",
|
||||
|
|
|
@ -144,6 +144,7 @@ enum
|
|||
CONTROL_RADAR,
|
||||
CONTROL_PREV_FIGHTER,
|
||||
CONTROL_NEXT_FIGHTER,
|
||||
CONTROL_SCREENSHOT,
|
||||
CONTROL_MAX
|
||||
};
|
||||
|
||||
|
|
|
@ -135,11 +135,11 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
}
|
||||
|
||||
if (app.keyboard[SDL_SCANCODE_F12])
|
||||
if (isControl(CONTROL_SCREENSHOT))
|
||||
{
|
||||
saveScreenshot();
|
||||
|
||||
app.keyboard[SDL_SCANCODE_F12] = 0;
|
||||
clearControl(CONTROL_SCREENSHOT);
|
||||
}
|
||||
|
||||
if (SDL_GetTicks() > expireTextTimer)
|
||||
|
|
|
@ -49,6 +49,8 @@ extern void initGame(void);
|
|||
extern void doKeyDown(SDL_KeyboardEvent *event);
|
||||
extern void doKeyUp(SDL_KeyboardEvent *event);
|
||||
extern void createScreenshotFolder(void);
|
||||
extern int isControl(int type);
|
||||
extern void clearControl(int type);
|
||||
|
||||
App app;
|
||||
Colors colors;
|
||||
|
|
|
@ -40,6 +40,7 @@ void initControls(void)
|
|||
controlName[CONTROL_RADAR] = _("Cycle Radar");
|
||||
controlName[CONTROL_NEXT_FIGHTER] = _("Next Fighter");
|
||||
controlName[CONTROL_PREV_FIGHTER] = _("Previous Fighter");
|
||||
controlName[CONTROL_SCREENSHOT] = _("Screenshot");
|
||||
|
||||
for (i = 0 ; i < CONTROL_MAX ; i++)
|
||||
{
|
||||
|
|
|
@ -41,13 +41,14 @@ void initLookups(void)
|
|||
addLookup("CONTROL_RADAR", CONTROL_RADAR);
|
||||
addLookup("CONTROL_NEXT_FIGHTER", CONTROL_NEXT_FIGHTER);
|
||||
addLookup("CONTROL_PREV_FIGHTER", CONTROL_PREV_FIGHTER);
|
||||
|
||||
addLookup("CONTROL_SCREENSHOT", CONTROL_SCREENSHOT);
|
||||
|
||||
addLookup("ET_WAYPOINT", ET_WAYPOINT);
|
||||
addLookup("ET_JUMPGATE", ET_JUMPGATE);
|
||||
addLookup("ET_CAPITAL_SHIP", ET_CAPITAL_SHIP);
|
||||
addLookup("ET_MINE", ET_MINE);
|
||||
addLookup("ET_SHADOW_MINE", ET_SHADOW_MINE);
|
||||
|
||||
|
||||
addLookup("EF_NO_KILL", EF_NO_KILL);
|
||||
addLookup("EF_DISABLED", EF_DISABLED);
|
||||
addLookup("EF_MUST_DISABLE", EF_MUST_DISABLE);
|
||||
|
|
Loading…
Reference in New Issue