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
|
#include "d/dolzel.h" // IWYU pragma: keep
#include "d/d_msg_scrn_base.h"
#include "JSystem/J2DGraph/J2DGrafContext.h"
#include "JSystem/J2DGraph/J2DScreen.h"
#include "d/d_msg_object.h"
#include "d/d_msg_out_font.h"
#include "d/d_pane_class.h"
#include <cstring>
dMsgScrnBase_c::dMsgScrnBase_c() {
init();
}
dMsgScrnBase_c::~dMsgScrnBase_c() {}
void dMsgScrnBase_c::init() {
mpScreen = NULL;
mpPmP_c = NULL;
field_0x54 = 0;
for (int i = 0; i < 7; i++) {
mpTm_c[i] = NULL;
mpTmr_c[i] = NULL;
}
mpOutFont = NULL;
field_0x48 = NULL;
field_0x4c = 0;
mCharInfoPtr = NULL;
mFontSize.mSizeX = mFontSize.mSizeY = 0.0f;
mRubySize = 0.0f;
mTextBoxPosX = 0.0f;
mTextBoxPosY = 0.0f;
mTextBoxScaleX = 1.0f;
mTextBoxScaleY = 1.0f;
mTBoxWidth = 0.0f;
mTBoxHeight = 0.0f;
mLineSpace = 0.0f;
mCharSpace = 0.0f;
mRubyCharSpace = 0.0f;
mSelFontSize = 0.0f;
mSelRubySize = 0.0f;
for (int i = 0; i < 3; i++) {
mSelTextBoxPosX[i] = 0.0f;
mSelTextBoxPosY[i] = 0.0f;
}
mSelTBoxWidth = 0.0f;
mSelCharSpace = 0.0f;
mSelRubyCharSpace = 0.0f;
mTextBoxPosOffsetY = 0.0f;
field_0xb8 = 0.0f;
mCharAlphaRate = 1.0f;
}
void dMsgScrnBase_c::multiDraw() {
if (field_0x48 != NULL) {
dComIfGd_set2DOpa(field_0x48);
}
}
void dMsgScrnBase_c::draw() {
J2DGrafContext* ctx = dComIfGp_getCurrentGrafPort();
ctx->setup2D();
mpScreen->draw(0.0f, 0.0f, ctx);
drawSelf();
ctx->setup2D();
}
void dMsgScrnBase_c::drawSelf() {
drawOutFont(0.0f, 0.0f, 1.0f);
}
void dMsgScrnBase_c::drawOutFont(f32 param_0, f32 param_1, f32 param_2) {
mpOutFont->draw(NULL, param_0, param_1, param_2);
}
void dMsgScrnBase_c::setString(char* mpText, char* i_stringB) {
for (int i = 0; i < 7; i++) {
if (mpTm_c[i] != NULL) {
JUT_ASSERT(262, ((J2DTextBox*)(mpTm_c[i]->getPanePtr()))->getStringAllocByte() > strlen(mpText));
if (i == 0) {
strcpy(((J2DTextBox*)mpTm_c[i]->getPanePtr())->getStringPtr(), mpText);
} else {
strcpy(((J2DTextBox*)mpTm_c[i]->getPanePtr())->getStringPtr(), i_stringB);
}
}
}
}
void dMsgScrnBase_c::setRubyString(char* mpText) {
for (int i = 0; i < 3; i++) {
if (mpTmr_c[i] != NULL) {
JUT_ASSERT(288, ((J2DTextBox*)(mpTmr_c[i]->getPanePtr()))->getStringAllocByte() > strlen(mpText));
strcpy(((J2DTextBox*)mpTmr_c[i]->getPanePtr())->getStringPtr(), mpText);
}
}
}
void dMsgScrnBase_c::fukiScale(f32 i_scale) {
mpPmP_c->paneScale(i_scale, i_scale);
}
void dMsgScrnBase_c::fukiTrans(f32 i_posX, f32 i_posY) {
mpPmP_c->paneTrans(i_posX, i_posY);
}
void dMsgScrnBase_c::fukiAlpha(f32 i_alpha) {
fontAlpha(i_alpha);
mpPmP_c->setAlphaRate(i_alpha);
}
void dMsgScrnBase_c::fontAlpha(f32 i_alpha) {
for (int i = 0; i < 7; i++) {
if (mpTm_c[i] != NULL) {
mpTm_c[i]->setAlphaRate(i_alpha);
}
if (mpTmr_c[i] != NULL) {
mpTmr_c[i]->setAlphaRate(i_alpha);
}
}
}
bool dMsgScrnBase_c::isTalkNow() {
switch (dMsgObject_getMsgObjectClass()->getStatus()) {
case 5:
case 6:
case 7:
case 8:
case 9:
case 15:
case 16:
case 20:
case 24:
return true;
default:
return false;
}
}
|