Compare commits
No commits in common. "32361db152be51704428d1abf3db4729312ee2f9" and "df93ccf8014986d68ac40dc55e1b5a7133524f3a" have entirely different histories.
32361db152
...
df93ccf801
@ -158,9 +158,7 @@ local function itemList(groups, wBudget, hBudget, savedState, onClick, setPage,
|
||||
text = text:sub(1,textBudget)
|
||||
end
|
||||
|
||||
local nbtColor = group:getNBT() and colors.cyan or nil
|
||||
|
||||
local textLabel = Text:new{ text = text, bgColor = bgColors[i % 2], fgColor = nbtColor }
|
||||
local textLabel = Text:new{ text = text, bgColor = bgColors[i % 2] }
|
||||
local countLabel = Text:new{ text = count, bgColor = bgColors[i % 2] }
|
||||
local paddedText = Padding:new{
|
||||
left = 0,
|
||||
@ -292,7 +290,7 @@ local PAGES = {
|
||||
state:setPage("MAIN")
|
||||
return NOOP
|
||||
end
|
||||
local title = Text:new{
|
||||
local hello = Text:new{
|
||||
text = "Detail: "..group:getSimpleName(),
|
||||
parent = state.monitor,
|
||||
onClick = function(e, x, y, s)
|
||||
@ -300,15 +298,7 @@ local PAGES = {
|
||||
end
|
||||
}
|
||||
|
||||
local paddedTitle = Padding:new{
|
||||
top = 1,
|
||||
left = 1,
|
||||
right = 1,
|
||||
bottom = 1,
|
||||
element = title
|
||||
}
|
||||
|
||||
return renderDefault(state, paddedTitle)
|
||||
return renderDefault(state, hello)
|
||||
end,
|
||||
|
||||
REQUEST = function(state, newPage)
|
||||
|
@ -49,10 +49,6 @@ function ItemGroup:getEnchantments()
|
||||
return self:_getIdentityStack():getEnchantments()
|
||||
end
|
||||
|
||||
function ItemGroup:getNBT()
|
||||
return self:_getIdentityStack():getNBT()
|
||||
end
|
||||
|
||||
function ItemGroup:_getIdentityStack()
|
||||
return self[1]
|
||||
end
|
||||
|
@ -19,7 +19,6 @@ function ItemStack:fromDetail(inv, detail, slot)
|
||||
obj.maxCount = detail.maxCount
|
||||
obj.enchantments = detail.enchantments
|
||||
obj.displayName = detail.displayName
|
||||
obj.nbt = detail.nbt
|
||||
end
|
||||
|
||||
setmetatable(obj, self)
|
||||
@ -38,8 +37,7 @@ function ItemStack:clone(withSlot)
|
||||
count = self.count,
|
||||
maxCount = self.maxCount,
|
||||
enchantments = self.enchantments,
|
||||
displayName = self.displayName,
|
||||
nbt = self.nbt
|
||||
displayName = self.displayName
|
||||
}
|
||||
|
||||
setmetatable(obj, self)
|
||||
@ -54,7 +52,7 @@ function ItemStack:toSerializable()
|
||||
maxCount = self.maxCount
|
||||
}
|
||||
|
||||
if not self:isEmpty() then
|
||||
if self.count ~= nil then
|
||||
-- Not empty
|
||||
ser.name = self.name
|
||||
ser.damage = self.damage
|
||||
@ -62,7 +60,6 @@ function ItemStack:toSerializable()
|
||||
ser.count = self.count
|
||||
ser.enchantments = self.enchantments
|
||||
ser.displayName = self.displayName
|
||||
ser.nbt = self.nbt
|
||||
end
|
||||
|
||||
return ser
|
||||
@ -109,10 +106,6 @@ function ItemStack:getInventory()
|
||||
return self.inv
|
||||
end
|
||||
|
||||
function ItemStack:getNBT()
|
||||
return self.nbt
|
||||
end
|
||||
|
||||
function ItemStack:isEmpty()
|
||||
return self.count == nil or self.count == 0
|
||||
end
|
||||
@ -170,7 +163,6 @@ function ItemStack:_modify(countDelta, stack)
|
||||
self.maxCount = nil
|
||||
self.enchantments = nil
|
||||
self.displayName = nil
|
||||
self.nbt = nil
|
||||
else
|
||||
-- If stack is empty, copy stack data from source
|
||||
if self:isEmpty() then
|
||||
@ -181,7 +173,6 @@ function ItemStack:_modify(countDelta, stack)
|
||||
self.maxCount = stack.maxCount
|
||||
self.enchantments = stack.enchantments
|
||||
self.displayName = stack.displayName
|
||||
self.nbt = stack.nbt
|
||||
end
|
||||
|
||||
self.count = newCount
|
||||
@ -252,7 +243,6 @@ function ItemStack:canTransfer(stack)
|
||||
self.damage == stack.damage and
|
||||
self.maxDamage == stack.maxDamage and
|
||||
self.displayName == stack.displayName and
|
||||
self.nbt == stack.nbt and
|
||||
objEquals(self.enchantments, stack.enchantments))
|
||||
end
|
||||
|
||||
@ -282,7 +272,6 @@ function ItemStack:matches(query)
|
||||
queryField(query.maxDamage, self.maxDamage) and
|
||||
queryField(query.enchantments, self.enchantments) and
|
||||
queryField(query.maxCount, self.maxCount) and
|
||||
queryField(query.nbt, self.nbt) and
|
||||
queryField(query.displayName, self.displayName)
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user