ui: hide egpu icon on disengage (#38557)

This commit is contained in:
Daniel Koepping
2026-08-07 02:40:53 -07:00
committed by GitHub
parent dd2214a78c
commit 155d206b2b
@@ -223,12 +223,12 @@ class HudRenderer(Widget):
if icon is not self._egpu_icon:
self._egpu_fade_time = rl.get_time()
self._egpu_icon = icon
alpha = self._egpu_alpha_filter.update(loading or 0 < rl.get_time() - self._egpu_fade_time < SET_SPEED_PERSISTENCE)
alpha = self._egpu_alpha_filter.update(loading or (0 < rl.get_time() - self._egpu_fade_time < SET_SPEED_PERSISTENCE and self._engaged))
if alpha < 1e-2:
return
pos = rl.Vector2(rect.x + rect.width - 10 - icon.width,
rect.y + rect.height - 14 - (self._txt_wheel.height + icon.height) / 2 + (1 - alpha) * icon.height / 2)
rect.y + rect.height - 14 - (self._txt_wheel.height + icon.height) / 2)
rl.draw_texture_ex(icon, pos, 0.0, 1.0, rl.Color(255, 255, 255, int(255 * opacity * alpha)))
def _draw_steering_wheel(self, rect: rl.Rectangle) -> None: