naev 0.11.5
gui.c File Reference

Contains the GUI stuff for the player. More...

#include "gui.h"
#include "ai.h"
#include "camera.h"
#include "comm.h"
#include "conf.h"
#include "dialogue.h"
#include "economy.h"
#include "quadtree.h"
#include "font.h"
#include "gui_omsg.h"
#include "gui_osd.h"
#include "hook.h"
#include "input.h"
#include "intro.h"
#include "land.h"
#include "log.h"
#include "map.h"
#include "map_overlay.h"
#include "menu.h"
#include "mission.h"
#include "music.h"
#include "ndata.h"
#include "nebula.h"
#include "nfile.h"
#include "nlua.h"
#include "nlua_gfx.h"
#include "nlua_gui.h"
#include "nlua_misn.h"
#include "nlua_tex.h"
#include "nlua_tk.h"
#include "nluadef.h"
#include "nmath.h"
#include "nstring.h"
#include "ntime.h"
#include "nxml.h"
#include "opengl.h"
#include "pause.h"
#include "pilot.h"
#include "player.h"
#include "render.h"
#include "rng.h"
#include "sound.h"
#include "space.h"
#include "spfx.h"
#include "start.h"
#include "toolkit.h"
#include "unidiff.h"

Go to the source code of this file.

Data Structures

struct  Radar
 Represents the player's radar. More...
 
struct  Mesg
 On screen player message. More...
 

Macros

#define XML_GUI_ID   "GUIs"
 
#define XML_GUI_TAG   "gui"
 
#define RADAR_BLINK_PILOT   0.5
 
#define RADAR_BLINK_SPOB   1.
 
#define RADAR_RES_MAX   300.
 
#define RADAR_RES_REF   100.
 
#define RADAR_RES_MIN   10.
 
#define RADAR_RES_INTERVAL   10.
 
#define LUA_FUNC(funcname)
 
#define LUA_CLEANUP(varname)
 

Functions

void weapon_minimap (const double res, const double w, const double h, const RadarShape shape, double alpha)
 Draws the minimap weapons (used in player.c).
 
static void gui_renderTargetReticles (const SimpleShader *shd, double x, double y, double radius, double angle, const glColour *c)
 Renders spob and jump point targeting reticles.
 
static void gui_borderIntersection (double *cx, double *cy, double rx, double ry, double hw, double hh)
 Gets the intersection with the border.
 
static void gui_renderPilotTarget (void)
 Renders the players pilot target.
 
static void gui_renderSpobTarget (void)
 Sets up rendering of spob and jump point targeting reticles.
 
static void gui_renderBorder (double dt)
 Renders the ships/spobs in the border.
 
static void gui_renderMessages (double dt)
 Renders the player's messages on screen.
 
static const glColour * gui_getSpobColour (int i)
 Gets the colour of a spob.
 
static void gui_renderRadarOutOfRange (RadarShape sh, int w, int h, int cx, int cy, const glColour *col)
 Renders an out of range marker for the spob.
 
static void gui_blink (double cx, double cy, double vr, const glColour *col, double blinkInterval, double blinkVar)
 Renders the spob blink around a position on the minimap.
 
static const glColour * gui_getPilotColour (const Pilot *p)
 Gets a pilot's colour, with a special colour for targets.
 
static void gui_calcBorders (void)
 Calculates and sets the GUI borders.
 
static int gui_doFunc (int func_ref, const char *func_name)
 Runs a GUI Lua function.
 
static int gui_prepFunc (int func_ref, const char *func_name)
 Prepares to run a function.
 
static int gui_runFunc (const char *func, int nargs, int nret)
 Runs a function.
 
void gui_setDefaults (void)
 
void gui_messageInit (int width, int x, int y)
 Initializes the message system.
 
void gui_messageScrollUp (int lines)
 Scrolls up the message box.
 
void gui_messageScrollDown (int lines)
 Scrolls up the message box.
 
void player_messageToggle (int enable)
 Toggles if player should receive messages.
 
void player_messageRaw (const char *str)
 Adds a mesg to the queue to be displayed on screen.
 
void player_message (const char *fmt,...)
 Adds a mesg to the queue to be displayed on screen.
 
