removed passing pop around unneccessarily

This commit is contained in:
Fox 2016-03-30 11:10:44 -07:00
parent 5047d4443d
commit e2a14399bd
12 changed files with 18 additions and 18 deletions

View File

@ -70,11 +70,11 @@ do
_base_0.__index = _base_0 _base_0.__index = _base_0
setmetatable(_base_0, _parent_0.__base) setmetatable(_base_0, _parent_0.__base)
_class_0 = setmetatable({ _class_0 = setmetatable({
__init = function(self, pop, parent, background) __init = function(self, parent, background)
if background == nil then if background == nil then
background = false background = false
end end
_class_0.__parent.__init(self, pop, parent) _class_0.__parent.__init(self, parent)
self.background = background self.background = background
end, end,
__base = _base_0, __base = _base_0,

View File

@ -169,7 +169,7 @@ do
} }
_base_0.__index = _base_0 _base_0.__index = _base_0
_class_0 = setmetatable({ _class_0 = setmetatable({
__init = function(self, pop, parent) __init = function(self, parent)
self.parent = parent self.parent = parent
self.child = { } self.child = { }
if parent then if parent then

View File

@ -98,7 +98,7 @@ do
_base_0.__index = _base_0 _base_0.__index = _base_0
setmetatable(_base_0, _parent_0.__base) setmetatable(_base_0, _parent_0.__base)
_class_0 = setmetatable({ _class_0 = setmetatable({
__init = function(self, pop, parent, text, color) __init = function(self, parent, text, color)
if text == nil then if text == nil then
text = "" text = ""
end end
@ -110,7 +110,7 @@ do
255 255
} }
end end
_class_0.__parent.__init(self, pop, parent) _class_0.__parent.__init(self, parent)
self.font = graphics.newFont(14) self.font = graphics.newFont(14)
self:setText(text) self:setText(text)
self.color = color self.color = color

View File

@ -63,7 +63,7 @@ pop.create = function(element, parent, ...)
if parent == nil then if parent == nil then
parent = pop.screen parent = pop.screen
end end
element = pop.elements[element](pop, parent, ...) element = pop.elements[element](parent, ...)
if parent then if parent then
insert(parent.child, element) insert(parent.child, element)
end end

View File

@ -70,11 +70,11 @@ do
_base_0.__index = _base_0 _base_0.__index = _base_0
setmetatable(_base_0, _parent_0.__base) setmetatable(_base_0, _parent_0.__base)
_class_0 = setmetatable({ _class_0 = setmetatable({
__init = function(self, pop, parent, background) __init = function(self, parent, background)
if background == nil then if background == nil then
background = false background = false
end end
_class_0.__parent.__init(self, pop, parent) _class_0.__parent.__init(self, parent)
self.background = background self.background = background
end, end,
__base = _base_0, __base = _base_0,

View File

@ -169,7 +169,7 @@ do
} }
_base_0.__index = _base_0 _base_0.__index = _base_0
_class_0 = setmetatable({ _class_0 = setmetatable({
__init = function(self, pop, parent) __init = function(self, parent)
self.parent = parent self.parent = parent
self.child = { } self.child = { }
if parent then if parent then

View File

@ -98,7 +98,7 @@ do
_base_0.__index = _base_0 _base_0.__index = _base_0
setmetatable(_base_0, _parent_0.__base) setmetatable(_base_0, _parent_0.__base)
_class_0 = setmetatable({ _class_0 = setmetatable({
__init = function(self, pop, parent, text, color) __init = function(self, parent, text, color)
if text == nil then if text == nil then
text = "" text = ""
end end
@ -110,7 +110,7 @@ do
255 255
} }
end end
_class_0.__parent.__init(self, pop, parent) _class_0.__parent.__init(self, parent)
self.font = graphics.newFont(14) self.font = graphics.newFont(14)
self:setText(text) self:setText(text)
self.color = color self.color = color

View File

@ -63,7 +63,7 @@ pop.create = function(element, parent, ...)
if parent == nil then if parent == nil then
parent = pop.screen parent = pop.screen
end end
element = pop.elements[element](pop, parent, ...) element = pop.elements[element](parent, ...)
if parent then if parent then
insert(parent.child, element) insert(parent.child, element)
end end

View File

@ -5,8 +5,8 @@ path = sub ..., 1, len(...) - len "/box"
element = require "#{path}/element" element = require "#{path}/element"
class box extends element class box extends element
new: (pop, parent, background=false) => new: (parent, background=false) =>
super pop, parent super parent
@background = background @background = background

View File

@ -2,7 +2,7 @@ import graphics from love
import floor from math import floor from math
class element class element
new: (pop, parent) => new: (parent) =>
@parent = parent @parent = parent
@child = {} @child = {}

View File

@ -12,8 +12,8 @@ class text extends element
else else
return pop.create("text", parent, ...) return pop.create("text", parent, ...)
new: (pop, parent, text="", color={255,255,255,255}) => new: (parent, text="", color={255,255,255,255}) =>
super pop, parent super parent
@font = graphics.newFont 14 @font = graphics.newFont 14
@setText text @setText text

View File

@ -49,7 +49,7 @@ pop.load = ->
-- creates an element with specified parent (parent can be false) -- creates an element with specified parent (parent can be false)
pop.create = (element, parent=pop.screen, ...) -> pop.create = (element, parent=pop.screen, ...) ->
element = pop.elements[element](pop, parent, ...) element = pop.elements[element](parent, ...)
if parent if parent
insert parent.child, element insert parent.child, element