aboutsummaryrefslogtreecommitdiff
path: root/builtin/mainmenu/dlg_contentstore.lua
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/mainmenu/dlg_contentstore.lua')
-rw-r--r--builtin/mainmenu/dlg_contentstore.lua28
1 files changed, 12 insertions, 16 deletions
diff --git a/builtin/mainmenu/dlg_contentstore.lua b/builtin/mainmenu/dlg_contentstore.lua
index 276a7b096..2152b8a39 100644
--- a/builtin/mainmenu/dlg_contentstore.lua
+++ b/builtin/mainmenu/dlg_contentstore.lua
@@ -151,11 +151,9 @@ local function start_install(package, reason)
if conf_path then
local conf = Settings(conf_path)
- if name_is_title then
- conf:set("name", package.title)
- else
- conf:set("title", package.title)
- conf:set("name", package.name)
+ conf:set("title", package.title)
+ if not name_is_title then
+ conf:set("name", package.name)
end
if not conf:get("description") then
conf:set("description", package.short_description)
@@ -193,7 +191,7 @@ end
local function queue_download(package, reason)
local max_concurrent_downloads = tonumber(core.settings:get("contentdb_max_concurrent_downloads"))
- if number_downloading < max_concurrent_downloads then
+ if number_downloading < math.max(max_concurrent_downloads, 1) then
start_install(package, reason)
else
table.insert(download_queue, { package = package, reason = reason })
@@ -360,7 +358,7 @@ function install_dialog.get_formspec()
selected_game_idx = i
end
- games[i] = core.formspec_escape(games[i].name)
+ games[i] = core.formspec_escape(games[i].title)
end
local selected_game = pkgmgr.games[selected_game_idx]
@@ -410,7 +408,7 @@ function install_dialog.get_formspec()
"container[0.375,0.70]",
"label[0,0.25;", fgettext("Base Game:"), "]",
- "dropdown[2,0;4.25,0.5;gameid;", table.concat(games, ","), ";", selected_game_idx, "]",
+ "dropdown[2,0;4.25,0.5;selected_game;", table.concat(games, ","), ";", selected_game_idx, "]",
"label[0,0.8;", fgettext("Dependencies:"), "]",
@@ -461,9 +459,9 @@ function install_dialog.handle_submit(this, fields)
return true
end
- if fields.gameid then
+ if fields.selected_game then
for _, game in pairs(pkgmgr.games) do
- if game.name == fields.gameid then
+ if game.title == fields.selected_game then
core.settings:set("menu_last_game", game.id)
break
end
@@ -490,12 +488,10 @@ local confirm_overwrite = {}
function confirm_overwrite.get_formspec()
local package = confirm_overwrite.package
- return "size[11.5,4.5,true]" ..
- "label[2,2;" ..
- fgettext("\"$1\" already exists. Would you like to overwrite it?", package.name) .. "]"..
- "style[install;bgcolor=red]" ..
- "button[3.25,3.5;2.5,0.5;install;" .. fgettext("Overwrite") .. "]" ..
- "button[5.75,3.5;2.5,0.5;cancel;" .. fgettext("Cancel") .. "]"
+ return confirmation_formspec(
+ fgettext("\"$1\" already exists. Would you like to overwrite it?", package.name),
+ 'install', fgettext("Overwrite"),
+ 'cancel', fgettext("Cancel"))
end
function confirm_overwrite.handle_submit(this, fields)