diff options
-rw-r--r-- | builtin/mainmenu/init.lua | 4 | ||||
-rw-r--r-- | builtin/mainmenu/tab_about.lua (renamed from builtin/mainmenu/tab_credits.lua) | 11 | ||||
-rw-r--r-- | doc/menu_lua_api.txt | 3 | ||||
-rw-r--r-- | src/client/game.cpp | 12 | ||||
-rw-r--r-- | src/script/lua_api/l_mainmenu.cpp | 12 |
5 files changed, 28 insertions, 14 deletions
diff --git a/builtin/mainmenu/init.lua b/builtin/mainmenu/init.lua index 45089c7c9..0c8578cd6 100644 --- a/builtin/mainmenu/init.lua +++ b/builtin/mainmenu/init.lua @@ -49,7 +49,7 @@ local tabs = {} tabs.settings = dofile(menupath .. DIR_DELIM .. "tab_settings.lua") tabs.content = dofile(menupath .. DIR_DELIM .. "tab_content.lua") -tabs.credits = dofile(menupath .. DIR_DELIM .. "tab_credits.lua") +tabs.about = dofile(menupath .. DIR_DELIM .. "tab_about.lua") tabs.local_game = dofile(menupath .. DIR_DELIM .. "tab_local.lua") tabs.play_online = dofile(menupath .. DIR_DELIM .. "tab_online.lua") @@ -98,7 +98,7 @@ local function init_globals() tv_main:add(tabs.content) tv_main:add(tabs.settings) - tv_main:add(tabs.credits) + tv_main:add(tabs.about) tv_main:set_global_event_handler(main_event_handler) tv_main:set_fixed_size(false) diff --git a/builtin/mainmenu/tab_credits.lua b/builtin/mainmenu/tab_about.lua index a34dd58bb..a1a7d4bfb 100644 --- a/builtin/mainmenu/tab_credits.lua +++ b/builtin/mainmenu/tab_about.lua @@ -97,8 +97,8 @@ local function buildCreditList(source) end return { - name = "credits", - caption = fgettext("Credits"), + name = "about", + caption = fgettext("About"), cbf_formspec = function(tabview, name, tabdata) local logofile = defaulttexturedir .. "logo.png" local version = core.get_version() @@ -119,11 +119,16 @@ return { buildCreditList(previous_contributors) .. "," .. ";1]" + -- Render information + fs = fs .. "label[0.75,4.9;" .. + fgettext("Active renderer:") .. "\n" .. + core.formspec_escape(core.get_screen_info().render_info) .. "]" + if PLATFORM ~= "Android" then fs = fs .. "tooltip[userdata;" .. fgettext("Opens the directory that contains user-provided worlds, games, mods,\n" .. "and texture packs in a file manager / explorer.") .. "]" - fs = fs .. "button[0,4.75;3.5,1;userdata;" .. fgettext("Open User Data Directory") .. "]" + fs = fs .. "button[0,4;3.5,1;userdata;" .. fgettext("Open User Data Directory") .. "]" end return fs diff --git a/doc/menu_lua_api.txt b/doc/menu_lua_api.txt index 90ec527b0..f4dfff261 100644 --- a/doc/menu_lua_api.txt +++ b/doc/menu_lua_api.txt @@ -204,7 +204,8 @@ core.get_screen_info() display_width = <width of display>, display_height = <height of display>, window_width = <current window width>, - window_height = <current window height> + window_height = <current window height>, + render_info = <active render information> } diff --git a/src/client/game.cpp b/src/client/game.cpp index 31c782c51..334f1da67 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -1390,9 +1390,21 @@ bool Game::createClient(const GameStartData &start_data) std::wstring str = utf8_to_wide(PROJECT_NAME_C); str += L" "; str += utf8_to_wide(g_version_hash); + { + const wchar_t *text = nullptr; + if (simple_singleplayer_mode) + text = wgettext("Singleplayer"); + else + text = wgettext("Multiplayer"); + str += L" ["; + str += text; + str += L"]"; + delete text; + } str += L" ["; str += driver->getName(); str += L"]"; + device->setWindowCaption(str.c_str()); LocalPlayer *player = client->getEnv().getLocalPlayer(); diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp index ba7f708a4..6826ece05 100644 --- a/src/script/lua_api/l_mainmenu.cpp +++ b/src/script/lua_api/l_mainmenu.cpp @@ -856,14 +856,6 @@ int ModApiMainMenu::l_get_screen_info(lua_State *L) lua_pushnumber(L,RenderingEngine::getDisplayDensity()); lua_settable(L, top); - lua_pushstring(L,"display_width"); - lua_pushnumber(L,RenderingEngine::getDisplaySize().X); - lua_settable(L, top); - - lua_pushstring(L,"display_height"); - lua_pushnumber(L,RenderingEngine::getDisplaySize().Y); - lua_settable(L, top); - const v2u32 &window_size = RenderingEngine::get_instance()->getWindowSize(); lua_pushstring(L,"window_width"); lua_pushnumber(L, window_size.X); @@ -872,6 +864,10 @@ int ModApiMainMenu::l_get_screen_info(lua_State *L) lua_pushstring(L,"window_height"); lua_pushnumber(L, window_size.Y); lua_settable(L, top); + + lua_pushstring(L, "render_info"); + lua_pushstring(L, wide_to_utf8(RenderingEngine::get_video_driver()->getName()).c_str()); + lua_settable(L, top); return 1; } |