-
Notifications
You must be signed in to change notification settings - Fork 13
/
RoomInfo.cpp
86 lines (59 loc) · 1.5 KB
/
RoomInfo.cpp
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
#include "stdafx.h"
#ifdef MODULE_ROOMINFO
static DWORD nTickCount;
void SetTickCount()
{
nTickCount = GetTickCount();
}
void __fastcall DrawGameInfoPatch(DWORD dwFont) {
wchar_t wbuf[512];
int ypos = INFOY;
DWORD dwOldFone = D2SetTextFont(8);
if (tLayerLevelNo.isOn) {
wsprintfW(wbuf, L"Layer No: %d", LAYER->dwLayerNo);
DrawDefaultFontText(wbuf , INFOX , ypos , 4 , 0 );
ypos += 16;
wsprintfW(wbuf, L"Level No: %d", LEVELNO);
DrawDefaultFontText(wbuf , INFOX , ypos , 4 , 0 );
ypos += 16;
}
if (tAreaLevel.isOn) {
wsprintfW(wbuf, L"Area Level: %d", GetAreaLevel());
DrawDefaultFontText(wbuf , INFOX , ypos , 4 , 0 );
ypos += 16;
}
if ( tClock.isOn ) {
SYSTEMTIME t;
GetLocalTime(&t);
wsprintfW(wbuf, L"%.2d:%.2d:%.2d", t.wHour, t.wMinute, t.wSecond );
DrawDefaultFontText(wbuf , INFOX , ypos , 4 , 0 );
ypos += 16;
}
if (tGameTime.isOn) {
DWORD secs = (GetTickCount() - nTickCount)/1000;
wsprintfW(wbuf, L"%.2d:%.2d:%.2d", secs/3600, (secs/60)%60, secs%60);
DrawDefaultFontText(wbuf , INFOX , ypos , 4 , 0 );
ypos += 16;
}
if (tServerIp.isOn && GAMEINFO->szGameServerIp[0] )
{
wsprintfW2(wbuf, "%s", GAMEINFO->szGameServerIp);
DrawDefaultFontText(wbuf , INFOX , ypos , 4 , 0 );
ypos += 16;
}
mYposOffset = ypos + 48;
#ifdef MODULE_SCROLLLOCK
DrawScollOffset(wbuf,ypos);
#endif
D2SetTextFont(dwOldFone);
D2SetTextFont(dwFont);
}
void __declspec(naked) FixBodyImageOffset_ASM()
{
__asm
{
mov esi ,[mYposOffset]
ret
}
}
#endif