32 #include "tolua_game_gen.h"
33 #include "tolua_signal_gen.h"
39 #include "tolua_client_gen.h"
63 const char *format, ...)
92 enum api_types *parg_types, va_list args)
149 const char *
section =
"script.code";
215 const char *format, ...)
227 va_start(args, format);
248 va_start(args, format);
297 va_start(args, signal_name);
int api_specenum_open(lua_State *L)
Define the __index function for each exported specenum type.
const struct ft_color ftc_luaconsole_verbose
const struct ft_color ftc_luaconsole_error
const struct ft_color ftc_luaconsole_normal
const struct ft_color ftc_luaconsole_warn
constexpr auto LOG_VERBOSE
constexpr auto LOG_NORMAL
#define fc_assert_ret_val(condition, val)
void luaconsole_vprintf(const struct ft_color color, const char *format, va_list args)
Add a line of text to the output ("chatline") window.
bool luascript_callback_invoke(struct fc_lua *fcl, const char *callback_name, int nargs, enum api_types *parg_types, va_list args)
Invoke the 'callback_name' Lua function.
int luascript_do_string(struct fc_lua *fcl, const char *str, const char *name)
lua_dostring replacement with error message showing on errors.
int luascript_do_file(struct fc_lua *fcl, const char *filename)
Parse and execute the script at filename.
void luascript_vars_load(struct fc_lua *fcl, struct section_file *file, const char *section)
Load lua variables from file.
void luascript_common_z(lua_State *L)
Runs tolua_common_z.lua.
struct fc_lua * luascript_new(luascript_log_func_t output_fct, bool secured_environment)
Initialize the scripting state.
void luascript_vars_save(struct fc_lua *fcl, struct section_file *file, const char *section)
Save lua variables to file.
void luascript_common_a(lua_State *L)
Runs tolua_common_a.lua.
void luascript_destroy(struct fc_lua *fcl)
Free the scripting data.
void luascript_signal_free(struct fc_lua *fcl)
Free script signals and callbacks.
void luascript_signal_init(struct fc_lua *fcl)
Initialize script signals and callbacks.
signal_deprecator * luascript_signal_create(struct fc_lua *fcl, const char *signal_name, int nargs,...)
Create a new signal type.
void luascript_signal_emit_valist(struct fc_lua *fcl, const char *signal_name, va_list args)
Invoke all the callback functions attached to a given signal.
const char * secfile_lookup_str_default(const struct section_file *secfile, const char *def, const char *path,...)
Lookup a string value in the secfile.
#define secfile_insert_str_noescape(secfile, string, path,...)
bool script_client_init()
Initialize the scripting state.
static void static void script_client_signal_create()
Declare any new signal types you need here.
static void script_client_code_load(struct section_file *file)
Load the optional game script code from file (useful for scenarios).
static char * script_client_code
Optional game script code (useful for scenarios).
static void script_client_vars_init()
Initialize the game script variables.
bool script_client_do_file(const char *filename)
Parse and execute the script at filename.
static void script_client_code_free()
Free the optional game script code (useful for scenarios).
void script_client_state_load(struct section_file *file)
Load the scripting state from file.
static void script_client_vars_save(struct section_file *file)
Save the game script variables to file.
static void script_client_vars_load(struct section_file *file)
Load the game script variables in file.
static void script_client_vars_free()
Free the game script variables.
bool script_client_do_string(const char *str)
Parse and execute the script in str.
static void script_client_code_init()
Initialize the optional game script code (useful for scenarios).
void script_client_state_save(struct section_file *file)
Save the scripting state to file.
static void script_client_output(struct fc_lua *fcl, QtMsgType level, const char *format,...) fc__attribute((__format__(__printf__
Ouput a message on the client lua console.
static void script_client_code_save(struct section_file *file)
Save the optional game script code to file (useful for scenarios).
bool script_client_callback_invoke(const char *callback_name, int nargs, enum api_types *parg_types, va_list args)
Invoke the 'callback_name' Lua function.
void script_client_signal_emit(const char *signal_name,...)
Invoke all the callback functions attached to a given signal.
void script_client_free()
Free the scripting data.
static struct fc_lua * main_fcl
Lua virtual machine state.
static void static sol::state * fcl
Lua virtual machine state.
struct setting_list * level[OLEVELS_NUM]
int fc_vsnprintf(char *str, size_t n, const char *format, va_list ap)
int fc__attribute((nonnull(1, 3)))