]> git.lizzy.rs Git - dragonblocks.git/blobdiff - engine/hudbar.js
Abstract MapDisplay from Map
[dragonblocks.git] / engine / hudbar.js
index 354d8d3bd77937b34fde10e636863bb66eb4683d..3855fe054b50bdc8fae3361e59da0921d3c4f0a9 100644 (file)
@@ -32,7 +32,7 @@ dragonblocks.Hudbar = class
 
                this.selectedSlot = 0;
 
-               let display = document.body.insertBefore(document.createElement("div"), document.getElementById("dragonblocks.map").nextSibling);
+               let display = document.body.insertBefore(document.createElement("div"), dragonblocks.mapDisplay.element.nextSibling);
                display.id = "dragonblocks.hudbar[" + this.id + "]";
                display.style.position = "fixed";
                display.style.bottom = "5px";
@@ -41,7 +41,7 @@ dragonblocks.Hudbar = class
 
                dblib.center(display);
 
-               for(let i = 0; i < this.slots; i++){
+               for (let i = 0; i < this.slots; i++) {
                        let slotDisplay = display.appendChild(document.createElement("div"));
                        slotDisplay.id = "dragonblocks.hudbar[" + this.id + "].slot[" + i + "]";
                        slotDisplay.style.position = "absolute";