int gui_onScreenPilot (double *rx, double *ry, const Pilot *pilot)
 Takes a pilot and returns whether it's on screen, plus its relative position.
 
int gui_onScreenSpob (double *rx, double *ry, const JumpPoint *jp, const Spob *pnt)
 Takes a spob or jump point and returns whether it's on screen, plus its relative position.
 
void gui_renderReticles (double dt)
 Renders the gui targeting reticles.
 
void gui_render (double dt)
 Renders the player's GUI.
 
void gui_cooldownEnd (void)
 Notifies GUI scripts that the player broke out of cooldown.
 
int gui_radarInit (int circle, int w, int h)
 Initializes the radar.
 
void gui_radarRender (double x, double y)
 Renders the GUI radar.
 
void gui_radarGetRes (double *res)
 Outputs the radar's resolution.
 
void gui_clearMessages (void)
 Clears the GUI messages.
 
void gui_renderPilot (const Pilot *p, RadarShape shape, double w, double h, double res, int overlay)
 Renders a pilot in the GUI radar.
 
void gui_renderAsteroid (const Asteroid *a, double w, double h, double res, int overlay)
 Renders an asteroid in the GUI radar.
 
void gui_renderPlayer (double res, int overlay)
 Renders the player cross on the radar or whatever.
 
void gui_forceBlink (void)
 Force sets the spob and pilot radar blink.
 
void gui_renderSpob (int ind, RadarShape shape, double w, double h, double res, double alpha, int overlay)
 Draws the spobs in the minimap.
 
void gui_renderJumpPoint (int ind, RadarShape shape, double w, double h, double res, double alpha, int overlay)
 Renders a jump point on the minimap.
 
void gui_setViewport (double x, double y, double w, double h)
 Sets the viewport.
 
void gui_clearViewport (void)
 Resets the viewport.
 
int gui_init (void)
 Initializes the GUI system.
 
void gui_reload (void)
 Reloads the GUI.
 
void gui_setCargo (void)
 Player just changed their cargo.
 
void gui_setNav (void)
 Player just changed their nav computer target.
 
void gui_setTarget (void)
 Player just changed their pilot target.
 
void gui_setShip (void)
 Player just upgraded their ship or modified it.
 
void gui_setSystem (void)
 Player just changed their system.
 
void gui_updateFaction (void)
 Player's relationship with a faction was modified.
 
void gui_updateEffects (void)
 
void gui_setGeneric (const Pilot *pilot)
 Calls trigger functions depending on who the pilot is.
 
const char * gui_pick (void)
 Determines which GUI should be used.
 
int gui_exists (const char *name)
 Checks to see if a GUI exists.
 
int gui_load (const char *name)
 Attempts to load the actual GUI.
 
void gui_cleanup (void)
 Cleans up the GUI.
 
void gui_free (void)
 Frees the gui stuff.
 
void gui_setRadarResolution (double res)
 Sets the radar resolution.
 
void gui_setRadarRel (int mod)
 Modifies the radar resolution.
 
void gui_getOffset (double *x, double *y)
 Gets the GUI offset.
 
glTexturegui_hailIcon (void)
 Gets the hail icon texture.
 
void gui_targetSpobGFX (glTexture *gfx)
 Sets the spob target GFX.
 
void gui_targetPilotGFX (glTexture *gfx)
 Sets the pilot target GFX.
 
static void gui_eventToScreenPos (int *sx, int *sy, int ex, int ey)
 Translates a mouse position from an SDL_Event to GUI coordinates.
 
int gui_radarClickEvent (SDL_Event *event)
 Handles a click at a position in the current system.
 
int gui_borderClickEvent (SDL_Event *event)
 Handles clicks on the GUI border icons.
 
int gui_handleEvent (SDL_Event *evt)
 Handles GUI events.
 
void gui_mouseClickEnable (int enable)
 Enables the mouse click callback.
 
void gui_mouseMoveEnable (int enable)
 Enables the mouse movement callback.
 

Variables

static double blink_pilot = 0.
 
static double blink_spob = 0.
 
static double animation_dt = 0.
 
