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

Commit c83077a

Browse files
committed
Added input to sliders.
1 parent d1e99b8 commit c83077a

File tree

4 files changed

+223
-318
lines changed

4 files changed

+223
-318
lines changed

src/SignsInternal/PluginGui/init.lua

Lines changed: 54 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ function PluginGui:newPluginGui(widgetGui)
3131
previewLabel:GetFrame().Parent = scrollFrame:GetContentsFrame()
3232

3333
local insertButton = CustomTextButton.new( -- Insert button
34-
"insertButton", -- name of the gui object
34+
"InsertButton", -- name of the gui object
3535
"Insert" -- the text displayed on the button
3636
)
3737
local buttonObject = insertButton:GetButton()
3838
buttonObject.Size = UDim2.new(1, -10, 0, 50)
3939
buttonObject.Parent = scrollFrame:GetContentsFrame()
4040

4141
local textCollapse = CollapsibleTitledSection.new( -- Text collapse
42-
"textCollapse", -- name suffix of the gui object
42+
"TextCollapse", -- name suffix of the gui object
4343
"Text", -- the text displayed beside the collapsible arrow
4444
true, -- have the content frame auto-update its size?
4545
true, -- minimizable?
@@ -48,47 +48,51 @@ function PluginGui:newPluginGui(widgetGui)
4848
listFrame:AddChild(textCollapse:GetSectionFrame()) -- add child to expanding VerticallyScalingListFrame
4949

5050
local textInput = LabeledTextInput.new( -- Asks user for text
51-
"textInput", -- name suffix of gui object
51+
"TextInput", -- name suffix of gui object
5252
"Text", -- title text of the multi choice
5353
"Text here" -- default value
5454
)
5555
textInput:SetMaxGraphemes(8192)
5656
textInput:GetFrame().Parent = textCollapse:GetContentsFrame()
5757

5858
local transparencyTextSlider = LabeledSlider.new( -- Size Slider
59-
"transparencyTextSlider", -- name suffix of gui object
59+
"TransparencyTextSlider", -- name suffix of gui object
6060
"Transparency", -- title text of the multi choice
6161
11, -- how many intervals to split the slider into
62-
1 -- the starting value of the slider
62+
1, -- the starting value of the slider
63+
0.1 -- multiplier for the slider value
6364
)
6465
transparencyTextSlider:GetFrame().Parent = textCollapse:GetContentsFrame()
6566

6667
local rotationTextSlider = LabeledSlider.new( -- Rotation Slider
67-
"rotationSlider", -- name suffix of gui object
68+
"RotationSlider", -- name suffix of gui object
6869
"Text Rotation", -- title text of the multi choice
69-
13, -- how many intervals to split the slider into
70-
1 -- the starting value of the slider
70+
9, -- how many intervals to split the slider into
71+
1, -- the starting value of the slider
72+
45 -- multiplier for the slider value
7173
)
7274
rotationTextSlider:GetFrame().Parent = textCollapse:GetContentsFrame()
7375

7476
local sizeTextSlider = LabeledSlider.new( -- Size Slider
75-
"sizeSlider", -- name suffix of gui object
77+
"SizeSlider", -- name suffix of gui object
7678
"Text Size", -- title text of the multi choice
7779
21, -- how many intervals to split the slider into
78-
4 -- the starting value of the slider
80+
4, -- the starting value of the slider
81+
5 -- multiplier for the slider value
7982
)
8083
sizeTextSlider:GetFrame().Parent = textCollapse:GetContentsFrame()
8184

8285
local heightTextSlider = LabeledSlider.new( -- Line height slider. Intended for onlt paid supporters.
83-
"heightSlider", -- name suffix of gui object
86+
"HeightSlider", -- name suffix of gui object
8487
"Line Height", -- title text of the multi choice
8588
5, -- how many intervals to split the slider into
86-
3 -- the starting value of the slider
89+
3, -- the starting value of the slider
90+
0.5 -- multiplier for the slider value
8791
)
8892
heightTextSlider:GetFrame().Parent = textCollapse:GetContentsFrame()
8993

9094
local markupCheckbox = LabeledCheckbox.new(
91-
"markupCheckbox", -- name suffix of gui object
95+
"MarkupCheckbox", -- name suffix of gui object
9296
"Rich Text", -- text beside the checkbox
9397
false, -- initial value
9498
false, -- initially disabled?
@@ -97,7 +101,7 @@ function PluginGui:newPluginGui(widgetGui)
97101
markupCheckbox:GetFrame().Parent = textCollapse:GetContentsFrame()
98102

99103
local scaledCheckbox = LabeledCheckbox.new(
100-
"scaledCheckbox", -- name suffix of gui object
104+
"ScaledCheckbox", -- name suffix of gui object
101105
"Text Scaled", -- text beside the checkbox
102106
false, -- initial value
103107
false, -- initially disabled?
@@ -106,7 +110,7 @@ function PluginGui:newPluginGui(widgetGui)
106110
scaledCheckbox:GetFrame().Parent = textCollapse:GetContentsFrame()
107111

108112
local wrappedCheckbox = LabeledCheckbox.new(
109-
"wrappedCheckbox", -- name suffix of gui object
113+
"WrappedCheckbox", -- name suffix of gui object
110114
"Text Wrapped", -- text beside the checkbox
111115
true, -- initial value
112116
false, -- initially disabled?
@@ -115,7 +119,7 @@ function PluginGui:newPluginGui(widgetGui)
115119
wrappedCheckbox:GetFrame().Parent = textCollapse:GetContentsFrame()
116120

117121
local fontCollapse = CollapsibleTitledSection.new( -- Fonts collapse
118-
"fontCollapse", -- name suffix of the gui object
122+
"FontCollapse", -- name suffix of the gui object
119123
"Font", -- the text displayed beside the collapsible arrow
120124
true, -- have the content frame auto-update its size?
121125
true, -- minimizable?
@@ -124,23 +128,23 @@ function PluginGui:newPluginGui(widgetGui)
124128
listFrame:AddChild(fontCollapse:GetSectionFrame()) -- add child to expanding VerticallyScalingListFrame
125129

126130
local boldCheckbox = LabeledCheckbox.new(
127-
"boldCheckbox", -- name suffix of gui object
131+
"BoldCheckbox", -- name suffix of gui object
128132
"Bold", -- text beside the checkbox
129133
false, -- initial value
130134
false -- initially disabled?
131135
)
132136
boldCheckbox:GetFrame().Parent = fontCollapse:GetContentsFrame()
133137

134138
local italicCheckbox = LabeledCheckbox.new(
135-
"italicCheckbox", -- name suffix of gui object
139+
"ItalicCheckbox", -- name suffix of gui object
136140
"Italic", -- text beside the checkbox
137141
false, -- initial value
138142
false -- initially disabled?
139143
)
140144
italicCheckbox:GetFrame().Parent = fontCollapse:GetContentsFrame()
141145

142146
local colorTextChoice = LabeledMultiChoice.new(
143-
"colorSelection", -- name suffix of gui object
147+
"ColorSelection", -- name suffix of gui object
144148
"Text Color", -- title text of the multi choice
145149
Color, -- choices array
146150
11 -- the starting index of the selection
@@ -152,15 +156,15 @@ function PluginGui:newPluginGui(widgetGui)
152156

153157
local fontTextChoice =
154158
LabeledMultiChoice.new( -- Basically in beta thingy for fonts. New system prob done by another PluginGui soon. This will suffice.
155-
"fontTextChoice", -- name suffix of gui object
159+
"FontTextChoice", -- name suffix of gui object
156160
"Font Face", -- title text of the multi choice
157161
FontFace, -- choices array
158162
32 -- the starting index of the selection
159163
)
160164
fontTextChoice:GetFrame().Parent = fontCollapse:GetContentsFrame()
161165

162166
local alignmentCollapse = CollapsibleTitledSection.new( -- Fonts collapse
163-
"alignmentCollapse", -- name suffix of the gui object
167+
"AlignmentCollapse", -- name suffix of the gui object
164168
"Alignment", -- the text displayed beside the collapsible arrow
165169
true, -- have the content frame auto-update its size?
166170
true, -- minimizable?
@@ -169,23 +173,23 @@ function PluginGui:newPluginGui(widgetGui)
169173
listFrame:AddChild(alignmentCollapse:GetSectionFrame()) -- add child to expanding VerticallyScalingListFrame
170174

171175
local yChoice = LabeledMultiChoice.new(
172-
"yChoice", -- name suffix of gui object
176+
"YChoice", -- name suffix of gui object
173177
"Horizontal Alignment", -- title text of the multi choice
174178
TextYAlignment, -- choices array
175179
2 -- the starting index of the selection
176180
)
177181
yChoice:GetFrame().Parent = alignmentCollapse:GetContentsFrame()
178182

179183
local xChoice = LabeledMultiChoice.new(
180-
"xChoice", -- name suffix of gui object
184+
"XChoice", -- name suffix of gui object
181185
"Vertical Alignment", -- title text of the multi choice
182186
TextXAlignment, -- choices array
183187
2 -- the starting index of the selection
184188
)
185189
xChoice:GetFrame().Parent = alignmentCollapse:GetContentsFrame()
186190

187191
local strokeCollapse = CollapsibleTitledSection.new( -- Fonts collapse
188-
"strokeCollapse", -- name suffix of the gui object
192+
"StrokeCollapse", -- name suffix of the gui object
189193
"Stroke", -- the text displayed beside the collapsible arrow
190194
true, -- have the content frame auto-update its size?
191195
true, -- minimizable?
@@ -194,33 +198,35 @@ function PluginGui:newPluginGui(widgetGui)
194198
listFrame:AddChild(strokeCollapse:GetSectionFrame()) -- add child to expanding VerticallyScalingListFrame
195199

196200
local strokeCheckbox = LabeledCheckbox.new(
197-
"strokeCheckbox", -- name suffix of gui object
201+
"StrokeCheckbox", -- name suffix of gui object
198202
"Enabled", -- text beside the checkbox
199203
false, -- initial value
200204
false -- initially disabled?
201205
)
202206
strokeCheckbox:GetFrame().Parent = strokeCollapse:GetContentsFrame()
203207

204208
local thicknessStrokeSlider = LabeledSlider.new( -- Size Slider
205-
"thicknessStrokeSlider", -- name suffix of gui object
209+
"ThicknessStrokeSlider", -- name suffix of gui object
206210
"Thickness", -- title text of the multi choice
207211
11, -- how many intervals to split the slider into
208212
2, -- the starting value of the slider
213+
1, -- the multiplier for the slider
209214
"api-reference/property/UIStroke/Thickness" -- link to wiki page
210215
)
211216
thicknessStrokeSlider:GetFrame().Parent = strokeCollapse:GetContentsFrame()
212217

213218
local transparencyStrokeSlider = LabeledSlider.new( -- Size Slider
214-
"transparencyStrokeSlider", -- name suffix of gui object
219+
"TransparencyStrokeSlider", -- name suffix of gui object
215220
"Transparency", -- title text of the multi choice
216221
11, -- how many intervals to split the slider into
217222
1, -- the starting value of the slider
223+
0.1, -- the multiplier for the slider
218224
"api-reference/property/UIStroke/Transparency" -- link to wiki page
219225
)
220226
transparencyStrokeSlider:GetFrame().Parent = strokeCollapse:GetContentsFrame()
221227

222228
local joinStrokeChoice = LabeledMultiChoice.new(
223-
"joinStrokeChoice", -- name suffix of gui object
229+
"JoinStrokeChoice", -- name suffix of gui object
224230
"Line Join Mode", -- title text of the multi choice
225231
LineJoinMode, -- choices array
226232
1, -- the starting index of the selection
@@ -229,7 +235,7 @@ function PluginGui:newPluginGui(widgetGui)
229235
joinStrokeChoice:GetFrame().Parent = strokeCollapse:GetContentsFrame()
230236

231237
local colorStrokeChoice = LabeledMultiChoice.new(
232-
"colorStrokeChoice", -- name suffix of gui object
238+
"ColorStrokeChoice", -- name suffix of gui object
233239
"Color", -- title text of the multi choice
234240
Color, -- choices array
235241
11, -- the starting index of the selection
@@ -241,7 +247,7 @@ function PluginGui:newPluginGui(widgetGui)
241247
colorStrokeChoice:GetFrame().Parent = strokeCollapse:GetContentsFrame()
242248

243249
local backgroundCollapse = CollapsibleTitledSection.new( -- Fonts collapse
244-
"backgroundCollapse", -- name suffix of the gui object
250+
"BackgroundCollapse", -- name suffix of the gui object
245251
"Background", -- the text displayed beside the collapsible arrow
246252
true, -- have the content frame auto-update its size?
247253
true, -- minimizable?
@@ -250,23 +256,24 @@ function PluginGui:newPluginGui(widgetGui)
250256
listFrame:AddChild(backgroundCollapse:GetSectionFrame()) -- add child to expanding VerticallyScalingListFrame
251257

252258
local transparencyBackgroundSlider = LabeledSlider.new( -- Size Slider
253-
"transparencyBackgroundSlider", -- name suffix of gui object
259+
"TransparencyBackgroundSlider", -- name suffix of gui object
254260
"Transparency", -- title text of the multi choice
255261
11, -- how many intervals to split the slider into
256-
11 -- the starting value of the slider
262+
11, -- the starting value of the slider
263+
0.1 -- the multiplier for the slider
257264
)
258265
transparencyBackgroundSlider:GetFrame().Parent = backgroundCollapse:GetContentsFrame()
259266

260267
local colorBackgroundChoice = LabeledMultiChoice.new(
261-
"colorBackgroundSelection", -- name suffix of gui object
268+
"ColorBackgroundSelection", -- name suffix of gui object
262269
"Background Color", -- title text of the multi choice
263270
Color, -- choices array
264271
1 -- the starting index of the selection
265272
)
266273
colorBackgroundChoice:GetFrame().Parent = backgroundCollapse:GetContentsFrame()
267274

268275
local surfaceCollapse = CollapsibleTitledSection.new( -- Fonts collapse
269-
"surfaceCollapse", -- name suffix of the gui object
276+
"SurfaceCollapse", -- name suffix of the gui object
270277
"Other", -- the text displayed beside the collapsible arrow
271278
true, -- have the content frame auto-update its size?
272279
true, -- minimizable?
@@ -275,23 +282,24 @@ function PluginGui:newPluginGui(widgetGui)
275282
listFrame:AddChild(surfaceCollapse:GetSectionFrame()) -- add child to expanding VerticallyScalingListFrame
276283

277284
local influenceSlider = LabeledSlider.new( -- Size Slider
278-
"influenceSlider", -- name suffix of gui object
285+
"InfluenceSlider", -- name suffix of gui object
279286
"Light Influence", -- title text of the multi choice
280287
5, -- how many intervals to split the slider into
281-
1 -- the starting value of the slider
288+
1, -- the starting value of the slider
289+
0.1 -- the multiplier for the slider
282290
)
283291
influenceSlider:GetFrame().Parent = surfaceCollapse:GetContentsFrame()
284292

285293
local topCheckbox = LabeledCheckbox.new(
286-
"topCheckbox", -- name suffix of gui object
294+
"TopCheckbox", -- name suffix of gui object
287295
"Always On Top", -- text beside the checkbox
288296
false, -- initial value
289297
false -- initially disabled?
290298
)
291299
topCheckbox:GetFrame().Parent = surfaceCollapse:GetContentsFrame()
292300

293301
local localizeCheckbox = LabeledCheckbox.new(
294-
"localizeCheckbox", -- name suffix of gui object
302+
"LocalizeCheckbox", -- name suffix of gui object
295303
"Auto Localize", -- text beside the checkbox
296304
true, -- initial value
297305
false -- initially disabled?
@@ -318,19 +326,19 @@ function PluginGui:newPluginGui(widgetGui)
318326
end)
319327

320328
transparencyTextSlider:SetValueChangedFunction(function(newValue)
321-
CustomTextLabel:UpdateTextTransparency((newValue - 1) / 10)
329+
CustomTextLabel:UpdateTextTransparency(newValue)
322330
end)
323331

324332
sizeTextSlider:SetValueChangedFunction(function(newValue)
325-
CustomTextLabel:UpdateTextSize((newValue - 1) * 5)
333+
CustomTextLabel:UpdateTextSize(newValue)
326334
end)
327335

328336
rotationTextSlider:SetValueChangedFunction(function(newValue)
329-
CustomTextLabel:UpdateTextRotation((newValue - 1) * 30)
337+
CustomTextLabel:UpdateTextRotation(newValue)
330338
end)
331339

332340
heightTextSlider:SetValueChangedFunction(function(newValue)
333-
CustomTextLabel:UpdateLineHeight((newValue - 1) / 2)
341+
CustomTextLabel:UpdateLineHeight(newValue)
334342
end)
335343

336344
markupCheckbox:SetValueChangedFunction(function(newValue)
@@ -344,7 +352,7 @@ function PluginGui:newPluginGui(widgetGui)
344352
wrappedCheckbox:SetDisabled(true)
345353
wrappedCheckbox:SetValue(true)
346354
else
347-
sizeTextSlider:SetValue(4)
355+
sizeTextSlider:SetValue(3)
348356
wrappedCheckbox:SetDisabled(false)
349357
end
350358
end)
@@ -392,15 +400,15 @@ function PluginGui:newPluginGui(widgetGui)
392400
end)
393401

394402
thicknessStrokeSlider:SetValueChangedFunction(function(newValue)
395-
CustomTextLabel:UpdateStrokeThickness((newValue - 1))
403+
CustomTextLabel:UpdateStrokeThickness(newValue)
396404
end)
397405

398406
transparencyStrokeSlider:SetValueChangedFunction(function(newValue)
399-
CustomTextLabel:UpdateStrokeTransparency((newValue - 1) / 10)
407+
CustomTextLabel:UpdateStrokeTransparency(newValue)
400408
end)
401409

402410
transparencyBackgroundSlider:SetValueChangedFunction(function(newValue)
403-
CustomTextLabel:UpdateBackgroundTransparency((newValue - 1) / 10)
411+
CustomTextLabel:UpdateBackgroundTransparency(newValue)
404412
end)
405413

406414
colorBackgroundChoice:SetValueChangedFunction(function(newIndex)

0 commit comments

Comments
 (0)