Compare commits
2 Commits
63e1e54462
...
145bc90eae
Author | SHA1 | Date | |
---|---|---|---|
![]() |
145bc90eae | ||
![]() |
1a63a7054f |
@ -122,10 +122,6 @@ 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
|
||||||
@ -139,15 +135,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
|
||||||
|
@ -331,11 +331,36 @@ local PAGES = {
|
|||||||
bgColor = colors.gray
|
bgColor = colors.gray
|
||||||
}
|
}
|
||||||
|
|
||||||
local itemCount = Text:new{
|
local simpleDetailsList = List:new{
|
||||||
text = "Count: "..tostring(group:getItemCount()),
|
[Orientation:getId()] = Orientation.HORIZONTAL,
|
||||||
}
|
[Children:getId()] = {
|
||||||
local itemSlots = Text:new{
|
Padding:new{
|
||||||
text = "Slots: "..tostring(group:getStackCount())
|
top = 0,
|
||||||
|
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()
|
||||||
@ -353,8 +378,13 @@ local PAGES = {
|
|||||||
local infoElements = List:new{
|
local infoElements = List:new{
|
||||||
[Children:getId()] = {
|
[Children:getId()] = {
|
||||||
paddedTitle,
|
paddedTitle,
|
||||||
itemCount,
|
Padding:new{
|
||||||
itemSlots,
|
top = 0,
|
||||||
|
bottom = 1,
|
||||||
|
left = 0,
|
||||||
|
right = 0,
|
||||||
|
element = simpleDetailsList
|
||||||
|
},
|
||||||
damageBar
|
damageBar
|
||||||
},
|
},
|
||||||
[Orientation:getId()] = Orientation.VERTICAL,
|
[Orientation:getId()] = Orientation.VERTICAL,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user