naev 0.11.5
nlua_shiplog.c File Reference

Handles the shiplog Lua bindings. More...

#include "nlua_shiplog.h"
#include "array.h"
#include "gui_osd.h"
#include "land.h"
#include "log.h"
#include "mission.h"
#include "music.h"
#include "ndata.h"
#include "nlua.h"
#include "nlua_bkg.h"
#include "nlua_camera.h"
#include "nlua_faction.h"
#include "nlua_hook.h"
#include "nlua_misn.h"
#include "nlua_music.h"
#include "nlua_player.h"
#include "nlua_system.h"
#include "nlua_tex.h"
#include "nlua_tk.h"
#include "nluadef.h"
#include "npc.h"
#include "nstring.h"
#include "nxml.h"
#include "player.h"
#include "rng.h"
#include "shiplog.h"
#include "toolkit.h"

Go to the source code of this file.

Functions

int shiplog_loadShiplog (nlua_env env)
 
static int shiplog_createLog (lua_State *L)
 Bindings for adding log entries to the ship log.
 
static int shiplog_appendLog (lua_State *L)
 Appends to the shiplog.
 
int nlua_loadShiplog (nlua_env env)
 Loads the mission Lua library.
 

Variables

static const luaL_Reg shiplog_methods []
 

Detailed Description

Handles the shiplog Lua bindings.

Definition in file nlua_shiplog.c.

Function Documentation

◆ nlua_loadShiplog()

int nlua_loadShiplog ( nlua_env env)

Loads the mission Lua library.

Parameters
envLua environment.

Definition at line 62 of file nlua_shiplog.c.

◆ shiplog_appendLog()

static int shiplog_appendLog ( lua_State * L)
static

Appends to the shiplog.

Lua usage parameter: shiplog.append("MyLog", "Some message here")

Lua function parameter: string idstr ID string of the log to append to. Lua function parameter: string message Message to append to the log. Lua return parameter: boolean true on success.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: append

Definition at line 118 of file nlua_shiplog.c.

◆ shiplog_createLog()

static int shiplog_createLog ( lua_State * L)
static

Bindings for adding log entries to the ship log.

A typical example would be:

shiplog.create( "idstring", "log name", "log type", 0, 0 )
shiplog.append( "idstring", "message to append to log" )

Lua module: shiplog

Creates a shiplog for this mission.

Lua usage parameter: shiplog.create("MyLog", "My mission title", "Mission type") – Creates log "MyLog" without erasing anything Lua usage parameter: shiplog.create("MyOtherLog", "Any title","Anything can be a type", true, 10) – Erases any existing MyOtherLog entries and sets a limit of 10 entries

Lua function parameter: string idstr ID string to identify this log, or empty string for unnamed logsets. Lua function parameter: string logname Name for this log. Lua function parameter: string logtype Type of log (e.g travel, trade, etc, can be anything). Lua function parameter:[opt=false] boolean overwrite Whether to remove previous entries of this logname and type. Lua function parameter:[opt=0] number maxLen Maximum length of the log (zero for infinite) - if greater than this length, new entries appended will result in old entries being removed.

Parameters
LLua State
Returns
Number of variables on the Lua State stack.

Lua function: create

Definition at line 93 of file nlua_shiplog.c.

Variable Documentation

◆ shiplog_methods

const luaL_Reg shiplog_methods[]
static
Initial value:
= {
{ "create", shiplog_createLog },
{ "append", shiplog_appendLog },
{0,0}
}
static int shiplog_appendLog(lua_State *L)
Appends to the shiplog.
static int shiplog_createLog(lua_State *L)
Bindings for adding log entries to the ship log.

Shiplog Lua methods.

Definition at line 49 of file nlua_shiplog.c.