static gl_vbo * gui_radar_select_vbo = NULL
 
static int gui_getMessage = 1
 
static char * gui_name = NULL
 
static IntList gui_qtquery
 
unsigned int land_wid
 
static nlua_env gui_env = LUA_NOREF
 
static int gui_L_mclick = 0
 
static int gui_L_mmove = 0
 
static double gui_viewport_x = 0.
 
static double gui_viewport_y = 0.
 
static double gui_viewport_w = 0.
 
static double gui_viewport_h = 0.
 
static Radar gui_radar
 
static double gui_xoff = 0.
 
static double gui_yoff = 0.
 
static const int mesg_max = 128
 
static int mesg_pointer = 0
 
static int mesg_viewpoint = -1
 
static const double mesg_timeout = 15.
 
static Mesgmesg_stack = NULL
 
static int gui_mesg_w = 0
 
static int gui_mesg_x = 0
 
static int gui_mesg_y = 0
 
static double gui_tr = 0.
 
static double gui_br = 0.
 
static double gui_tl = 0.
 
static double gui_bl = 0.
 
static glTexturegui_ico_hail = NULL
 
static glTexturegui_target_spob = NULL
 
static glTexturegui_target_pilot = NULL
 
static int gui_lua_create = LUA_NOREF
 
static int gui_lua_render = LUA_NOREF
 
static int gui_lua_render_cooldown = LUA_NOREF
 
static int gui_lua_cooldown_end = LUA_NOREF
 
static int gui_lua_mouse_move = LUA_NOREF
 
static int gui_lua_mouse_click = LUA_NOREF
 
static int gui_lua_update_cargo = LUA_NOREF
 
static int gui_lua_update_nav = LUA_NOREF
 
static int gui_lua_update_target = LUA_NOREF
 
static int gui_lua_update_ship = LUA_NOREF
 
static int gui_lua_update_system = LUA_NOREF
 
static int gui_lua_update_faction = LUA_NOREF
 
static int gui_lua_update_effects = LUA_NOREF
 
static int can_jump = 0
 

Detailed Description

Contains the GUI stuff for the player.

Definition in file gui.c.

Macro Definition Documentation

◆ LUA_CLEANUP

#define LUA_CLEANUP ( varname)
Value:
if (varname!=LUA_NOREF) luaL_unref(naevL, LUA_REGISTRYINDEX, varname ); varname = LUA_NOREF

◆ LUA_FUNC

#define LUA_FUNC ( funcname)
Value:
gui_lua_##funcname = nlua_refenvtype( gui_env, #funcname, LUA_TFUNCTION );
static nlua_env gui_env
Definition gui.c:90
int nlua_refenvtype(nlua_env env, const char *name, int type)
Gets the reference of a global in a lua environment if it matches a type.
Definition nlua.c:920

◆ RADAR_BLINK_PILOT

#define RADAR_BLINK_PILOT   0.5

Blink rate of the pilot target on radar.

Definition at line 70 of file gui.c.

◆ RADAR_BLINK_SPOB

#define RADAR_BLINK_SPOB   1.

Blink rate of the spob target on radar.

Definition at line 71 of file gui.c.

◆ RADAR_RES_INTERVAL

#define RADAR_RES_INTERVAL   10.

Steps used to increase/decrease resolution.

Definition at line 119 of file gui.c.

◆ RADAR_RES_MAX

#define RADAR_RES_MAX   300.

Maximum radar resolution.

Definition at line 116 of file gui.c.

◆ RADAR_RES_MIN

#define RADAR_RES_MIN   10.

Minimum radar resolution.

Definition at line 118 of file gui.c.

◆ RADAR_RES_REF

#define RADAR_RES_REF   100.

Reference radar resolution.

Definition at line 117 of file gui.c.

◆ XML_GUI_ID

#define XML_GUI_ID   "GUIs"

XML section identifier for GUI document.

Definition at line 67 of file gui.c.

◆ XML_GUI_TAG

#define XML_GUI_TAG   "gui"

XML Section identifier for GUI tags.

Definition at line 68 of file gui.c.

Function Documentation

◆ gui_blink()

