naev 0.12.5
comm.c File Reference

For communicating with spobs/pilots. More...

#include "comm.h"
#include "ai.h"
#include "array.h"
#include "escort.h"
#include "hook.h"
#include "log.h"
#include "ndata.h"
#include "nlua.h"
#include "pilot.h"
#include "player.h"
Include dependency graph for comm.c:

Go to the source code of this file.

Macros

#define BUTTON_WIDTH   80
#define BUTTON_HEIGHT   30
#define GRAPHIC_WIDTH   256
#define GRAPHIC_HEIGHT   256

Functions

static const char * comm_getString (const Pilot *p, const char *str)
 Gets a string from the pilot's memory.
int comm_isOpen (void)
 Check to see if the comm window is open.
void comm_queueClose (void)
 Queues a close command when possible.
int comm_openPilot (unsigned int pilot)
 Opens the communication dialogue with a pilot.
int comm_openSpob (Spob *spob)
 Opens a communication dialogue with a spob.

Variables

static Spobcomm_spob = NULL
static int comm_commClose = 0
static nlua_env comm_env = LUA_NOREF
static int comm_open = 0

Detailed Description

For communicating with spobs/pilots.

Definition in file comm.c.

Macro Definition Documentation

◆ BUTTON_HEIGHT

#define BUTTON_HEIGHT   30

Button height.

Definition at line 22 of file comm.c.

◆ BUTTON_WIDTH

#define BUTTON_WIDTH   80

Button width.

Definition at line 21 of file comm.c.

◆ GRAPHIC_HEIGHT

#define GRAPHIC_HEIGHT   256

Height of graphic.

Definition at line 25 of file comm.c.

◆ GRAPHIC_WIDTH

#define GRAPHIC_WIDTH   256

Width of graphic.

Definition at line 24 of file comm.c.

Function Documentation

◆ comm_getString()

const char * comm_getString ( const Pilot * p,
const char * str )
static

Gets a string from the pilot's memory.

Valid targets are:

  • comm_no: message of communication failure.
  • bribe_no: unbribe message
  • bribe_prompt: bribe prompt
  • bribe_paid: paid message
Parameters
pPilot to get string from.
strString to get.
Returns
String matching str.

Definition at line 242 of file comm.c.

◆ comm_isOpen()

int comm_isOpen ( void )

Check to see if the comm window is open.

Definition at line 41 of file comm.c.

◆ comm_openPilot()

int comm_openPilot ( unsigned int pilot)

Opens the communication dialogue with a pilot.

Parameters
pilotPilot to communicate with.
Returns
0 on success.

Definition at line 60 of file comm.c.

◆ comm_openSpob()

int comm_openSpob ( Spob * spob)

Opens a communication dialogue with a spob.

Parameters
spobSpob to communicate with.
Returns
0 on success.

Definition at line 187 of file comm.c.

◆ comm_queueClose()

void comm_queueClose ( void )

Queues a close command when possible.

Definition at line 49 of file comm.c.

Variable Documentation

◆ comm_commClose

int comm_commClose = 0
static

Close comm when done.

Definition at line 28 of file comm.c.

◆ comm_env

nlua_env comm_env = LUA_NOREF
static

Comm Lua env.

Definition at line 29 of file comm.c.

◆ comm_open

int comm_open = 0
static

Definition at line 30 of file comm.c.

◆ comm_spob

Spob* comm_spob = NULL
static

Spob currently talking to.

Definition at line 27 of file comm.c.