Clean up some corescripts
This commit is contained in:
parent
736186bb75
commit
55d3a622aa
|
|
@ -75,7 +75,7 @@ function UpdateGUI(health)
|
||||||
local x = 0.019 + (maxWidth - width)
|
local x = 0.019 + (maxWidth - width)
|
||||||
local y = 0.1
|
local y = 0.1
|
||||||
|
|
||||||
tray.bar.Position = UDim2.new(x,0,y, 0)
|
tray.bar.Position = UDim2.new(x ,0, y, 0)
|
||||||
tray.bar.Size = UDim2.new(width, 0, height, 0)
|
tray.bar.Size = UDim2.new(width, 0, height, 0)
|
||||||
-- If more than 1/4 health, bar = green. Else, bar = red.
|
-- If more than 1/4 health, bar = green. Else, bar = red.
|
||||||
if( (health / humanoid.MaxHealth) > 0.25 ) then
|
if( (health / humanoid.MaxHealth) > 0.25 ) then
|
||||||
|
|
|
||||||
|
|
@ -327,19 +327,19 @@ function trim(s)
|
||||||
return (s:gsub("^%s*(.-)%s*$", "%1"))
|
return (s:gsub("^%s*(.-)%s*$", "%1"))
|
||||||
end
|
end
|
||||||
|
|
||||||
function splitByWhitespace(text)
|
-- function splitByWhitespace(text)
|
||||||
if type(text) ~= "string" then
|
-- if type(text) ~= "string" then
|
||||||
return nil
|
-- return nil
|
||||||
end
|
-- end
|
||||||
|
|
||||||
local terms = {}
|
-- local terms = {}
|
||||||
for token in string.gmatch(text, "[^%s]+") do
|
-- for token in string.gmatch(text, "[^%s]+") do
|
||||||
if string.len(token) > 0 then
|
-- if string.len(token) > 0 then
|
||||||
table.insert(terms, token)
|
-- table.insert(terms, token)
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
return terms
|
-- return terms
|
||||||
end
|
-- end
|
||||||
|
|
||||||
function resetSearchBoxGui()
|
function resetSearchBoxGui()
|
||||||
resetButton.Visible = false
|
resetButton.Visible = false
|
||||||
|
|
|
||||||
|
|
@ -3433,7 +3433,7 @@ t.Help = function(funcNameOrFunc)
|
||||||
elseif 'GetFontHeight' == funcNameOrFunc or t.GetFontHeight == funcNameOrFunc then
|
elseif 'GetFontHeight' == funcNameOrFunc or t.GetFontHeight == funcNameOrFunc then
|
||||||
return 'Function GetFontHeight. ' .. 'Arguments: (font, fontSize). ' .. 'Side effect: returns the size in pixels of the given font + fontSize'
|
return 'Function GetFontHeight. ' .. 'Arguments: (font, fontSize). ' .. 'Side effect: returns the size in pixels of the given font + fontSize'
|
||||||
elseif 'CreateScrollingFrame' == funcNameOrFunc or t.CreateScrollingFrame == funcNameOrFunc then
|
elseif 'CreateScrollingFrame' == funcNameOrFunc or t.CreateScrollingFrame == funcNameOrFunc then
|
||||||
return 'Function CreateScrollingFrame. ' .. 'Arguments: (orderList, style) ' .. 'Side effect: returns 4 objects, (scrollFrame, scrollUpButton, scrollDownButton, recalculateFunction). "scrollFrame" can be filled with GuiObjects. It will lay them out and allow scrollUpButton/scrollDownButton to interact with them. Orderlist is optional (and specifies the order to layout the children. Without orderlist, it uses the children order. style is also optional, and allows for a "grid" styling if style is passed "grid" as a string. recalculateFunction can be called \n when a relayout is needed (\n when orderList changes)'
|
return 'Function CreateScrollingFrame. ' .. 'Arguments: (orderList, style) ' .. 'Side effect: returns 4 objects, (scrollFrame, scrollUpButton, scrollDownButton, recalculateFunction). "scrollFrame" can be filled with GuiObjects. It will lay them out and allow scrollUpButton/scrollDownButton to interact with them. Orderlist is optional (and specifies the order to layout the children. Without orderlist, it uses the children order. style is also optional, and allows for a "grid" styling if style is passed "grid" as a string. recalculateFunction can be called\n when a relayout is needed (\n when orderList changes)'
|
||||||
elseif 'CreateTrueScrollingFrame' == funcNameOrFunc or t.CreateTrueScrollingFrame == funcNameOrFunc then
|
elseif 'CreateTrueScrollingFrame' == funcNameOrFunc or t.CreateTrueScrollingFrame == funcNameOrFunc then
|
||||||
return 'Function CreateTrueScrollingFrame. ' .. 'Arguments: (nil) ' .. 'Side effect: returns 2 objects, (scrollFrame, controlFrame). "scrollFrame" can be filled with GuiObjects, and they will be clipped if not inside the frame"s bounds. controlFrame has children scrollup and scrolldown, as well as a slider. controlFrame can be parented to any guiobject and it will readjust itself to fit.'
|
return 'Function CreateTrueScrollingFrame. ' .. 'Arguments: (nil) ' .. 'Side effect: returns 2 objects, (scrollFrame, controlFrame). "scrollFrame" can be filled with GuiObjects, and they will be clipped if not inside the frame"s bounds. controlFrame has children scrollup and scrolldown, as well as a slider. controlFrame can be parented to any guiobject and it will readjust itself to fit.'
|
||||||
elseif 'AutoTruncateTextObject' == funcNameOrFunc or t.AutoTruncateTextObject == funcNameOrFunc then
|
elseif 'AutoTruncateTextObject' == funcNameOrFunc or t.AutoTruncateTextObject == funcNameOrFunc then
|
||||||
|
|
@ -3441,7 +3441,7 @@ t.Help = function(funcNameOrFunc)
|
||||||
elseif 'CreateSlider' == funcNameOrFunc or t.CreateSlider == funcNameOrFunc then
|
elseif 'CreateSlider' == funcNameOrFunc or t.CreateSlider == funcNameOrFunc then
|
||||||
return 'Function CreateSlider. ' .. 'Arguments: (steps, width, position) ' .. 'Side effect: returns 2 objects, (sliderGui, sliderPosition). The "steps" argument specifies how many different positions the slider can hold along the bar. "width" specifies in pixels how wide the bar should be (modifiable afterwards if desired). "position" argument should be a UDim2 for slider positioning. "sliderPosition" is an IntValue whose current .Value specifies the specific step the slider is currently on.'
|
return 'Function CreateSlider. ' .. 'Arguments: (steps, width, position) ' .. 'Side effect: returns 2 objects, (sliderGui, sliderPosition). The "steps" argument specifies how many different positions the slider can hold along the bar. "width" specifies in pixels how wide the bar should be (modifiable afterwards if desired). "position" argument should be a UDim2 for slider positioning. "sliderPosition" is an IntValue whose current .Value specifies the specific step the slider is currently on.'
|
||||||
elseif 'CreateLoadingFrame' == funcNameOrFunc or t.CreateLoadingFrame == funcNameOrFunc then
|
elseif 'CreateLoadingFrame' == funcNameOrFunc or t.CreateLoadingFrame == funcNameOrFunc then
|
||||||
return 'Function CreateLoadingFrame. ' .. 'Arguments: (name, size, position) ' .. 'Side effect: Creates a gui that can be manipulated to show progress for a particular action. Name appears above the loading bar, and size and position are udim2 values (both size and position are optional arguments). Returns 3 arguments, the first being the gui created. The second being updateLoadingGuiPercent, which is a bindable function. This function takes one argument (two optionally), which should be a number between 0 and 1, representing the percentage the loading gui should be at. The second argument to this function is a boolean value that if set to true will tween the current percentage value to the new percentage value, therefore our third argument is how long this tween should take. Our third returned argument is a BindableEvent, that \n when fired means that someone clicked the cancel button on the dialog.'
|
return 'Function CreateLoadingFrame. ' .. 'Arguments: (name, size, position) ' .. 'Side effect: Creates a gui that can be manipulated to show progress for a particular action. Name appears above the loading bar, and size and position are udim2 values (both size and position are optional arguments). Returns 3 arguments, the first being the gui created. The second being updateLoadingGuiPercent, which is a bindable function. This function takes one argument (two optionally), which should be a number between 0 and 1, representing the percentage the loading gui should be at. The second argument to this function is a boolean value that if set to true will tween the current percentage value to the new percentage value, therefore our third argument is how long this tween should take. Our third returned argument is a BindableEvent, that\n when fired means that someone clicked the cancel button on the dialog.'
|
||||||
elseif 'CreateTerrainMaterialSelector' == funcNameOrFunc or t.CreateTerrainMaterialSelector == funcNameOrFunc then
|
elseif 'CreateTerrainMaterialSelector' == funcNameOrFunc or t.CreateTerrainMaterialSelector == funcNameOrFunc then
|
||||||
return 'Function CreateTerrainMaterialSelector. ' .. 'Arguments: (size, position) ' .. 'Side effect: Size and position are UDim2 values that specifies the selector"s size and position. Both size and position are optional arguments. This method returns 3 objects (terrainSelectorGui, terrainSelected, forceTerrainSelection). terrainSelectorGui is just the gui object that we generate with this function, parent it as you like. TerrainSelected is a BindableEvent that is fired whenever a new terrain type is selected in the gui. ForceTerrainSelection is a function that takes an argument of Enum.CellMaterial and will force the gui to show that material as currently selected.'
|
return 'Function CreateTerrainMaterialSelector. ' .. 'Arguments: (size, position) ' .. 'Side effect: Size and position are UDim2 values that specifies the selector"s size and position. Both size and position are optional arguments. This method returns 3 objects (terrainSelectorGui, terrainSelected, forceTerrainSelection). terrainSelectorGui is just the gui object that we generate with this function, parent it as you like. TerrainSelected is a BindableEvent that is fired whenever a new terrain type is selected in the gui. ForceTerrainSelection is a function that takes an argument of Enum.CellMaterial and will force the gui to show that material as currently selected.'
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue