27#include "map_overlay.h"
37#define MOUSE_HIDE (3.)
43typedef struct Keybind_ {
54 {
"accel", N_(
"Accelerate"), N_(
"Makes your ship accelerate forward.") },
55 {
"left", N_(
"Turn Left"), N_(
"Makes your ship turn left.") },
56 {
"right", N_(
"Turn Right"), N_(
"Makes your ship turn right.") },
57 {
"reverse", N_(
"Reverse"), N_(
"Makes your ship face the direction you're moving from. Useful for braking.") },
58 {
"stealth", N_(
"Stealth"), N_(
"Tries to enter stealth mode.") },
60 {
"target_next", N_(
"Target Next"), N_(
"Cycles through ship targets.") },
61 {
"target_prev", N_(
"Target Previous"), N_(
"Cycles backwards through ship targets.") },
62 {
"target_nearest", N_(
"Target Nearest"), N_(
"Targets the nearest non-disabled ship.") },
63 {
"target_nextHostile", N_(
"Target Next Hostile"), N_(
"Cycles through hostile ship targets.") },
64 {
"target_prevHostile", N_(
"Target Previous Hostile"), N_(
"Cycles backwards through hostile ship targets.") },
65 {
"target_hostile", N_(
"Target Nearest Hostile"), N_(
"Targets the nearest hostile ship.") },
66 {
"target_clear", N_(
"Clear Target"), N_(
"Clears the currently-targeted ship, spob or jump point.") },
68 {
"primary", N_(
"Fire Primary Weapon"), N_(
"Fires primary weapons.") },
69 {
"face", N_(
"Face Target"), N_(
"Faces the targeted ship if one is targeted, otherwise faces targeted spob or jump point.") },
70 {
"board", N_(
"Board Target"), N_(
"Attempts to board the targeted ship.") },
72 {
"secondary", N_(
"Fire Secondary Weapon"), N_(
"Fires secondary weapons.") },
73 {
"weapset1", N_(
"Weapon Set 1"), N_(
"Activates weapon set 1.") },
74 {
"weapset2", N_(
"Weapon Set 2"), N_(
"Activates weapon set 2.") },
75 {
"weapset3", N_(
"Weapon Set 3"), N_(
"Activates weapon set 3.") },
76 {
"weapset4", N_(
"Weapon Set 4"), N_(
"Activates weapon set 4.") },
77 {
"weapset5", N_(
"Weapon Set 5"), N_(
"Activates weapon set 5.") },
78 {
"weapset6", N_(
"Weapon Set 6"), N_(
"Activates weapon set 6.") },
79 {
"weapset7", N_(
"Weapon Set 7"), N_(
"Activates weapon set 7.") },
80 {
"weapset8", N_(
"Weapon Set 8"), N_(
"Activates weapon set 8.") },
81 {
"weapset9", N_(
"Weapon Set 9"), N_(
"Activates weapon set 9.") },
82 {
"weapset0", N_(
"Weapon Set 0"), N_(
"Activates weapon set 0.") },
84 {
"e_targetNext", N_(
"Target Next Escort"), N_(
"Cycles through your escorts.") },
85 {
"e_targetPrev", N_(
"Target Previous Escort"), N_(
"Cycles backwards through your escorts.") },
86 {
"e_attack", N_(
"Escort Attack Command"), N_(
"Orders escorts to attack your target.") },
87 {
"e_hold", N_(
"Escort Hold Command"), N_(
"Orders escorts to hold their formation.") },
88 {
"e_return", N_(
"Escort Return Command"), N_(
"Orders escorts to return to your ship hangars.") },
89 {
"e_clear", N_(
"Escort Clear Commands"), N_(
"Clears your escorts of commands.") },
91 {
"autonav", N_(
"Autonavigation On"), N_(
"Initializes the autonavigation system.") },
92 {
"target_spob", N_(
"Target Spob"), N_(
"Cycles through spob targets.") },
93 {
"land", N_(
"Land"), N_(
"Attempts to land on the targeted spob or targets the nearest landable spob. Requests permission if necessary.") },
94 {
"thyperspace", N_(
"Target Jumpgate"), N_(
"Cycles through jump points.") },
95 {
"starmap", N_(
"Star Map"), N_(
"Opens the star map.") },
96 {
"jump", N_(
"Initiate Jump"), N_(
"Attempts to jump via a jump point.") },
97 {
"overlay", N_(
"Overlay Map"), N_(
"Opens the in-system overlay map.") },
98 {
"mousefly", N_(
"Mouse Flight"), N_(
"Toggles mouse flying.") },
99 {
"cooldown", N_(
"Active Cooldown"), N_(
"Begins active cooldown.") },
101 {
"log_up", N_(
"Log Scroll Up"), N_(
"Scrolls the log upwards.") },
102 {
"log_down", N_(
"Log Scroll Down"), N_(
"Scrolls the log downwards.") },
103 {
"hail", N_(
"Hail Target"), N_(
"Attempts to initialize communication with the targeted ship.") },
104 {
"autohail", N_(
"Autohail"), N_(
"Automatically initialize communication with a ship that is hailing you.") },
106 {
"mapzoomin", N_(
"Radar Zoom In"), N_(
"Zooms in on the radar.") },
107 {
"mapzoomout", N_(
"Radar Zoom Out"), N_(
"Zooms out on the radar.") },
108 {
"screenshot", N_(
"Screenshot"), N_(
"Takes a screenshot.") },
109 {
"togglefullscreen", N_(
"Toggle Fullscreen"), N_(
"Toggles between windowed and fullscreen mode.") },
110 {
"pause", N_(
"Pause"), N_(
"Pauses the game.") },
111 {
"speed", N_(
"Toggle Speed"), N_(
"Toggles speed modifier.") },
112 {
"menu", N_(
"Small Menu"), N_(
"Opens the small in-game menu.") },
113 {
"info", N_(
"Information Menu"), N_(
"Opens the information menu.") },
114 {
"console", N_(
"Lua Console"), N_(
"Opens the Lua console.") },
115 {
"switchtab1", N_(
"Switch Tab 1"), N_(
"Switches to tab 1.") },
116 {
"switchtab2", N_(
"Switch Tab 2"), N_(
"Switches to tab 2.") },
117 {
"switchtab3", N_(
"Switch Tab 3"), N_(
"Switches to tab 3.") },
118 {
"switchtab4", N_(
"Switch Tab 4"), N_(
"Switches to tab 4.") },
119 {
"switchtab5", N_(
"Switch Tab 5"), N_(
"Switches to tab 5.") },
120 {
"switchtab6", N_(
"Switch Tab 6"), N_(
"Switches to tab 6.") },
121 {
"switchtab7", N_(
"Switch Tab 7"), N_(
"Switches to tab 7.") },
122 {
"switchtab8", N_(
"Switch Tab 8"), N_(
"Switches to tab 8.") },
123 {
"switchtab9", N_(
"Switch Tab 9"), N_(
"Switches to tab 9.") },
124 {
"switchtab0", N_(
"Switch Tab 0"), N_(
"Switches to tab 0.") },
126 {
"paste", N_(
"Paste"), N_(
"Paste from the operating system's clipboard.") },
166static void input_key(
int keynum,
double value,
double kabs,
int repeat );
198 input_setKeybind(
"target_nextHostile", KEYBIND_NULL, SDLK_UNKNOWN, NMOD_NONE );
199 input_setKeybind(
"target_prevHostile", KEYBIND_NULL, SDLK_UNKNOWN, NMOD_NONE );
207 input_setKeybind(
"target_nextHostile", KEYBIND_KEYBOARD, SDLK_r, NMOD_CTRL );
208 input_setKeybind(
"target_prevHostile", KEYBIND_NULL, SDLK_UNKNOWN, NMOD_NONE );
210 input_setKeybind(
"target_clear", KEYBIND_KEYBOARD, SDLK_BACKSPACE, NMOD_ANY );
258 input_setKeybind(
"mapzoomout", KEYBIND_KEYBOARD, SDLK_KP_MINUS, NMOD_ANY );
259 input_setKeybind(
"screenshot", KEYBIND_KEYBOARD, SDLK_KP_MULTIPLY, NMOD_ANY );
260 input_setKeybind(
"togglefullscreen", KEYBIND_KEYBOARD, SDLK_F11, NMOD_ANY );
286 SDL_EventState( SDL_SYSWMEVENT, SDL_DISABLE );
289 SDL_EventState( SDL_KEYDOWN, SDL_ENABLE );
290 SDL_EventState( SDL_KEYUP, SDL_ENABLE );
293 SDL_EventState( SDL_MOUSEMOTION, SDL_ENABLE );
294 SDL_EventState( SDL_MOUSEBUTTONDOWN, SDL_ENABLE );
295 SDL_EventState( SDL_MOUSEBUTTONUP, SDL_ENABLE );
298 SDL_EventState( SDL_JOYAXISMOTION, SDL_DISABLE );
299 SDL_EventState( SDL_JOYHATMOTION, SDL_DISABLE );
300 SDL_EventState( SDL_JOYBUTTONDOWN, SDL_DISABLE );
301 SDL_EventState( SDL_JOYBUTTONUP, SDL_DISABLE );
304 SDL_EventState( SDL_QUIT, SDL_ENABLE );
307 SDL_EventState( SDL_WINDOWEVENT, SDL_ENABLE );
310 SDL_EventState( SDL_TEXTINPUT, SDL_DISABLE);
313 SDL_EventState( SDL_MOUSEWHEEL, SDL_ENABLE );
320 memset( temp, 0,
sizeof(
Keybind) );
322 temp->
type = KEYBIND_NULL;
323 temp->
key = SDLK_UNKNOWN;
324 temp->
mod = NMOD_NONE;
326 if (strcmp(temp->
name,
"paste")==0)
375 SDL_ShowCursor( SDL_ENABLE );
399 SDL_Keycode k = SDL_GetKeyFromName( name );
400 if (k == SDLK_UNKNOWN)
401 WARN(_(
"Keyname '%s' doesn't match any key."), name);
414void input_setKeybind(
const char *keybind, KeybindType type, SDL_Keycode key, SDL_Keymod mod )
425 WARN(_(
"Unable to set keybinding '%s', that command doesn't exist"), keybind);
447 WARN(_(
"Unable to get keybinding '%s', that command doesn't exist"), keybind);
448 return (SDL_Keycode)-1;
461 KeybindType type = KEYBIND_NULL;
462 SDL_Keymod mod = NMOD_NONE;
468 strncpy( buf, _(
"Not bound"), len );
471 case KEYBIND_KEYBOARD:
475 if ((mod != NMOD_NONE) && (mod != NMOD_ANY))
478 if (key < 0x100 && isalpha(key))
479 p +=
scnprintf( &buf[p], len-p,
"%c", toupper(key) );
485 case KEYBIND_JBUTTON:
486 snprintf( buf, len, _(
"joy button %d"), key );
489 case KEYBIND_JHAT_UP:
490 snprintf( buf, len, _(
"joy hat %d up"), key );
493 case KEYBIND_JHAT_DOWN:
494 snprintf( buf, len, _(
"joy hat %d down"), key );
497 case KEYBIND_JHAT_LEFT:
498 snprintf( buf, len, _(
"joy hat %d left"), key );
501 case KEYBIND_JHAT_RIGHT:
502 snprintf( buf, len, _(
"joy hat %d right"), key );
505 case KEYBIND_JAXISPOS:
506 snprintf( buf, len, _(
"joy axis %d-"), key );
509 case KEYBIND_JAXISNEG:
510 snprintf( buf, len, _(
"joy axis %d+"), key );
524 case NMOD_NONE:
return _(
"None");
525 case NMOD_CTRL:
return _(
"Ctrl");
526 case NMOD_SHIFT:
return _(
"Shift");
527 case NMOD_ALT:
return _(
"Alt");
528 case NMOD_META:
return _(
"Meta");
529 case NMOD_ANY:
return _(
"Any");
530 default:
return _(
"unknown");
557 case KEYBIND_KEYBOARD:
558 if ((k->
mod == NMOD_ANY) || (mod == NMOD_ANY) ||
563 case KEYBIND_JAXISPOS:
564 case KEYBIND_JAXISNEG:
565 case KEYBIND_JBUTTON:
566 case KEYBIND_JHAT_UP:
567 case KEYBIND_JHAT_DOWN:
568 case KEYBIND_JHAT_LEFT:
569 case KEYBIND_JHAT_RIGHT:
592 WARN(_(
"Unable to get keybinding description '%s', that command doesn't exist"), keybind);
604 SDL_Keymod mod_filtered = 0;
605 if (mod & (KMOD_LSHIFT | KMOD_RSHIFT))
606 mod_filtered |= NMOD_SHIFT;
607 if (mod & (KMOD_LCTRL | KMOD_RCTRL))
608 mod_filtered |= NMOD_CTRL;
609 if (mod & (KMOD_LALT | KMOD_RALT))
610 mod_filtered |= NMOD_ALT;
611 if (mod & (KMOD_LGUI | KMOD_RGUI))
612 mod_filtered |= NMOD_META;
626 SDL_ShowCursor( SDL_DISABLE );
650#define KEY(s) (strcmp(input_keybinds[keynum].name,s)==0)
651#define INGAME() (!toolkit_isOpen() && ((value==KEY_RELEASE) || !player_isFlag(PLAYER_CINEMATICS)))
653 ((player.p != NULL) && !pilot_isFlag(player.p,PILOT_HYP_PREP) &&\
654 !pilot_isFlag(player.p,PILOT_HYP_BEGIN) &&\
655 !pilot_isFlag(player.p,PILOT_HYPERSPACE))
656#define NODEAD() ((player.p != NULL) && !pilot_isFlag(player.p,PILOT_DEAD))
657#define NOLAND() ((player.p != NULL) && (!landed && !pilot_isFlag(player.p,PILOT_LANDING)))
666static void input_key(
int keynum,
double value,
double kabs,
int repeat )
672 if ((value == KEY_PRESS) && !repeat) {
677 else if (value == KEY_RELEASE) {
688 if (
KEY(
"accel") && !repeat) {
697 if (value==KEY_PRESS) {
699 player_setFlag(PLAYER_ACCEL);
704 else if (value==KEY_RELEASE) {
705 player_rmFlag(PLAYER_ACCEL);
707 if (!player_isFlag(PLAYER_REVERSE))
717 else if (value==KEY_RELEASE)
720 if (value==KEY_PRESS)
725 }
else if (
KEY(
"left") && !repeat) {
728 player_setFlag(PLAYER_TURN_LEFT);
733 if (value==KEY_PRESS) {
735 player_setFlag(PLAYER_TURN_LEFT);
738 else if (value==KEY_RELEASE) {
739 player_rmFlag(PLAYER_TURN_LEFT);
745 }
else if (
KEY(
"right") && !repeat) {
748 player_setFlag(PLAYER_TURN_RIGHT);
753 if (value==KEY_PRESS) {
755 player_setFlag(PLAYER_TURN_RIGHT);
758 else if (value==KEY_RELEASE) {
759 player_rmFlag(PLAYER_TURN_RIGHT);
765 }
else if (
KEY(
"reverse") && !repeat) {
768 if (value==KEY_PRESS) {
770 player_setFlag(PLAYER_REVERSE);
772 else if ((value==KEY_RELEASE) && player_isFlag(PLAYER_REVERSE)) {
773 player_rmFlag(PLAYER_REVERSE);
775 if (!player_isFlag(PLAYER_ACCEL))
786 if (value==KEY_PRESS)
791 if (value==KEY_PRESS)
795 }
else if (
KEY(
"face") && !repeat) {
796 if (value==KEY_PRESS) {
798 player_setFlag(PLAYER_FACE);
800 else if ((value==KEY_RELEASE) && player_isFlag(PLAYER_FACE))
801 player_rmFlag(PLAYER_FACE);
807 }
else if (
KEY(
"primary") && !repeat) {
808 if (value==KEY_PRESS) {
809 player_setFlag(PLAYER_PRIMARY);
811 else if (value==KEY_RELEASE)
812 player_rmFlag(PLAYER_PRIMARY);
814 }
else if ((
INGAME() || map_isOpen()) &&
NODEAD() &&
KEY(
"target_next")) {
815 if (value==KEY_PRESS) {
817 map_cycleMissions(1);
821 }
else if ((
INGAME() || map_isOpen()) &&
NODEAD() &&
KEY(
"target_prev")) {
822 if (value==KEY_PRESS) {
824 map_cycleMissions(-1);
828 }
else if ((
INGAME() || map_isOpen()) &&
NODEAD() &&
KEY(
"target_nearest")) {
829 if (value==KEY_PRESS) {
831 map_cycleMissions(1);
846 if (value==KEY_PRESS) {
872 }
else if (
KEY(
"secondary") && !repeat) {
873 if (value==KEY_PRESS) {
874 player_setFlag(PLAYER_SECONDARY);
876 else if (value==KEY_RELEASE)
877 player_rmFlag(PLAYER_SECONDARY);
880 }
else if (
NODEAD() &&
KEY(
"weapset1")) {
882 }
else if (
NODEAD() &&
KEY(
"weapset2")) {
884 }
else if (
NODEAD() &&
KEY(
"weapset3")) {
886 }
else if (
NODEAD() &&
KEY(
"weapset4")) {
888 }
else if (
NODEAD() &&
KEY(
"weapset5")) {
890 }
else if (
NODEAD() &&
KEY(
"weapset6")) {
892 }
else if (
NODEAD() &&
KEY(
"weapset7")) {
894 }
else if (
NODEAD() &&
KEY(
"weapset8")) {
896 }
else if (
NODEAD() &&
KEY(
"weapset9")) {
898 }
else if (
NODEAD() &&
KEY(
"weapset0")) {
905 if (value==KEY_PRESS) {
919 if (value==KEY_PRESS) {
930 if (value==KEY_PRESS) map_open();
931 }
else if (
KEY(
"jump") &&
INGAME() && !repeat) {
932 if (value==KEY_PRESS) {
936 }
else if (
KEY(
"overlay") &&
NODEAD() && (
INGAME() || map_isOpen()) && !repeat) {
941 }
else if (
KEY(
"mousefly") &&
NODEAD() && !repeat) {
942 if (value==KEY_PRESS)
945 if (value==KEY_PRESS) {
954 if (value==KEY_PRESS) {
958 if (value==KEY_PRESS) {
962 if (value==KEY_PRESS) {
966 if (value==KEY_PRESS) {
980 }
else if (
KEY(
"screenshot")) {
983 }
else if (
KEY(
"togglefullscreen") && !repeat) {
984 if (value==KEY_PRESS) naev_toggleFullscreen();
986 }
else if (
KEY(
"pause") && !repeat) {
987 if (value==KEY_PRESS) {
996 }
else if (
KEY(
"speed") && !repeat) {
997 if ((value==KEY_PRESS) && (!player_isFlag( PLAYER_CINEMATICS_2X ))) {
1006 }
else if (
KEY(
"menu") &&
NODEAD() && !repeat) {
1007 if (value==KEY_PRESS)
menu_small( 1, 1, 1, 1 );
1014 }
else if (
KEY(
"console") &&
NODEAD() && !repeat) {
1024 hparam[0].
type = HOOK_PARAM_STRING;
1026 hparam[1].
type = HOOK_PARAM_BOOL;
1027 hparam[1].
u.
b = (value > 0.);
1028 hparam[2].
type = HOOK_PARAM_SENTINEL;
1037static void input_joyaxis(
const SDL_Keycode axis,
const int value );
1038static void input_joyevent(
const int event,
const SDL_Keycode button );
1039static void input_keyevent(
const int event,
const SDL_Keycode key,
const SDL_Keymod mod,
const int repeat );
1049static void input_joyaxis(
const SDL_Keycode axis,
const int value )
1056 int k = (value > 0) ? KEY_PRESS : KEY_RELEASE;
1065 int k = (value < 0) ? KEY_PRESS : KEY_RELEASE;
1078static void input_joyevent(
const int event,
const SDL_Keycode button )
1101 int event = (value & SDL_HAT_UP) ? KEY_PRESS : KEY_RELEASE;
1105 int event = (value & SDL_HAT_DOWN) ? KEY_PRESS : KEY_RELEASE;
1109 int event = (value & SDL_HAT_LEFT) ? KEY_PRESS : KEY_RELEASE;
1113 int event = (value & SDL_HAT_RIGHT) ? KEY_PRESS : KEY_RELEASE;
1130static void input_keyevent(
const int event, SDL_Keycode key,
const SDL_Keymod mod,
const int repeat )
1141 (event == KEY_RELEASE))
1179 hparam[0].
type = HOOK_PARAM_NUMBER;
1180 hparam[0].
u.
num =
event->button.button;
1181 hparam[1].
type = HOOK_PARAM_BOOL;
1182 hparam[1].
u.
b = (
event->type == SDL_MOUSEBUTTONDOWN);
1183 hparam[2].
type = HOOK_PARAM_SENTINEL;
1187 if (player_isFlag(PLAYER_CINEMATICS))
1191 if ((
player.
p == NULL) || player_isFlag(PLAYER_DESTROYED))
1195 if (pilot_isFlag(
player.
p, PILOT_DEAD))
1199 if (event->button.button == SDL_BUTTON_MIDDLE) {
1205 if (event->button.button != SDL_BUTTON_LEFT &&
1206 event->button.button != SDL_BUTTON_RIGHT)
1234int input_clickPos( SDL_Event *event,
double x,
double y,
double zoom,
double minpr,
double minr )
1240 int pntid, jpid, astid, fieid;
1244 if (event->button.button == SDL_BUTTON_RIGHT) {
1247 dp =
pow2(x - p->solid->pos.x) +
pow2(y - p->solid->pos.y);
1254 rp =
MAX( 1.5 * PILOT_SIZE_APPROX * p->ship->gfx_space->sw / 2 * zoom, minpr);
1258 r =
MAX( 1.5 * pnt->
radius * zoom, minr );
1260 else if (jpid >= 0) {
1262 r =
MAX( 1.5 * jp->radius * zoom, minr );
1264 else if (astid >= 0) {
1275 if ((dp >
pow2(rp)) || ((
d <
pow2(r)) && (dp >
d)))
1279 jpid = pntid = astid = fieid = -1;
1282 if (event->button.button == SDL_BUTTON_LEFT) {
1283 if (pid != PLAYER_ID) {
1286 else if (pntid >= 0) {
1289 else if (jpid >= 0) {
1292 else if (astid >= 0) {
1297 else if (event->button.button == SDL_BUTTON_RIGHT) {
1327 if (!jp_isUsable(jp))
1334 map_select( jp->target, 0 );
1362 if (!spob_isKnown(pnt))
1374 if (!spob_isFlag(pnt, SPOB_SERVICE_INHABITED) || pnt->can_land ||
1375 (pnt->land_override > 0)) {
1377 if (ret == PLAYER_LAND_AGAIN) {
1380 else if (ret == PLAYER_LAND_DENIED) {
1421 if (pilot == PLAYER_ID)
1432 if (pilot_isDisabled(p) || pilot_isFlag(p, PILOT_BOARDABLE)) {
1465 unsigned int threshold;
1491 if ((event->type == SDL_MOUSEMOTION) ||
1492 (event->type == SDL_MOUSEBUTTONDOWN) ||
1493 (event->type == SDL_MOUSEBUTTONUP)) {
1495 SDL_ShowCursor( SDL_ENABLE );
1502 if (event->type == SDL_KEYDOWN && SDL_HasClipboardText() &&
1503 SDL_EventState( SDL_TEXTINPUT, SDL_QUERY )==SDL_ENABLE) {
1505 if ((input_paste->
key == event->key.keysym.sym) &&
1506 (input_paste->
mod & mod)) {
1508 char *txt = SDL_GetClipboardText();
1509 evt.type = SDL_TEXTINPUT;
1512 while ((ch = u8_nextchar( txt, &i ))) {
1513 size_t e = u8_wc_toutf8( evt.text.text, ch );
1514 evt.text.text[e] =
'\0';
1515 SDL_PushEvent( &evt );
1529 if (ovr_input(event))
1536 switch (event->type) {
1541 case SDL_JOYAXISMOTION:
1545 case SDL_JOYBUTTONDOWN:
1549 case SDL_JOYBUTTONUP:
1553 case SDL_JOYHATMOTION:
1558 if (event->key.repeat != 0)
1560 input_keyevent(KEY_PRESS, event->key.keysym.sym, event->key.keysym.mod, 0);
1564 if (event->key.repeat !=0)
1566 input_keyevent(KEY_RELEASE, event->key.keysym.sym, event->key.keysym.mod, 0);
1570 case SDL_MOUSEBUTTONDOWN:
1574 case SDL_MOUSEWHEEL:
1575 if (event->wheel.y > 0)
1577 else if (event->wheel.y < 0)
1581 case SDL_MOUSEMOTION:
Provides macros to work with dynamic arrays.
int player_tryBoard(int noisy)
Attempt to board the player's target.
double cam_getZoomTarget(void)
Gets the camera zoom.
double cam_getZoom(void)
Gets the camera zoom.
void cam_setZoomTarget(double zoom, double speed)
Sets the camera zoom target.
void cli_open(void)
Opens the console.
int escorts_return(Pilot *parent)
Have a pilot order its escorts to dock.
int escorts_attack(Pilot *parent)
Have a pilot order its escorts to attack its target.
int escorts_hold(Pilot *parent)
Have a pilot order its escorts to hold position.
int escorts_clear(Pilot *parent)
Have a pilot order its escorts to clear orders.
const char * pgettext_var(const char *msgctxt, const char *msgid)
int gui_radarClickEvent(SDL_Event *event)
Handles a click at a position in the current system.
int gui_handleEvent(SDL_Event *evt)
Handles GUI events.
void gui_messageScrollDown(int lines)
Scrolls up the message box.
int gui_borderClickEvent(SDL_Event *event)
Handles clicks on the GUI border icons.
void gui_setRadarRel(int mod)
Modifies the radar resolution.
void gui_messageScrollUp(int lines)
Scrolls up the message box.
int hooks_runParam(const char *stack, const HookParam *param)
Runs all the hooks of stack.
void menu_info(int window)
Opens the information menu.
Header file with generic functions and naev-specifics.
int scnprintf(char *text, size_t maxlen, const char *fmt,...)
Like snprintf(), but returns the number of characters ACTUALLY "printed" into the buffer....
void gl_windowToScreenPos(int *sx, int *sy, int wx, int wy)
Translates the window position to screen position.
void gl_screenToGameCoords(double *nx, double *ny, int bx, int by)
Converts screen coordinates to in-game coordinates.
void pause_player(void)
Pauses the game and marks the pause as player-initiated.
void unpause_game(void)
Unpauses the game.
double pilot_getNearestPos(const Pilot *p, unsigned int *tp, double x, double y, int disabled)
Get the nearest pilot to a pilot from a certain position.
Pilot * pilot_get(unsigned int id)
Pulls a pilot out of the pilot_stack based on ID.
void pilot_afterburnOver(Pilot *p)
Deactivates the afterburner.
void pilot_afterburn(Pilot *p)
Activate the afterburner.
void player_stealth(void)
Input binding for toggling stealth for the player.
void player_weapSetPress(int id, double value, int repeat)
Handles keyboard events involving the player's weapon-set keys. It's valid to call this while gamepla...
void player_autohail(void)
Automatically tries to hail a pilot that hailed the player.
void player_accel(double acc)
Start accelerating.
void player_targetEscort(int prev)
Targets the pilot.
void player_targetAsteroidSet(int field, int id)
Sets the player's target asteroid.
void player_targetSet(unsigned int id)
Sets the player's target.
void player_hailSpob(void)
Opens communication with the player's spob target.
void player_resetSpeed(void)
Resets the player speed stuff.
void player_targetHyperspaceSet(int id, int nomsg)
Sets the player's hyperspace target.
void player_targetHyperspace(void)
Gets a hyperspace target.
void player_hyperspacePreempt(int preempt)
Enables or disables jump points preempting spobs in autoface and target clearing.
void player_toggleMouseFly(void)
Toggles mouse flying.
void player_targetNearest(void)
Player targets nearest pilot.
void player_restoreControl(int reason, const char *str)
Aborts autonav and other states that take control of the ship.
int player_jump(void)
Actually attempts to jump in hyperspace.
void player_targetSpobSet(int id)
Sets the player's target spob.
void player_accelOver(void)
Done accelerating.
int player_land(int loud)
Try to land or target closest spob if no land target.
void player_brake(void)
Starts braking or active cooldown.
void player_targetPrev(int mode)
Cycles to previous target.
void player_targetClear(void)
Clears the player's ship, spob or hyperspace target, in that order.
void player_targetHostile(void)
Targets the nearest hostile enemy to the player.
void player_screenshot(void)
Takes a screenshot.
void player_targetSpob(void)
Cycle through spob targets.
void player_targetNext(int mode)
Cycles to next target.
void player_hail(void)
Opens communication with the player's target.
void player_autonavStartWindow(unsigned int wid, const char *str)
Starts autonav and closes the window.
void player_autonavPos(double x, double y)
Starts autonav with a local position destination.
void player_autonavStart(void)
Starts autonav.
void player_autonavPil(unsigned int p)
Starts autonav with a pilot to follow.
void player_autonavSpob(const char *name, int tryland)
Starts autonav with a spob destination.
double system_getClosest(const StarSystem *sys, int *pnt, int *jp, int *ast, int *fie, double x, double y)
Gets the closest feature to a position in the system.
int space_canHyperspace(const Pilot *p)
Checks to make sure if pilot is far enough away to hyperspace.
void spob_updateLand(Spob *p)
Updates the land possibilities of a spob.
Represents an asteroid field anchor.
Represents a single asteroid.
The actual hook parameter.
The representation of an in-game pilot.
unsigned int repeat_delay
unsigned int doubletap_sens
Represents a Space Object (SPOB), including and not limited to planets, stations, wormholes,...