diff options
author | sapier <Sapier at GMX dot net> | 2014-04-05 14:12:36 +0200 |
---|---|---|
committer | sapier <Sapier at GMX dot net> | 2014-04-27 21:53:13 +0200 |
commit | 1838a3fd696782b1733a435bbb25accf3e40d1f3 (patch) | |
tree | 9edee41b26d5307b1d2e4626e65bb372a3d8cab7 /src/script | |
parent | 8d315347100f1d261bb496b6c73f8cab5d2b7a41 (diff) | |
download | minetest-1838a3fd696782b1733a435bbb25accf3e40d1f3.tar.gz minetest-1838a3fd696782b1733a435bbb25accf3e40d1f3.tar.bz2 minetest-1838a3fd696782b1733a435bbb25accf3e40d1f3.zip |
Add support for dpi based HUD scaling
Add support for (configurable) multiline hotbar
Improved screensize handling
Add userdefined gui scale by BlockMen
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/lua_api/l_mainmenu.cpp | 28 | ||||
-rw-r--r-- | src/script/lua_api/l_mainmenu.h | 2 |
2 files changed, 30 insertions, 0 deletions
diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp index fbb70c389..5de1c77f0 100644 --- a/src/script/lua_api/l_mainmenu.cpp +++ b/src/script/lua_api/l_mainmenu.cpp @@ -1003,6 +1003,33 @@ int ModApiMainMenu::l_gettext(lua_State *L) } /******************************************************************************/ +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) { GUIEngine* engine = getGuiEngine(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); } diff --git a/src/script/lua_api/l_mainmenu.h b/src/script/lua_api/l_mainmenu.h index 69011c7b5..b711f2f86 100644 --- a/src/script/lua_api/l_mainmenu.h +++ b/src/script/lua_api/l_mainmenu.h @@ -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); |