mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add package update detection on Content tab (#13807)
This commit is contained in:
parent
ddce858c34
commit
4ee32c5441
16 changed files with 329 additions and 54 deletions
|
@ -651,6 +651,16 @@ int ModApiUtil::l_set_last_run_mod(lua_State *L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
// urlencode(value)
|
||||
int ModApiUtil::l_urlencode(lua_State *L)
|
||||
{
|
||||
NO_MAP_LOCK_REQUIRED;
|
||||
|
||||
const char *value = luaL_checkstring(L, 1);
|
||||
lua_pushstring(L, urlencode(value).c_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
void ModApiUtil::Initialize(lua_State *L, int top)
|
||||
{
|
||||
API_FCT(log);
|
||||
|
@ -697,6 +707,8 @@ void ModApiUtil::Initialize(lua_State *L, int top)
|
|||
API_FCT(get_last_run_mod);
|
||||
API_FCT(set_last_run_mod);
|
||||
|
||||
API_FCT(urlencode);
|
||||
|
||||
LuaSettings::create(L, g_settings, g_settings_path);
|
||||
lua_setfield(L, top, "settings");
|
||||
}
|
||||
|
@ -723,6 +735,8 @@ void ModApiUtil::InitializeClient(lua_State *L, int top)
|
|||
API_FCT(colorspec_to_colorstring);
|
||||
API_FCT(colorspec_to_bytes);
|
||||
|
||||
API_FCT(urlencode);
|
||||
|
||||
LuaSettings::create(L, g_settings, g_settings_path);
|
||||
lua_setfield(L, top, "settings");
|
||||
}
|
||||
|
@ -766,6 +780,8 @@ void ModApiUtil::InitializeAsync(lua_State *L, int top)
|
|||
API_FCT(get_last_run_mod);
|
||||
API_FCT(set_last_run_mod);
|
||||
|
||||
API_FCT(urlencode);
|
||||
|
||||
LuaSettings::create(L, g_settings, g_settings_path);
|
||||
lua_setfield(L, top, "settings");
|
||||
}
|
||||
|
|
|
@ -128,6 +128,9 @@ private:
|
|||
// set_last_run_mod(modname)
|
||||
static int l_set_last_run_mod(lua_State *L);
|
||||
|
||||
// urlencode(value)
|
||||
static int l_urlencode(lua_State *L);
|
||||
|
||||
public:
|
||||
static void Initialize(lua_State *L, int top);
|
||||
static void InitializeAsync(lua_State *L, int top);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue