Compare commits

..

No commits in common. "31f53ef5216a656a59b0260f4f70f619d3353835" and "25a998a5427dac3e8e4e1ae318c58e827c10d04b" have entirely different histories.

2 changed files with 11 additions and 32 deletions

View File

@ -22,7 +22,4 @@ function Orientation:with(elementType)
return elementType
end
Orientation.VERTICAL = true
Orientation.HORIZONTAL = false
return Orientation

View File

@ -132,7 +132,7 @@ local function itemList(groups, wBudget, hBudget, savedState, onClick, setPage,
padImport,
padNext
},
[Orientation:getId()] = Orientation.HORIZONTAL
[Orientation:getId()] = false
}
local bgColors = {
@ -179,7 +179,7 @@ local function itemList(groups, wBudget, hBudget, savedState, onClick, setPage,
paddedText,
countLabel
},
[Orientation:getId()] = Orientation.HORIZONTAL,
[Orientation:getId()] = false,
onClick = onClick and function(element, x, y, source)
return onClick(element, x, y, source, group)
end or nil
@ -196,7 +196,7 @@ local function itemList(groups, wBudget, hBudget, savedState, onClick, setPage,
return List:new{
[Children:getId()] = entries,
[Orientation:getId()] = Orientation.VERTICAL
[Orientation:getId()] = true
}, state
end
@ -297,7 +297,10 @@ local PAGES = {
end
local title = Text:new{
text = "Detail: "..group:getSimpleName(),
bgColor = colors.gray
parent = state.monitor,
onClick = function(e, x, y, s)
state:setPage("MAIN")
end
}
local paddedTitle = Padding:new{
@ -305,37 +308,16 @@ local PAGES = {
left = 1,
right = 1,
bottom = 1,
element = title,
bgColor = colors.gray
}
local itemCount = Text:new{
text = "Count: "..tostring(group:getItemCount()),
}
local itemSlots = Text:new{
text = "Slots: "..tostring(group:getStackCount())
}
local infoElements = List:new{
[Children:getId()] = {
paddedTitle,
itemCount,
itemSlots
},
[Orientation:getId()] = Orientation.VERTICAL,
width = state.width
element = title
}
local stuffContainer = Container:new{
[Children:getId()] = {
infoElements
paddedTitle
},
width = state.width,
height = state.height,
parent = state.monitor,
onClick = function(e, x, y, s)
state:setPage("MAIN")
end
parent = state.monitor
}
return renderDefault(state, stuffContainer)