Hooked up new HUD icons.

This commit is contained in:
Nick Winter 2014-03-04 11:15:31 -08:00
parent 3ea4439fc1
commit 4556536df4
8 changed files with 29 additions and 8 deletions
app

Binary file not shown.

Before

(image error) Size: 646 B

Binary file not shown.

Before

(image error) Size: 513 B

Binary file not shown.

Before

(image error) Size: 571 B

Binary file not shown.

Before

(image error) Size: 576 B

Binary file not shown.

Before

(image error) Size: 581 B

View file

@ -95,14 +95,35 @@
height: 100px
@include user-select(text)
.prop
img
margin-right: 5px
width: 16px
height: 16px
.text-prop
width: 50%
.prop-label-icon
$iconSize: 16px
display: inline-block
width: $iconSize
height: $iconSize
margin-right: 5px
background: transparent url(/images/level/hud_info_icons.png) no-repeat
background-size: auto $iconSize
float: left
&.prop-label-icon-pos
background-position-x: -1 * $iconSize
&.prop-label-icon-target
background-position-x: -2 * $iconSize
&.prop-label-icon-inventory
background-position-x: -3 * $iconSize
&.prop-label-icon-visualRange
background-position-x: -4 * $iconSize
&.prop-label-icon-attackDamage
background-position-x: -5 * $iconSize
&.prop-label-icon-attackRange
background-position-x: -6 * $iconSize
&.prop-label-icon-maxSpeed
background-position-x: -7 * $iconSize
&.prop-label-icon-gold
background-position-x: -8 * $iconSize
.prop-value.bar-prop
width: 100px

View file

@ -1,6 +1,6 @@
.prop(name="#{prop}")
if hasIcon
img.prop-label(src="/images/level/prop_#{prop}.png", alt="#{prop}")
span(class="prop-label prop-label-icon prop-label-icon-#{prop}")
else
span.prop-label #{prop}:

View file

@ -247,7 +247,7 @@ module.exports = class HUDView extends View
return null # included in the bar
context =
prop: prop
hasIcon: prop in ["health", "pos", "target", "inventory", "gold"]
hasIcon: prop in ["health", "pos", "target", "inventory", "gold", "visualRange", "attackDamage", "attackRange", "maxSpeed"]
hasBar: prop in ["health"]
$(prop_template(context))