1
0
Преглед на файлове

split `contents` in `<<act>>`

Stephan Fuchs преди 5 месеца
родител
ревизия
80cceef791
променени са 1 файла, в които са добавени 10 реда и са изтрити 1 реда
  1. 10 1
      sugarcube/src/actions/act.tw

+ 10 - 1
sugarcube/src/actions/act.tw

@@ -18,6 +18,8 @@
 		arg 2: flags:
 			'ab_label':			overwrite the label in the action bar
 			'contents':			overwrite contents
+			'contents_header':	
+			'contents_footer':
 			'capture':			captured vars-array (e.g. ['_npcID'])
 			'cost':     		cost {cash: ?}
 			'disabled':			The action is disabled. Show the value as tooltip.
@@ -203,6 +205,11 @@
 	<</if>>
 
 	<<if !_skipButton>>
+
+		<<if _act_contents>>
+			<<set _act_contents = (_flags.contents_header ?? '') + _act_contents + (_flags.contents_footer ?? '')>>
+		<</if>>
+
 		<<if !_displayMode or _displayMode === -1>>
 
 			<<set _ab_label = ('ab_label' in _flags) ? _flags.ab_label : _label>>
@@ -242,7 +249,9 @@
 
     <<set _flags = _args[2]>>
     <<if !_flags>><<set _flags = {}>><</if>>
-    <<set _flags.contents = '<<set _actions = []>><<replace ".passage">>'+_actCLA_contents+'<</replace>><<actionsRefresh>><<sidebarUpdate>>'>>
+	<<set _flags.contents_header = '<<set _actions = []>><<replace ".passage">>'>>
+    <<set _flags.contents = _actCLA_contents>>
+	<<set _flags.contents_footer = '<</replace>><<actionsRefresh>><<sidebarUpdate>>'>>
 
     <<act _args[0] _args[1] _flags>><</act>>