From b9475faea15be7573bf101a5f0865b3edafe8b0f Mon Sep 17 00:00:00 2001 From: "Dr.Abc" Date: Sun, 1 Sep 2024 19:37:05 +0800 Subject: [PATCH] fix bunch of sequence --- src/Source/HUD/vgui/dmgtiles.cpp | 1 + src/Source/HUD/vgui/flashlight.cpp | 1 + src/Source/HUD/vgui/itemhighlight.cpp | 4 +++- src/Source/HUD/vgui/weaponchoose.cpp | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Source/HUD/vgui/dmgtiles.cpp b/src/Source/HUD/vgui/dmgtiles.cpp index d4db77cf..d13db032 100644 --- a/src/Source/HUD/vgui/dmgtiles.cpp +++ b/src/Source/HUD/vgui/dmgtiles.cpp @@ -72,6 +72,7 @@ void CTileIconItem::SetImage(const char* image){ void CTileIconItem::Show(){ SetVisible(true); + vgui::GetAnimationController()->CancelAnimationsForPanel(GetParent()); GetAnimationController()->StartAnimationSequence(GetParent(), GetName()); } diff --git a/src/Source/HUD/vgui/flashlight.cpp b/src/Source/HUD/vgui/flashlight.cpp index cfb9ea05..f1be9f40 100644 --- a/src/Source/HUD/vgui/flashlight.cpp +++ b/src/Source/HUD/vgui/flashlight.cpp @@ -61,6 +61,7 @@ void CFlashLightPanel::SetParent(vgui::VPANEL parent) { } void CFlashLightPanel::SetFlashLight(bool on, int battery){ + vgui::GetAnimationController()->CancelAnimationsForPanel(GetParent()); vgui::GetAnimationController()->StartAnimationSequence(this, on ? "FlashLightOn" : "FlashLightOff"); m_pOnImage->SetVisible(on); m_pOffImage->SetVisible(!on); diff --git a/src/Source/HUD/vgui/itemhighlight.cpp b/src/Source/HUD/vgui/itemhighlight.cpp index 9f6049af..30ebd681 100644 --- a/src/Source/HUD/vgui/itemhighlight.cpp +++ b/src/Source/HUD/vgui/itemhighlight.cpp @@ -68,8 +68,10 @@ class CItemPickupPanel : public vgui::Panel { m_pText = new vgui::Label(this, "Text", "#GameUI_ABC_ItemPickupNotice"); } virtual void SetVisible(bool state) override { - if (state && !IsVisible()) + if (state && !IsVisible()) { + vgui::GetAnimationController()->CancelAnimationsForPanel(GetParent()); vgui::GetAnimationController()->StartAnimationSequence(GetParent(), "ItemPickupNoticePopUp"); + } BaseClass::SetVisible(state); } virtual void PerformLayout() override { diff --git a/src/Source/HUD/vgui/weaponchoose.cpp b/src/Source/HUD/vgui/weaponchoose.cpp index 1b674aae..db6ee5f6 100644 --- a/src/Source/HUD/vgui/weaponchoose.cpp +++ b/src/Source/HUD/vgui/weaponchoose.cpp @@ -198,6 +198,7 @@ void CWeaponChoosePanel::ShowPanel(bool state) { return; SetVisible(state); if (state) { + vgui::GetAnimationController()->CancelAnimationsForPanel(GetParent()); vgui::GetAnimationController()->StartAnimationSequence(GetParent(), "WeaponChooseIn"); InvalidateLayout(); }