static void gui_blink ( double cx,
double cy,
double vr,
const glColour * col,
double blinkInterval,
double blinkVar )
static

Renders the spob blink around a position on the minimap.

Definition at line 1321 of file gui.c.

◆ gui_borderClickEvent()

int gui_borderClickEvent ( SDL_Event * event)

Handles clicks on the GUI border icons.

event The click event.

Returns
Whether the click was used to trigger an action.

Definition at line 2137 of file gui.c.

◆ gui_borderIntersection()

static void gui_borderIntersection ( double * cx,
double * cy,
double rx,
double ry,
double hw,
double hh )
static

Gets the intersection with the border.

http://en.wikipedia.org/wiki/Intercept_theorem

Parameters
[out]cxX intersection.
[out]cyY intersection.
rxCenter X position of intersection.
ryCenter Y position of intersection.
hwScreen half-width.
hhScreen half-height.

Definition at line 492 of file gui.c.

◆ gui_calcBorders()

static void gui_calcBorders ( void )
static

Calculates and sets the GUI borders.

Definition at line 1593 of file gui.c.

◆ gui_cleanup()

void gui_cleanup ( void )

Cleans up the GUI.

Definition at line 1954 of file gui.c.

◆ gui_clearMessages()

void gui_clearMessages ( void )

Clears the GUI messages.

Definition at line 986 of file gui.c.

◆ gui_clearViewport()

void gui_clearViewport ( void )

Resets the viewport.

Definition at line 1584 of file gui.c.

◆ gui_cooldownEnd()

void gui_cooldownEnd ( void )

Notifies GUI scripts that the player broke out of cooldown.

Definition at line 856 of file gui.c.

◆ gui_doFunc()

static int gui_doFunc ( int func_ref,
const char * func_name )
static

Runs a GUI Lua function.

Parameters
func_refReference of the functionn to run.
func_nameName of the function to run.
Returns
0 on success.

Definition at line 1684 of file gui.c.

◆ gui_eventToScreenPos()

static void gui_eventToScreenPos ( int * sx,
int * sy,
int ex,
int ey )
static

Translates a mouse position from an SDL_Event to GUI coordinates.

Definition at line 2097 of file gui.c.

◆ gui_exists()

int gui_exists ( const char * name)

Checks to see if a GUI exists.

Returns
non-zero if filename exists. zero otherwise.

Definition at line 1863 of file gui.c.

◆ gui_forceBlink()

void gui_forceBlink ( void )

Force sets the spob and pilot radar blink.

Definition at line 1312 of file gui.c.

◆ gui_free()

void gui_free ( void )

Frees the gui stuff.

Definition at line 2008 of file gui.c.

◆ gui_getOffset()

void gui_getOffset ( double * x,
double * y )

Gets the GUI offset.

Parameters
xX offset.
yY offset.

Definition at line 2062 of file gui.c.

◆ gui_getPilotColour()

static const glColour * gui_getPilotColour ( const Pilot * p)
static

Gets a pilot's colour, with a special colour for targets.

Parameters
pPilot to get colour of.
Returns
The colour of the pilot.
See also
pilot_getColour

Definition at line 1085 of file gui.c.

◆ gui_getSpobColour()

static const glColour * gui_getSpobColour ( int i)
static

Gets the colour of a spob.

Parameters
iIndex of the spob to get colour of.
Returns
Colour of the spob.

Definition at line 1296 of file gui.c.

◆ gui_hailIcon()

glTexture * gui_hailIcon ( void )

Gets the hail icon texture.

Definition at line 2071 of file gui.c.

◆ gui_handleEvent()

int gui_handleEvent ( SDL_Event * evt)

Handles GUI events.

Definition at line 2192 of file gui.c.

◆ gui_init()

int gui_init ( void )

Initializes the GUI system.

Returns
0 on success;

Definition at line 1623 of file gui.c.

◆ gui_load()

int gui_load ( const char * name)

Attempts to load the actual GUI.

Parameters
nameName of the GUI to load.
Returns
0 on success.

Definition at line 1876 of file gui.c.

◆ gui_messageInit()

void gui_messageInit ( int width,
int x,
int y )

Initializes the message system.

