Ver código fonte

allow additional wardrobeItem-settings

Stephan Fuchs 2 meses atrás
pai
commit
9c2401fd03
2 arquivos alterados com 5 adições e 1 exclusões
  1. 3 0
      src/wardrobeItems.js
  2. 2 1
      task_processor.js

+ 3 - 0
src/wardrobeItems.js

@@ -72,6 +72,9 @@ export default function wardrobeItems(code,options){
 			if(options.shop)
 				properties.shop = options.shop;
 
+			if(options.wardrobeItem)
+				properties = Object.assign(properties, options.wardrobeItem)
+
 			return `setup.wardrobeStatic['${itemId}'] = ${JSON.stringify(properties)}\n`
 
 		});

+ 2 - 1
task_processor.js

@@ -70,7 +70,8 @@ function convertFile(task){
 		/*if(qsp2twOptions.startsWith("!! QSRC2TW_module")){
 			convertMode = qsp2twOptions.trim().split(" ").toReversed()[0];
 		}*/
-		const modeLookupRegex = /\s*!!\s*QSRC2TW_module\s+(\w+)(\s+{[^}]+})?/;
+		//const modeLookupRegex = /\s*!!\s*QSRC2TW_module\s+(\w+)(\s+{[^}]+})?/;
+		const modeLookupRegex = /\s*!!\s*QSRC2TW_module\s+(\w+)(\s+.+)?/;
 		let modeLookupResult;
 		try{
 			if(modeLookupResult = modeLookupRegex.exec(qsp2twOptions)){