mirror of
				https://github.com/Mestima/wanda.git
				synced 2025-10-31 08:12:34 +00:00 
			
		
		
		
	new config options
This commit is contained in:
		| @ -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 | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  | |||||||
| @ -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  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user