public void SetPing(long ms) { _ping = ms; _isPending = false; if (!_isOutdated) { int index = 0; for (int i = _qualityStateTextures.Length - 1; i > 0; i--) { index = i; if (ms > QualityThresholds[i]) { break; } } GuiTexture2D bg = _qualityStateTextures[_qualityStateTextures.Length - index]; if (!bg.HasValue && GuiRenderer != null) { bg = GuiRenderer.GetTexture(QualityStates[QualityStates.Length - index]); } Background = bg; } }
public void Set(HeartValue value) { Texture.IsVisible = true; switch (value) { case HeartValue.Full: Texture.Texture = GuiRenderer.GetTexture(GuiTextures.HealthHeart); break; case HeartValue.Half: Texture.Texture = GuiRenderer.GetTexture(GuiTextures.HealthHalfHeart); break; case HeartValue.None: Texture.IsVisible = false; break; } }