Skip to main content

StaminaBarVisibility.HandStaminaView

A private class in Root.Township, Alta.StatSystem. Reach it through att-stubs' publicized assemblies or Harmony's AccessTools.

Client: fades one hand's stamina bars and notches in while stamina is below maximum and out when it is full. StaminaBarVisibility keeps one for each hand.

Constructors​

MemberWhat it is
HandStaminaView(StatBarBase[] staminaStatBars, Material notchesMaterial, float alphaLerpSpeed)Creates a StaminaBarVisibility.HandStaminaView from staminaStatBars, notchesMaterial and alphaLerpSpeed.

Fields​

6 private and internal fields
MemberWhat it is
private float alphaBacking field for Alpha.
private readonly float alphaLerpSpeedHow fast alpha changes per second.
private Stat handStaminaStatThe stamina stat read from the bars, compared with its maximum to decide fading.
private readonly int NotchAlphaShader property ID for _AlphaLimit on the notch material.
private readonly Material notchesMaterialPer-hand clone of the notch material.
private readonly StatBarBase[] staminaStatBarsThis hand's stamina bars.

Properties​

MemberWhat it is
float Alpha { get; set; }Current opacity. Setting it updates the notch material and every stamina bar.

Methods​

MemberWhat it is
void DisableStaminaBars()Disables all of this hand's stamina bars. Called when the player dies.
void UpdateStaminaStatBarAlpha()Called every LateUpdate: hides the bars when downed, fades them out at full stamina and in otherwise.
2 private and internal methods
MemberWhat it is
private void HideNotches()Sets the notch material's alpha limit to 0.
private void SetupStamina()Initializes each bar at zero alpha, takes its stat as the tracked stamina stat and forces the cloned notch material on it.

Used in​

Members of other types that take, return or hold a HandStaminaView: