diff --git a/public/css/building.css b/public/css/building.css index ac504bf..a6cb110 100644 --- a/public/css/building.css +++ b/public/css/building.css @@ -588,8 +588,9 @@ body { font-family: "Cinzel", serif; font-size: 15px; color: #2b1b0f; - line-height: 1.6; + line-height: 1.8; text-align: center; + white-space: pre-line; } .notification-footer { diff --git a/public/js/buildings/schwarzmarkt.js b/public/js/buildings/schwarzmarkt.js index 8c3258b..70722cb 100644 --- a/public/js/buildings/schwarzmarkt.js +++ b/public/js/buildings/schwarzmarkt.js @@ -147,7 +147,15 @@ document.addEventListener("click", async (e) => { const data = await res.json(); if (data.error) { - showNotification(data.error, "Nicht genug Gold", "🪙"); + if (data.missing) { + showNotification( + `Du hast ${data.gold} 🪙 Gold.\nDu brauchst ${data.price} 🪙 Gold.\nEs fehlen dir noch ${data.missing} 🪙 Gold.`, + "Nicht genug Gold", + "🪙", + ); + } else { + showNotification(data.error, "Hinweis", "⚠️"); + } return; } diff --git a/routes/blackmarket.js b/routes/blackmarket.js index fdebb2b..c2925c3 100644 --- a/routes/blackmarket.js +++ b/routes/blackmarket.js @@ -82,7 +82,13 @@ WHERE account_id = ? ); if (currency.gold < price) { - return res.json({ error: "Nicht genug Gold" }); + const missing = price - currency.gold; + return res.json({ + error: "Nicht genug Gold", + gold: currency.gold, + price: price, + missing: missing, + }); } await db.query(