Added old files
This commit is contained in:
parent
9ae92803ce
commit
ef3620f4f9
86 changed files with 2157 additions and 0 deletions
25
sources/scripts/gage.shield.js
Normal file
25
sources/scripts/gage.shield.js
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
'use strict'
|
||||
|
||||
function Gage_Shield (name, limit, color) {
|
||||
Gage.call(this, name, limit, color)
|
||||
|
||||
this.break_limit = null
|
||||
|
||||
this.update = function () {
|
||||
if (this.is_damaged() === true) {
|
||||
this.value_element.innerHTML = `${this.break_limit - 1}/${this.value} <span class='unit'>DP</span>`
|
||||
this.progress.update(this.value < this.break_limit ? this.value : this.break_limit - 1, 11)
|
||||
} else if (this.value == 0) {
|
||||
this.value_element.innerHTML = "0 <span class='unit'>DP</span>"
|
||||
this.progress.update(0, 11)
|
||||
} else {
|
||||
this.value_element.innerHTML = '<span>' + this.value + "</span> <span class='unit'>DP</span>"
|
||||
this.progress.update(this.value, 11)
|
||||
}
|
||||
}
|
||||
|
||||
this.is_damaged = function () {
|
||||
if (this.break_limit === null) { return false }
|
||||
return true
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue