aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorExcaliburZero <cwellsny@nycap.rr.com>2015-07-15 13:21:27 -0400
committerest31 <MTest31@outlook.com>2015-07-18 07:50:44 +0200
commit5b9c8dfbd26851268ae2cdaecafb255cc57d05cd (patch)
tree58e944744fb1c8630cd29aac04b59afde28c1685
parent8d03301138c0e82728d61b957ea47a5a4061633a (diff)
downloadminetest-5b9c8dfbd26851268ae2cdaecafb255cc57d05cd.tar.gz
minetest-5b9c8dfbd26851268ae2cdaecafb255cc57d05cd.tar.bz2
minetest-5b9c8dfbd26851268ae2cdaecafb255cc57d05cd.zip
Change texture pack description file name
Change the name for texture pack description files from "info.txt" to "description.txt" in order to keep the naming consistent between description files for both mods and texture packs. Also add backwards compatibility for texture packs that use "info.txt", and note in the log that "info.txt" is depreciated.
-rw-r--r--builtin/mainmenu/tab_texturepacks.lua14
1 files changed, 11 insertions, 3 deletions
diff --git a/builtin/mainmenu/tab_texturepacks.lua b/builtin/mainmenu/tab_texturepacks.lua
index 9417b94e0..3fb7b8598 100644
--- a/builtin/mainmenu/tab_texturepacks.lua
+++ b/builtin/mainmenu/tab_texturepacks.lua
@@ -45,7 +45,7 @@ end
--------------------------------------------------------------------------------
local function get_formspec(tabview, name, tabdata)
-
+
local retval = "label[4,-0.25;".. fgettext("Select texture pack:") .. "]"..
"textlist[4,0.25;7.5,5.0;TPs;"
@@ -62,10 +62,18 @@ local function get_formspec(tabview, name, tabdata)
return retval
end
- local infofile = current_texture_path ..DIR_DELIM.."info.txt"
+ local infofile = current_texture_path ..DIR_DELIM.."description.txt"
+ -- This adds backwards compatibility for old texture pack description files named
+ -- "info.txt", and should be removed once all such texture packs have been updated
+ if not file_exists(infofile) then
+ infofile = current_texture_path ..DIR_DELIM.."info.txt"
+ if file_exists(infofile) then
+ minetest.log("info.txt is depreciated. description.txt should be used instead.");
+ end
+ end
local infotext = ""
local f = io.open(infofile, "r")
- if f==nil then
+ if not f then
infotext = fgettext("No information available")
else
infotext = f:read("*all")