diff --git a/gui/tradeGUI.js b/gui/tradeGUI.js index ed02ec4..d38cd73 100644 --- a/gui/tradeGUI.js +++ b/gui/tradeGUI.js @@ -147,6 +147,11 @@ function drawTradeGUI() { guiControl.drawItem(items[guiControl.trade.page], guiControl.trade.leftBorder, guiControl.trade.rowTop(1) - pixel(5)); guiControl.drawPixelText(itemPriceDisplay, guiControl.trade.leftBorder + pixel(guiControl.iconSize + 4), guiControl.trade.rowTop(1) - pixel(5) + pixel(), 8, "black", 6); + if (items.length > 1) { + guiControl.drawPageArrow("left", guiControl.trade.padding, guiControl.trade.rowTop(1) - pixel(5)); + guiControl.drawPageArrow("right", OS.camera.width - pixel(4) - guiControl.trade.padding, guiControl.trade.rowTop(1) - pixel(5)); + } + // Amounts guiControl.drawPixelText("Shop" + guiControl.trade.island.inventory[items[guiControl.trade.page]].toString(), OS.camera.width - pixel(20), guiControl.trade.rowTop(2) - pixel(6) + pixel(), 4, "black", 4); guiControl.drawPixelText("Own " + G.inventory.cargo[items[guiControl.trade.page]].toString(), OS.camera.width - pixel(20), guiControl.trade.rowTop(3) - pixel(6) + pixel(), 4, (G.inventory.cargo[items[guiControl.trade.page]] < G.stats.hold) ? "black" : "yellow", 4); @@ -241,6 +246,11 @@ function drawTradeGUI() { guiControl.drawItem(items[guiControl.trade.page], guiControl.trade.leftBorder, guiControl.trade.rowTop(1) - pixel(5)); guiControl.drawPixelText(itemPriceDisplay, guiControl.trade.leftBorder + pixel(guiControl.iconSize + 4), guiControl.trade.rowTop(1) - pixel(5) + pixel(), 8, "black", 6); + if (items.length > 1) { + guiControl.drawPageArrow("left", guiControl.trade.padding, guiControl.trade.rowTop(1) - pixel(5)); + guiControl.drawPageArrow("right", OS.camera.width - pixel(4) - guiControl.trade.padding, guiControl.trade.rowTop(1) - pixel(5)); + } + // Amounts guiControl.drawPixelText("Shop" + guiControl.trade.island.inventory[items[guiControl.trade.page]].toString(), OS.camera.width - pixel(20), guiControl.trade.rowTop(2) - pixel(6) + pixel(), 4, "black", 4); guiControl.drawPixelText("Own " + G.inventory.cargo[items[guiControl.trade.page]].toString(), OS.camera.width - pixel(20), guiControl.trade.rowTop(3) - pixel(6) + pixel(), 4, (G.inventory.cargo[items[guiControl.trade.page]] > 0) ? "black" : "yellow", 4); diff --git a/images/arrows.png b/images/arrows.png new file mode 100644 index 0000000..1340a48 Binary files /dev/null and b/images/arrows.png differ diff --git a/images/sources/arrows.pyxel b/images/sources/arrows.pyxel new file mode 100644 index 0000000..ee059c4 Binary files /dev/null and b/images/sources/arrows.pyxel differ diff --git a/loadGUIs.js b/loadGUIs.js index 9a95189..2fbb744 100644 --- a/loadGUIs.js +++ b/loadGUIs.js @@ -29,12 +29,17 @@ var guiControl = { }, drawCursor: function (xPosition, yPosition) { OS.context.drawImage(guiControl.cursor, xPosition, yPosition); + }, + drawPageArrow: function (direction, xPosition, yPosition) { + OS.context.drawImage(guiControl.arrows, (direction == "left") ? 0 : pixel(4), 0, pixel(4), pixel(7), xPosition, yPosition, pixel(4), pixel(7)); } } guiControl.background = new Image(); guiControl.background.src = "images/guiBackground.png"; guiControl.cursor = new Image(); guiControl.cursor.src = "images/guiCursor.png"; +guiControl.arrows = new Image(); +guiControl.arrows.src = "images/arrows.png"; guiControl.itemSheet = new Image(); guiControl.itemSheet.src = "images/items_sheet.png";