mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02:00
Add support for dpi based HUD scaling
Add support for (configurable) multiline hotbar Improved screensize handling Add userdefined gui scale by BlockMen
This commit is contained in:
@@ -1002,6 +1002,33 @@ int ModApiMainMenu::l_gettext(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
int ModApiMainMenu::l_get_screen_info(lua_State *L)
|
||||
{
|
||||
lua_newtable(L);
|
||||
int top = lua_gettop(L);
|
||||
lua_pushstring(L,"density");
|
||||
lua_pushnumber(L,porting::getDisplayDensity());
|
||||
lua_settable(L, top);
|
||||
|
||||
lua_pushstring(L,"display_width");
|
||||
lua_pushnumber(L,porting::getDisplaySize().X);
|
||||
lua_settable(L, top);
|
||||
|
||||
lua_pushstring(L,"display_height");
|
||||
lua_pushnumber(L,porting::getDisplaySize().Y);
|
||||
lua_settable(L, top);
|
||||
|
||||
lua_pushstring(L,"window_width");
|
||||
lua_pushnumber(L,porting::getWindowSize().X);
|
||||
lua_settable(L, top);
|
||||
|
||||
lua_pushstring(L,"window_height");
|
||||
lua_pushnumber(L,porting::getWindowSize().Y);
|
||||
lua_settable(L, top);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
int ModApiMainMenu::l_do_async_callback(lua_State *L)
|
||||
{
|
||||
@@ -1060,6 +1087,7 @@ void ModApiMainMenu::Initialize(lua_State *L, int top)
|
||||
API_FCT(sound_play);
|
||||
API_FCT(sound_stop);
|
||||
API_FCT(gettext);
|
||||
API_FCT(get_screen_info);
|
||||
API_FCT(do_async_callback);
|
||||
}
|
||||
|
||||
|
@@ -103,6 +103,8 @@ private:
|
||||
|
||||
static int l_update_formspec(lua_State *L);
|
||||
|
||||
static int l_get_screen_info(lua_State *L);
|
||||
|
||||
//filesystem
|
||||
|
||||
static int l_get_scriptdir(lua_State *L);
|
||||
|
Reference in New Issue
Block a user