summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2023-01-02 03:01:50 +0000
committerubq323 <ubq323@ubq323.website>2023-01-02 03:01:50 +0000
commitb6c5dce6955446ebeb5735c0e4e4d8015de564de (patch)
treedc16451fb9a8916d0d589097feefa2512cf8d0b8
parent7b31b56ddebed0aea6e3013b708507e1b82120dd (diff)
shop
-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