Parameters
widthMessage width.
xX position to set at.
yY position to set at.

Definition at line 217 of file gui.c.

◆ gui_messageScrollDown()

void gui_messageScrollDown ( int lines)

Scrolls up the message box.

Parameters
linesNumber of lines to scroll up.

Definition at line 258 of file gui.c.

◆ gui_messageScrollUp()

void gui_messageScrollUp ( int lines)

Scrolls up the message box.

Parameters
linesNumber of lines to scroll up.

Definition at line 229 of file gui.c.

◆ gui_mouseClickEnable()

void gui_mouseClickEnable ( int enable)

Enables the mouse click callback.

Definition at line 2246 of file gui.c.

◆ gui_mouseMoveEnable()

void gui_mouseMoveEnable ( int enable)

Enables the mouse movement callback.

Definition at line 2254 of file gui.c.

◆ gui_onScreenPilot()

int gui_onScreenPilot ( double * rx,
double * ry,
const Pilot * pilot )

Takes a pilot and returns whether it's on screen, plus its relative position.

Parameters
[out]rxRelative X position (factoring in viewport offset)
[out]ryRelative Y position (factoring in viewport offset)
pilotPilot to determine the visibility and position of
Returns
Whether or not the pilot is on-screen.

Definition at line 624 of file gui.c.

◆ gui_onScreenSpob()

int gui_onScreenSpob ( double * rx,
double * ry,
const JumpPoint * jp,
const Spob * pnt )

Takes a spob or jump point and returns whether it's on screen, plus its relative position.

Parameters
[out]rxRelative X position (factoring in viewport offset)
[out]ryRelative Y position (factoring in viewport offset)
jpJump point to determine the visibility and position of
pntSpob to determine the visibility and position of
Returns
Whether or not the given spob is on-screen.

Definition at line 661 of file gui.c.

◆ gui_pick()

const char * gui_pick ( void )

Determines which GUI should be used.

Definition at line 1844 of file gui.c.

◆ gui_prepFunc()

static int gui_prepFunc ( int func_ref,
const char * func_name )
static

Prepares to run a function.

Parameters
func_refReference of the functionn to prepare.
func_nameName of the function to prepare.
Returns
0 on success.

Definition at line 1703 of file gui.c.

◆ gui_radarClickEvent()

int gui_radarClickEvent ( SDL_Event * event)

Handles a click at a position in the current system.

event The click event.

Returns
Whether the click was used to trigger an action.

Definition at line 2108 of file gui.c.

◆ gui_radarGetRes()

void gui_radarGetRes ( double * res)

Outputs the radar's resolution.

Parameters
[out]resCurrent zoom ratio.

Definition at line 978 of file gui.c.

◆ gui_radarInit()

int gui_radarInit ( int circle,
int w,
int h )

Initializes the radar.

Parameters
circleWhether or not the radar is circular.
wRadar width.
hRadar height.

Definition at line 868 of file gui.c.

◆ gui_radarRender()

void gui_radarRender ( double x,
double y )

Renders the GUI radar.

Parameters
xX position to render at.
yY position to render at.

Definition at line 883 of file gui.c.

◆ gui_reload()

void gui_reload ( void )

Reloads the GUI.

Definition at line 1756 of file gui.c.

◆ gui_render()

void gui_render ( double dt)

Renders the player's GUI.

Parameters
dtCurrent delta tick.

Definition at line 725 of file gui.c.

◆ gui_renderAsteroid()

void gui_renderAsteroid ( const Asteroid * a,
double w,
double h,
double res,
int overlay )

Renders an asteroid in the GUI radar.

Parameters
aAsteroid to render.
wWidth.
hHeight.
resRadar resolution.
overlayWhether to render onto the overlay.

Definition at line 1200 of file gui.c.

◆ gui_renderBorder()

static void gui_renderBorder ( double dt)
static

Renders the ships/spobs in the border.

Parameters
dtCurrent delta tick.

Definition at line 534 of file gui.c.

◆ gui_renderJumpPoint()

void gui_renderJumpPoint ( int ind,
RadarShape shape,
double w,
double h,
double res,
double alpha,
int overlay )

