forked from sdlpal/sdlpal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.h
283 lines (231 loc) · 7.5 KB
/
ui.h
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
/* -*- mode: c; tab-width: 4; c-basic-offset: 4; c-file-style: "linux" -*- */
//
// Copyright (c) 2009-2011, Wei Mingzhi <whistler_wmz@users.sf.net>.
// Copyright (c) 2011-2018, SDLPAL development team.
// All rights reserved.
//
// This file is part of SDLPAL.
//
// SDLPAL is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
#ifndef UI_H
#define UI_H
#include "common.h"
#define CHUNKNUM_SPRITEUI 9
#define MENUITEM_COLOR 0x4F
#define MENUITEM_COLOR_INACTIVE 0x1C
#define MENUITEM_COLOR_CONFIRMED 0x2C
#define MENUITEM_COLOR_SELECTED_INACTIVE 0x1F
#define MENUITEM_COLOR_SELECTED_FIRST 0xF9
#define MENUITEM_COLOR_SELECTED_TOTALNUM 6
#define MENUITEM_COLOR_SELECTED \
(MENUITEM_COLOR_SELECTED_FIRST + \
SDL_GetTicks() / (600 / MENUITEM_COLOR_SELECTED_TOTALNUM) \
% MENUITEM_COLOR_SELECTED_TOTALNUM)
#define MENUITEM_COLOR_EQUIPPEDITEM 0xC8
#define DESCTEXT_COLOR 0x2E
#define MAINMENU_BACKGROUND_FBPNUM (gConfig.fIsWIN95 ? 2 :60)
#define RIX_NUM_OPENINGMENU 4
#define MAINMENU_LABEL_NEWGAME 7
#define MAINMENU_LABEL_LOADGAME 8
#define LOADMENU_LABEL_SLOT_FIRST 43
#define CONFIRMMENU_LABEL_NO 19
#define CONFIRMMENU_LABEL_YES 20
#define CASH_LABEL 21
#define SWITCHMENU_LABEL_DISABLE 17
#define SWITCHMENU_LABEL_ENABLE 18
#define GAMEMENU_LABEL_STATUS 3
#define GAMEMENU_LABEL_MAGIC 4
#define GAMEMENU_LABEL_INVENTORY 5
#define GAMEMENU_LABEL_SYSTEM 6
#define SYSMENU_LABEL_SAVE 11
#define SYSMENU_LABEL_LOAD 12
#define SYSMENU_LABEL_MUSIC 13
#define SYSMENU_LABEL_SOUND 14
#define SYSMENU_LABEL_QUIT 15
#define SYSMENU_LABEL_BATTLEMODE 606
#define SYSMENU_LABEL_LAUNCHSETTING 612
#define BATTLESPEEDMENU_LABEL_1 (SYSMENU_LABEL_BATTLEMODE + 1)
#define BATTLESPEEDMENU_LABEL_2 (SYSMENU_LABEL_BATTLEMODE + 2)
#define BATTLESPEEDMENU_LABEL_3 (SYSMENU_LABEL_BATTLEMODE + 3)
#define BATTLESPEEDMENU_LABEL_4 (SYSMENU_LABEL_BATTLEMODE + 4)
#define BATTLESPEEDMENU_LABEL_5 (SYSMENU_LABEL_BATTLEMODE + 5)
#define INVMENU_LABEL_USE 23
#define INVMENU_LABEL_EQUIP 22
#define STATUS_BACKGROUND_FBPNUM 0
#define STATUS_LABEL_EXP 2
#define STATUS_LABEL_LEVEL 48
#define STATUS_LABEL_HP 49
#define STATUS_LABEL_MP 50
#define STATUS_LABEL_EXP_LAYOUT 29
#define STATUS_LABEL_LEVEL_LAYOUT 30
#define STATUS_LABEL_HP_LAYOUT 31
#define STATUS_LABEL_MP_LAYOUT 32
#define STATUS_LABEL_ATTACKPOWER 51
#define STATUS_LABEL_MAGICPOWER 52
#define STATUS_LABEL_RESISTANCE 53
#define STATUS_LABEL_DEXTERITY 54
#define STATUS_LABEL_FLEERATE 55
#define STATUS_COLOR_EQUIPMENT 0xBE
#define EQUIP_LABEL_HEAD 600
#define EQUIP_LABEL_SHOULDER 601
#define EQUIP_LABEL_BODY 602
#define EQUIP_LABEL_HAND 603
#define EQUIP_LABEL_FOOT 604
#define EQUIP_LABEL_NECK 605
#define BUYMENU_LABEL_CURRENT 35
#define SELLMENU_LABEL_PRICE 25
#define SPRITENUM_SLASH 39
#define SPRITENUM_ITEMBOX 70
#define SPRITENUM_CURSOR_YELLOW 68
#define SPRITENUM_CURSOR 69
#define SPRITENUM_PLAYERINFOBOX 18
#define SPRITENUM_PLAYERFACE_FIRST 48
#define EQUIPMENU_BACKGROUND_FBPNUM 1
#define ITEMUSEMENU_COLOR_STATLABEL 0xBB
#define BATTLEWIN_GETEXP_LABEL 30
#define BATTLEWIN_BEATENEMY_LABEL 9
#define BATTLEWIN_DOLLAR_LABEL 10
#define BATTLEWIN_LEVELUP_LABEL 32
#define BATTLEWIN_ADDMAGIC_LABEL 33
#define BATTLEWIN_LEVELUP_LABEL_COLOR 0xBB
#define SPRITENUM_ARROW 47
#define BATTLE_LABEL_ESCAPEFAIL 31
typedef struct tagBOX
{
PAL_POS pos;
WORD wWidth, wHeight;
SDL_Surface *lpSavedArea;
} BOX, *LPBOX;
typedef struct tagMENUITEM
{
WORD wValue;
WORD wNumWord;
BOOL fEnabled;
PAL_POS pos;
} MENUITEM, *LPMENUITEM;
typedef const MENUITEM* LPCMENUITEM;
typedef struct tagOBJECTDESC
{
WORD wObjectID;
LPWSTR lpDesc;
struct tagOBJECTDESC *next;
} OBJECTDESC, *LPOBJECTDESC;
typedef VOID (*LPITEMCHANGED_CALLBACK)(WORD);
#define MENUITEM_VALUE_CANCELLED 0xFFFF
typedef enum tagNUMCOLOR
{
kNumColorYellow,
kNumColorBlue,
kNumColorCyan
} NUMCOLOR;
typedef enum tagNUMALIGN
{
kNumAlignLeft,
kNumAlignMid,
kNumAlignRight
} NUMALIGN;
PAL_C_LINKAGE_BEGIN
INT
PAL_InitUI(
VOID
);
VOID
PAL_FreeUI(
VOID
);
LPBOX
PAL_CreateBox(
PAL_POS pos,
INT nRows,
INT nColumns,
INT iStyle,
BOOL fSaveScreen
);
LPBOX
PAL_CreateBoxWithShadow(
PAL_POS pos,
INT nRows,
INT nColumns,
INT iStyle,
BOOL fSaveScreen,
INT nShadowOffset
);
LPBOX
PAL_CreateSingleLineBox(
PAL_POS pos,
INT nLen,
BOOL fSaveScreen
);
LPBOX
PAL_CreateSingleLineBoxWithShadow(
PAL_POS pos,
INT nLen,
BOOL fSaveScreen,
INT nShadowOffset
);
VOID
PAL_DeleteBox(
LPBOX lpBox
);
WORD
PAL_ReadMenu(
LPITEMCHANGED_CALLBACK lpfnMenuItemChanged,
LPCMENUITEM rgMenuItem,
INT nMenuItem,
WORD wDefaultItem,
BYTE bLabelColor
);
VOID
PAL_DrawNumber(
UINT iNum,
UINT nLength,
PAL_POS pos,
NUMCOLOR color,
NUMALIGN align
);
INT
PAL_TextWidth(
LPCWSTR lpszItemText
);
INT
PAL_MenuTextMaxWidth(
LPCMENUITEM rgMenuItem,
INT nMenuItem
);
INT
PAL_WordMaxWidth(
INT nFirstWord,
INT nWordNum
);
INT
PAL_WordWidth(
INT nWordIndex
);
LPOBJECTDESC
PAL_LoadObjectDesc(
LPCSTR lpszFileName
);
VOID
PAL_FreeObjectDesc(
LPOBJECTDESC lpObjectDesc
);
LPCWSTR
PAL_GetObjectDesc(
LPOBJECTDESC lpObjectDesc,
WORD wObjectID
);
extern LPSPRITE gpSpriteUI;
PAL_C_LINKAGE_END
#endif