Skip to content

Commit 5b9c8df

Browse files
ExcaliburZeroest31
authored andcommittedJul 18, 2015
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.
1 parent 8d03301 commit 5b9c8df

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed
 

Diff for: ‎builtin/mainmenu/tab_texturepacks.lua

+11-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ end
4545

4646
--------------------------------------------------------------------------------
4747
local function get_formspec(tabview, name, tabdata)
48-
48+
4949
local retval = "label[4,-0.25;".. fgettext("Select texture pack:") .. "]"..
5050
"textlist[4,0.25;7.5,5.0;TPs;"
5151

@@ -62,10 +62,18 @@ local function get_formspec(tabview, name, tabdata)
6262
return retval
6363
end
6464

65-
local infofile = current_texture_path ..DIR_DELIM.."info.txt"
65+
local infofile = current_texture_path ..DIR_DELIM.."description.txt"
66+
-- This adds backwards compatibility for old texture pack description files named
67+
-- "info.txt", and should be removed once all such texture packs have been updated
68+
if not file_exists(infofile) then
69+
infofile = current_texture_path ..DIR_DELIM.."info.txt"
70+
if file_exists(infofile) then
71+
minetest.log("info.txt is depreciated. description.txt should be used instead.");
72+
end
73+
end
6674
local infotext = ""
6775
local f = io.open(infofile, "r")
68-
if f==nil then
76+
if not f then
6977
infotext = fgettext("No information available")
7078
else
7179
infotext = f:read("*all")

2 commit comments

Comments
 (2)

thecow275 commented on Sep 19, 2016

@thecow275

you should change depreciated to deprecated

est31 commented on Sep 19, 2016

@est31
Contributor

Thanks for pointing out! will push a fix shortly.

Please sign in to comment.