Просмотр исходного кода

Distinguish move buttons with no destination and with failed conditions

tags/v0.1.2
Fen Dweller 6 лет назад
Родитель
Сommit
ca0fdca6c2
Не найден GPG ключ соответствующий данной подписи Идентификатор GPG ключа: E80B35A6F11C3656
2 измененных файлов: 8 добавлений и 1 удалений
  1. +5
    -0
      satiate.css
  2. +3
    -1
      world.js

+ 5
- 0
satiate.css Просмотреть файл

@@ -350,6 +350,11 @@ a:hover {
border: none; border: none;
} }


.missing {
background-color: #444;
color: #aaa !important;
}

#move-up-left { #move-up-left {
position: absolute; position: absolute;
left: -140px; left: -140px;


+ 3
- 1
world.js Просмотреть файл

@@ -40,7 +40,7 @@ function resetControls(state) {
const button = document.createElement("button"); const button = document.createElement("button");
button.classList.add("move-button") button.classList.add("move-button")
button.id = "move-" + dir; button.id = "move-" + dir;
button.classList.add("disabled");
button.classList.add("missing");
button.setAttribute("disabled", "true"); button.setAttribute("disabled", "true");
button.textContent = dirs[dir]; button.textContent = dirs[dir];
moveHolder.appendChild(button); moveHolder.appendChild(button);
@@ -177,6 +177,8 @@ function updateRoom(state) {
} }
} }


button.classList.remove("missing");
button.classList.add("disabled");
button.textContent = dest.name; button.textContent = dest.name;


// if any condition fails, don't enable/add a listener // if any condition fails, don't enable/add a listener


Загрузка…
Отмена
Сохранить