naev 0.12.6
nlua_diff.c File Reference

Unidiff Lua module. More...

#include "nlua_diff.h"
#include "unidiff.h"
Include dependency graph for nlua_diff.c:

Go to the source code of this file.

Functions

static int diffL_apply (lua_State *L)
 Lua bindings to apply/remove Universe Diffs.
static int diffL_remove (lua_State *L)
 Removes a diff by name.
static int diffL_isapplied (lua_State *L)
 Checks to see if a diff is currently applied.
int nlua_loadDiff (nlua_env env)
 Loads the diff Lua library.

Variables

static const luaL_Reg diffL_methods []

Detailed Description

Unidiff Lua module.

Definition in file nlua_diff.c.

Function Documentation

◆ diffL_apply()

int diffL_apply ( lua_State * L)
static

Lua bindings to apply/remove Universe Diffs.

Universe Diffs are patches you can apply to the universe to make permanent changes. They are defined in dat/unidiff.xml.

Typical usage would be:

diff.apply( "collective_dead" )

Lua module: diff

Applies a diff by name.

If your diff modifies a Spob or a system, the safe lanes will be re-computed just after it is applied, causing the game to freeze for a short time. As a result, prefer not to apply a diff when the player is in space.

Lua function parameter: string name Name of the diff to apply.

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

Lua function: apply

Definition at line 63 of file nlua_diff.c.

◆ diffL_isapplied()

int diffL_isapplied ( lua_State * L)
static

Checks to see if a diff is currently applied.

Lua function parameter: string name Name of the diff to check. Lua return parameter: boolean true if diff is applied, false if it isn't.

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

Lua function: isApplied

Definition at line 90 of file nlua_diff.c.

◆ diffL_remove()

int diffL_remove ( lua_State * L)
static

Removes a diff by name.

Lua function parameter: string name Name of the diff to remove.

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

Lua function: remove

Definition at line 76 of file nlua_diff.c.

◆ nlua_loadDiff()

int nlua_loadDiff ( nlua_env env)

Loads the diff Lua library.

Parameters
envLua enviornment.
Returns
0 on success.

Definition at line 34 of file nlua_diff.c.

Variable Documentation

◆ diffL_methods

const luaL_Reg diffL_methods[]
static
Initial value:
= {
{ "apply", diffL_apply },
{ "remove", diffL_remove },
{ "isApplied", diffL_isapplied },
{ 0, 0 } }
static int diffL_isapplied(lua_State *L)
Checks to see if a diff is currently applied.
Definition nlua_diff.c:90
static int diffL_remove(lua_State *L)
Removes a diff by name.
Definition nlua_diff.c:76
static int diffL_apply(lua_State *L)
Lua bindings to apply/remove Universe Diffs.
Definition nlua_diff.c:63

Unidiff Lua methods.

Definition at line 23 of file nlua_diff.c.