From b6c5dce6955446ebeb5735c0e4e4d8015de564de Mon Sep 17 00:00:00 2001 From: ubq323 Date: Mon, 2 Jan 2023 03:01:50 +0000 Subject: shop --- shop2.lua | 13 ++++++++----- 1 file 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 @ac.kst ",w) } + + end -- cgit v1.2.3