|
|
|
|
@ -1268,6 +1268,58 @@ BOOL control_WriteStringToBuffer(BYTE *str)
|
|
|
|
|
return TRUE; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void CPrintString(int y, const char *str, BOOL center, int lines) |
|
|
|
|
{ |
|
|
|
|
BYTE c; |
|
|
|
|
const char *tmp; |
|
|
|
|
int lineOffset, strWidth, sx, sy; |
|
|
|
|
|
|
|
|
|
lineOffset = 0; |
|
|
|
|
sx = 177 + PANEL_X; |
|
|
|
|
sy = lineOffsets[lines][y] + PANEL_Y; |
|
|
|
|
if (center == TRUE) { |
|
|
|
|
strWidth = 0; |
|
|
|
|
tmp = str; |
|
|
|
|
while (*tmp) { |
|
|
|
|
c = gbFontTransTbl[(BYTE)*tmp++]; |
|
|
|
|
strWidth += fontkern[fontframe[c]] + 2; |
|
|
|
|
} |
|
|
|
|
if (strWidth < 288) |
|
|
|
|
lineOffset = (288 - strWidth) >> 1; |
|
|
|
|
sx += lineOffset; |
|
|
|
|
} |
|
|
|
|
while (*str) { |
|
|
|
|
c = gbFontTransTbl[(BYTE)*str++]; |
|
|
|
|
c = fontframe[c]; |
|
|
|
|
lineOffset += fontkern[c] + 2; |
|
|
|
|
if (c) { |
|
|
|
|
if (lineOffset < 288) { |
|
|
|
|
PrintChar(sx, sy, c, infoclr); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
sx += fontkern[c] + 2; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void PrintInfo() |
|
|
|
|
{ |
|
|
|
|
int yo, lo, i; |
|
|
|
|
|
|
|
|
|
if (!talkflag) { |
|
|
|
|
yo = 0; |
|
|
|
|
lo = 1; |
|
|
|
|
if (infostr[0] != '\0') { |
|
|
|
|
CPrintString(0, infostr, TRUE, pnumlines); |
|
|
|
|
yo = 1; |
|
|
|
|
lo = 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (i = 0; i < pnumlines; i++) { |
|
|
|
|
CPrintString(i + yo, panelstr[i], pstrjust[i], pnumlines - lo); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets a string to be drawn in the info box and then draws it. |
|
|
|
|
*/ |
|
|
|
|
@ -1339,70 +1391,61 @@ void DrawInfoBox()
|
|
|
|
|
PrintInfo(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void PrintInfo() |
|
|
|
|
{ |
|
|
|
|
int yo, lo, i; |
|
|
|
|
|
|
|
|
|
if (!talkflag) { |
|
|
|
|
yo = 0; |
|
|
|
|
lo = 1; |
|
|
|
|
if (infostr[0] != '\0') { |
|
|
|
|
CPrintString(0, infostr, TRUE, pnumlines); |
|
|
|
|
yo = 1; |
|
|
|
|
lo = 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (i = 0; i < pnumlines; i++) { |
|
|
|
|
CPrintString(i + yo, panelstr[i], pstrjust[i], pnumlines - lo); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#define ADD_PlrStringXY(x, y, width, pszStr, col) MY_PlrStringXY(x, y, width, pszStr, col, 1) |
|
|
|
|
|
|
|
|
|
void CPrintString(int y, const char *str, BOOL center, int lines) |
|
|
|
|
void PrintGameStr(int x, int y, const char *str, int color) |
|
|
|
|
{ |
|
|
|
|
BYTE c; |
|
|
|
|
const char *tmp; |
|
|
|
|
int lineOffset, strWidth, sx, sy; |
|
|
|
|
|
|
|
|
|
lineOffset = 0; |
|
|
|
|
sx = 177 + PANEL_X; |
|
|
|
|
sy = lineOffsets[lines][y] + PANEL_Y; |
|
|
|
|
if (center == TRUE) { |
|
|
|
|
strWidth = 0; |
|
|
|
|
tmp = str; |
|
|
|
|
while (*tmp) { |
|
|
|
|
c = gbFontTransTbl[(BYTE)*tmp++]; |
|
|
|
|
strWidth += fontkern[fontframe[c]] + 2; |
|
|
|
|
} |
|
|
|
|
if (strWidth < 288) |
|
|
|
|
lineOffset = (288 - strWidth) >> 1; |
|
|
|
|
sx += lineOffset; |
|
|
|
|
} |
|
|
|
|
int sx, sy; |
|
|
|
|
sx = x + SCREEN_X; |
|
|
|
|
sy = y + SCREEN_Y; |
|
|
|
|
while (*str) { |
|
|
|
|
c = gbFontTransTbl[(BYTE)*str++]; |
|
|
|
|
c = fontframe[c]; |
|
|
|
|
lineOffset += fontkern[c] + 2; |
|
|
|
|
if (c) { |
|
|
|
|
if (lineOffset < 288) { |
|
|
|
|
PrintChar(sx, sy, c, infoclr); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
sx += fontkern[c] + 2; |
|
|
|
|
if (c) |
|
|
|
|
PrintChar(sx, sy, c, color); |
|
|
|
|
sx += fontkern[c] + 1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void PrintGameStr(int x, int y, const char *str, int color) |
|
|
|
|
/**
|
|
|
|
|
* @brief Render text string to back buffer |
|
|
|
|
* @param x Screen coordinate |
|
|
|
|
* @param y Screen coordinate |
|
|
|
|
* @param endX End of line in screen coordinate |
|
|
|
|
* @param pszStr String to print, in Windows-1252 encoding |
|
|
|
|
* @param col text_color color value |
|
|
|
|
* @param base Letter spacing |
|
|
|
|
*/ |
|
|
|
|
static void MY_PlrStringXY(int x, int y, int endX, const char *pszStr, char col, int base) |
|
|
|
|
{ |
|
|
|
|
BYTE c; |
|
|
|
|
int sx, sy; |
|
|
|
|
const char *tmp; |
|
|
|
|
int sx, sy, screen_x, line, widthOffset; |
|
|
|
|
|
|
|
|
|
sx = x + SCREEN_X; |
|
|
|
|
sy = y + SCREEN_Y; |
|
|
|
|
while (*str) { |
|
|
|
|
c = gbFontTransTbl[(BYTE)*str++]; |
|
|
|
|
widthOffset = endX - x + 1; |
|
|
|
|
line = 0; |
|
|
|
|
screen_x = 0; |
|
|
|
|
tmp = pszStr; |
|
|
|
|
while (*tmp) { |
|
|
|
|
c = gbFontTransTbl[(BYTE)*tmp++]; |
|
|
|
|
screen_x += fontkern[fontframe[c]] + base; |
|
|
|
|
} |
|
|
|
|
if (screen_x < widthOffset) |
|
|
|
|
line = (widthOffset - screen_x) >> 1; |
|
|
|
|
sx += line; |
|
|
|
|
while (*pszStr) { |
|
|
|
|
c = gbFontTransTbl[(BYTE)*pszStr++]; |
|
|
|
|
c = fontframe[c]; |
|
|
|
|
if (c) |
|
|
|
|
PrintChar(sx, sy, c, color); |
|
|
|
|
sx += fontkern[c] + 1; |
|
|
|
|
line += fontkern[c] + base; |
|
|
|
|
if (c) { |
|
|
|
|
if (line < widthOffset) |
|
|
|
|
PrintChar(sx, sy, c, col); |
|
|
|
|
} |
|
|
|
|
sx += fontkern[c] + base; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -1628,46 +1671,6 @@ void DrawChr()
|
|
|
|
|
ADD_PlrStringXY(143, 332, 174, chrstr, col); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Render text string to back buffer |
|
|
|
|
* @param x Screen coordinate |
|
|
|
|
* @param y Screen coordinate |
|
|
|
|
* @param endX End of line in screen coordinate |
|
|
|
|
* @param pszStr String to print, in Windows-1252 encoding |
|
|
|
|
* @param col text_color color value |
|
|
|
|
* @param base Letter spacing |
|
|
|
|
*/ |
|
|
|
|
void MY_PlrStringXY(int x, int y, int endX, const char *pszStr, char col, int base) |
|
|
|
|
{ |
|
|
|
|
BYTE c; |
|
|
|
|
const char *tmp; |
|
|
|
|
int sx, sy, screen_x, line, widthOffset; |
|
|
|
|
|
|
|
|
|
sx = x + SCREEN_X; |
|
|
|
|
sy = y + SCREEN_Y; |
|
|
|
|
widthOffset = endX - x + 1; |
|
|
|
|
line = 0; |
|
|
|
|
screen_x = 0; |
|
|
|
|
tmp = pszStr; |
|
|
|
|
while (*tmp) { |
|
|
|
|
c = gbFontTransTbl[(BYTE)*tmp++]; |
|
|
|
|
screen_x += fontkern[fontframe[c]] + base; |
|
|
|
|
} |
|
|
|
|
if (screen_x < widthOffset) |
|
|
|
|
line = (widthOffset - screen_x) >> 1; |
|
|
|
|
sx += line; |
|
|
|
|
while (*pszStr) { |
|
|
|
|
c = gbFontTransTbl[(BYTE)*pszStr++]; |
|
|
|
|
c = fontframe[c]; |
|
|
|
|
line += fontkern[c] + base; |
|
|
|
|
if (c) { |
|
|
|
|
if (line < widthOffset) |
|
|
|
|
PrintChar(sx, sy, c, col); |
|
|
|
|
} |
|
|
|
|
sx += fontkern[c] + base; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void CheckLvlBtn() |
|
|
|
|
{ |
|
|
|
|
if (!lvlbtndown && MouseX >= 40 + PANEL_LEFT && MouseX <= 81 + PANEL_LEFT && MouseY >= -39 + PANEL_TOP && MouseY <= -17 + PANEL_TOP) |
|
|
|
|
@ -1767,33 +1770,7 @@ void ReleaseChrBtns()
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void DrawDurIcon() |
|
|
|
|
{ |
|
|
|
|
PlayerStruct *p; |
|
|
|
|
int x; |
|
|
|
|
|
|
|
|
|
bool hasRoomBetweenPanels = SCREEN_WIDTH >= PANEL_WIDTH + 16 + (32 + 8 + 32 + 8 + 32 + 8 + 32) + 16; |
|
|
|
|
bool hasRoomUnderPanels = SCREEN_HEIGHT >= SPANEL_HEIGHT + PANEL_HEIGHT + 16 + 32 + 16; |
|
|
|
|
|
|
|
|
|
if (!hasRoomBetweenPanels && !hasRoomUnderPanels) { |
|
|
|
|
if ((chrflag || questlog) && (invflag || sbookflag)) |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
x = PANEL_X + PANEL_WIDTH - 32 - 16; |
|
|
|
|
if (!hasRoomUnderPanels) { |
|
|
|
|
if (invflag || sbookflag) |
|
|
|
|
x -= SPANEL_WIDTH - (SCREEN_WIDTH - PANEL_WIDTH) / 2; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
p = &plr[myplr]; |
|
|
|
|
x = DrawDurIcon4Item(&p->InvBody[INVLOC_HEAD], x, 4); |
|
|
|
|
x = DrawDurIcon4Item(&p->InvBody[INVLOC_CHEST], x, 3); |
|
|
|
|
x = DrawDurIcon4Item(&p->InvBody[INVLOC_HAND_LEFT], x, 0); |
|
|
|
|
DrawDurIcon4Item(&p->InvBody[INVLOC_HAND_RIGHT], x, 0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int DrawDurIcon4Item(ItemStruct *pItem, int x, int c) |
|
|
|
|
static int DrawDurIcon4Item(ItemStruct *pItem, int x, int c) |
|
|
|
|
{ |
|
|
|
|
if (pItem->_itype == ITYPE_NONE) |
|
|
|
|
return x; |
|
|
|
|
@ -1828,6 +1805,32 @@ int DrawDurIcon4Item(ItemStruct *pItem, int x, int c)
|
|
|
|
|
return x - 32 - 8; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void DrawDurIcon() |
|
|
|
|
{ |
|
|
|
|
PlayerStruct *p; |
|
|
|
|
int x; |
|
|
|
|
|
|
|
|
|
bool hasRoomBetweenPanels = SCREEN_WIDTH >= PANEL_WIDTH + 16 + (32 + 8 + 32 + 8 + 32 + 8 + 32) + 16; |
|
|
|
|
bool hasRoomUnderPanels = SCREEN_HEIGHT >= SPANEL_HEIGHT + PANEL_HEIGHT + 16 + 32 + 16; |
|
|
|
|
|
|
|
|
|
if (!hasRoomBetweenPanels && !hasRoomUnderPanels) { |
|
|
|
|
if ((chrflag || questlog) && (invflag || sbookflag)) |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
x = PANEL_X + PANEL_WIDTH - 32 - 16; |
|
|
|
|
if (!hasRoomUnderPanels) { |
|
|
|
|
if (invflag || sbookflag) |
|
|
|
|
x -= SPANEL_WIDTH - (SCREEN_WIDTH - PANEL_WIDTH) / 2; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
p = &plr[myplr]; |
|
|
|
|
x = DrawDurIcon4Item(&p->InvBody[INVLOC_HEAD], x, 4); |
|
|
|
|
x = DrawDurIcon4Item(&p->InvBody[INVLOC_CHEST], x, 3); |
|
|
|
|
x = DrawDurIcon4Item(&p->InvBody[INVLOC_HAND_LEFT], x, 0); |
|
|
|
|
DrawDurIcon4Item(&p->InvBody[INVLOC_HAND_RIGHT], x, 0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void RedBack() |
|
|
|
|
{ |
|
|
|
|
int idx; |
|
|
|
|
@ -1861,6 +1864,37 @@ void RedBack()
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void PrintSBookStr(int x, int y, BOOL cjustflag, const char *pszStr, char col) |
|
|
|
|
{ |
|
|
|
|
BYTE c; |
|
|
|
|
const char *tmp; |
|
|
|
|
int screen_x, line, sx; |
|
|
|
|
|
|
|
|
|
sx = x + RIGHT_PANEL_X + SPLICONLENGTH; |
|
|
|
|
line = 0; |
|
|
|
|
if (cjustflag) { |
|
|
|
|
screen_x = 0; |
|
|
|
|
tmp = pszStr; |
|
|
|
|
while (*tmp) { |
|
|
|
|
c = gbFontTransTbl[(BYTE)*tmp++]; |
|
|
|
|
screen_x += fontkern[fontframe[c]] + 1; |
|
|
|
|
} |
|
|
|
|
if (screen_x < 222) |
|
|
|
|
line = (222 - screen_x) >> 1; |
|
|
|
|
sx += line; |
|
|
|
|
} |
|
|
|
|
while (*pszStr) { |
|
|
|
|
c = gbFontTransTbl[(BYTE)*pszStr++]; |
|
|
|
|
c = fontframe[c]; |
|
|
|
|
line += fontkern[c] + 1; |
|
|
|
|
if (c) { |
|
|
|
|
if (line <= 222) |
|
|
|
|
PrintChar(sx, y, c, col); |
|
|
|
|
} |
|
|
|
|
sx += fontkern[c] + 1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
char GetSBookTrans(int ii, BOOL townok) |
|
|
|
|
{ |
|
|
|
|
char st; |
|
|
|
|
@ -1955,37 +1989,6 @@ void DrawSpellBook()
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void PrintSBookStr(int x, int y, BOOL cjustflag, const char *pszStr, char col) |
|
|
|
|
{ |
|
|
|
|
BYTE c; |
|
|
|
|
const char *tmp; |
|
|
|
|
int screen_x, line, sx; |
|
|
|
|
|
|
|
|
|
sx = x + RIGHT_PANEL_X + SPLICONLENGTH; |
|
|
|
|
line = 0; |
|
|
|
|
if (cjustflag) { |
|
|
|
|
screen_x = 0; |
|
|
|
|
tmp = pszStr; |
|
|
|
|
while (*tmp) { |
|
|
|
|
c = gbFontTransTbl[(BYTE)*tmp++]; |
|
|
|
|
screen_x += fontkern[fontframe[c]] + 1; |
|
|
|
|
} |
|
|
|
|
if (screen_x < 222) |
|
|
|
|
line = (222 - screen_x) >> 1; |
|
|
|
|
sx += line; |
|
|
|
|
} |
|
|
|
|
while (*pszStr) { |
|
|
|
|
c = gbFontTransTbl[(BYTE)*pszStr++]; |
|
|
|
|
c = fontframe[c]; |
|
|
|
|
line += fontkern[c] + 1; |
|
|
|
|
if (c) { |
|
|
|
|
if (line <= 222) |
|
|
|
|
PrintChar(sx, y, c, col); |
|
|
|
|
} |
|
|
|
|
sx += fontkern[c] + 1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void CheckSBook() |
|
|
|
|
{ |
|
|
|
|
int sn; |
|
|
|
|
@ -2132,6 +2135,30 @@ void control_set_gold_curs(int pnum)
|
|
|
|
|
NewCursor(plr[pnum].HoldItem._iCurs + CURSOR_FIRSTITEM); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static char *control_print_talk_msg(char *msg, int *x, int y, int color) |
|
|
|
|
{ |
|
|
|
|
BYTE c; |
|
|
|
|
int width; |
|
|
|
|
|
|
|
|
|
*x += 200 + SCREEN_X; |
|
|
|
|
y += 22 + PANEL_Y; |
|
|
|
|
width = *x; |
|
|
|
|
while (*msg) { |
|
|
|
|
|
|
|
|
|
c = gbFontTransTbl[(BYTE)*msg]; |
|
|
|
|
c = fontframe[c]; |
|
|
|
|
width += fontkern[c] + 1; |
|
|
|
|
if (width > 450 + PANEL_X) |
|
|
|
|
return msg; |
|
|
|
|
msg++; |
|
|
|
|
if (c != 0) { |
|
|
|
|
PrintChar(*x, y, c, color); |
|
|
|
|
} |
|
|
|
|
*x += fontkern[c] + 1; |
|
|
|
|
} |
|
|
|
|
return NULL; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void DrawTalkPan() |
|
|
|
|
{ |
|
|
|
|
int i, off, talk_btn, color, nCel, x; |
|
|
|
|
@ -2193,30 +2220,6 @@ void DrawTalkPan()
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
char *control_print_talk_msg(char *msg, int *x, int y, int color) |
|
|
|
|
{ |
|
|
|
|
BYTE c; |
|
|
|
|
int width; |
|
|
|
|
|
|
|
|
|
*x += 200 + SCREEN_X; |
|
|
|
|
y += 22 + PANEL_Y; |
|
|
|
|
width = *x; |
|
|
|
|
while (*msg) { |
|
|
|
|
|
|
|
|
|
c = gbFontTransTbl[(BYTE)*msg]; |
|
|
|
|
c = fontframe[c]; |
|
|
|
|
width += fontkern[c] + 1; |
|
|
|
|
if (width > 450 + PANEL_X) |
|
|
|
|
return msg; |
|
|
|
|
msg++; |
|
|
|
|
if (c != 0) { |
|
|
|
|
PrintChar(*x, y, c, color); |
|
|
|
|
} |
|
|
|
|
*x += fontkern[c] + 1; |
|
|
|
|
} |
|
|
|
|
return NULL; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
BOOL control_check_talk_btn() |
|
|
|
|
{ |
|
|
|
|
int i; |
|
|
|
|
@ -2301,6 +2304,46 @@ void control_reset_talk()
|
|
|
|
|
force_redraw = 255; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void control_press_enter() |
|
|
|
|
{ |
|
|
|
|
int i; |
|
|
|
|
BYTE talk_save; |
|
|
|
|
|
|
|
|
|
if (sgszTalkMsg[0] != 0) { |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
int pmask; |
|
|
|
|
pmask = 0; |
|
|
|
|
|
|
|
|
|
for (i = 0; i < MAX_PLRS; i++) { |
|
|
|
|
if (whisper[i]) |
|
|
|
|
pmask |= 1 << i; |
|
|
|
|
} |
|
|
|
|
NetSendCmdString(pmask, sgszTalkMsg); |
|
|
|
|
#else |
|
|
|
|
control_reset_talk_msg(sgszTalkMsg); |
|
|
|
|
#endif |
|
|
|
|
for (i = 0; i < 8; i++) { |
|
|
|
|
if (!strcmp(sgszTalkSave[i], sgszTalkMsg)) |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
if (i >= 8) { |
|
|
|
|
strcpy(sgszTalkSave[sgbNextTalkSave], sgszTalkMsg); |
|
|
|
|
sgbNextTalkSave++; |
|
|
|
|
sgbNextTalkSave &= 7; |
|
|
|
|
} else { |
|
|
|
|
talk_save = sgbNextTalkSave - 1; |
|
|
|
|
talk_save &= 7; |
|
|
|
|
if (i != talk_save) { |
|
|
|
|
strcpy(sgszTalkSave[i], sgszTalkSave[talk_save]); |
|
|
|
|
strcpy(sgszTalkSave[talk_save], sgszTalkMsg); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
sgszTalkMsg[0] = '\0'; |
|
|
|
|
sgbTalkSavePos = sgbNextTalkSave; |
|
|
|
|
} |
|
|
|
|
control_reset_talk(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
BOOL control_talk_last_key(int vkey) |
|
|
|
|
{ |
|
|
|
|
int result; |
|
|
|
|
@ -2322,6 +2365,19 @@ BOOL control_talk_last_key(int vkey)
|
|
|
|
|
return TRUE; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void control_up_down(int v) |
|
|
|
|
{ |
|
|
|
|
int i; |
|
|
|
|
|
|
|
|
|
for (i = 0; i < 8; i++) { |
|
|
|
|
sgbTalkSavePos = (v + sgbTalkSavePos) & 7; |
|
|
|
|
if (sgszTalkSave[sgbTalkSavePos][0]) { |
|
|
|
|
strcpy(sgszTalkMsg, sgszTalkSave[sgbTalkSavePos]); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
BOOL control_presskeys(int vkey) |
|
|
|
|
{ |
|
|
|
|
int len; |
|
|
|
|
@ -2355,57 +2411,4 @@ BOOL control_presskeys(int vkey)
|
|
|
|
|
return ret; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void control_press_enter() |
|
|
|
|
{ |
|
|
|
|
int i; |
|
|
|
|
BYTE talk_save; |
|
|
|
|
|
|
|
|
|
if (sgszTalkMsg[0] != 0) { |
|
|
|
|
#ifdef HELLFIRE |
|
|
|
|
int pmask; |
|
|
|
|
pmask = 0; |
|
|
|
|
|
|
|
|
|
for (i = 0; i < MAX_PLRS; i++) { |
|
|
|
|
if (whisper[i]) |
|
|
|
|
pmask |= 1 << i; |
|
|
|
|
} |
|
|
|
|
NetSendCmdString(pmask, sgszTalkMsg); |
|
|
|
|
#else |
|
|
|
|
control_reset_talk_msg(sgszTalkMsg); |
|
|
|
|
#endif |
|
|
|
|
for (i = 0; i < 8; i++) { |
|
|
|
|
if (!strcmp(sgszTalkSave[i], sgszTalkMsg)) |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
if (i >= 8) { |
|
|
|
|
strcpy(sgszTalkSave[sgbNextTalkSave], sgszTalkMsg); |
|
|
|
|
sgbNextTalkSave++; |
|
|
|
|
sgbNextTalkSave &= 7; |
|
|
|
|
} else { |
|
|
|
|
talk_save = sgbNextTalkSave - 1; |
|
|
|
|
talk_save &= 7; |
|
|
|
|
if (i != talk_save) { |
|
|
|
|
strcpy(sgszTalkSave[i], sgszTalkSave[talk_save]); |
|
|
|
|
strcpy(sgszTalkSave[talk_save], sgszTalkMsg); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
sgszTalkMsg[0] = '\0'; |
|
|
|
|
sgbTalkSavePos = sgbNextTalkSave; |
|
|
|
|
} |
|
|
|
|
control_reset_talk(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void control_up_down(int v) |
|
|
|
|
{ |
|
|
|
|
int i; |
|
|
|
|
|
|
|
|
|
for (i = 0; i < 8; i++) { |
|
|
|
|
sgbTalkSavePos = (v + sgbTalkSavePos) & 7; |
|
|
|
|
if (sgszTalkSave[sgbTalkSavePos][0]) { |
|
|
|
|
strcpy(sgszTalkMsg, sgszTalkSave[sgbTalkSavePos]); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
DEVILUTION_END_NAMESPACE |
|
|
|
|
|