diff options
author | rubenwardy <rw@rubenwardy.com> | 2022-05-21 16:23:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-21 16:23:30 +0100 |
commit | 4e9e230e34912d08ec0f0fc01d14ef80654c7cac (patch) | |
tree | ae06c4fc9971808dd0a87d07aba702d8561b05ef /src/script | |
parent | dc45b85a543b4c8ad72f69a554ecfe7f0a60c533 (diff) | |
download | minetest-4e9e230e34912d08ec0f0fc01d14ef80654c7cac.tar.gz minetest-4e9e230e34912d08ec0f0fc01d14ef80654c7cac.tar.bz2 minetest-4e9e230e34912d08ec0f0fc01d14ef80654c7cac.zip |
Deprecate game.conf name, use title instead (#12030)
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/lua_api/l_mainmenu.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp index db031dde5..4d9fa5b14 100644 --- a/src/script/lua_api/l_mainmenu.cpp +++ b/src/script/lua_api/l_mainmenu.cpp @@ -304,7 +304,11 @@ int ModApiMainMenu::l_get_games(lua_State *L) lua_settable(L, top_lvl2); lua_pushstring(L, "name"); - lua_pushstring(L, game.name.c_str()); + lua_pushstring(L, game.title.c_str()); + lua_settable(L, top_lvl2); + + lua_pushstring(L, "title"); + lua_pushstring(L, game.title.c_str()); lua_settable(L, top_lvl2); lua_pushstring(L, "author"); @@ -356,6 +360,11 @@ int ModApiMainMenu::l_get_content_info(lua_State *L) lua_pushstring(L, spec.author.c_str()); lua_setfield(L, -2, "author"); + if (!spec.title.empty()) { + lua_pushstring(L, spec.title.c_str()); + lua_setfield(L, -2, "title"); + } + lua_pushinteger(L, spec.release); lua_setfield(L, -2, "release"); |