File size: 2,515 Bytes
b6a38d7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
-- ========== GENERATED BY ExtrasGen Editor (Ctrl-Alt-G) DO NOT EDIT MANUALLY! ==========

PlaceObj('ExtrasGen', {
	RequiresClass = "EditorLineGuide",
	RequiresGuideType = "Horizontal",
	ToolbarSection = "Horizontal Objects",
	group = "PlaceObjects",
	id = "LayPlatformInside",
	PlaceObj('PrgIf', {
		Condition = function (self) return #initial_selection ~= 4 end,
		PlaceObj('PrgPrint', {
			VarArgs = {
				'"Four guides in a rectangle required - use the New Guides tool to place them."',
			},
		}),
	}),
	PlaceObj('PrgElse', {
		PlaceObj('PrgAssignExpr', {
			Value = function (self) return initial_selection[1] end,
			Variable = "guide1",
		}),
		PlaceObj('PrgAssignExpr', {
			Value = function (self) return initial_selection[2] end,
			Variable = "guide2",
		}),
		PlaceObj('PrgIf', {
			Condition = function (self) return guide1:GetNormal() + guide2:GetNormal() ~= point30 end,
			PlaceObj('PrgAssignExpr', {
				Value = function (self) return initial_selection[3] end,
				Variable = "guide2",
			}),
		}),
		PlaceObj('PrgIf', {
			Condition = function (self) return guide1:GetNormal() + guide2:GetNormal() ~= point30 end,
			PlaceObj('PrgAssignExpr', {
				Value = function (self) return initial_selection[4] end,
				Variable = "guide2",
			}),
		}),
		PlaceObj('PrgAssignExpr', {
			Value = function (self) return 0 end,
			Variable = "counter",
		}),
		PlaceObj('PrgAssignExpr', {
			Value = function (self) return {} end,
			Variable = "slabs",
		}),
		PlaceObj('PrgIf', {
			Condition = function (self) return Dot(guide2:GetPos() - guide1:GetPos(), guide1:GetNormal()) < 0 end,
			Repeat = true,
			PlaceObj('MoveSizeGuides', {
				Along = -1200,
				AlongScale = 1200,
				GuidesVar = "guide1",
			}),
			PlaceObj('LaySlabsAlongGuides', {
				AssignTo = "slabs",
				GuidesVar = "guide1",
				Middle = {
					PlaceObj('PlaceObjectData', {
						EditorClass = "FloorSlab",
					}),
				},
				SnapToNearestWall = false,
				SnapToVoxelEdge = false,
			}),
			PlaceObj('PrgAssignExpr', {
				Value = function (self) return counter + 1 end,
				Variable = "counter",
			}),
		}),
		PlaceObj('PrgIf', {
			Condition = function (self) return counter > 0 end,
			Repeat = true,
			PlaceObj('MoveSizeGuides', {
				Along = 1200,
				AlongScale = 1200,
				GuidesVar = "guide1",
			}),
			PlaceObj('PrgAssignExpr', {
				Value = function (self) return counter - 1 end,
				Variable = "counter",
			}),
		}),
		PlaceObj('SelectInEditor', {
			ObjectsVar = "slabs",
			SelectInEditor = false,
		}),
	}),
})