Renders a jump point on the minimap.

Parameters
indJump point to render.
shapeShape of the radar (RADAR_RECT or RADAR_CIRCLE).
wWidth.
hHeight.
resRadar resolution.
alphaAlpha to use.
overlayWhether to render onto the overlay.

Definition at line 1477 of file gui.c.

◆ gui_renderMessages()

static void gui_renderMessages ( double dt)
static

Renders the player's messages on screen.

Parameters
dtCurrent delta tick.

Definition at line 998 of file gui.c.

◆ gui_renderPilot()

void gui_renderPilot ( const Pilot * p,
RadarShape shape,
double w,
double h,
double res,
int overlay )

Renders a pilot in the GUI radar.

Parameters
pPilot to render.
shapeShape of the radar (RADAR_RECT or RADAR_CIRCLE).
wWidth.
hHeight.
resRadar resolution.
overlayWhether to render onto the overlay.

Definition at line 1107 of file gui.c.

◆ gui_renderPilotTarget()

static void gui_renderPilotTarget ( void )
static

Renders the players pilot target.

Definition at line 439 of file gui.c.

◆ gui_renderPlayer()

void gui_renderPlayer ( double res,
int overlay )

Renders the player cross on the radar or whatever.

Definition at line 1267 of file gui.c.

◆ gui_renderRadarOutOfRange()

static void gui_renderRadarOutOfRange ( RadarShape sh,
int w,
int h,
int cx,
int cy,
const glColour * col )
static

Renders an out of range marker for the spob.

Definition at line 1332 of file gui.c.

◆ gui_renderReticles()

void gui_renderReticles ( double dt)

Renders the gui targeting reticles.

Parameters
dtCurrent deltatick.

Definition at line 703 of file gui.c.

◆ gui_renderSpob()

void gui_renderSpob ( int ind,
RadarShape shape,
double w,
double h,
double res,
double alpha,
int overlay )

Draws the spobs in the minimap.

Matrix mode is already displaced to center of the minimap.

Definition at line 1372 of file gui.c.

◆ gui_renderSpobTarget()

static void gui_renderSpobTarget ( void )
static

Sets up rendering of spob and jump point targeting reticles.

Definition at line 356 of file gui.c.

◆ gui_renderTargetReticles()

static void gui_renderTargetReticles ( const SimpleShader * shd,
double x,
double y,
double radius,
double angle,
const glColour * c )
static

Renders spob and jump point targeting reticles.

Parameters
shdShader to use to render.
xX position of reticle segment.
yY position of reticle segment.
radiusRadius.
angleAngle to rotate.
cColour.

Definition at line 420 of file gui.c.

◆ gui_runFunc()

static int gui_runFunc ( const char * func,
int nargs,
int nret )
static

Runs a function.

Note
Function must be prepared beforehand.
Parameters
funcName of the function to run.
nargsArguments to the function.
nretParameters to get returned from the function.

Definition at line 1738 of file gui.c.

◆ gui_setCargo()

void gui_setCargo ( void )

Player just changed their cargo.

Definition at line 1767 of file gui.c.

◆ gui_setDefaults()

void gui_setDefaults ( void )

Sets the GUI to defaults.

Definition at line 204 of file gui.c.

◆ gui_setGeneric()

void gui_setGeneric ( const Pilot * pilot)

Calls trigger functions depending on who the pilot is.

Parameters
pilotThe pilot to act based upon.

Definition at line 1824 of file gui.c.

◆ gui_setNav()

void gui_setNav ( void )

Player just changed their nav computer target.

Definition at line 1775 of file gui.c.

◆ gui_setRadarRel()

void gui_setRadarRel ( int mod)

Modifies the radar resolution.

Parameters
modNumber of intervals to jump (up or down).

Definition at line 2049 of file gui.c.

◆ gui_setRadarResolution()

void gui_setRadarResolution ( double res)

Sets the radar resolution.

Parameters
resResolution to set to.

Definition at line 2039 of file gui.c.

◆ gui_setShip()

void gui_setShip ( void )

Player just upgraded their ship or modified it.

Definition at line 1791 of file gui.c.

