The Battle for Wesnoth  1.19.7+dev
Namespaces | Functions
lua_preferences.cpp File Reference
#include "scripting/lua_preferences.hpp"
#include "config.hpp"
#include "preferences/preferences.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

int impl_preferences_get (lua_State *L)
 The __index metamethod. More...
 
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

Definition at line 52 of file lua_preferences.cpp.

References prefs::get(), and lua_push().

Referenced by lua_preferences::register_table().

◆ impl_preferences_get()

int impl_preferences_get ( lua_State *  L)

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 29 of file lua_preferences.cpp.

Referenced by lua_preferences::register_table().

◆ impl_preferences_set()

int impl_preferences_set ( lua_State *  L)

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 43 of file lua_preferences.cpp.

Referenced by lua_preferences::register_table().