The Battle for Wesnoth  1.19.0-dev
Namespaces | Functions
lua_preferences.cpp File Reference
#include "scripting/lua_preferences.hpp"
#include "config.hpp"
#include "preferences/advanced.hpp"
#include "preferences/general.hpp"
#include "scripting/lua_common.hpp"
#include "scripting/push_check.hpp"
Include dependency graph for lua_preferences.cpp:

Go to the source code of this file.

Namespaces

 lua_preferences
 

Functions

static int impl_preferences_get (lua_State *L)
 The __index metamethod. More...
 
static int impl_preferences_set (lua_State *L)
 The __newindex metamethod. More...
 
static int impl_preferences_dir (lua_State *L)
 
std::string lua_preferences::register_table (lua_State *L)
 

Function Documentation

◆ impl_preferences_dir()

static int impl_preferences_dir ( lua_State *  L)
static

◆ impl_preferences_get()

static int impl_preferences_get ( lua_State *  L)
static

The __index metamethod.

Parameter 1: the preference table. Parameter 2: preference name, must be a string. Returns: preference value. If there isn't such a preference, returns nil.

Definition at line 30 of file lua_preferences.cpp.

References preferences::get_as_attribute(), and luaW_pushscalar().

Referenced by lua_preferences::register_table().

◆ impl_preferences_set()

static int impl_preferences_set ( lua_State *  L)
static

The __newindex metamethod.

Parameter 1: the preference table. Parameter 2: preference name, must be a string. Parameter 3: preference value. Returns nothing.

Definition at line 44 of file lua_preferences.cpp.

References luaW_toscalar(), and preferences::set().

Referenced by lua_preferences::register_table().