diff --git a/Krypton b/Krypton index 0d6038f..2f5557c 160000 --- a/Krypton +++ b/Krypton @@ -1 +1 @@ -Subproject commit 0d6038f75e1509dcdee95ef9d05962424fe2005f +Subproject commit 2f5557ccbac59b263c5af7394a0d236d43f4fddd diff --git a/config.lua b/config.lua index 7120243..5ceba92 100644 --- a/config.lua +++ b/config.lua @@ -12,6 +12,7 @@ theme = { formatting = { headerAlign = "center", + footerAlign = "center", productNameAlign = "center", productTextSize = "auto" }, @@ -19,6 +20,8 @@ bgColor = colors.lightGray, headerBgColor = colors.red, headerColor = colors.white, + footerBgColor = colors.red, + footerColor = colors.white, productBgColor = colors.blue, outOfStockQtyColor = colors.red, lowQtyColor = colors.orange, diff --git a/core/ConfigValidator.lua b/core/ConfigValidator.lua index e0805c3..f582ff3 100644 --- a/core/ConfigValidator.lua +++ b/core/ConfigValidator.lua @@ -14,6 +14,7 @@ theme = { formatting = { headerAlign = "enum<'left' | 'center' | 'right'>: alignment", + footerAlign = "enum<'left' | 'center' | 'right'>: alignment", productNameAlign = "enum<'left' | 'center' | 'right'>: alignment", productTextSize = "enum<'small' | 'medium' | 'large' | 'auto'>: text size", }, @@ -21,6 +22,8 @@ bgColor = "color", headerBgColor = "color", headerColor = "color", + footerBgColor = "color", + footerColor = "color", productBgColor = "color", outOfStockQtyColor = "color", lowQtyColor = "color", diff --git a/core/ShopState.lua b/core/ShopState.lua index e966896..fba53a7 100644 --- a/core/ShopState.lua +++ b/core/ShopState.lua @@ -121,6 +121,7 @@ peripheral.call(state.config.peripherals.outputChest, "drop", 1, productSource.amount, state.config.settings.dropDirection) end end + purchasedProduct.quantity = purchasedProduct.quantity - available if refundAmount > 0 then refund(transactionCurrency, transaction.from, meta, refundAmount, "Here is the funds remaining after your purchase!") end diff --git a/radon.lua b/radon.lua index 2c6929a..11e91d2 100644 --- a/radon.lua +++ b/radon.lua @@ -104,6 +104,11 @@ header } + if props.shopState.selectedCurrency then + local footer = SmolText { display=display, text="/pay @" .. props.shopState.selectedCurrency.name .. " ", x=1, y=display.bgCanvas.height-smolFont.height-4, align=theme.formatting.footerAlign, bg=theme.colors.footerBgColor, color = theme.colors.footerColor, width=display.bgCanvas.width } + table.insert(flatCanvas, footer) + end + local maxAddrWidth = 0 local maxQtyWidth = 0 local maxPriceWidth = 0 @@ -112,7 +117,7 @@ local selectedCategory = props.shopState.selectedCategory local catName = categories[selectedCategory].name local shopProducts = getDisplayedProducts(categories[selectedCategory].products, config.settings) - local productsHeight = display.bgCanvas.height - 17 + local productsHeight = display.bgCanvas.height - 17 - smolFont.height - 4 local heightPerProduct = math.floor(productsHeight / #shopProducts) local productTextSize if theme.formatting.productTextSize == "auto" then