소스 검색

Allow for stats to be hidden

tags/v0.1.3
Fen Dweller 6 년 전
부모
커밋
1de392dc57
1개의 변경된 파일9개의 추가작업 그리고 0개의 파일을 삭제
  1. +9
    -0
      game.js

+ 9
- 0
game.js 파일 보기

@@ -86,6 +86,15 @@ function renderTime(time) {
function updateStatDisplay(stats, statType) {
Object.entries(stats).forEach(([key, val]) => {

if (val.hidden === true) {
const field = document.querySelector("#" + statType + "-info-" + key);
field.style.display = "none";
} else if (val.hidden === false) {
const field = document.querySelector("#" + statType + "-info-" + key);
field.style.display = "block";
}

if (val.type == "meter") {
const field = document.querySelector("#" + statType + "-info-" + key + " > .stat-bar");
field.style.width = (val.value / val.max * 100) + "%";


불러오는 중...
취소
저장