Stephan Fuchs 1 éve
szülő
commit
6a379ef31d
2 módosított fájl, 10 hozzáadás és 2 törlés
  1. 2 2
      qrsc_to_tw.py
  2. 8 0
      sugarcube/src/macros/gs.tw

+ 2 - 2
qrsc_to_tw.py

@@ -112,7 +112,7 @@ def convert_literal(literal_raw):
 
     if(match := re.match(r'^\$ARGS\[(\d+)\]$',literal,re.I)):
         #ARGS
-        return f'$location_var[_here][{match.group(1)}]'
+        return f'$location_var[$here][{match.group(1)}]'
 
     if(match := re.match(r"^(\$?)[a-zA-z]+\w*(\[('\w*'|\d+)\])?$",literal)):
         if match.group(1):
@@ -205,7 +205,7 @@ def convert_file(filename,skipIfNotExplicit=0,defaultsubfolder=False):
     with open(tw_filepath, 'w') as file:
         #file.write(f'<!-- GENERATED: {datetime.datetime.now()} -->\n')
         file.write(f'::{location_identifier}\n')
-        file.write(f"<<set _here = '{location_identifier}'>>\n")
+        file.write(f"<<set $here = '{location_identifier}'>>\n")
 
 
 

+ 8 - 0
sugarcube/src/macros/gs.tw

@@ -15,5 +15,13 @@
     <<for _i = 1; _i < 10; _i++>>
         <<set $location_var[_destintation][(_i-1)] to _args[_i]>>
     <</for>>
+
+    <<if !$hereStack>>
+        <<set $hereStack to []>>
+    <</if>>
+    <<run $hereStack.push($here)>>
+
     <<include _destintation>>
+
+    <<set $here to $hereStack.pop()>>
 <</widget>>