|
|
|
|
|
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, |
|
}), |
|
}), |
|
}) |
|
|
|
|