浏览代码

Improved combat formatting. Added a description box

tags/v0.2.8
Fen Dweller 7 年前
父节点
当前提交
dc6b68791c
共有 3 个文件被更改,包括 19 次插入16 次删除
  1. +12
    -2
      feast.css
  2. +3
    -14
      feast.html
  3. +4
    -0
      feast.js

+ 12
- 2
feast.css 查看文件

@@ -38,12 +38,18 @@ button {
} }


.combat-button { .combat-button {
width: 100px;
height: 100px;
width: 200px;
height: 50px;
font-size: 18px; font-size: 18px;
user-select: none; user-select: none;
} }


#combat-desc {
width: 200px;
height: 400px;
background: #222;
}

.dialog-button { .dialog-button {
width: 300px; width: 300px;
height: 75px; height: 75px;
@@ -55,6 +61,10 @@ button {
list-style-type: none; list-style-type: none;
} }


#combat {
list-style-type: none;
}

#log { #log {
background: #222; background: #222;
width: 100%; width: 100%;


+ 3
- 14
feast.html 查看文件

@@ -110,20 +110,9 @@
</div> </div>
</div> </div>
<div class="selector" id="selector-combat"> <div class="selector" id="selector-combat">
<div id="combat">
<table>
<tr>
<th>
<button class="combat-button">Punch</button>
</th>
<th>
<button class="combat-button">Eat</button>
</th>
<th>
<button class="combat-button">Sneeze</button>
</th>
</tr>
</table>
<ul id="combat">
</ul>
<div id="combat-desc">
</div> </div>
</div> </div>
<div class="selector" id="selector-dialog"> <div class="selector" id="selector-dialog">


+ 4
- 0
feast.js 查看文件

@@ -70,6 +70,7 @@ function updateCombat() {
button.classList.add("combat-button"); button.classList.add("combat-button");
button.innerHTML = attacks[i].name; button.innerHTML = attacks[i].name;
button.addEventListener("click", function() { attackClicked(i) }); button.addEventListener("click", function() { attackClicked(i) });
button.addEventListener("mouseover", function() { attackHovered(i) });
li.appendChild(button); li.appendChild(button);
list.appendChild(li); list.appendChild(li);
} }
@@ -200,6 +201,9 @@ function attackClicked(index) {
} }
} }


function attackHovered(index) {
document.getElementById("combat-desc").innerHTML = attacks[index].desc;
}
function startDialog(dialog) { function startDialog(dialog) {
mode = "dialog"; mode = "dialog";
currentDialog = dialog; currentDialog = dialog;


正在加载...
取消
保存