Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/StatusBars.js
Show First 20 Lines • Show All 201 Lines • ▼ Show 20 Lines | StatusBars.prototype.AddCaptureBar = function(cmpOverlayRenderer, yoffset) | ||||
let width = +this.template.BarWidth; | let width = +this.template.BarWidth; | ||||
let height = +this.template.BarHeight; | let height = +this.template.BarHeight; | ||||
// World-space offset from the unit's position | // World-space offset from the unit's position | ||||
let offset = { "x": 0, "y": +this.template.HeightOffset, "z": 0 }; | let offset = { "x": 0, "y": +this.template.HeightOffset, "z": 0 }; | ||||
let setCaptureBarPart = function(playerID, startSize) | let setCaptureBarPart = function(playerID, startSize) | ||||
{ | { | ||||
let c = QueryPlayerIDInterface(playerID).GetColor(); | let c = QueryPlayerIDInterface(playerID).GetDisplayedColor(); | ||||
let strColor = (c.r * 255) + " " + (c.g * 255) + " " + (c.b * 255) + " 255"; | let strColor = (c.r * 255) + " " + (c.g * 255) + " " + (c.b * 255) + " 255"; | ||||
let size = width * cp[playerID] / cmpCapturable.GetMaxCapturePoints(); | let size = width * cp[playerID] / cmpCapturable.GetMaxCapturePoints(); | ||||
cmpOverlayRenderer.AddSprite( | cmpOverlayRenderer.AddSprite( | ||||
"art/textures/ui/session/icons/capture_bar.png", | "art/textures/ui/session/icons/capture_bar.png", | ||||
{ "x": startSize, "y": yoffset }, | { "x": startSize, "y": yoffset }, | ||||
{ "x": startSize + size, "y": height + yoffset }, | { "x": startSize + size, "y": height + yoffset }, | ||||
offset, | offset, | ||||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator