OpenMoHAA
0.82.0
Loading...
Searching...
No Matches
cl_uidmbox.h
1
/*
2
===========================================================================
3
Copyright (C) 2015-2024 the OpenMoHAA team
4
5
This file is part of OpenMoHAA source code.
6
7
OpenMoHAA source code is free software; you can redistribute it
8
and/or modify it under the terms of the GNU General Public License as
9
published by the Free Software Foundation; either version 2 of the License,
10
or (at your option) any later version.
11
12
OpenMoHAA source code is distributed in the hope that it will be
13
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU General Public License for more details.
16
17
You should have received a copy of the GNU General Public License
18
along with OpenMoHAA source code; if not, write to the Free Software
19
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
===========================================================================
21
*/
22
23
#pragma once
24
25
static
constexpr
unsigned
int
DMBOX_ITEM_FLAG_BOLD = 2u;
26
static
constexpr
unsigned
int
DMBOX_ITEM_FLAG_DEATH = 4u;
27
28
typedef
enum
{ box_moving_out, box_moving_in, box_out, box_in } boxstate_t;
29
30
class
UIDMBox :
public
UIWidget {
31
struct
item_t {
32
str
string;
33
UColor
color;
34
UIFont
* font;
35
int
flags;
36
};
37
38
protected
:
39
item_t m_items[ 10 ];
40
int
m_numitems;
41
bool
m_reallyshown;
42
UIFont
*m_fontbold;
43
bool
m_boxmovingout;
44
boxstate_t m_boxstate;
45
int
m_boxtime;
46
int
m_movespeed;
47
int
m_iBeginDecay;
48
int
m_iEndDecay;
49
// Added in OPM
50
bool
m_drawoutline;
51
52
public
:
53
CLASS_PROTOTYPE( UIDMBox );
54
55
protected
:
56
void
VerifyBoxOut(
void
);
57
void
ChangeBoxState( boxstate_t
state
);
58
void
HandleBoxMoving(
void
);
59
void
PostMoveinEvent(
void
);
60
void
PostDecayEvent(
void
);
61
void
setShowState(
void
);
62
void
RemoveTopItem(
void
);
63
str
CalculateBreaks(
UIFont
*font,
str
text,
float
max_width );
64
float
PrintWrap(
UIFont
*font,
float
x,
float
y ,
str
text );
65
float
DrawItem( item_t *in,
float
x,
float
y,
float
alpha );
66
67
public
:
68
UIDMBox();
69
70
void
Print(
const
char
*text );
71
void
OnSizeChanged(
Event
*ev );
72
void
Create(
const
UIRect2D
& rect,
const
UColor
& fore,
const
UColor
& back,
float
alpha );
73
void
MoveInEvent(
Event
*ev );
74
void
DecayEvent(
Event
*ev );
75
void
Draw(
void
)
override
;
76
void
setRealShow(
bool
b );
77
void
Clear(
void
);
78
};
Event
Definition
listener.h:246
UColor
Definition
ucolor.h:25
UIFont
Definition
uifont.h:40
UIRect2D
Definition
uirect2d.h:28
str
Definition
str.h:77
state
Definition
puff.c:88
code
client
cl_uidmbox.h
Generated by
1.13.2