Browse Source

Fixes #90

tags/v0.1.2^2
Big Bad Waffle 7 years ago
parent
commit
e140d44d02
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      src/client/ui/templates/target/target.js

+ 12
- 0
src/client/ui/templates/target/target.js View File

@@ -13,6 +13,7 @@ define([
target: null,
lastHp: null,
lastMana: null,
lastLevel: null,

postRender: function() {
this.onEvent('onSetTarget', this.onSetTarget.bind(this));
@@ -50,6 +51,7 @@ define([
if (!this.target) {
this.lastHp = null;
this.lastMana = null;
this.lastLevel = null;
this.el.hide();
} else {
var el = this.el;
@@ -91,6 +93,16 @@ define([

var stats = target.stats.values;

if (stats.level != this.lastLevel) {
this.el.find('.infoLevel')
.html('(' + stats.level + ')')
.removeClass('high-level');

var crushing = (stats.level - 5 >= window.player.stats.level);
if (crushing)
this.el.find('.infoLevel').addClass('high-level');
}

if (stats.hp != this.lastHp) {
this.buildBar(0, stats.hp, stats.hpMax);
this.lastHp = stats.hp;


Loading…
Cancel
Save