Rename ZeroPad to just Pad

This commit is contained in:
Brandon Dyck 2024-04-19 12:50:58 -06:00
parent 293b31d39a
commit 2e2d63dfd7
2 changed files with 9 additions and 9 deletions

View File

@ -28,7 +28,7 @@ function newobject:initialize()
self.internal = false self.internal = false
self.canmodify = false self.canmodify = false
self.lastbuttonclicked = false self.lastbuttonclicked = false
self.zeropad = false self.pad = false
self.internals = {} self.internals = {}
self.OnValueChanged = nil self.OnValueChanged = nil
@ -148,7 +148,7 @@ end
function newobject:updateinput() function newobject:updateinput()
local value = self.value local value = self.value
if self.zeropad then if self.pad then
local maxabs = math.max(math.abs(self.min), math.abs(self.max)) local maxabs = math.max(math.abs(self.min), math.abs(self.max))
-- A range from 0 to 0 would be unusual, but it would break the math. -- A range from 0 to 0 would be unusual, but it would break the math.
if maxabs == 0 then maxabs = 1 end if maxabs == 0 then maxabs = 1 end
@ -500,26 +500,26 @@ function newobject:GetDecimals()
end end
--[[--------------------------------------------------------- --[[---------------------------------------------------------
- func: SetZeroPad(decimals) - func: SetPad(decimals)
- desc: sets whether to pad the object's value - desc: sets whether to pad the object's value
with zeroes with zeroes
--]]--------------------------------------------------------- --]]---------------------------------------------------------
function newobject:SetZeroPad(zeropad) function newobject:SetPad(pad)
self.zeropad = zeropad self.pad = pad
self:updateinput() self:updateinput()
return self return self
end end
--[[--------------------------------------------------------- --[[---------------------------------------------------------
- func: GetZeroPad() - func: GetPad()
- desc: gets whether to pad the object's value - desc: gets whether to pad the object's value
with zeroes with zeroes
--]]--------------------------------------------------------- --]]---------------------------------------------------------
function newobject:GetZeroPad() function newobject:GetPad()
return self.zeropad return self.pad
end end

View File

@ -58,7 +58,7 @@ function love.load()
:SetValue(0) :SetValue(0)
:SetParent(timeInputs) :SetParent(timeInputs)
:SetX(100) :SetX(100)
:SetZeroPad(true) :SetPad(true)
local controls = loveframes.Create("collapsiblecategory") local controls = loveframes.Create("collapsiblecategory")
:SetPos(column2X, margin) :SetPos(column2X, margin)
:SetObject(timeInputs) :SetObject(timeInputs)