diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-20 14:33:09 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-20 14:33:09 +1000 |
commit | 6352e8e3196f78388b6c771073f9e03eaa612673 (patch) | |
tree | e23772f79a7fbc41bc9108951e9e136857484bf4 /source/frontend/StarRadioMessagePopup.hpp | |
parent | 6741a057e5639280d85d0f88ba26f000baa58f61 (diff) |
everything everywhere
all at once
Diffstat (limited to 'source/frontend/StarRadioMessagePopup.hpp')
-rw-r--r-- | source/frontend/StarRadioMessagePopup.hpp | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/source/frontend/StarRadioMessagePopup.hpp b/source/frontend/StarRadioMessagePopup.hpp new file mode 100644 index 0000000..11c18d5 --- /dev/null +++ b/source/frontend/StarRadioMessagePopup.hpp @@ -0,0 +1,65 @@ +#ifndef STAR_RADIO_MESSAGE_POPUP_HPP +#define STAR_RADIO_MESSAGE_POPUP_HPP + +#include "StarGameTimers.hpp" +#include "StarPane.hpp" +#include "StarAiTypes.hpp" +#include "StarRadioMessageDatabase.hpp" + +namespace Star { + +STAR_CLASS(LabelWidget); +STAR_CLASS(ImageWidget); +STAR_CLASS(AudioInstance); + +class RadioMessagePopup : public Pane { +public: + RadioMessagePopup(); + + void update() override; + void dismissed() override; + + bool messageActive(); + + void setMessage(RadioMessage message); + void setChatHeight(int chatHeight); + void interrupt(); + +private: + enum PopupStage { AnimateIn, ScrollText, Persist, AnimateOut, Hidden }; + + void updateAnchorOffset(); + void nextPopupStage(); + void enterStage(PopupStage newStage); + + PopupStage m_popupStage; + GameTimer m_stageTimer; + + LabelWidgetPtr m_messageLabel; + ImageWidgetPtr m_portraitImage; + + RadioMessage m_message; + + String m_backgroundImage; + + float m_animateInTime; + String m_animateInImage; + int m_animateInFrames; + + float m_animateOutTime; + String m_animateOutImage; + int m_animateOutFrames; + + Vec2I m_chatOffset; + Vec2I m_chatStartPosition; + Vec2I m_chatEndPosition; + + float m_slideTimer; + float m_slideTime; + + AudioInstancePtr m_chatterSound; +}; + +} + +#endif |