瀏覽代碼

Disabled exits are now clearly indicated

tags/v0.2.8
Fen Dweller 7 年之前
父節點
當前提交
23a266d212
共有 2 個文件被更改,包括 15 次插入5 次删除
  1. +10
    -0
      feast.css
  2. +5
    -5
      feast.js

+ 10
- 0
feast.css 查看文件

@@ -35,6 +35,16 @@ button {
background: #111;
}

.disabled-button {
background: repeating-linear-gradient(
45deg,
#111,
#111 10px,
#622 10px,
#622 20px
);
}

.compass-button {
width: 100px;
height: 100px;


+ 5
- 5
feast.js 查看文件

@@ -27,21 +27,21 @@ function round(number, digits) {
function updateExploreCompass() {
for (let i = 0; i < dirButtons.length; i++) {
let button = dirButtons[i];
button.classList.remove("active-button");
button.classList.remove("inactive-button");
button.classList.remove("disabled-button");
if (currentRoom.exits[i] == null) {
button.disabled = true;
button.classList.remove("active-compass-button");
button.classList.add("inactive-button");
button.innerHTML = "";
} else {
if (currentRoom.exits[i].conditions.reduce((result, test) => result && test(prefs), true)) {
button.disabled = false;
button.classList.remove("inactive-button");
button.classList.add("active-compass-button");
button.classList.add("active-button");
button.innerHTML = currentRoom.exits[i].name;
} else {
button.disabled = true;
button.classList.add("inactive-button");
button.classList.remove("active-compass-button");
button.classList.add("disabled-button");
button.innerHTML = currentRoom.exits[i].name;
}
}


Loading…
取消
儲存