summaryrefslogtreecommitdiff
path: root/include/d/lyt/d_lyt_common_title.h
blob: 9d74f6bf2582b3272417e6df2e90e6a63fffeb4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#ifndef D_LYT_COMMON_TITLE_H
#define D_LYT_COMMON_TITLE_H

#include "common.h"
#include "d/lyt/d2d.h"
#include "s/s_State.hpp"
#include "sized_string.h"

/**
 * 2D UI - Common - Title
 *
 * Used on title screen and pause menu.
 */
class dLytCommonTitle_c {
public:
    dLytCommonTitle_c();
    virtual ~dLytCommonTitle_c() {}

    bool build();
    bool remove();
    bool execute();
    bool draw();

    enum SetMode_e {
        SET_00 = 0,
        SET_01 = 1,
        SET_CAPTION_IMMEDIATELY = 2,
        SET_OUT = 3,
    };

    bool set(s32 arg, const char *title, const char *caption);
    const char *setSubTitle(s32 msgIdx);
    const char *setSysTitle(s32 msgIdx);
    const char *setSysCaption(s32 msgIdx);

    void setField_0x680(UNKWORD val) {
        field_0x680 = val;
    }

    void setInputInOut(bool inOut) {
        mInputInOut = inOut;
    }

private:
    void gotoStateNone();
    void startAnim(int idx);
    void stopAnim(int idx);
    void playBackwards(d2d::AnmGroup_c &anm);

    void applyText();
    void applyTextChange(s32 arg);

    void applyTitle(s32 arg);
    void applyCaption(s32 arg);

    d2d::AnmGroup_c &getAnm(int idx) {
        return mAnm[idx];
    }

    STATE_FUNC_DECLARE(dLytCommonTitle_c, None);
    STATE_FUNC_DECLARE(dLytCommonTitle_c, In);
    STATE_FUNC_DECLARE(dLytCommonTitle_c, Wait);
    STATE_FUNC_DECLARE(dLytCommonTitle_c, Out);
    STATE_FUNC_DECLARE(dLytCommonTitle_c, Change);

    /* 0x004 */ UI_STATE_MGR_DECLARE(dLytCommonTitle_c);
    /* 0x040 */ d2d::LytBase_c mLyt;
    /* 0x0D0 */ d2d::ResAccIf_c mResAcc;
    /* 0x440 */ d2d::AnmGroup_c mAnm[8];
    /* 0x640 */ SizedString<0x20> mTitle;
    /* 0x660 */ SizedString<0x20> mCaption;

    /* 0x680 */ UNKWORD field_0x680;
    /* 0x680 */ UNKWORD mSetMode;
    /* 0x688 */ s32 mStep;
    /* 0x68C */ bool mChangeRequest;
    /* 0x68D */ bool field_0x68D;
    /* 0x68E */ bool mVisible;
    /* 0x68F */ bool field_0x68F;
    /* 0x690 */ bool mInputInOut;
};

#endif