Navigation Menu

Skip to content

Commit

Permalink
Change texture pack description file name
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ExcaliburZero authored and est31 committed Jul 18, 2015
1 parent 8d03301 commit 5b9c8df
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions builtin/mainmenu/tab_texturepacks.lua
Expand Up @@ -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;"

Expand All @@ -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")
Expand Down

2 comments on commit 5b9c8df

@thecow275
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should change depreciated to deprecated

@est31
Copy link
Contributor

@est31 est31 commented on 5b9c8df Sep 19, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing out! will push a fix shortly.

Please sign in to comment.