1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Deprecate game.conf name, use title instead (#12030)

This commit is contained in:
rubenwardy 2022-05-21 16:23:30 +01:00 committed by GitHub
parent dc45b85a54
commit 4e9e230e34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 90 additions and 31 deletions

View file

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