diff --git a/assets/root/uiplayergauge.py b/assets/root/uiplayergauge.py index 2e73bda2..5e8b08ed 100644 --- a/assets/root/uiplayergauge.py +++ b/assets/root/uiplayergauge.py @@ -22,7 +22,7 @@ class PlayerGauge(ui.Gauge): self.SetPosition(-100, -100) ui.Gauge.Hide(self) - def OnUpdate(self): + def __UpdateScreenPosition(self): playerIndex = player.GetMainCharacterIndex() (x, y, z)=textTail.GetPosition(playerIndex) @@ -30,6 +30,14 @@ class PlayerGauge(ui.Gauge): isChat = textTail.IsChat(playerIndex) ui.Gauge.SetPosition(self, int(x - self.GetWidth() // 2), int(y + 5) + isChat * 17) + def OnUpdate(self): + self.__UpdateScreenPosition() + + def OnRender(self): + # Refresh the anchor every render so the gauge tracks interpolated + # character/text-tail positions on high refresh displays. + self.__UpdateScreenPosition() + def RefreshGauge(self): self.curHP = player.GetStatus(player.HP)