Explorar el Código

Random Images Fix in Beverages

Stephan Fuchs hace 1 año
padre
commit
f4fcd6c807

+ 1 - 1
beverage_convert.py

@@ -70,7 +70,7 @@ def file_convert(filename):
                 elif match := re.search(r"""<<image\s+"(.*?)"\s*>>""",line):
                     image =match.group(1)
                     file.write(f'\timage: "{image}",\n')
-                elif match := re.search(r"""<<image\s+`('.*?)'\s*\+\s*rand\((\d+)\s*,\s*(\d+)\s*\)\s*\+\s*'(.*?')`\s*>>""",line):
+                elif match := re.search(r"""<<image\s+`'(?:images/)?(.*?)'\s*\+\s*rand\((\d+)\s*,\s*(\d+)\s*\)\s*\+\s*'(.*?)'`\s*>>""",line):
                     image = match.group(1) + '#' + match.group(4)
                     rand0 = match.group(2)
                     rand1 = match.group(3)

+ 3 - 3
sugarcube/src/autogenerated/beverage/compiled/foodcompiled.js

@@ -278,7 +278,7 @@ setup.beverages['s_meal'] = {
 	energy_inc: 40,
 	cumclean: 2,
 	breath: 0,
-	imageRand: {template:"'images/shared/food/food_#.jpg'",min:1,max:4},
+	imageRand: {template:"shared/food/food_#.jpg",min:1,max:4},
 	$_eat: 0,
 	hydra_inc: 40,
 }
@@ -291,7 +291,7 @@ setup.beverages['m_meal'] = {
 	energy_inc: 60,
 	cumclean: 2,
 	breath: 0,
-	imageRand: {template:"'images/shared/food/food_#.jpg'",min:1,max:4},
+	imageRand: {template:"shared/food/food_#.jpg",min:1,max:4},
 	$_eat: 0,
 	hydra_inc: 60,
 }
@@ -304,7 +304,7 @@ setup.beverages['l_meal'] = {
 	energy_inc: 100,
 	cumclean: 2,
 	breath: 0,
-	imageRand: {template:"'images/shared/food/food_#.jpg'",min:1,max:4},
+	imageRand: {template:"shared/food/food_#.jpg",min:1,max:4},
 	$_eat: 0,
 	hydra_inc: 100,
 }