1#pragma once
2
3#include <math/seadVector.h>
4
5#include "Library/Layout/LayoutActor.h"
6
7namespace al {
8struct ActorInitInfo;
9class LayoutInitInfo;
10class LiveActor;
11class TalkMessageVoicePlayer;
12
13struct BalloonMessageInitParam {
14public:
15 const char* name = "バルーン";
16 const char* archiveName = "BalloonSpeak";
17 const char* paneName = "TxtMessage";
18 const char* message;
19 f32 appearDist = 500.0f;
20 f32 killDist = 600.0f;
21 const char* suffix = nullptr;
22 f32 yPosOffset = 160.0f;
23 s32 playerIndex = -1;
24 s32 _38 = 0;
25 bool _3c = false;
26};
27
28class BalloonMessage : public LayoutActor {
29public:
30 static BalloonMessage* create(const LiveActor* hostActor, const LayoutInitInfo& info,
31 const BalloonMessageInitParam& initParam, bool isAutoUpdate);
32
33 BalloonMessage(const LiveActor* hostActor, const LayoutInitInfo& info,
34 const BalloonMessageInitParam& initParam, bool isAutoUpdate);
35
36 void appear() override;
37 void control() override;
38
39 void end();
40 void update();
41 void updateTrans();
42 void appearWithPushA();
43 void hidePushA();
44 void showPushA();
45
46 void setText(const char* message);
47 void setTextW(const char16* message);
48 bool isEnableAppear() const;
49 bool isEnableEnd() const;
50 bool isNearPlayerActor(f32 threshold) const;
51 bool isShowPushA() const;
52 bool isVoicePlayerPlaying() const;
53 bool isWait() const;
54
55 void exeAppear();
56 void exeWait();
57 void exeEnd();
58 void exeHide();
59
60private:
61 const LiveActor* mHostActor;
62 const char* mPaneName;
63 f32 mAppearDist;
64 f32 mKillDist;
65 sead::Vector3f mPosOffset = sead::Vector3f::zero;
66 s32 mPlayerIndex;
67 s32 _158;
68 bool mIsAutoUpdate;
69 bool _15d;
70 bool mIsTalkMessageVoicePlayerStarted = false;
71 TalkMessageVoicePlayer* mTalkMessageVoicePlayer = nullptr;
72 sead::FixedSafeString<0x40> mSeName = {};
73};
74
75BalloonMessage* createBalloonMessage(const LiveActor* hostActor, const ActorInitInfo& info,
76 const BalloonMessageInitParam& initParam);
77BalloonMessage* createBalloonMessageNoAutoUpdate(const LiveActor* hostActor,
78 const ActorInitInfo& info,
79 const BalloonMessageInitParam& initParam);
80BalloonMessage* createBalloonMessage(const LiveActor* hostActor, const ActorInitInfo& info);
81BalloonMessage* createBalloonMessage(const LiveActor* hostActor, const ActorInitInfo& info,
82 const char* message);
83
84static_assert(sizeof(BalloonMessageInitParam) == 0x40);
85static_assert(sizeof(BalloonMessage) == 0x1c0);
86} // namespace al
87