Update GUI issues

This commit is contained in:
Robbie Antenesse 2019-02-13 13:07:05 -07:00
parent 7b8729d4e0
commit 6dad9281d7
3 changed files with 19 additions and 19 deletions

View File

@ -37,7 +37,7 @@ guiControl.inventory.Draw = function () {
guiControl.drawPixelText("Storage", guiControl.leftBorder - pixel(2), guiControl.topOfBackground, 8, "black", 6);
guiControl.drawPageArrow("left", pixel(4), guiControl.topOfBackground);
guiControl.drawPageArrow("right", OS.camera.width - pixel(4) - pixel(4), guiControl.topOfBackground);
guiControl.drawPageArrow("right", pixel(4) + guiControl.gui_sheet.guiBackground.width - pixel(4) - pixel(4), guiControl.topOfBackground);
// Money icon
guiControl.drawIcon(7, 2, guiControl.leftBorder, guiControl.rowTop(0));

View File

@ -17,7 +17,7 @@ guiControl.map.Draw = function () {
guiControl.drawPixelText("Map", guiControl.leftBorder + pixel(10), guiControl.topOfBackground, 8, "black", 6);
guiControl.drawPageArrow("left", pixel(4), guiControl.topOfBackground);
guiControl.drawPageArrow("right", OS.camera.width - pixel(4) - pixel(4), guiControl.topOfBackground);
guiControl.drawPageArrow("right", pixel(4) + guiControl.gui_sheet.guiBackground.width - pixel(4) - pixel(4), guiControl.topOfBackground);
var saveFillStyle = OS.context.fillStyle;

View File

@ -167,28 +167,28 @@ guiControl.trade.Draw = function () {
var itemPrice = G.economy.cargoItemWorth[items[guiControl.trade.page]] + guiControl.trade.island.priceDifferences[items[guiControl.trade.page]] - guiControl.trade.island.haggleAmount;
if (itemPrice < 1) itemPrice = 1;
var itemPriceDisplay = itemPrice.toString() + " c";
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);
guiControl.drawItem(items[guiControl.trade.page], guiControl.trade.leftBorder + pixel(40), guiControl.trade.rowTop(1) - pixel(5));
guiControl.drawPixelText(itemPriceDisplay, guiControl.trade.leftBorder + pixel(40) + 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));
guiControl.drawPageArrow("left", guiControl.trade.padding + pixel(30), guiControl.trade.rowTop(1) - pixel(5));
guiControl.drawPageArrow("right", OS.camera.width - pixel(4) - guiControl.trade.padding - pixel(50), 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, (guiControl.trade.island.CanBuyFrom(items[guiControl.trade.page], itemPrice)) ? "black" : "yellow", 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);
guiControl.drawPixelText("Shop Has " + guiControl.trade.island.inventory[items[guiControl.trade.page]].toString(), OS.camera.width - pixel(50), guiControl.trade.rowTop(2) - pixel(6) + pixel(), 9, (guiControl.trade.island.CanBuyFrom(items[guiControl.trade.page], itemPrice)) ? "black" : "yellow", 4);
guiControl.drawPixelText("You Have " + G.inventory.cargo[items[guiControl.trade.page]].toString(), OS.camera.width - pixel(50), guiControl.trade.rowTop(3) - pixel(6) + pixel(), 9, (G.inventory.cargo[items[guiControl.trade.page]] < G.stats.hold) ? "black" : "yellow", 4);
} else {
guiControl.drawPixelText("Sold Out!", guiControl.trade.leftBorder, guiControl.trade.rowTop(1) - pixel(5) + pixel(), 10, "black", 6);
}
// Draw Amount of Cargo
guiControl.drawIcon(1, 1, OS.camera.width - pixel(20), guiControl.trade.rowTop(4) - pixel(5));
guiControl.drawPixelText(G.inventory.CheckCargo().length.toString(), OS.camera.width - pixel(20) + (guiControl.iconScaled + pixel()), guiControl.trade.rowTop(4) - pixel(4), 4, (G.inventory.CheckCargo().length < G.stats.inventory) ? "black" : "yellow", 6);
guiControl.drawIcon(1, 1, OS.camera.width - pixel(50), guiControl.trade.rowTop(4) - pixel(5));
guiControl.drawPixelText(G.inventory.CheckCargo().length.toString(), OS.camera.width - pixel(50) + (guiControl.iconScaled + pixel()), guiControl.trade.rowTop(4) - pixel(4), 4, (G.inventory.CheckCargo().length < G.stats.inventory) ? "black" : "yellow", 6);
// Yes/No Options
guiControl.drawPixelText("Haggle", guiControl.trade.leftBorder, guiControl.trade.rowTop(2) - pixel(2), 8, (guiControl.trade.island.timesHaggledToday >= G.stats.popularity) ? "yellow" : ((items.length > 0 && guiControl.trade.island.haggleAmount == 0) ? "black" : "white"), 6);
guiControl.drawPixelText((guiControl.trade.island.CanBuyFrom(items[guiControl.trade.page], itemPrice)) ? "Yes" : "Over!", guiControl.trade.leftBorder, guiControl.trade.rowTop(3) - pixel(2), 8, (items.length > 0 && G.inventory.CanBuy(items[guiControl.trade.page], itemPrice)) ? ((guiControl.trade.island.CanBuyFrom(items[guiControl.trade.page], itemPrice)) ? "black" : "yellow") : "white", 6);
guiControl.drawPixelText((guiControl.trade.island.CanBuyFrom(items[guiControl.trade.page], itemPrice)) ? "Yes" : "Nothing to Buy!", guiControl.trade.leftBorder, guiControl.trade.rowTop(3) - pixel(2), 20, (items.length > 0 && G.inventory.CanBuy(items[guiControl.trade.page], itemPrice)) ? ((guiControl.trade.island.CanBuyFrom(items[guiControl.trade.page], itemPrice)) ? "black" : "yellow") : "white", 6);
// Back Text
guiControl.drawPixelText("Back", guiControl.trade.leftBorder, guiControl.trade.rowTop(4) - pixel(2), 8, "black", 6);
@ -277,17 +277,17 @@ guiControl.trade.Draw = function () {
itemPrice = Math.round(itemPrice * priceCut);
if (itemPrice < 1) itemPrice = 1;
var itemPriceDisplay = itemPrice.toString() + " c";
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);
guiControl.drawItem(items[guiControl.trade.page], guiControl.trade.leftBorder + pixel(40), guiControl.trade.rowTop(1) - pixel(5));
guiControl.drawPixelText(itemPriceDisplay, guiControl.trade.leftBorder + pixel(40) + 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));
guiControl.drawPageArrow("left", guiControl.trade.padding + pixel(30), guiControl.trade.rowTop(1) - pixel(5));
guiControl.drawPageArrow("right", OS.camera.width - pixel(4) - guiControl.trade.padding - pixel(50), 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, (guiControl.trade.island.CanSellTo(items[guiControl.trade.page], itemPrice)) ? "black" : "yellow", 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);
guiControl.drawPixelText("Shop Has " + guiControl.trade.island.inventory[items[guiControl.trade.page]].toString(), OS.camera.width - pixel(50), guiControl.trade.rowTop(2) - pixel(6) + pixel(), 9, (guiControl.trade.island.CanBuyFrom(items[guiControl.trade.page], itemPrice)) ? "black" : "yellow", 4);
guiControl.drawPixelText("You Have " + G.inventory.cargo[items[guiControl.trade.page]].toString(), OS.camera.width - pixel(50), guiControl.trade.rowTop(3) - pixel(6) + pixel(), 9, (G.inventory.cargo[items[guiControl.trade.page]] < G.stats.hold) ? "black" : "yellow", 4);
} else {
guiControl.drawPixelText("No Cargo!", guiControl.trade.padding, guiControl.trade.rowTop(1) - pixel(5) + pixel(), 10, "black", 6);
}
@ -297,8 +297,8 @@ guiControl.trade.Draw = function () {
guiControl.drawPixelText(G.inventory.CheckCargo().length.toString(), OS.camera.width - pixel(20) + (guiControl.iconScaled + pixel()), guiControl.trade.rowTop(4) - pixel(4), 4, (G.inventory.CheckCargo().length > 0) ? "black" : "yellow", 6);
// Yes/No Options
guiControl.drawPixelText("Hagl?", guiControl.trade.leftBorder, guiControl.trade.rowTop(2) - pixel(2), 8, (guiControl.trade.island.timesHaggledToday >= G.stats.popularity) ? "yellow" : ((items.length > 0 && guiControl.trade.island.haggleAmount == 0) ? "black" : "white"), 6);
guiControl.drawPixelText((guiControl.trade.island.CanSellTo(items[guiControl.trade.page], itemPrice)) ? "Yes" : "Over!", guiControl.trade.leftBorder, guiControl.trade.rowTop(3) - pixel(2), 8, (items.length > 0 && G.inventory.CanSell(items[guiControl.trade.page])) ? ((guiControl.trade.island.CanSellTo(items[guiControl.trade.page], itemPrice)) ? "black" : "yellow") : "white", 6);
guiControl.drawPixelText("Haggle?", guiControl.trade.leftBorder, guiControl.trade.rowTop(2) - pixel(2), 8, (guiControl.trade.island.timesHaggledToday >= G.stats.popularity) ? "yellow" : ((items.length > 0 && guiControl.trade.island.haggleAmount == 0) ? "black" : "white"), 6);
guiControl.drawPixelText((guiControl.trade.island.CanSellTo(items[guiControl.trade.page], itemPrice)) ? "Yes" : "Nothing to Sell!", guiControl.trade.leftBorder, guiControl.trade.rowTop(3) - pixel(2), 20, (items.length > 0 && G.inventory.CanSell(items[guiControl.trade.page])) ? ((guiControl.trade.island.CanSellTo(items[guiControl.trade.page], itemPrice)) ? "black" : "yellow") : "white", 6);
// Back Text
guiControl.drawPixelText("Back", guiControl.trade.leftBorder, guiControl.trade.rowTop(4) - pixel(2), 8, "black", 6);