summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shop2.lua13
1 files changed, 8 insertions, 5 deletions
diff --git a/shop2.lua b/shop2.lua
index 2666661..b2dd456 100644
--- a/shop2.lua
+++ b/shop2.lua
@@ -1,9 +1,9 @@
local ourname = "ac.kst"
local ITEMS = {
- {"dmn", 5, "minecraft:diamond", "Diamond", 321},
- {"blz", 10, "minecraft:blaze_rod", "Blaze Rod", 27},
- {"ely", 40, "minecraft:elytra", "Elytra", 8},
+ {"dmn", 5, "minecraft:diamond", "Diamond", colors.cyan, 321},
+ {"blz", 10, "minecraft:blaze_rod", "Blaze Rod", colors.orange, 27},
+ {"ely", 40, "minecraft:elytra", "Elytra", colors.purple, 8},
}
local function printseq(m) return function(q)
@@ -46,7 +46,8 @@ local function disp_shopscreen()
-- 123456789012345678901234567890123456789012345678901234567
-- 0 1 2 3 4 5
- local function fmt_row(m,y, stock,price,adr,name)
+ local function fmt_row(m,y, stock,price,adr,name, colour)
+ colour = colour or colors.cyan
printseq(m) {
{1,y}, colors.white, pad(stock,5),
{8,y}, colors.yellow, pad(price,5), colors.lightGray, "kst",
@@ -62,7 +63,7 @@ local function disp_shopscreen()
}
for ix,i in ipairs(ITEMS) do
- fmt_row(m,ix+2,i[5],i[2],i[1],i[4])
+ fmt_row(m,ix+2,i[6],i[2],i[1],i[4],i[5])
end
local w,h = m.getSize()
@@ -71,6 +72,8 @@ local function disp_shopscreen()
{1,h-1}, colors.blue, centre("/pay <adr>@ac.kst <amount>",w)
}
+
+
end