Changeset View
Standalone View
binaries/data/mods/public/simulation/components/Auras.js
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | |||||
Auras.prototype.GetRange = function(name) | Auras.prototype.GetRange = function(name) | ||||
{ | { | ||||
if (this.IsRangeAura(name)) | if (this.IsRangeAura(name)) | ||||
return +this.auras[name].radius; | return +this.auras[name].radius; | ||||
return undefined; | return undefined; | ||||
}; | }; | ||||
/** | |||||
* Return the names of any range auras - used to render their ranges. | |||||
*/ | |||||
Auras.prototype.GetVisualAuraRangeNames = function() | |||||
{ | |||||
elexis: Should use GetVisualAuraRangeName .find or .filter, depending on the approach. If converting… | |||||
Not Done Inline ActionsRename to GetVisualAuraNames? (Since we don't get the name of the range, since the visual part of the name implies that we only get the names of the ranges that should be displayed, i.e. global ones excluded natively and since we might want to add support to nonvisual ranged auras. Otherwise could rename to GetVisualRangedAuras if that is better) elexis: Rename to `GetVisualAuraNames`? (Since we don't get the name of the range, since the visual… | |||||
Not Done Inline ActionsGetVisualRangedAuras seems good. Sandarac: `GetVisualRangedAuras` seems good. | |||||
Not Done Inline Actions(Perhaps GetRange(d)AuraNames is better, since it could be used for non-visual things too) elexis: (Perhaps GetRange(d)AuraNames is better, since it could be used for non-visual things too) | |||||
Not Done Inline ActionsI'm not sure about that. I think the current name is okay. Sandarac: I'm not sure about that. I think the current name is okay. | |||||
return this.GetAuraNames().filter(auraName => this.IsRangeAura(auraName)); | |||||
}; | |||||
Auras.prototype.GetLineTexture = function(name) | |||||
{ | |||||
return this.auras[name].rangeOverlay ? this.auras[name].rangeOverlay.lineTexture : "outline_border.png"; | |||||
Not Done Inline Actions(Seems correct to not check for the existance of this.auras[name] so that we get some errors to debug instead of silencing them) elexis: (Seems correct to not check for the existance of `this.auras[name]` so that we get some errors… | |||||
Not Done Inline ActionsYes. Sandarac: Yes. | |||||
}; | |||||
Auras.prototype.GetLineTextureMask = function(name) | |||||
{ | |||||
return this.auras[name].rangeOverlay ? this.auras[name].rangeOverlay.lineTextureMask : "outline_border_mask.png"; | |||||
}; | |||||
Auras.prototype.GetLineThickness = function(name) | |||||
{ | |||||
return this.auras[name].rangeOverlay ? this.auras[name].rangeOverlay.lineThickness : 0.2; | |||||
}; | |||||
Not Done Inline Actions✓ This block looks really nice! The defaults might or might not be moved to the aura templates someday elexis: ✓
This block looks really nice!
The defaults might or might not be moved to the aura… | |||||
Auras.prototype.GetClasses = function(name) | Auras.prototype.GetClasses = function(name) | ||||
{ | { | ||||
return this.auras[name].affects; | return this.auras[name].affects; | ||||
}; | }; | ||||
Auras.prototype.GetModifications = function(name) | Auras.prototype.GetModifications = function(name) | ||||
{ | { | ||||
return this.auras[name].modifications; | return this.auras[name].modifications; | ||||
▲ Show 20 Lines • Show All 363 Lines • Show Last 20 Lines |
Should use GetVisualAuraRangeName .find or .filter, depending on the approach. If converting undefined to string implicitly isn't supported, make it || "".