summaryrefslogtreecommitdiff
path: root/include/d/d_lyt_hio.h
blob: 3a34f070c486e4dc174296ca94fc0bc1eef16c69 (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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
#ifndef D_LYT_HIO_H
#define D_LYT_HIO_H

#include "common.h"
#include "libms/flowfile.h"
#include "libms/msgfile.h"
#include "nw4r/ut/ut_Color.h"
#include "sized_string.h"

/**
 * This class appears to be the remnant of a sort of "hot-reloading"
 * mechanism for the game's user interface. Many of the functions
 * affect text formatting, UI layouting, and it also has mechanisms
 * for overriding the text and flow files being accessed. The actual
 * implementation appears to have been stripped out though.
 */
class dLyt_HIO_c {
public:
    dLyt_HIO_c();
    virtual ~dLyt_HIO_c() {}

    void destroy();

    inline static f32 getField0x758() {
        if (sInstance != nullptr) {
            return sInstance->field_0x758;
        }
        return 0.0f;
    }

    inline static f32 getField0x75C() {
        if (sInstance != nullptr) {
            return sInstance->field_0x75C;
        }
        return 0.0f;
    }

    inline static f32 getField0x760() {
        if (sInstance != nullptr) {
            return sInstance->field_0x760;
        } else {
            return 0.0f;
        }
    }

    inline static f32 getField0x764() {
        if (sInstance != nullptr) {
            return sInstance->field_0x764;
        }
        return 0.0f;
    }

    inline static f32 getField0x768() {
        if (sInstance != nullptr) {
            return sInstance->field_0x768;
        }
        return 0.0f;
    }

    inline static f32 getField0x76C() {
        if (sInstance != nullptr) {
            return sInstance->field_0x76C;
        }
        return 0.0f;
    }

    inline static f32 getField0x788() {
        return sInstance->field_0x788;
    }

    inline static f32 getFn800B1F70() {
        if (sInstance != nullptr) {
            return sInstance->fn_800B1F70();
        }
        return 1.0f;
    }

    inline static f32 getFn800B1FC0() {
        if (sInstance != nullptr) {
            return sInstance->fn_800B1FC0();
        }
        return 1.0f;
    }

    inline static f32 getFn800B1FD0() {
        if (sInstance != nullptr) {
            return sInstance->fn_800B1FD0();
        }
        return 1.0f;
    }

    inline static f32 getFn800B1F10() {
        return sInstance->fn_800B1F10();
    }

    inline static f32 getFn800B1FF0() {
        if (sInstance != nullptr) {
            return sInstance->fn_800B1FF0();
        }
        return 0.0f;
    }

    inline static f32 getFn800B2000() {
        if (sInstance != nullptr) {
            return sInstance->fn_800B2000();
        }
        return 0.0f;
    }

    inline static f32 getFn800B2010() {
        if (sInstance != nullptr) {
            return sInstance->fn_800B2010();
        }
        return 0.0f;
    }

    inline static f32 getFn800B2020() {
        if (sInstance != nullptr) {
            return sInstance->fn_800B2020();
        }
        return 0.0f;
    }

    inline static f32 getFn800B2030() {
        if (sInstance != nullptr) {
            return sInstance->fn_800B2030();
        }
        return 0.0f;
    }

    inline static f32 getFn800B2040() {
        if (sInstance != nullptr) {
            return sInstance->fn_800B2040();
        }
        return 0.0f;
    }

    inline static s16 getAnimBtnTransitionDuration() {
        if (sInstance != nullptr) {
            return sInstance->field_0x7AA;
        }
        return 0;
    }

    inline static s16 getAnimBtnTotalDuration() {
        if (sInstance != nullptr) {
            return sInstance->field_0x7AA + sInstance->field_0x7AC;
        }
        return 0;
    }

    static dLyt_HIO_c *getInstance() {
        return sInstance;
    }

    f32 getField0x770() const {
        return field_0x770;
    }

    f32 getField0x774() const {
        return field_0x774;
    }

    f32 getField0x778() const {
        return field_0x778;
    }

    f32 getField0x77C() const {
        return field_0x77C;
    }

    f32 getField0x780() const {
        return field_0x780;
    }

    f32 getField0x784() const {
        return field_0x784;
    }

    s32 getField0x796() const {
        return field_0x796;
    }

    s16 getMsgWindowWaitDelay() const {
        return mMsgWindowWaitDelay;
    }

    bool getShouldOverrideData() const {
        return mShouldOverrideData;
    }

    void *getOverrideZev0() const {
        return mOverrideZev0;
    }

    void *getOverrideStageZev() const {
        return mOverrideStageZev;
    }

    bool getShouldHookAllocations() const {
        return mShouldHookAllocations;
    }

    MsbtInfo *getOverrideMsbtInfo(s32 index) const {
        return mMsbts[index];
    }

    MsbfInfo *getOverrideMsbfInfo(s32 index) const {
        return mMsbfs[index];
    }

    const char *getStr1() const {
        return field_0x004;
    }

    const char *getStr2() const {
        return field_0x084;
    }

    const char *getStr3() const {
        return field_0x104;
    }

    void setStr1(const char *s) {
        field_0x004 = s;
    }

    void setStr2(const char *s) {
        field_0x084 = s;
    }

    void setStr3(const char *s) {
        field_0x104 = s;
    }

    void *allocUnk(size_t size, int align);
    void destroyUnk(void *thing);

private:
    static dLyt_HIO_c *sInstance;

    void destroyFlow(MsbfInfo *flow);
    void destroyMsg(MsbtInfo *msg);

    f32 fn_800B1F10();
    f32 fn_800B1F70();
    f32 fn_800B1FC0();
    f32 fn_800B1FD0();
    f32 fn_800B1FE0();
    f32 fn_800B1FF0();
    f32 fn_800B2000();
    f32 fn_800B2010();
    f32 fn_800B2020();
    f32 fn_800B2030();
    f32 fn_800B2040();

    /* 0x004 */ SizedString<0x80> field_0x004;
    /* 0x084 */ SizedString<0x80> field_0x084;
    /* 0x104 */ SizedString<0x80> field_0x104;
    /* 0x184 */ void *field_buf0[82];
    /* 0x2CC */ void *field_buf4[23];
    /* 0x328 */ void *field_buf1[80];
    /* 0x468 */ MsbtInfo *mMsbts[82];
    /* 0x5B0 */ MsbtInfo *field_buf5[23];
    /* 0x60C */ MsbfInfo *mMsbfs[80];
    /* 0x74C */ void *mOverrideZev0;
    /* 0x750 */ void *mOverrideStageZev;
    /* 0x754 */ f32 field_0x754;
    /* 0x758 */ f32 field_0x758;
    /* 0x75C */ f32 field_0x75C;
    /* 0x760 */ f32 field_0x760;
    /* 0x764 */ f32 field_0x764;
    /* 0x768 */ f32 field_0x768;
    /* 0x76C */ f32 field_0x76C;
    /* 0x770 */ f32 field_0x770;
    /* 0x774 */ f32 field_0x774;
    /* 0x778 */ f32 field_0x778;
    /* 0x77C */ f32 field_0x77C;
    /* 0x780 */ f32 field_0x780;
    /* 0x784 */ f32 field_0x784;
    /* 0x788 */ f32 field_0x788;
    /* 0x78C */ f32 field_0x78C;
    /* 0x790 */ f32 field_0x790;
    /* 0x794 */ s16 field_0x794;
    /* 0x796 */ s16 field_0x796;
    /* 0x798 */ UNKWORD field_0x798;
    /* 0x79C */ UNKWORD field_0x79C;
    /* 0x7A0 */ UNKWORD field_0x7A0;
    /* 0x7A4 */ s16 field_0x7A4;
    /* 0x7A6 */ s16 field_0x7A6;
    /* 0x7A8 */ s16 field_0x7A8;
    /* 0x7AA */ s16 field_0x7AA;
    /* 0x7AC */ s16 field_0x7AC;
    /* 0x7AE */ s16 mMsgWindowWaitDelay;
    /* 0x7B0 */ s16 field_0x7B0;
    /* 0x7B2 */ bool field_0x7B2;
    /* 0x7B3 */ bool field_0x7B3;
    /* 0x7B4 */ bool mShouldOverrideData;
    /* 0x7B5 */ bool field_0x7B5;
    /* 0x7B6 */ bool mShouldHookAllocations;
    /* 0x7B6 */ bool field_0x7B7;
    /* 0x7B8 */ nw4r::ut::Color field_0x7B8;
    /* 0x7BC */ nw4r::ut::Color field_0x7BC;
};

#endif