UiAnimViewEventNode.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <LyShine/Animation/IUiAnimation.h>
  10. #include "UiAnimViewAnimNode.h"
  11. ////////////////////////////////////////////////////////////////////////////
  12. // This class represents an IUiAnimNode deditcated to firing Track Events
  13. ////////////////////////////////////////////////////////////////////////////
  14. class CUiAnimViewEventNode
  15. : public CUiAnimViewAnimNode
  16. , public IUiTrackEventListener
  17. {
  18. public:
  19. CUiAnimViewEventNode(IUiAnimSequence* pSequence, IUiAnimNode* pAnimNode, CUiAnimViewNode* pParentNode);
  20. virtual ~CUiAnimViewEventNode();
  21. // overrides from IUiTrackEventListener
  22. void OnTrackEvent(IUiAnimSequence* pSequence, int reason, const char* event, void* pUserData) override;
  23. // gets all event keys that have eventName set as their Track Event
  24. static CUiAnimViewKeyBundle GetTrackEventKeys(CUiAnimViewAnimNode* pAnimNode, const char* eventName);
  25. protected:
  26. // updates existing keys using fromName events, changes them to use the toName events instead
  27. void RenameTrackEvent(const char* fromName, const char* toName);
  28. // updates existing keys using removedEventName events to use the empty string (representing no event)
  29. void RemoveTrackEvent(const char* removedEventName);
  30. };