Skip to content
This repository was archived by the owner on Aug 20, 2024. It is now read-only.

Commit 04dd45c

Browse files
committed
Update Signs Free.
Signed-off-by: RyanLua <[email protected]>
1 parent d161b2f commit 04dd45c

File tree

3 files changed

+206
-86
lines changed

3 files changed

+206
-86
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
local choices = {
2+
{ Id = "1", Mode = Enum.TextXAlignment.Left, Text = "Left" },
3+
{ Id = "2", Mode = Enum.TextXAlignment.Center, Text = "Center" },
4+
{ Id = "3", Mode = Enum.TextXAlignment.Right, Text = "Right" },
5+
}
6+
7+
return choices
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
local choices = {
2+
{ Id = "1", Mode = Enum.TextYAlignment.Top, Text = "Top" },
3+
{ Id = "2", Mode = Enum.TextYAlignment.Center, Text = "Center" },
4+
{ Id = "3", Mode = Enum.TextYAlignment.Bottom, Text = "Bottom" },
5+
}
6+
7+
return choices

src/SignsFree/PluginGui/init.lua

Lines changed: 192 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ local VerticallyScalingListFrame = require(targetFolder.VerticallyScalingListFra
1616
local Color = require(script.Color)
1717
local FontFace = require(script.FontFace)
1818
local GuiObjectPart = require(script.GuiObjectPart)
19+
local LineJoinMode = require(script.LineJoinMode)
1920
local AspectRatio = require(script.AspectRatio)
21+
local TextXAlignment = require(script.TextXAlignment)
22+
local TextYAlignment = require(script.TextYAlignment)
2023

2124
local PluginGui = {}
2225

@@ -68,7 +71,7 @@ function PluginGui:newPluginGui(widgetGui)
6871
-- Text collapse
6972
local textCollapse = CollapsibleTitledSection.new(
7073
"TextCollapse", -- name suffix of the gui object
71-
"Text", -- the text displayed beside the collapsible arrow
74+
"Text Contents", -- the text displayed beside the collapsible arrow
7275
true, -- have the content frame auto-update its size?
7376
true, -- minimizable?
7477
false -- minimized by default?
@@ -87,31 +90,28 @@ function PluginGui:newPluginGui(widgetGui)
8790
CustomTextLabel:UpdateText(newValue)
8891
end)
8992

90-
-- Text transparency slider
91-
local transparencyTextSlider = LabeledSlider.new(
92-
"TransparencyTextSlider", -- name suffix of gui object
93-
"Transparency", -- title text of the multi choice
94-
11, -- how many intervals to split the slider into
95-
1, -- the starting value of the slider
96-
0.1 -- multiplier for the slider value
93+
-- Rich text checkbox
94+
local markupCheckbox = LabeledCheckbox.new(
95+
"MarkupCheckbox", -- name suffix of gui object
96+
"Rich Text", -- text beside the checkbox
97+
false, -- initial value
98+
false, -- initially disabled?
99+
"articles/gui-rich-text" -- link to wiki page
97100
)
98-
transparencyTextSlider:GetFrame().Parent = textCollapse:GetContentsFrame()
99-
transparencyTextSlider:SetValueChangedFunction(function(newValue)
100-
CustomTextLabel:UpdateTextTransparency(newValue)
101+
markupCheckbox:GetFrame().Parent = textCollapse:GetContentsFrame()
102+
markupCheckbox:SetValueChangedFunction(function(newValue)
103+
CustomTextLabel:UpdateRichText(newValue)
101104
end)
102105

103-
-- Text rotation slider
104-
local rotationTextSlider = LabeledSlider.new(
105-
"RotationSlider", -- name suffix of gui object
106-
"Text Rotation", -- title text of the multi choice
107-
9, -- how many intervals to split the slider into
108-
1, -- the starting value of the slider
109-
45 -- multiplier for the slider value
106+
-- Size collapse
107+
local sizeCollapse = CollapsibleTitledSection.new(
108+
"SizeCollapse", -- name suffix of the gui object
109+
"Sizing & Wrapping", -- the text displayed beside the collapsible arrow
110+
true, -- have the content frame auto-update its size?
111+
true, -- minimizable?
112+
true -- minimized by default?
110113
)
111-
rotationTextSlider:GetFrame().Parent = textCollapse:GetContentsFrame()
112-
rotationTextSlider:SetValueChangedFunction(function(newValue)
113-
CustomTextLabel:UpdateTextRotation(newValue)
114-
end)
114+
createFrame:AddChild(sizeCollapse:GetSectionFrame())
115115

116116
-- Size slider
117117
local sizeTextSlider = LabeledSlider.new(
@@ -121,47 +121,11 @@ function PluginGui:newPluginGui(widgetGui)
121121
4, -- the starting value of the slider
122122
5 -- multiplier for the slider value
123123
)
124-
sizeTextSlider:GetFrame().Parent = textCollapse:GetContentsFrame()
124+
sizeTextSlider:GetFrame().Parent = sizeCollapse:GetContentsFrame()
125125
sizeTextSlider:SetValueChangedFunction(function(newValue)
126126
CustomTextLabel:UpdateTextSize(newValue)
127127
end)
128128

129-
-- Line height slider
130-
local heightTextSlider = LabeledSlider.new(
131-
"HeightSlider", -- name suffix of gui object
132-
"Line Height", -- title text of the multi choice
133-
5, -- how many intervals to split the slider into
134-
3, -- the starting value of the slider
135-
0.5 -- multiplier for the slider value
136-
)
137-
heightTextSlider:GetFrame().Parent = textCollapse:GetContentsFrame()
138-
heightTextSlider:SetValueChangedFunction(function(newValue)
139-
CustomTextLabel:UpdateLineHeight(newValue)
140-
end)
141-
142-
-- Rich text checkbox
143-
local markupCheckbox = LabeledCheckbox.new(
144-
"MarkupCheckbox", -- name suffix of gui object
145-
"Rich Text", -- text beside the checkbox
146-
false, -- initial value
147-
false, -- initially disabled?
148-
"articles/gui-rich-text" -- link to wiki page
149-
)
150-
markupCheckbox:GetFrame().Parent = textCollapse:GetContentsFrame()
151-
markupCheckbox:SetValueChangedFunction(function(newValue)
152-
CustomTextLabel:UpdateRichText(newValue)
153-
end)
154-
155-
-- Text scaled checkbox
156-
local scaledCheckbox = LabeledCheckbox.new(
157-
"ScaledCheckbox", -- name suffix of gui object
158-
"Text Scaled", -- text beside the checkbox
159-
false, -- initial value
160-
false, -- initially disabled?
161-
"api-reference/property/TextLabel/TextScaled" -- link to wiki page
162-
)
163-
scaledCheckbox:GetFrame().Parent = textCollapse:GetContentsFrame()
164-
165129
-- Text wrapped checkbox
166130
local wrappedCheckbox = LabeledCheckbox.new(
167131
"WrappedCheckbox", -- name suffix of gui object
@@ -170,12 +134,20 @@ function PluginGui:newPluginGui(widgetGui)
170134
false, -- initially disabled?
171135
"api-reference/property/TextLabel/TextWrapped" -- link to wiki page
172136
)
173-
wrappedCheckbox:GetFrame().Parent = textCollapse:GetContentsFrame()
137+
wrappedCheckbox:GetFrame().Parent = sizeCollapse:GetContentsFrame()
174138
wrappedCheckbox:SetValueChangedFunction(function(newValue)
175139
CustomTextLabel:UpdateTextWrapped(newValue)
176140
end)
177141

178142
-- Text scaled checkbox
143+
local scaledCheckbox = LabeledCheckbox.new(
144+
"ScaledCheckbox", -- name suffix of gui object
145+
"Text Scaled", -- text beside the checkbox
146+
false, -- initial value
147+
false, -- initially disabled?
148+
"api-reference/property/TextLabel/TextScaled" -- link to wiki page
149+
)
150+
scaledCheckbox:GetFrame().Parent = sizeCollapse:GetContentsFrame()
179151
scaledCheckbox:SetValueChangedFunction(function(newValue)
180152
CustomTextLabel:UpdateTextScaled(newValue)
181153
if scaledCheckbox:GetValue() == true then
@@ -188,6 +160,82 @@ function PluginGui:newPluginGui(widgetGui)
188160
end
189161
end)
190162

163+
-- Ratio choice
164+
local ratioChoice = LabeledMultiChoice.new(
165+
"RatioChoice", -- name suffix of gui object
166+
"Aspect Ratio", -- title text of the multi choice
167+
AspectRatio, -- choices array
168+
5 -- the starting index of the selection
169+
)
170+
ratioChoice:GetFrame().Parent = sizeCollapse:GetContentsFrame()
171+
ratioChoice:SetValueChangedFunction(function(newIndex)
172+
local newValue = AspectRatio[newIndex].Value
173+
CustomTextLabel:UpdateAspectRatio(newValue)
174+
end)
175+
176+
-- Alignment collapse
177+
local alignmentCollapse = CollapsibleTitledSection.new(
178+
"AlignmentCollapse", -- name suffix of the gui object
179+
"Alignment & Rotation", -- the text displayed beside the collapsible arrow
180+
true, -- have the content frame auto-update its size?
181+
true, -- minimizable?
182+
true -- minimized by default?
183+
)
184+
createFrame:AddChild(alignmentCollapse:GetSectionFrame())
185+
186+
-- Text rotation slider
187+
local rotationTextSlider = LabeledSlider.new(
188+
"RotationSlider", -- name suffix of gui object
189+
"Text Rotation", -- title text of the multi choice
190+
9, -- how many intervals to split the slider into
191+
1, -- the starting value of the slider
192+
45 -- multiplier for the slider value
193+
)
194+
rotationTextSlider:GetFrame().Parent = alignmentCollapse:GetContentsFrame()
195+
rotationTextSlider:SetValueChangedFunction(function(newValue)
196+
CustomTextLabel:UpdateTextRotation(newValue)
197+
end)
198+
199+
-- Line height slider
200+
local heightTextSlider = LabeledSlider.new(
201+
"HeightSlider", -- name suffix of gui object
202+
"Line Height", -- title text of the multi choice
203+
5, -- how many intervals to split the slider into
204+
3, -- the starting value of the slider
205+
0.5 -- multiplier for the slider value
206+
)
207+
heightTextSlider:GetFrame().Parent = alignmentCollapse:GetContentsFrame()
208+
heightTextSlider:SetValueChangedFunction(function(newValue)
209+
CustomTextLabel:UpdateLineHeight(newValue)
210+
end)
211+
212+
213+
-- Horizontal alignment choice
214+
local yChoice = LabeledMultiChoice.new(
215+
"YChoice", -- name suffix of gui object
216+
"Horizontal Alignment", -- title text of the multi choice
217+
TextYAlignment, -- choices array
218+
2 -- the starting index of the selection
219+
)
220+
yChoice:GetFrame().Parent = alignmentCollapse:GetContentsFrame()
221+
yChoice:SetValueChangedFunction(function(newIndex)
222+
local newValue = TextYAlignment[newIndex].Mode
223+
CustomTextLabel:UpdateVerticalAlignment(newValue)
224+
end)
225+
226+
-- Vertical alignment choice
227+
local xChoice = LabeledMultiChoice.new(
228+
"XChoice", -- name suffix of gui object
229+
"Vertical Alignment", -- title text of the multi choice
230+
TextXAlignment, -- choices array
231+
2 -- the starting index of the selection
232+
)
233+
xChoice:GetFrame().Parent = alignmentCollapse:GetContentsFrame()
234+
xChoice:SetValueChangedFunction(function(newIndex)
235+
local newValue = TextXAlignment[newIndex].Mode
236+
CustomTextLabel:UpdateHorizontalAlignment(newValue)
237+
end)
238+
191239
-- Font collapse
192240
local fontCollapse = CollapsibleTitledSection.new(
193241
"FontCollapse", -- name suffix of the gui object
@@ -198,6 +246,19 @@ function PluginGui:newPluginGui(widgetGui)
198246
)
199247
createFrame:AddChild(fontCollapse:GetSectionFrame())
200248

249+
-- Text transparency slider
250+
local transparencyTextSlider = LabeledSlider.new(
251+
"TransparencyTextSlider", -- name suffix of gui object
252+
"Transparency", -- title text of the multi choice
253+
11, -- how many intervals to split the slider into
254+
1, -- the starting value of the slider
255+
0.1 -- multiplier for the slider value
256+
)
257+
transparencyTextSlider:GetFrame().Parent = fontCollapse:GetContentsFrame()
258+
transparencyTextSlider:SetValueChangedFunction(function(newValue)
259+
CustomTextLabel:UpdateTextTransparency(newValue)
260+
end)
261+
201262
-- Bold checkbox
202263
local boldCheckbox = LabeledCheckbox.new(
203264
"BoldCheckbox", -- name suffix of gui object
@@ -304,29 +365,6 @@ function PluginGui:newPluginGui(widgetGui)
304365
CustomTextLabel:UpdateStrokeColor(newValue)
305366
end)
306367

307-
-- Size collapse
308-
local sizeCollapse = CollapsibleTitledSection.new(
309-
"SizeCollapse", -- name suffix of the gui object
310-
"Size", -- the text displayed beside the collapsible arrow
311-
true, -- have the content frame auto-update its size?
312-
true, -- minimizable?
313-
true -- minimized by default?
314-
)
315-
createFrame:AddChild(sizeCollapse:GetSectionFrame())
316-
317-
-- Size choice
318-
local ratioChoice = LabeledMultiChoice.new(
319-
"RatioChoice", -- name suffix of gui object
320-
"Aspect Ratio", -- title text of the multi choice
321-
AspectRatio, -- choices array
322-
5 -- the starting index of the selection
323-
)
324-
ratioChoice:GetFrame().Parent = sizeCollapse:GetContentsFrame()
325-
ratioChoice:SetValueChangedFunction(function(newIndex)
326-
local newValue = AspectRatio[newIndex].Value
327-
CustomTextLabel:UpdateAspectRatio(newValue)
328-
end)
329-
330368
-- Background collapse
331369
local backgroundCollapse = CollapsibleTitledSection.new(
332370
"BackgroundCollapse", -- name suffix of the gui object
@@ -366,15 +404,83 @@ function PluginGui:newPluginGui(widgetGui)
366404
CustomTextLabel:UpdateBackgroundColor3(newValue)
367405
end)
368406

407+
-- Other collapse
408+
local surfaceCollapse = CollapsibleTitledSection.new(
409+
"SurfaceCollapse", -- name suffix of the gui object
410+
"Other", -- the text displayed beside the collapsible arrow
411+
true, -- have the content frame auto-update its size?
412+
true, -- minimizable?
413+
true -- minimized by default?
414+
)
415+
createFrame:AddChild(surfaceCollapse:GetSectionFrame())
416+
417+
-- Light influence slider
418+
local influenceSlider = LabeledSlider.new(
419+
"InfluenceSlider", -- name suffix of gui object
420+
"Light Influence", -- title text of the multi choice
421+
5, -- how many intervals to split the slider into
422+
1, -- the starting value of the slider
423+
0.1 -- the multiplier for the slider
424+
)
425+
influenceSlider:GetFrame().Parent = surfaceCollapse:GetContentsFrame()
426+
427+
-- Always on top checkbox
428+
local topCheckbox = LabeledCheckbox.new(
429+
"TopCheckbox", -- name suffix of gui object
430+
"Always On Top", -- text beside the checkbox
431+
false, -- initial value
432+
false -- initially disabled?
433+
)
434+
topCheckbox:GetFrame().Parent = surfaceCollapse:GetContentsFrame()
435+
436+
-- Auto localize checkbox
437+
local localizeCheckbox = LabeledCheckbox.new(
438+
"LocalizeCheckbox", -- name suffix of gui object
439+
"Auto Localize", -- text beside the checkbox
440+
true, -- initial value
441+
false -- initially disabled?
442+
)
443+
localizeCheckbox:GetFrame().Parent = surfaceCollapse:GetContentsFrame()
444+
369445
-- Insert sign button
370446
insertButton:GetButton().MouseButton1Click:Connect(function()
371447
local label = CustomTextLabel:GetLabel()
372-
local influence = 0
373-
local top = false
374-
local localize = true
448+
local influence = ((influenceSlider:GetValue() - 1) / 4)
449+
local top = topCheckbox:GetValue()
450+
local localize = localizeCheckbox:GetValue()
375451
local size = CustomTextLabel:GetLabel().AbsoluteSize
376452
GuiObjectPart.new(label, localize, influence, top, size)
377453
end)
454+
455+
-- -- Edit tab
456+
457+
-- local editScrollFrame = VerticalScrollingFrameScrollingFrame.new("EditScrollFrame")
458+
459+
-- local editFrame = VerticallyScalingListFrame.new( -- Scrolling frame
460+
-- "EditFrame" -- name suffix of gui object
461+
-- )
462+
463+
-- local editButton = CustomTextButton.new(
464+
-- "EditButton", -- name of the gui object
465+
-- "Edit" -- the text displayed on the button
466+
-- )
467+
-- local editObject = editButton:GetButton()
468+
-- editObject.Size = UDim2.new(1, -5, 0, 50)
469+
-- editObject.Parent = editScrollFrame:GetContentsFrame()
470+
471+
-- local hint = GuiUtilities.MakeFrameWithSubSectionLabel("Hint", "Selected is not a SignsPart.")
472+
-- editFrame:AddChild(hint)
473+
474+
-- tabBar:AddTab("EditScrollFrame", "Edit")
475+
-- editFrame:GetFrame().Parent = editScrollFrame:GetContentsFrame() -- scroll content will be the VerticallyScalingListFrame
476+
-- editScrollFrame:GetSectionFrame().Parent = tabBar:GetFrame() -- set the section parent
477+
478+
-- editButton:GetButton().MouseButton1Click:Connect(function()
479+
-- local Selection = game:GetService("Selection")
480+
481+
-- Selection:Get()
482+
-- HighlightEditable:highlight()
483+
-- end)
378484
end
379485

380486
-- Destorys the plugin gui so a new one can be created

0 commit comments

Comments
 (0)