Update server/static/ui_hud.js
This commit is contained in:
@@ -37,12 +37,11 @@ export function setupHUD(root) {
|
|||||||
location.reload();
|
location.reload();
|
||||||
};
|
};
|
||||||
|
|
||||||
// functions for other modules to update XP
|
|
||||||
window.updateXP = level => {
|
window.updateXP = level => {
|
||||||
const label = panel.querySelector('#xplabel');
|
const label = panel.querySelector('#xplabel');
|
||||||
label.textContent = `Lvl ${level}`;
|
label.textContent = `Lvl ${level}`;
|
||||||
const fill = panel.querySelector('#xpfill');
|
const fill = panel.querySelector('#xpfill');
|
||||||
const pct = Math.min(100, level); // dumb visual
|
const pct = Math.min(100, level); // simple visual
|
||||||
fill.style.width = `${pct}%`;
|
fill.style.width = `${pct}%`;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user