From ad6efe88d947994b4069668d05529e145f2c17f8 Mon Sep 17 00:00:00 2001 From: Daniel Maixner Date: Sun, 1 Oct 2023 12:26:58 +0200 Subject: [PATCH] UI improvements --- www/assets/css/hud.css | 6 ++++-- www/assets/js/Enums.js | 2 +- www/assets/js/Hud.js | 13 ++++++++----- www/resources/font/README.md | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/www/assets/css/hud.css b/www/assets/css/hud.css index 221d0a2..31dfe60 100644 --- a/www/assets/css/hud.css +++ b/www/assets/css/hud.css @@ -3,6 +3,10 @@ src: url("../../resources/font/csgo_icons.ttf"); } +.icons { + font-family: csIcons, Arial, serif; +} + #hud { --color-attackers: #ff9145; --color-defenders: #43b4fd; @@ -433,7 +437,6 @@ } #hud .inventory { - font-family: csIcons; margin-top: auto; margin-bottom: 1rem; font-size: 150%; @@ -449,7 +452,6 @@ } #hud .kill-feed { - font-family: csIcons, Arial, serif; max-height: 220px; font-size: 0.9rem; white-space: nowrap; diff --git a/www/assets/js/Enums.js b/www/assets/js/Enums.js index 2d45d09..5277fd4 100644 --- a/www/assets/js/Enums.js +++ b/www/assets/js/Enums.js @@ -198,7 +198,7 @@ const ItemIdToIcon = { 1: '\uE03B', 2: '\uE004', 3: '\uE013', - 4: '\uE00E', + 4: '\uE003', 5: '\uE007', 6: '\uE00E', 7: '\uE009', diff --git a/www/assets/js/Hud.js b/www/assets/js/Hud.js index a8f446d..1ea57d6 100644 --- a/www/assets/js/Hud.js +++ b/www/assets/js/Hud.js @@ -28,6 +28,7 @@ export class HUD { canBuyIcon: null, canPlantIcon: null, haveDefuseKit: null, + haveBomb: null, spectateUi: null, inventory: null, money: null, @@ -80,7 +81,7 @@ export class HUD { bombPlanted(detonationTimeSec) { this.#resetCountDown() this.#elements.time.innerText = '⚠️ 💣' - this.displayBottomMessage(`⚠️ Alert
The bomb has been planted.
${detonationTimeSec} seconds to detonation.`) + this.displayBottomMessage(`⚠️ Alert
The bomb has been planted.
${detonationTimeSec} seconds till detonation.`) setTimeout(() => this.clearBottomMessage(), 3000) } @@ -218,6 +219,7 @@ export class HUD { this.#elements.canBuyIcon.classList.toggle('hidden', !player.canBuy); this.#elements.canPlantIcon.classList.toggle('hidden', !player.canPlant); this.#elements.haveDefuseKit.classList.toggle('hidden', (player.slots[Enum.InventorySlot.SLOT_KIT] === undefined)); + this.#elements.haveBomb.classList.toggle('hidden', (player.slots[Enum.InventorySlot.SLOT_BOMB] === undefined)); this.#elements.spectateUi.classList.toggle('hidden', this.#game.playerMe.getId() === this.#game.playerSpectate.getId()); if (player.canBuy && this.#showAble.showBuyMenu) { if (this.#elements.buyMenu.classList.contains('hidden')) { @@ -284,8 +286,8 @@ export class HUD {
0 $ 🛒
- - + +
@@ -316,9 +318,9 @@ export class HUD {
-
+
-
+
@@ -339,6 +341,7 @@ export class HUD { this.#elements.canBuyIcon = elementHud.querySelector('[data-can-buy]') this.#elements.canPlantIcon = elementHud.querySelector('[data-can-plant]') this.#elements.haveDefuseKit = elementHud.querySelector('[data-have-defuse-kit]') + this.#elements.haveBomb = elementHud.querySelector('[data-have-bomb]') this.#elements.spectateUi = elementHud.querySelector('#mode-spectate') this.#elements.scoreDetail = elementHud.querySelector('#scoreboard-detail') this.#elements.inventory = elementHud.querySelector('.inventory') diff --git a/www/resources/font/README.md b/www/resources/font/README.md index b8fe6c7..4f93c9f 100644 --- a/www/resources/font/README.md +++ b/www/resources/font/README.md @@ -7,6 +7,6 @@ by **ohmygosh** from https://www.unknowncheats.me/forum/downloads.php?do=file&id # Acknowledgement -Thanks original authors for providing these awesome images for free! +Thanks original authors for providing these awesome fonts for free! If you find file here that violence license, please open issue.