1
0
Эх сурвалжийг харах

Moved DynamicHousing to its own file

Stephan Fuchs 9 сар өмнө
parent
commit
f5fdf48015

+ 25 - 0
sugarcube/src/housing/dynamicHousing.tw

@@ -0,0 +1,25 @@
+:: dynamicHousing[include]
+	<<set _currentRoom ??= ($dynamicHousingRoom ?? _housingData.entry)>>
+	<<set $dynamicHousingRoom = _currentRoom>>
+	<<set _currentRoomData = _housingData.rooms[_currentRoom]>>
+
+	<h2>_currentRoomData.title</h2>
+	<<image _currentRoomData.image>>
+	<p>_currentRoomData.description</p>
+
+	<<for _connection range _currentRoomData.connections ?? []>>
+		<<if typeof _connection === 'string'>>
+			<<set _destination = _housingData.rooms[_connection]>>
+			<<ConnectedLocation _destination.title _housingData.passage `_connection+''` _destination.image 1>>
+		<<else>>
+			<<ConnectedLocation _connection.label _connection.destination '' _connection.image _connection.time>>
+		<</if>>
+	<</for>>
+
+	<<for _tag range _currentRoomData.tags ?? []>>
+		<<run _tags.push(_tag)>>
+	<</for>>
+
+	<<if _currentRoomData.passage>>
+		<<gs _currentRoomData.passage>>
+	<</if>>

+ 0 - 24
sugarcube/src/npcs/school/Artem/artemhome.tw

@@ -219,31 +219,7 @@
 	<<set _currentRoom = $location_var[$here][0]>>
 	<<gs 'dynamicHousing'>>
 
-:: dynamicHousing[include]
-	<<set _currentRoom ??= ($dynamicHousingRoom ?? _housingData.entry)>>
-	<<set $dynamicHousingRoom = _currentRoom>>
-	<<set _currentRoomData = _housingData.rooms[_currentRoom]>>
 
-	<h2>_currentRoomData.title</h2>
-	<<image _currentRoomData.image>>
-	<p>_currentRoomData.description</p>
-
-	<<for _connection range _currentRoomData.connections ?? []>>
-		<<if typeof _connection === 'string'>>
-			<<set _destination = _housingData.rooms[_connection]>>
-			<<ConnectedLocation _destination.title _housingData.passage `_connection+''` _destination.image 1>>
-		<<else>>
-			<<ConnectedLocation _connection.label _connection.destination '' _connection.image _connection.time>>
-		<</if>>
-	<</for>>
-
-	<<for _tag range _currentRoomData.tags ?? []>>
-		<<run _tags.push(_tag)>>
-	<</for>>
-
-	<<if _currentRoomData.passage>>
-		<<gs _currentRoomData.passage>>
-	<</if>>
 
 :: asdasdasdasd