1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00: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:
sapier 2014-04-05 14:12:36 +02:00
parent 8d31534710
commit 1838a3fd69
13 changed files with 266 additions and 151 deletions

View file

@ -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);
}

View file

@ -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);