◆ gui_setSystem()

void gui_setSystem ( void )

Player just changed their system.

Definition at line 1799 of file gui.c.

◆ gui_setTarget()

void gui_setTarget ( void )

Player just changed their pilot target.

Definition at line 1783 of file gui.c.

◆ gui_setViewport()

void gui_setViewport ( double x,
double y,
double w,
double h )

Sets the viewport.

Definition at line 1566 of file gui.c.

◆ gui_targetPilotGFX()

void gui_targetPilotGFX ( glTexture * gfx)

Sets the pilot target GFX.

Definition at line 2088 of file gui.c.

◆ gui_targetSpobGFX()

void gui_targetSpobGFX ( glTexture * gfx)

Sets the spob target GFX.

Definition at line 2079 of file gui.c.

◆ gui_updateEffects()

void gui_updateEffects ( void )

Definition at line 1813 of file gui.c.

◆ gui_updateFaction()

void gui_updateFaction ( void )

Player's relationship with a faction was modified.

Definition at line 1807 of file gui.c.

◆ player_message()

void player_message ( const char * fmt,
... )

Adds a mesg to the queue to be displayed on screen.

Parameters
fmtString with formatting like printf.

Definition at line 335 of file gui.c.

◆ player_messageRaw()

void player_messageRaw ( const char * str)

Adds a mesg to the queue to be displayed on screen.

Parameters
strMessage to add.

Definition at line 298 of file gui.c.

◆ player_messageToggle()

void player_messageToggle ( int enable)

Toggles if player should receive messages.

Parameters
enableWhether or not to enable player receiving messages.

Definition at line 288 of file gui.c.

◆ weapon_minimap()

void weapon_minimap ( double res,
double w,
double h,
const RadarShape shape,
double alpha )
extern

Draws the minimap weapons (used in player.c).

from weapon.c

Parameters
resMinimap resolution.
wWidth of minimap.
hHeight of minimap.
shapeShape of the minimap.
alphaAlpha to draw points at.

Definition at line 204 of file weapon.c.

Variable Documentation

◆ animation_dt

double animation_dt = 0.
static

Used for animations.

Definition at line 76 of file gui.c.

◆ blink_pilot

double blink_pilot = 0.
static

Timer on target blinking on radar.

Definition at line 74 of file gui.c.

◆ blink_spob

double blink_spob = 0.
static

Timer on spob blinking on radar.

Definition at line 75 of file gui.c.

◆ can_jump

int can_jump = 0
static

Stores whether or not the player is able to jump.

Definition at line 719 of file gui.c.

◆ gui_bl

double gui_bl = 0.
static

Border bottom-left.

Definition at line 150 of file gui.c.

◆ gui_br

double gui_br = 0.
static

Border bottom-right.

Definition at line 148 of file gui.c.

◆ gui_env

nlua_env gui_env = LUA_NOREF
static

GUI Lua stuff. Current GUI Lua environment.

Definition at line 90 of file gui.c.

◆ gui_getMessage

int gui_getMessage = 1
static

Whether or not the player should receive messages.

Definition at line 81 of file gui.c.

◆ gui_ico_hail

glTexture* gui_ico_hail = NULL
static

Hailing icon.

Definition at line 153 of file gui.c.

◆ gui_L_mclick

int gui_L_mclick = 0
static

Use mouse click callback.

Definition at line 91 of file gui.c.

◆ gui_L_mmove

int gui_L_mmove = 0
static

Use mouse movement callback.

Definition at line 92 of file gui.c.

◆ gui_lua_cooldown_end

int gui_lua_cooldown_end = LUA_NOREF
static

Definition at line 161 of file gui.c.

◆ gui_lua_create

int gui_lua_create = LUA_NOREF
static

Definition at line 158 of file gui.c.

◆ gui_lua_mouse_click

int gui_lua_mouse_click = LUA_NOREF
static

Definition at line 163 of file gui.c.

◆ gui_lua_mouse_move

int gui_lua_mouse_move = LUA_NOREF
static

Definition at line 162 of file gui.c.

◆ gui_lua_render

int gui_lua_render = LUA_NOREF
static

Definition at line 159 of file gui.c.

