roblox / studiowidgets Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
The TitledSection element in Studio's Properties panel will collapse / expand when the developer double-clicks any position within the elements title bar. The CollapsibleTitledSection of the StudioWidgets library does not come with this functionality and instead requires developers to accurately click the small arrow icon. Adding this behavior will be a great improvement to the elements usability.
function CustomTextButtonClass:getButton()
should be function CustomTextButtonClass:GetButton()
as according to https://github.com/Roblox/StudioWidgets#coding-conventions.
When using the code: LabeledMultiChoice.new("LabeledMultiChoice", "LabeledMultiChoice", {'Labeled', 'Multi', 'Choice'}, 1)
I get the error Workspace.SubWidgets.Modules.StudioWidgets.LabeledCheckbox:46: attempt to concatenate local 'nameSuffix' (a nil value)
. The labelled multi choice does not appear.
Here's the full output:
17:41:23.428 - Workspace.SubWidgets.Modules.StudioWidgets.LabeledCheckbox:46: attempt to concatenate local 'nameSuffix' (a nil value)
17:41:23.428 - Stack Begin
17:41:23.428 - Script 'Workspace.SubWidgets.Modules.StudioWidgets.LabeledCheckbox', Line 46 - field new
17:41:23.429 - Script 'Workspace.SubWidgets.Modules.StudioWidgets.LabeledRadioButton', Line 22 - field new
17:41:23.429 - Script 'Workspace.SubWidgets.Modules.StudioWidgets.LabeledMultiChoice', Line 112 - method _AddRadioButton
17:41:23.430 - Script 'Workspace.SubWidgets.Modules.StudioWidgets.LabeledMultiChoice', Line 102 - method _MakeRadioButtons
I'm trying to get something to work so I can copy the the LabeledMultiChoice from the PluginGuiService, unfortunately, I have no luck. If I try a local plugin in my plugins folder, it prints out 16:40:56.495 - forrobloxosthingy.lua:19: attempt to index nil with 'new'
and as a installed published plugin prints out 16:55:02.143 - Plugin_4087104785.Script:19: attempt to index nil with 'new'
. If that happens, then it is likely that saving a local plugin not in my plugins folder or pcall(function()
won't work too. If you want to download the code, click here.
Thanks.
Plus judging by the attempt to index nil with 'new'
, it might have been removed.
LabeledRadioButton and LabeledCheckbox should be selected when their label is clicked, not just their button. This would make them easier to select, particularly for the small variants.
With all widgets aiming to replicate the Properties panel, I found the default behavior of LabeledTextInput to be breaking the full-width consistency. I think all developers will benefit from the following change.
Current:
StudioWidgets/src/LabeledTextInput.lua
Line 40 in fa75191
textBoxWrapperFrame.Size = UDim2.new(1,-(GuiUtilities.StandardLineElementLeftMargin+GuiUtilities.StandardLineLabelLeftMargin), 0.6, 0)
As this removes the kTextInputWidth variable from the equation, line 10 would become obsolete:
StudioWidgets/src/LabeledTextInput.lua
Line 10 in fa75191
The LabeledSlider
UI is pretty glitchy when you drag the slider around.
Personally, I fixed this by assigning a Heartbeat connection to the element. It's not a great or elegant solution, but it fixed the issue for me. I assume that the sliderValue.Changed
method is firing 1 frame after the change is actually being made, thus causing the issue.
For the sake of example, my solution is shown below. Notice that this also includes a new sliderValue.Changed
connection that replaces the current one. Again, not a great solution, but it works for my current project:
local lastVal = nil
local function Recalc()
if (lastVal == self._value) then return end
lastVal = self._value
local scale = (lastVal - 1) / (sliderIntervals - 1)
self._preThumbImage.Size = UDim2.new(scale, 0, 1, 0)
self._postThumbImage.Size = UDim2.new(1 - scale, 0, 1, 0)
self._postThumbImage.Position = UDim2.new(scale, 0, 0, 0)
self._thumb.Position = UDim2.new(scale, 0, 0.5, 0)
end
local heartbeat = game:GetService("RunService").Heartbeat:Connect(Recalc)
frame:GetPropertyChangedSignal("Parent"):Connect(function()
if (not frame.Parent) then
heartbeat:Disconnect()
elseif (not heartbeat.Connected) then
heartbeat = game:GetService("RunService").Heartbeat:Connect(Recalc)
end
end)
sliderValue.Changed:connect(function()
self._value = sliderValue.Value
if self._valueChangedFunction then
self._valueChangedFunction(self._value)
end
end)
No value was assigned to parent
:
@ line 27
https://github.com/Roblox/StudioWidgets/blob/master/src/LabeledTextInput.lua#L27
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.