-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.h
237 lines (193 loc) · 6.1 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
/* -*- mode: c; tab-width: 4; c-basic-offset: 3; c-file-style: "linux" -*- */
//
// Copyright (c) 2009, Wei Mingzhi <[email protected]>.
// 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
#ifdef __cplusplus
extern "C"
{
#endif
#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
#ifdef PAL_WIN95
#define MAINMENU_BACKGROUND_FBPNUM 2
#else
#define MAINMENU_BACKGROUND_FBPNUM 60
#endif
#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 (PAL_ADDITIONAL_WORD_FIRST)
#define BATTLESPEEDMENU_LABEL_1 (PAL_ADDITIONAL_WORD_FIRST + 1)
#define BATTLESPEEDMENU_LABEL_2 (PAL_ADDITIONAL_WORD_FIRST + 2)
#define BATTLESPEEDMENU_LABEL_3 (PAL_ADDITIONAL_WORD_FIRST + 3)
#define BATTLESPEEDMENU_LABEL_4 (PAL_ADDITIONAL_WORD_FIRST + 4)
#define BATTLESPEEDMENU_LABEL_5 (PAL_ADDITIONAL_WORD_FIRST + 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_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 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 0x39
#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 struct tagOBJECTDESC
{
WORD wObjectID;
LPSTR 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;
INT
PAL_InitUI(
VOID
);
VOID
PAL_FreeUI(
VOID
);
LPBOX
PAL_CreateBox(
PAL_POS pos,
INT nRows,
INT nColumns,
INT iStyle,
BOOL fSaveScreen
);
LPBOX
PAL_CreateSingleLineBox(
PAL_POS pos,
INT nLen,
BOOL fSaveScreen
);
VOID
PAL_DeleteBox(
LPBOX lpBox
);
WORD
PAL_ReadMenu(
LPITEMCHANGED_CALLBACK lpfnMenuItemChanged,
LPMENUITEM rgMenuItem,
INT nMenuItem,
WORD wDefaultItem,
BYTE bLabelColor
);
VOID
PAL_DrawNumber(
UINT iNum,
UINT nLength,
PAL_POS pos,
NUMCOLOR color,
NUMALIGN align
);
LPOBJECTDESC
PAL_LoadObjectDesc(
LPCSTR lpszFileName
);
VOID
PAL_FreeObjectDesc(
LPOBJECTDESC lpObjectDesc
);
LPCSTR
PAL_GetObjectDesc(
LPOBJECTDESC lpObjectDesc,
WORD wObjectID
);
extern LPSPRITE gpSpriteUI;
#ifdef __cplusplus
}
#endif
#endif