new config options

This commit is contained in:
Mestima 2021-09-29 06:44:46 +03:00
parent 68501c93ce
commit 524441569b
No known key found for this signature in database
GPG Key ID: 30B59EB1D7F18807
2 changed files with 27 additions and 1 deletions

View File

@ -34,5 +34,25 @@ configuration_options = {
{ description = "中文", data = "chi" }, { description = "中文", data = "chi" },
}, },
default = "eng" default = "eng"
},
{
name = "clock_tools",
label = "Clockmaker's Tools storable",
hover = "Can store Clockmaker's Tools or not",
options = {
{ description = "you can", data = true },
{ description = "you can't", data = false }
},
default = true
},
{
name = "time_pieces",
label = "Time Pieces storable",
hover = "Can store Time Pieces or not",
options = {
{ description = "you can", data = true },
{ description = "you can't", data = false }
},
default = true
} }
} }

View File

@ -1,5 +1,10 @@
local containers = require("containers") local containers = require("containers")
local storable = {
["pocketwatch_dismantler"] = GetModConfigData("clock_tools"),
["pocketwatch_parts"] = GetModConfigData("time_pieces")
}
local params = { local params = {
pocketwatchpack = { pocketwatchpack = {
widget = { widget = {
@ -21,7 +26,8 @@ end
function params.pocketwatchpack.itemtestfn(container, item, slot) function params.pocketwatchpack.itemtestfn(container, item, slot)
return (item:HasTag("pocketwatch") or (item.prefab == "pocketwatch_parts" or item.prefab == "pocketwatch_dismantler")) if (item:HasTag("pocketwatch")) then return true end
return storable[item.prefab] == true
end end