|
@@ -1,7 +1,15 @@
|
|
|
:: LocationMacros[widget]
|
|
|
<!-- USAGE EXAMPLE: <<ConnectedLocation 'Exit the room' 'korrPar' '' 'locations/pavlovsk/resident/apartment/home/korrPar.webp' 1 >> -->
|
|
|
<<widget 'ConnectedLocation'>>
|
|
|
- <<set _skipConnectedLocation = false>>
|
|
|
+
|
|
|
+ <<set _passage to _args[1]>>
|
|
|
+ <<set _passageArg to _args[2]>>
|
|
|
+ <<set _additionalSettings = Object.assign({},_args[5] ?? {},{capture:['_passage','_passageArg']})>>
|
|
|
+
|
|
|
+ <<ConnectedLocationCode _args[0] _args[3] _args[4] _additionalSettings>>
|
|
|
+ <<gt _passage _passageArg>>
|
|
|
+ <</ConnectedLocationCode>>
|
|
|
+ /*<<set _skipConnectedLocation = false>>
|
|
|
<<set _label to _args[0]>>
|
|
|
<<set _passage to _args[1]>>
|
|
|
<<set _passageArg to _args[2]>>
|
|
@@ -11,7 +19,7 @@
|
|
|
<<set _class = "connectedLocation">>
|
|
|
<<set _priority = 0>>
|
|
|
<<set _hotkeys = []>>
|
|
|
- /*<<if _args[5] and typeof _args[5] === 'object'>>*/
|
|
|
+
|
|
|
<<set _additionalSettings = _args[5] ?? {}>>
|
|
|
<<if _additionalSettings.class>>
|
|
|
<<set _class += " " + _additionalSettings.class>>
|
|
@@ -30,7 +38,6 @@
|
|
|
<<set _skipConnectedLocation = true>>
|
|
|
<</if>>
|
|
|
<</if>>
|
|
|
- /*<</if>>*/
|
|
|
|
|
|
<<set _myPassage = passage()>>
|
|
|
|
|
@@ -58,7 +65,7 @@
|
|
|
indecencyBlocked:_indecencyBlocked
|
|
|
}>>
|
|
|
<<run $connectedLocations.push(_connectedLocationData)>>
|
|
|
- <</if>>
|
|
|
+ <</if>>*/
|
|
|
<</widget>>
|
|
|
|
|
|
<!-- For internal use. Provides nothing but the dom. Should be attached to the right postion by another script (currently PassageDone) -->
|
|
@@ -85,6 +92,11 @@
|
|
|
|
|
|
<<widget 'ConnectionExecute'>>
|
|
|
<<set _executeData to _args[0]>>
|
|
|
+
|
|
|
+ <<for _capturedKey, _captureValue range _executeData.capturedVars>>
|
|
|
+ <<run State.setVar(_capturedKey,_captureValue)>>
|
|
|
+ <</for>>
|
|
|
+
|
|
|
<<if _executeData.duration > 0>>
|
|
|
<<set $time.minutes += _executeData.duration>>
|
|
|
<</if>>
|
|
@@ -107,25 +119,29 @@
|
|
|
<<set _hotkeys = []>>
|
|
|
|
|
|
|
|
|
-
|
|
|
- /*<<if _args[3] and typeof _args[3] === 'object'>>*/
|
|
|
- <<set _additionalSettings = _args[3] ?? {}>>
|
|
|
- <<if _additionalSettings.class>>
|
|
|
- <<set _class += " " + _additionalSettings.class>>
|
|
|
- <</if>>
|
|
|
- <<if _additionalSettings.priority>>
|
|
|
- <<set _priority = _additionalSettings.priority>>
|
|
|
- <</if>>
|
|
|
- <<if _additionalSettings.hotkeys>>
|
|
|
- <<set _hotkeys = _additionalSettings.hotkeys>>
|
|
|
- <</if>>
|
|
|
- <<set _indecencyBlocked = _additionalSettings.indecencyBlocked ? true : false>>
|
|
|
- <<if _allowedVehicles = _additionalSettings.allowedVehicles>>
|
|
|
- <<if !_allowedVehicles.includes($pc.vehicleType)>>
|
|
|
- <<set _skipConnectedLocation = true>>
|
|
|
- <</if>>
|
|
|
+ /* ----- Additional Settings ----- */
|
|
|
+ <<set _additionalSettings = _args[3] ?? {}>>
|
|
|
+ <<if _additionalSettings.class>>
|
|
|
+ <<set _class += " " + _additionalSettings.class>>
|
|
|
+ <</if>>
|
|
|
+ <<if _additionalSettings.priority>>
|
|
|
+ <<set _priority = _additionalSettings.priority>>
|
|
|
+ <</if>>
|
|
|
+ <<if _additionalSettings.hotkeys>>
|
|
|
+ <<set _hotkeys = _additionalSettings.hotkeys>>
|
|
|
+ <</if>>
|
|
|
+ <<set _indecencyBlocked = _additionalSettings.indecencyBlocked ? true : false>>
|
|
|
+ <<if _allowedVehicles = _additionalSettings.allowedVehicles>>
|
|
|
+ <<if !_allowedVehicles.includes($pc.vehicleType)>>
|
|
|
+ <<set _skipConnectedLocation = true>>
|
|
|
<</if>>
|
|
|
- /*<</if>>*/
|
|
|
+ <</if>>
|
|
|
+ <<set _capture = _additionalSettings.capture ?? []>>
|
|
|
+
|
|
|
+ <<set _capturedVars = {}>>
|
|
|
+ <<for _key range _capture>>
|
|
|
+ <<set _capturedVars[_key] = clone(State.getVar(_key))>>
|
|
|
+ <</for>>
|
|
|
|
|
|
<<set _myPassage = passage()>>
|
|
|
|
|
@@ -148,7 +164,8 @@
|
|
|
priority: _priority,
|
|
|
content: _content,
|
|
|
hotkeys: _hotkeys,
|
|
|
- indecencyBlocked:_indecencyBlocked
|
|
|
+ indecencyBlocked:_indecencyBlocked,
|
|
|
+ capturedVars: _capturedVars
|
|
|
}>>
|
|
|
<<run $connectedLocations.push(_connectedLocationData)>>
|
|
|
|