aboutsummaryrefslogtreecommitdiff
path: root/builtin/mainmenu
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2018-06-18 20:47:38 +0100
committerGitHub <noreply@github.com>2018-06-18 20:47:38 +0100
commitca502fc274c640f1e301a77ecb336ab5a23d348d (patch)
tree41c38f278225e21067144330a4c6195eecee963b /builtin/mainmenu
parente8b687d7cafd7ff77572238cf98954527ab1056a (diff)
downloadminetest-ca502fc274c640f1e301a77ecb336ab5a23d348d.tar.gz
minetest-ca502fc274c640f1e301a77ecb336ab5a23d348d.tar.bz2
minetest-ca502fc274c640f1e301a77ecb336ab5a23d348d.zip
Update to new ContentDB API
Diffstat (limited to 'builtin/mainmenu')
-rw-r--r--builtin/mainmenu/dlg_contentstore.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/builtin/mainmenu/dlg_contentstore.lua b/builtin/mainmenu/dlg_contentstore.lua
index 59c2480c1..6cebdf2e0 100644
--- a/builtin/mainmenu/dlg_contentstore.lua
+++ b/builtin/mainmenu/dlg_contentstore.lua
@@ -145,9 +145,9 @@ local function start_install(calling_dialog, package)
end
local function get_screenshot(package)
- if #package.screenshots == 0 then
+ if not package.thumbnail then
return defaulttexturedir .. "no_screenshot.png"
- elseif screenshot_downloading[package.screenshots[1]] then
+ elseif screenshot_downloading[package.thumbnail] then
return defaulttexturedir .. "loading_screenshot.png"
end
@@ -163,7 +163,7 @@ local function get_screenshot(package)
end
-- Show error if we've failed to download before
- if screenshot_downloaded[package.screenshots[1]] then
+ if screenshot_downloaded[package.thumbnail] then
return defaulttexturedir .. "error_screenshot.png"
end
@@ -173,8 +173,8 @@ local function get_screenshot(package)
return core.download_file(params.url, params.dest)
end
local function callback(success)
- screenshot_downloading[package.screenshots[1]] = nil
- screenshot_downloaded[package.screenshots[1]] = true
+ screenshot_downloading[package.thumbnail] = nil
+ screenshot_downloaded[package.thumbnail] = true
if not success then
core.log("warning", "Screenshot download failed for some reason")
end
@@ -185,8 +185,8 @@ local function get_screenshot(package)
end
end
if core.handle_async(download_screenshot,
- { dest = filepath, url = package.screenshots[1] }, callback) then
- screenshot_downloading[package.screenshots[1]] = true
+ { dest = filepath, url = package.thumbnail }, callback) then
+ screenshot_downloading[package.thumbnail] = true
else
core.log("error", "ERROR: async event failed")
return defaulttexturedir .. "error_screenshot.png"