Implement itemstack fetching
This commit is contained in:
parent
3a46e08f37
commit
40cf649c16
@ -546,6 +546,21 @@ local PAGES = {
|
||||
}
|
||||
}
|
||||
|
||||
local function paddedButton(label, width, height, parentHeight, parentWidth, onClick, bgColor, x, y)
|
||||
local labelElement = Text:new{ text = label, bgColor = bgColor }
|
||||
return Padding:new{
|
||||
x = (parentWidth + (x or 1)) % parentWidth,
|
||||
y = (parentHeight + (y or 1)) % parentHeight,
|
||||
top = math.ceil((height - labelElement:getHeight()) / 2),
|
||||
bottom = math.floor((height - labelElement:getHeight()) / 2),
|
||||
left = math.ceil((width - labelElement:getWidth()) / 2),
|
||||
right = math.floor((width - labelElement:getWidth()) / 2),
|
||||
element = labelElement,
|
||||
bgColor = bgColor,
|
||||
onClick = onClick
|
||||
}
|
||||
end
|
||||
|
||||
local stuffContainer = List:new{
|
||||
[Orientation:getId()] = Orientation.VERTICAL,
|
||||
[Children:getId()] = {
|
||||
@ -558,6 +573,53 @@ local PAGES = {
|
||||
end
|
||||
}
|
||||
|
||||
local bottomBar = List:new{
|
||||
[Orientation:getId()] = Orientation.HORIZONTAL,
|
||||
[Children:getId()] = {
|
||||
paddedButton(
|
||||
"Fetch",
|
||||
state.width / 2,
|
||||
3,
|
||||
state.height,
|
||||
state.width,
|
||||
function()
|
||||
state:itemTransaction(function()
|
||||
group:transferTo(state.node)
|
||||
end)
|
||||
state:setPage("Main")
|
||||
return true
|
||||
end,
|
||||
colors.gray,
|
||||
1,
|
||||
-2
|
||||
),
|
||||
paddedButton(
|
||||
"Back",
|
||||
state.width / 2,
|
||||
3,
|
||||
state.height,
|
||||
state.width,
|
||||
function()
|
||||
state:setPage("GROUP_DETAIL", group)
|
||||
return true
|
||||
end,
|
||||
colors.gray,
|
||||
1,
|
||||
-2
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
-- Anchored to (1,1)
|
||||
local windowWrapper = Container:new{
|
||||
[Children:getId()] = {
|
||||
stuffContainer,
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-- Set up event management
|
||||
local function updateDisplayState()
|
||||
local dataRequestText = paddedRequestCount:findById("data_request")
|
||||
local dataDividerPad = paddedRequestCount:findById("data_divider")
|
||||
|
Loading…
x
Reference in New Issue
Block a user