Compare commits

..

No commits in common. "145bc90eae3afae81eed6ede82fc1bb016922f12" and "63e1e544624c31feb4684c208e31230472ae598b" have entirely different histories.

2 changed files with 13 additions and 39 deletions

View File

@ -122,6 +122,10 @@ function Children:with(elementType)
end end
function elementType:handleEvent(evt) function elementType:handleEvent(evt)
if Element.handleEvent(self, evt) then
return true
end
local evtLocalCoords = Event.toElementLocalPosition(evt, self) local evtLocalCoords = Event.toElementLocalPosition(evt, self)
if Event.isClickEvent(evt) then if Event.isClickEvent(evt) then
@ -135,15 +139,15 @@ function Children:with(elementType)
return true return true
end end
end end
return false
else else
for _,child in self:_iterateChildren() do for _,child in self:_iterateChildren() do
if child:handleEvent(evtLocalCoords) then if child:handleEvent(evtLocalCoords) then
return true return true
end end
end end
return false
end end
return Element.handleEvent(self, evt)
end end
return elementType return elementType

View File

@ -331,36 +331,11 @@ local PAGES = {
bgColor = colors.gray bgColor = colors.gray
} }
local simpleDetailsList = List:new{ local itemCount = Text:new{
[Orientation:getId()] = Orientation.HORIZONTAL, text = "Count: "..tostring(group:getItemCount()),
[Children:getId()] = { }
Padding:new{ local itemSlots = Text:new{
top = 0, text = "Slots: "..tostring(group:getStackCount())
left = 1,
right = 1,
bottom = 0,
element = List:new{
[Orientation:getId()] = Orientation.VERTICAL,
[Children:getId()] = {
Text:new{ text = "Count" },
Text:new{ text = tostring(group:getItemCount()) }
}
}
},
Padding:new{
top = 0,
left = 1,
right = 1,
bottom = 0,
element = List:new{
[Orientation:getId()] = Orientation.VERTICAL,
[Children:getId()] = {
Text:new{ text = "Slot" },
Text:new{ text = tostring(group:getStackCount()) }
}
}
}
}
} }
local damage = group:getDamage() local damage = group:getDamage()
@ -378,13 +353,8 @@ local PAGES = {
local infoElements = List:new{ local infoElements = List:new{
[Children:getId()] = { [Children:getId()] = {
paddedTitle, paddedTitle,
Padding:new{ itemCount,
top = 0, itemSlots,
bottom = 1,
left = 0,
right = 0,
element = simpleDetailsList
},
damageBar damageBar
}, },
[Orientation:getId()] = Orientation.VERTICAL, [Orientation:getId()] = Orientation.VERTICAL,