mirror of
https://github.com/TangentFoxy/Pop.Box.git
synced 2024-12-15 12:44:20 +00:00
removed passing pop around unneccessarily
This commit is contained in:
parent
5047d4443d
commit
e2a14399bd
@ -70,11 +70,11 @@ do
|
||||
_base_0.__index = _base_0
|
||||
setmetatable(_base_0, _parent_0.__base)
|
||||
_class_0 = setmetatable({
|
||||
__init = function(self, pop, parent, background)
|
||||
__init = function(self, parent, background)
|
||||
if background == nil then
|
||||
background = false
|
||||
end
|
||||
_class_0.__parent.__init(self, pop, parent)
|
||||
_class_0.__parent.__init(self, parent)
|
||||
self.background = background
|
||||
end,
|
||||
__base = _base_0,
|
||||
|
@ -169,7 +169,7 @@ do
|
||||
}
|
||||
_base_0.__index = _base_0
|
||||
_class_0 = setmetatable({
|
||||
__init = function(self, pop, parent)
|
||||
__init = function(self, parent)
|
||||
self.parent = parent
|
||||
self.child = { }
|
||||
if parent then
|
||||
|
@ -98,7 +98,7 @@ do
|
||||
_base_0.__index = _base_0
|
||||
setmetatable(_base_0, _parent_0.__base)
|
||||
_class_0 = setmetatable({
|
||||
__init = function(self, pop, parent, text, color)
|
||||
__init = function(self, parent, text, color)
|
||||
if text == nil then
|
||||
text = ""
|
||||
end
|
||||
@ -110,7 +110,7 @@ do
|
||||
255
|
||||
}
|
||||
end
|
||||
_class_0.__parent.__init(self, pop, parent)
|
||||
_class_0.__parent.__init(self, parent)
|
||||
self.font = graphics.newFont(14)
|
||||
self:setText(text)
|
||||
self.color = color
|
||||
|
@ -63,7 +63,7 @@ pop.create = function(element, parent, ...)
|
||||
if parent == nil then
|
||||
parent = pop.screen
|
||||
end
|
||||
element = pop.elements[element](pop, parent, ...)
|
||||
element = pop.elements[element](parent, ...)
|
||||
if parent then
|
||||
insert(parent.child, element)
|
||||
end
|
||||
|
@ -70,11 +70,11 @@ do
|
||||
_base_0.__index = _base_0
|
||||
setmetatable(_base_0, _parent_0.__base)
|
||||
_class_0 = setmetatable({
|
||||
__init = function(self, pop, parent, background)
|
||||
__init = function(self, parent, background)
|
||||
if background == nil then
|
||||
background = false
|
||||
end
|
||||
_class_0.__parent.__init(self, pop, parent)
|
||||
_class_0.__parent.__init(self, parent)
|
||||
self.background = background
|
||||
end,
|
||||
__base = _base_0,
|
||||
|
@ -169,7 +169,7 @@ do
|
||||
}
|
||||
_base_0.__index = _base_0
|
||||
_class_0 = setmetatable({
|
||||
__init = function(self, pop, parent)
|
||||
__init = function(self, parent)
|
||||
self.parent = parent
|
||||
self.child = { }
|
||||
if parent then
|
||||
|
@ -98,7 +98,7 @@ do
|
||||
_base_0.__index = _base_0
|
||||
setmetatable(_base_0, _parent_0.__base)
|
||||
_class_0 = setmetatable({
|
||||
__init = function(self, pop, parent, text, color)
|
||||
__init = function(self, parent, text, color)
|
||||
if text == nil then
|
||||
text = ""
|
||||
end
|
||||
@ -110,7 +110,7 @@ do
|
||||
255
|
||||
}
|
||||
end
|
||||
_class_0.__parent.__init(self, pop, parent)
|
||||
_class_0.__parent.__init(self, parent)
|
||||
self.font = graphics.newFont(14)
|
||||
self:setText(text)
|
||||
self.color = color
|
||||
|
@ -63,7 +63,7 @@ pop.create = function(element, parent, ...)
|
||||
if parent == nil then
|
||||
parent = pop.screen
|
||||
end
|
||||
element = pop.elements[element](pop, parent, ...)
|
||||
element = pop.elements[element](parent, ...)
|
||||
if parent then
|
||||
insert(parent.child, element)
|
||||
end
|
||||
|
@ -5,8 +5,8 @@ path = sub ..., 1, len(...) - len "/box"
|
||||
element = require "#{path}/element"
|
||||
|
||||
class box extends element
|
||||
new: (pop, parent, background=false) =>
|
||||
super pop, parent
|
||||
new: (parent, background=false) =>
|
||||
super parent
|
||||
|
||||
@background = background
|
||||
|
||||
|
@ -2,7 +2,7 @@ import graphics from love
|
||||
import floor from math
|
||||
|
||||
class element
|
||||
new: (pop, parent) =>
|
||||
new: (parent) =>
|
||||
@parent = parent
|
||||
@child = {}
|
||||
|
||||
|
@ -12,8 +12,8 @@ class text extends element
|
||||
else
|
||||
return pop.create("text", parent, ...)
|
||||
|
||||
new: (pop, parent, text="", color={255,255,255,255}) =>
|
||||
super pop, parent
|
||||
new: (parent, text="", color={255,255,255,255}) =>
|
||||
super parent
|
||||
|
||||
@font = graphics.newFont 14
|
||||
@setText text
|
||||
|
@ -49,7 +49,7 @@ pop.load = ->
|
||||
|
||||
-- creates an element with specified parent (parent can be false)
|
||||
pop.create = (element, parent=pop.screen, ...) ->
|
||||
element = pop.elements[element](pop, parent, ...)
|
||||
element = pop.elements[element](parent, ...)
|
||||
|
||||
if parent
|
||||
insert parent.child, element
|
||||
|
Loading…
Reference in New Issue
Block a user