diff --git a/doc/en/scripting/builtins/libpack.md b/doc/en/scripting/builtins/libpack.md index 3a11dc55..2daab126 100644 --- a/doc/en/scripting/builtins/libpack.md +++ b/doc/en/scripting/builtins/libpack.md @@ -104,7 +104,7 @@ pack.get_info(packids: table) -> {id={...}, id2={...}, ...} ``` ```lua -pack.assemble(packis: table) -> table +pack.assemble(packids: table) -> table ``` Checks the configuration for correctness and adds dependencies, returning the complete configuration. diff --git a/doc/ru/scripting/builtins/libpack.md b/doc/ru/scripting/builtins/libpack.md index d6f7efae..91726d72 100644 --- a/doc/ru/scripting/builtins/libpack.md +++ b/doc/ru/scripting/builtins/libpack.md @@ -92,7 +92,7 @@ pack.get_info(packids: table) -> {id={...}, id2={...}, ...} ``` ```lua -pack.assemble(packis: table) -> table +pack.assemble(packids: table) -> table ``` Проверяет корректность конфигурации и добавляет зависимости, возвращая полную. diff --git a/res/layouts/console.xml b/res/layouts/console.xml index 3772d240..756459de 100644 --- a/res/layouts/console.xml +++ b/res/layouts/console.xml @@ -33,4 +33,5 @@ onup="on_history_up()" ondown="on_history_down()"> + diff --git a/res/layouts/pages/content.xml.lua b/res/layouts/pages/content.xml.lua index dc952645..89c230ed 100644 --- a/res/layouts/pages/content.xml.lua +++ b/res/layouts/pages/content.xml.lua @@ -347,12 +347,6 @@ function refresh() packs_info[id] = {packinfo.id, packinfo.title} end - for i,id in ipairs(packs_installed) do - if table.has(required, id) then - document["pack_"..id].enabled = false - end - end - if #packs_excluded == 0 then packs_excluded = table.copy(packs_available) end if #packs_included == 0 then packs_included = table.copy(packs_installed) end @@ -372,6 +366,12 @@ function refresh() place_pack(packs_add, packinfo, callback, string.format('reposition_func("%s")', packinfo.id)) end + for i,id in ipairs(packs_installed) do + if table.has(required, id) then + document["pack_"..id].enabled = false + end + end + check_deleted() apply_movements(packs_cur, packs_add) refresh_changes() diff --git a/src/content/PacksManager.cpp b/src/content/PacksManager.cpp index 3cbde0f2..12276717 100644 --- a/src/content/PacksManager.cpp +++ b/src/content/PacksManager.cpp @@ -108,17 +108,15 @@ static bool resolve_dependencies( continue; } - auto dep_pack = found -> second; + auto dep_pack = found->second; if (Version::matchesPattern(dep.version) && Version::matchesPattern(dep_pack.version) && Version(dep_pack.version) .processOperator(dep.op, Version(dep.version)) ) { // dependency pack version meets the required one - continue; } else if (dep.version == "*" || dep.version == dep_pack.version){ // fallback: dependency pack version also meets required one - continue; } else { throw contentpack_error( dep.id,