◆ gui_lua_render_cooldown

int gui_lua_render_cooldown = LUA_NOREF
static

Definition at line 160 of file gui.c.

◆ gui_lua_update_cargo

int gui_lua_update_cargo = LUA_NOREF
static

Definition at line 164 of file gui.c.

◆ gui_lua_update_effects

int gui_lua_update_effects = LUA_NOREF
static

Definition at line 170 of file gui.c.

◆ gui_lua_update_faction

int gui_lua_update_faction = LUA_NOREF
static

Definition at line 169 of file gui.c.

◆ gui_lua_update_nav

int gui_lua_update_nav = LUA_NOREF
static

Definition at line 165 of file gui.c.

◆ gui_lua_update_ship

int gui_lua_update_ship = LUA_NOREF
static

Definition at line 167 of file gui.c.

◆ gui_lua_update_system

int gui_lua_update_system = LUA_NOREF
static

Definition at line 168 of file gui.c.

◆ gui_lua_update_target

int gui_lua_update_target = LUA_NOREF
static

Definition at line 166 of file gui.c.

◆ gui_mesg_w

int gui_mesg_w = 0
static

Width of messages.

Definition at line 142 of file gui.c.

◆ gui_mesg_x

int gui_mesg_x = 0
static

X positioning of messages.

Definition at line 143 of file gui.c.

◆ gui_mesg_y

int gui_mesg_y = 0
static

Y positioning of messages.

Definition at line 144 of file gui.c.

◆ gui_name

char* gui_name = NULL
static

Name of the GUI (for errors and such).

Definition at line 82 of file gui.c.

◆ gui_qtquery

IntList gui_qtquery
static

For querying collisions.

Definition at line 83 of file gui.c.

◆ gui_radar

Radar gui_radar
static

Definition at line 120 of file gui.c.

◆ gui_radar_select_vbo

gl_vbo* gui_radar_select_vbo = NULL
static

Definition at line 79 of file gui.c.

◆ gui_target_pilot

glTexture* gui_target_pilot = NULL
static

Pilot targeting icon.

Definition at line 155 of file gui.c.

◆ gui_target_spob

glTexture* gui_target_spob = NULL
static

Spob targeting icon.

Definition at line 154 of file gui.c.

◆ gui_tl

double gui_tl = 0.
static

Border top-left.

Definition at line 149 of file gui.c.

◆ gui_tr

double gui_tr = 0.
static

Border top-right.

Definition at line 147 of file gui.c.

◆ gui_viewport_h

double gui_viewport_h = 0.
static

GUI Viewport height.

Definition at line 100 of file gui.c.

◆ gui_viewport_w

double gui_viewport_w = 0.
static

GUI Viewport width.

Definition at line 99 of file gui.c.

◆ gui_viewport_x

double gui_viewport_x = 0.
static

Cropping. GUI Viewport X offset.

Definition at line 97 of file gui.c.

◆ gui_viewport_y

double gui_viewport_y = 0.
static

GUI Viewport Y offset.

Definition at line 98 of file gui.c.

◆ gui_xoff

double gui_xoff = 0.
static

X Offset that GUI introduces.

Definition at line 123 of file gui.c.

◆ gui_yoff

double gui_yoff = 0.
static

Y offset that GUI introduces.

Definition at line 124 of file gui.c.

◆ land_wid

unsigned int land_wid
extern

From land.c

Land window ID, also used in gui.c

Definition at line 79 of file land.c.

◆ mesg_max

const int mesg_max = 128
static

Maximum messages onscreen

Definition at line 127 of file gui.c.

◆ mesg_pointer

int mesg_pointer = 0
static

Current pointer message is at (for when scrolling).

Definition at line 128 of file gui.c.

◆ mesg_stack

Mesg* mesg_stack = NULL
static

Stack of messages, will be of mesg_max size.

Definition at line 141 of file gui.c.

◆ mesg_timeout

const double mesg_timeout = 15.
static

Timeout length.

Definition at line 130 of file gui.c.

◆ mesg_viewpoint

int mesg_viewpoint = -1
static

Position of viewing.

Definition at line 129 of file gui.c.