-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #19 Since SelectionBox does not have AlwaysOnTop property I had to create custom one with BoxHandle and CylinderHandles with this pr, all modes including `Outline` and `Box` have working AlwaysOnTop setting ![image](https://user-images.githubusercontent.com/34089907/184451387-dde6a538-5ffb-40aa-b7af-3b36de617ed4.png)
- Loading branch information
Showing
3 changed files
with
96 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,28 @@ | ||
local Modules = script.Parent.Parent.Parent.Parent | ||
local Roact = require(Modules.Roact) | ||
local Util = require(Modules.Plugin.Util) | ||
|
||
local function BoxAdorn(props) | ||
if props.Adornee.ClassName == "Attachment" then | ||
return Roact.createElement("BoxHandleAdornment", { | ||
Adornee = props.Adornee.Parent, | ||
CFrame = props.Adornee.CFrame, | ||
Size = Vector3.new(1.2, 1.2, 1.2), | ||
Transparency = 0.3, | ||
local children = {} | ||
if props.AlwaysOnTop then | ||
children = Util.GenerateOutline({ | ||
Size = if props.Adornee.ClassName == "Attachment" | ||
then props.Adornee.Parent.Size | ||
elseif props.Adornee.ClassName == "Model" then props.Adornee:GetExtentsSize() | ||
else props.Adornee.Size, | ||
Adornee = if props.Adornee.ClassName == "Attachment" then props.Adornee.Parent else props.Adornee, | ||
Color3 = props.Color, | ||
Box = true, | ||
}) | ||
end | ||
return Roact.createElement("SelectionBox", { | ||
LineThickness = 0.03, | ||
SurfaceTransparency = 0.7, | ||
SurfaceColor3 = props.Color, | ||
Adornee = props.Adornee, | ||
Adornee = if props.Adornee.ClassName == "Attachment" then props.Adornee.Parent else props.Adornee, | ||
Color3 = props.Color, | ||
}) | ||
Visible = not props.AlwaysOnTop, | ||
}, children) | ||
end | ||
|
||
return BoxAdorn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
local Modules = script.Parent.Parent.Parent.Parent | ||
local Roact = require(Modules.Roact) | ||
local Util = require(Modules.Plugin.Util) | ||
|
||
local function OutlineAdorn(props) | ||
if props.Adornee.ClassName == "Attachment" then | ||
return Roact.createElement("BoxHandleAdornment", { | ||
Adornee = props.Adornee.Parent, | ||
CFrame = props.Adornee.CFrame, | ||
Size = Vector3.new(1.5, 1.5, 1.5), | ||
Transparency = 0.3, | ||
local children = {} | ||
if props.AlwaysOnTop then | ||
children = Util.GenerateOutline({ | ||
Size = if props.Adornee.ClassName == "Attachment" | ||
then props.Adornee.Parent.Size | ||
elseif props.Adornee.ClassName == "Model" then props.Adornee:GetExtentsSize() | ||
else props.Adornee.Size, | ||
Adornee = if props.Adornee.ClassName == "Attachment" then props.Adornee.Parent else props.Adornee, | ||
Color3 = props.Color, | ||
}) | ||
end | ||
return Roact.createElement("SelectionBox", { | ||
LineThickness = 0.05, | ||
Adornee = props.Adornee, | ||
LineThickness = 0.03, | ||
Adornee = if props.Adornee.ClassName == "Attachment" then props.Adornee.Parent else props.Adornee, | ||
Color3 = props.Color, | ||
}) | ||
Visible = not props.AlwaysOnTop, | ||
}, children) | ||
end | ||
|
||
return OutlineAdorn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters