This repository has been archived by the owner on Jul 2, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
/
uibattle.h
153 lines (127 loc) · 4.03 KB
/
uibattle.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
/* -*- 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 UIBATTLE_H
#define UIBATTLE_H
#ifdef __cplusplus
extern "C"
{
#endif
#include "ui.h"
typedef enum tagBATTLEUISTATE
{
kBattleUIWait,
kBattleUISelectMove,
kBattleUISelectTargetEnemy,
kBattleUISelectTargetPlayer,
kBattleUISelectTargetEnemyAll,
kBattleUISelectTargetPlayerAll,
} BATTLEUISTATE;
typedef enum tagBATTLEMENUSTATE
{
kBattleMenuMain,
kBattleMenuMagicSelect,
kBattleMenuUseItemSelect,
kBattleMenuThrowItemSelect,
kBattleMenuMisc,
kBattleMenuMiscItemSubMenu,
} BATTLEMENUSTATE;
typedef enum tagBATTLEUIACTION
{
kBattleUIActionAttack,
kBattleUIActionMagic,
kBattleUIActionCoopMagic,
kBattleUIActionMisc,
} BATTLEUIACTION;
#define SPRITENUM_BATTLEICON_ATTACK 40
#define SPRITENUM_BATTLEICON_MAGIC 41
#define SPRITENUM_BATTLEICON_COOPMAGIC 42
#define SPRITENUM_BATTLEICON_MISCMENU 43
#define SPRITENUM_BATTLE_ARROW_CURRENTPLAYER 69
#define SPRITENUM_BATTLE_ARROW_CURRENTPLAYER_RED 68
#define SPRITENUM_BATTLE_ARROW_SELECTEDPLAYER 67
#define SPRITENUM_BATTLE_ARROW_SELECTEDPLAYER_RED 66
#define BATTLEUI_LABEL_ITEM 5
#define BATTLEUI_LABEL_DEFEND 58
#define BATTLEUI_LABEL_AUTO 56
#define BATTLEUI_LABEL_INVENTORY 57
#define BATTLEUI_LABEL_FLEE 59
#define BATTLEUI_LABEL_STATUS 60
#define BATTLEUI_LABEL_USEITEM 23
#define BATTLEUI_LABEL_THROWITEM 24
#define TIMEMETER_COLOR_DEFAULT 0x1B
#define TIMEMETER_COLOR_SLOW 0x5B
#define TIMEMETER_COLOR_HASTE 0x2A
#define BATTLEUI_MAX_SHOWNUM 16
typedef struct tagSHOWNUM
{
WORD wNum;
PAL_POS pos;
DWORD dwTime;
NUMCOLOR color;
} SHOWNUM;
typedef struct tagBATTLEUI
{
BATTLEUISTATE state;
BATTLEMENUSTATE MenuState;
CHAR szMsg[256]; // message to be shown on the screen
CHAR szNextMsg[256]; // next message to be shown on the screen
DWORD dwMsgShowTime; // the end time of showing the message
WORD wNextMsgDuration; // duration of the next message
WORD wCurPlayerIndex; // index of the current player
WORD wSelectedAction; // current selected action
WORD wSelectedIndex; // current selected index of player or enemy
WORD wPrevEnemyTarget; // previous enemy target
WORD wActionType; // type of action to be performed
WORD wObjectID; // object ID of the item or magic to use
BOOL fAutoAttack; // TRUE if auto attack
SHOWNUM rgShowNum[BATTLEUI_MAX_SHOWNUM];
} BATTLEUI;
VOID
PAL_PlayerInfoBox(
PAL_POS pos,
WORD wPlayerRole,
INT iTimeMeter,
BYTE bTimeMeterColor,
BOOL fUpdate
);
VOID
PAL_BattleUIShowText(
LPCSTR lpszText,
WORD wDuration
);
VOID
PAL_BattleUIPlayerReady(
WORD wPlayerIndex
);
VOID
PAL_BattleUIUpdate(
VOID
);
VOID
PAL_BattleUIShowNum(
WORD wNum,
PAL_POS pos,
NUMCOLOR color
);
#ifdef __cplusplus
}
#endif
#endif