This repository has been archived by the owner on Jul 16, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix debug widgets with absolute references
- Loading branch information
Showing
6 changed files
with
215 additions
and
204 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
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
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,27 +1,27 @@ | ||
local ReplicatedStorage = game:GetService("ReplicatedStorage") | ||
local Plasma = require(ReplicatedStorage.Packages.plasma) | ||
local create = Plasma.create | ||
return function(Plasma) | ||
local create = Plasma.create | ||
|
||
return Plasma.widget(function(fn, options) | ||
options = options or {} | ||
return Plasma.widget(function(fn, options) | ||
options = options or {} | ||
|
||
local padding = options.padding or 10 | ||
local padding = options.padding or 10 | ||
|
||
local frame = Plasma.useInstance(function() | ||
return create("Frame", { | ||
BackgroundTransparency = 1, | ||
Position = UDim2.new(0, 0, 0, options.marginTop or 0), | ||
Size = UDim2.new(1, 0, 1, -(options.marginTop or 0)), | ||
local frame = Plasma.useInstance(function() | ||
return create("Frame", { | ||
BackgroundTransparency = 1, | ||
Position = UDim2.new(0, 0, 0, options.marginTop or 0), | ||
Size = UDim2.new(1, 0, 1, -(options.marginTop or 0)), | ||
|
||
create("UIListLayout", { | ||
SortOrder = Enum.SortOrder.LayoutOrder, | ||
FillDirection = options.direction or Enum.FillDirection.Vertical, | ||
Padding = UDim.new(0, padding), | ||
}), | ||
}) | ||
end) | ||
create("UIListLayout", { | ||
SortOrder = Enum.SortOrder.LayoutOrder, | ||
FillDirection = options.direction or Enum.FillDirection.Vertical, | ||
Padding = UDim.new(0, padding), | ||
}), | ||
}) | ||
end) | ||
|
||
Plasma.scope(fn) | ||
Plasma.scope(fn) | ||
|
||
return frame | ||
end) | ||
return frame | ||
end) | ||
end |
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,48 +1,47 @@ | ||
local ReplicatedStorage = game:GetService("ReplicatedStorage") | ||
local Plasma = require(ReplicatedStorage.Packages.plasma) | ||
return function(Plasma) | ||
return Plasma.widget(function() | ||
local instance = Plasma.useInstance(function() | ||
local style = Plasma.useStyle() | ||
|
||
return Plasma.widget(function() | ||
local instance = Plasma.useInstance(function() | ||
local style = Plasma.useStyle() | ||
local Frame = Instance.new("Frame") | ||
Frame.BackgroundColor3 = style.bg2 | ||
Frame.Position = UDim2.new(0.5, 0, 0.5, 0) | ||
Frame.AnchorPoint = Vector2.new(0.5, 0.5) | ||
Frame.Size = UDim2.new(0, 50, 0, 40) | ||
Frame.Visible = false | ||
|
||
local Frame = Instance.new("Frame") | ||
Frame.BackgroundColor3 = style.bg2 | ||
Frame.Position = UDim2.new(0.5, 0, 0.5, 0) | ||
Frame.AnchorPoint = Vector2.new(0.5, 0.5) | ||
Frame.Size = UDim2.new(0, 50, 0, 40) | ||
Frame.Visible = false | ||
local UICorner = Instance.new("UICorner") | ||
UICorner.Parent = Frame | ||
|
||
local UICorner = Instance.new("UICorner") | ||
UICorner.Parent = Frame | ||
local UIPadding = Instance.new("UIPadding") | ||
UIPadding.PaddingBottom = UDim.new(0, 20) | ||
UIPadding.PaddingLeft = UDim.new(0, 20) | ||
UIPadding.PaddingRight = UDim.new(0, 20) | ||
UIPadding.PaddingTop = UDim.new(0, 20) | ||
UIPadding.Parent = Frame | ||
|
||
local UIPadding = Instance.new("UIPadding") | ||
UIPadding.PaddingBottom = UDim.new(0, 20) | ||
UIPadding.PaddingLeft = UDim.new(0, 20) | ||
UIPadding.PaddingRight = UDim.new(0, 20) | ||
UIPadding.PaddingTop = UDim.new(0, 20) | ||
UIPadding.Parent = Frame | ||
local UIStroke = Instance.new("UIStroke") | ||
UIStroke.Parent = Frame | ||
|
||
local UIStroke = Instance.new("UIStroke") | ||
UIStroke.Parent = Frame | ||
local UIListLayout = Instance.new("UIListLayout") | ||
UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder | ||
UIListLayout.Padding = UDim.new(0, 10) | ||
UIListLayout.Parent = Frame | ||
|
||
local UIListLayout = Instance.new("UIListLayout") | ||
UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder | ||
UIListLayout.Padding = UDim.new(0, 10) | ||
UIListLayout.Parent = Frame | ||
local numChildren = #Frame:GetChildren() | ||
|
||
local numChildren = #Frame:GetChildren() | ||
Plasma.automaticSize(Frame) | ||
|
||
Plasma.automaticSize(Frame) | ||
local function updateVisibility() | ||
Frame.Visible = #Frame:GetChildren() > numChildren | ||
end | ||
|
||
local function updateVisibility() | ||
Frame.Visible = #Frame:GetChildren() > numChildren | ||
end | ||
Frame.ChildAdded:Connect(updateVisibility) | ||
Frame.ChildRemoved:Connect(updateVisibility) | ||
|
||
Frame.ChildAdded:Connect(updateVisibility) | ||
Frame.ChildRemoved:Connect(updateVisibility) | ||
return Frame | ||
end) | ||
|
||
return Frame | ||
return instance | ||
end) | ||
|
||
return instance | ||
end) | ||
end |
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,54 +1,53 @@ | ||
local ReplicatedStorage = game:GetService("ReplicatedStorage") | ||
local Plasma = require(ReplicatedStorage.Packages.plasma) | ||
local create = Plasma.create | ||
|
||
return Plasma.widget(function(children, options) | ||
options = options or {} | ||
|
||
options.fullHeight = if options.fullHeight then options.fullHeight else true | ||
|
||
Plasma.useInstance(function() | ||
local style = Plasma.useStyle() | ||
|
||
local frame = create("Frame", { | ||
BackgroundColor3 = style.bg2, | ||
Position = UDim2.new(0, 0, 0, 0), | ||
Size = UDim2.new(0, 250, if options.fullHeight then 1 else 0, 0), | ||
|
||
create("UIPadding", { | ||
PaddingBottom = UDim.new(0, 20), | ||
PaddingLeft = UDim.new(0, 20), | ||
PaddingRight = UDim.new(0, 20), | ||
PaddingTop = UDim.new(0, 20), | ||
}), | ||
create("UIStroke", {}), | ||
|
||
create("UIListLayout", { | ||
SortOrder = Enum.SortOrder.LayoutOrder, | ||
}), | ||
|
||
create("ScrollingFrame", { | ||
BackgroundTransparency = 1, | ||
Name = "Container", | ||
VerticalScrollBarInset = Enum.ScrollBarInset.ScrollBar, | ||
HorizontalScrollBarInset = Enum.ScrollBarInset.ScrollBar, | ||
BorderSizePixel = 0, | ||
ScrollBarThickness = 6, | ||
ClipsDescendants = false, | ||
Size = UDim2.new(1, 0, 1, 0), | ||
return function(Plasma) | ||
local create = Plasma.create | ||
return Plasma.widget(function(children, options) | ||
options = options or {} | ||
|
||
options.fullHeight = if options.fullHeight then options.fullHeight else true | ||
|
||
Plasma.useInstance(function() | ||
local style = Plasma.useStyle() | ||
|
||
local frame = create("Frame", { | ||
BackgroundColor3 = style.bg2, | ||
Position = UDim2.new(0, 0, 0, 0), | ||
Size = UDim2.new(0, 250, if options.fullHeight then 1 else 0, 0), | ||
|
||
create("UIPadding", { | ||
PaddingBottom = UDim.new(0, 20), | ||
PaddingLeft = UDim.new(0, 20), | ||
PaddingRight = UDim.new(0, 20), | ||
PaddingTop = UDim.new(0, 20), | ||
}), | ||
create("UIStroke", {}), | ||
|
||
create("UIListLayout", { | ||
SortOrder = Enum.SortOrder.LayoutOrder, | ||
}), | ||
}), | ||
}) | ||
|
||
Plasma.automaticSize(frame.Container, { | ||
axis = Enum.AutomaticSize.Y, | ||
}) | ||
create("ScrollingFrame", { | ||
BackgroundTransparency = 1, | ||
Name = "Container", | ||
VerticalScrollBarInset = Enum.ScrollBarInset.ScrollBar, | ||
HorizontalScrollBarInset = Enum.ScrollBarInset.ScrollBar, | ||
BorderSizePixel = 0, | ||
ScrollBarThickness = 6, | ||
ClipsDescendants = false, | ||
Size = UDim2.new(1, 0, 1, 0), | ||
|
||
create("UIListLayout", { | ||
SortOrder = Enum.SortOrder.LayoutOrder, | ||
}), | ||
}), | ||
}) | ||
|
||
return frame, frame.Container | ||
end) | ||
Plasma.automaticSize(frame.Container, { | ||
axis = Enum.AutomaticSize.Y, | ||
}) | ||
|
||
Plasma.scope(children) | ||
end) | ||
return frame, frame.Container | ||
end) | ||
|
||
Plasma.scope(children) | ||
end) | ||
end |
Oops, something went wrong.