um, would it be better if i like sent the template to you to see if you could make it multi-line?
That would be fine. I can make it multi line for you.
Okay! Also it appears you script, would the solution be to size it based off the textbounds too? Getting a file to send to you right now
I actually am not sure. I think the best solution would be to change the UI properties though.
list template | BAE 2.0.rbxm (13.1 KB) - could you also make it a textbox that keeps the mouseentered function i think its sometype of selection issue on my end
Actually, I think I found a better way. I changed AutomaticSize to Y in the text box and it seems to work better.
Anyways, here’s the improved one:
list template _ BAE 2.0.rbxm (13.1 KB)
uhhh can i show you an example of what i would like it to look like?
Yeah, that’s because you forgot a UIListLayout (or maybe that was me).
uhhh can i send u the bae 2.0 list function i believe its something there because its bigger than the original size that needs to be changed
Yes, send the code here. Format it properly using three ```
createLabel()
local Title,canRefresh,canSearch,dataTable = Data[1],Data[2],Data[3],Data[4]
local List = baseClip:WaitForChild('List Template')
local listClone = List:Clone()
listClone.Name = "List Clone"
local scrollingFrame = listClone:WaitForChild('ScrollingFrame')
local Template = scrollingFrame:WaitForChild('Template')
Template.Visible = false
local Controls = listClone:WaitForChild('Controls')
local exitButton = Controls:WaitForChild('Exit')
local searchButton = Controls:WaitForChild('Search')
local refreshButton = Controls:WaitForChild('Refresh')
local Decoration = Controls:WaitForChild('Decoration')
local searchBar = Decoration:WaitForChild('Search')
local searchBox = searchBar:WaitForChild('TextBox')
local listTitle = Decoration:WaitForChild('Title')
listTitle.Text = Title
if canSearch and not canRefresh then
refreshButton.Visible = false
Decoration.Size = UDim2.new(1.277, -90,0, 30)
elseif not canSearch and canRefresh then
searchButton.Visible = false
refreshButton.Position = UDim2.new(1.277, -90,0, 30)
Decoration.Size = UDim2.new(1.277, -90,0, 30)
elseif not canSearch and not canRefresh then
Decoration.Size = UDim2.new(1.277, -90,0, 30)
searchButton.Visible = false
refreshButton.Visible = false
end
listClone.Position = UDim2.new(0,-listClone.Size.X.Offset-5,0.5,-150)
listClone.Parent = baseClip
listClone.Visible = true
exitButton.MouseButton1Click:connect(function()
spawn(function()
for a,b in pairs(scrollingFrame:GetChildren()) do
TweenTextTransparency(b,0,1,0.5*0.65)
wait()
end
end)
for a,b in pairs(Stacks.Frames) do
if b == listClone then
table.remove(Stacks.Frames,a)
end
end
figureFrames(Stacks.Frames)
listClone:TweenPosition(UDim2.new(listClone.Position.X.Scale,listClone.Position.X.Offset,1,5),"Out","Quint",0.3,true)
repeat wait() until listClone.Position == UDim2.new(listClone.Position.X.Scale,listClone.Position.X.Offset,1,5)
listClone:Destroy()
end)
local function tableTest(Table)
for a,b in next,Table do
if type(b) == "table" then
return "Table"
elseif type(b) == "string" or type(b) == "number" or type(b) == "boolean" then
return "Other"
end
end
end
-- local function Reverse(Table)
-- local Len = #Table
-- local newTab = {}
-- for i,v in pairs(Table) do
-- newTab[Len] = v
-- Len = Len - 1
-- end
-- return newTab
-- end
local function queryTable(Table,Data)
local tempTable = {}
ypcall(function()
for _,v in pairs(Table) do
if string.lower(v):match(string.lower(Data)) then
table.insert(tempTable,v)
end
end
end)
return tempTable
end
local Down = 0
local stopLoops = {}
local lastLoop = nil
local loopManager = {}
loopManager.__index = loopManager
function loopManager.new() return setmetatable({}, loopManager) end
function loopManager:Break()
stopLoops[self] = true
end
function loopManager:NewLoop(Table)
for a,b in pairs(scrollingFrame:GetChildren()) do
if b.Name ~= 'Template' then
b:Destroy()
end
end
local tempDown = 0
if #Table >= 1 then
for a,b in pairs(Table) do
if stopLoops[self] then stopLoops[self] = nil break end
local dataText = Template:clone()
if Title == "Commands" and tableTest(Table) == "Table" then
dataText.Text = b[2]..b[5][1]
dataText.Name = b[5][1]
elseif Title == "Donor Data" and tableTest(Table) == "Table" then
dataText.Text = b[1]
dataText.Name = b[1]
else
dataText.Text = b
dataText.Name = b
end
if tempDown == 0 then
dataText.Position = UDim2.new(0,10,0,20*tempDown+0*tempDown)
tempDown = 1
else
dataText.Position = UDim2.new(0,10,0,20*tempDown+0*tempDown)
tempDown = tempDown+1
end
scrollingFrame.CanvasSize = UDim2.new(0,0,0,20*tempDown+0*tempDown)
dataText.Parent = scrollingFrame
dataText.TextTransparency = 1
dataText.Visible = true
TweenTextTransparency(dataText,1,0,0.5*0.65)
Services.runService.RenderStepped:wait()
if tempDown >= 1500 then
dataText.Name = "Displaying 1500 of "..#Table..' results.'
dataText.Text = "Displaying 1500 of "..#Table..' results.'
break
end
end
else
scrollingFrame.CanvasSize = UDim2.new(0,0,0,20*Down+0*Down)
local dataText = Template:clone()
dataText.Text = 'No Data'
dataText.Parent = scrollingFrame
dataText.Name = 'No Data'
dataText.Visible = true
TweenTextTransparency(dataText,1,0,0.5*0.65)
end
end
scrollingFrame.ChildAdded:connect(function(Obj)
if Obj:IsA('TextLabel') then
Obj.MouseEnter:connect(function()
Obj.MouseMoved:connect(function(X,Y)
if Title == 'Commands' then
local Matched = false
for a,b in pairs(dataTable) do
if Obj.Name == b[5][1] then
Matched = true
mouseLabel.Text = b[2]..b[5][1]..' '..b[5][2]..'\n'..b[5][3]
end
end
if not Matched then
mouseLabel.Text = Obj.Text
end
elseif Title == "Donor Data" then
local Matched = false
for a,b in pairs(dataTable) do
if Obj.Name == b[1] then
Matched = true
mouseLabel.Text = b[1]..'\n'..b[2]
end
end
if not Matched then
mouseLabel.Text = Obj.Text
end
else
mouseLabel.Text = Obj.Text
end
local XB,YB = mouseLabel.TextBounds.X, mouseLabel.TextBounds.Y
mouseLabel.BorderSizePixel = 1
mouseLabel.Size = UDim2.new(0,XB+10,0,YB+10)
local mouseOffset
if mouseLabel.AbsoluteSize.Y <= 28 then
mouseOffset = ((mouseLabel.AbsoluteSize.Y*2)-5)
else
mouseOffset = 60
end
if X-(mouseLabel.AbsoluteSize.X) >= 0 then
mouseLabel.Position = UDim2.new(0, X-(mouseLabel.AbsoluteSize.X), 0, Y-(mouseLabel.AbsoluteSize.Y/2)-mouseOffset)
elseif X-(mouseLabel.AbsoluteSize.X) <= 0 then
mouseLabel.Position = UDim2.new(0, X, 0, Y-(mouseLabel.AbsoluteSize.Y/2)-mouseOffset)
end
end)
end)
Obj.MouseLeave:connect(function()
mouseLabel.Text = ''
mouseLabel.BorderSizePixel = 0
mouseLabel.Size = UDim2.new(0,0,0,0)
end)
end
end)
searchButton.MouseButton1Click:connect(function()
if listTitle.Visible then
listTitle.Visible = false
searchBar.Position = UDim2.new(0,0,-1,0)
searchBar.Visible = true
searchBar:TweenPosition(UDim2.new(0,0,0,0),'Out','Quint',0.3,true)
else
listTitle.Visible = true
searchBar:TweenPosition(UDim2.new(0,0,1,0),'Out','Quint',0.3,true)
searchBar.Visible = false
listTitle.Visible = true
end
searchBox.Text = "Search.."
end)
local refreshDebounce = false
refreshButton.MouseButton1Click:connect(function()
if not canRefresh then return end
if not refreshDebounce then
refreshDebounce = true
-- local Reply = essentialsFunction:InvokeServer(clientConfig.Key,'Refresh',Title)
local Reply = invokeServer('Refresh',Title)
if Reply then
dataTable = Reply
if lastLoop then
lastLoop:Break()
end
local newLoop = loopManager.new()
lastLoop = newLoop
newLoop:NewLoop(dataTable)
end
wait(0.15)
refreshDebounce = false
end
end)
searchBox.Changed:connect(function(Prop)
if Prop == "Text" then
if searchBox.Text ~= '' and searchBox.Text ~= "Search.." then
if lastLoop then
lastLoop:Break()
end
local queriedTable
if tableTest(dataTable) == "Table" then
local tempTable = {}
for a,b in next,dataTable do
table.insert(tempTable,b[1])
end
queriedTable = queryTable(tempTable,searchBox.Text)
else
queriedTable = queryTable(dataTable,searchBox.Text)
end
local newLoop = loopManager.new()
lastLoop = newLoop
newLoop:NewLoop(queriedTable)
else
if lastLoop then
lastLoop:Break()
end
local newLoop = loopManager.new()
lastLoop = newLoop
newLoop:NewLoop(dataTable)
end
end
end)
spawn(function()
local newLoop = loopManager.new()
lastLoop = newLoop
newLoop:NewLoop(dataTable)
end)
table.insert(Stacks.Frames,listClone)
figureFrames(Stacks.Frames)```
Remove this line. Then, add a UIListLayout to the scrolling frame.
edit: actually, try not removing the line and just remove the Y scale and offset
when clicking the refresh icon or search, sometimes the ui list layout is automatically removed & i think the layout for bae 2,0 is handled within the script so one sec!
and uh on another note do you know how to restore the hover to see function with a textbox? works with a textlabel but not a box
I think that is separate code.
edit: found the issue! - it was looking for a textlabel not a textbox
This code? I think you need to move on to UserInputService which requires a LocalScript. Input is already handled by Roblox.
Oh, nevermind, this is the exit button code. My mistake.
oh wait - i think i got it
The solution was basic admin checks for items in the list/scrollframe not a template and adding a check for the uilistlayout fixed it, thanks to @SubtotalAnt8185 for the help!
*also on another note make sure you change the check from textlabel to textbox in essentials code to make sure the hover to view function is restored
enable automaticsize & textwrapped with autosize being set to Y and then add a uilistlayout and change the padding to your liking
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.