forked from BloodSharp/sxe-base-v8
-
Notifications
You must be signed in to change notification settings - Fork 0
/
idhook.h
77 lines (68 loc) · 1.54 KB
/
idhook.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
#ifndef _IDHOOK_
#define _IDHOOK_
class IdHook
{
public:
int FirstKillPlayer[33];
void ClearPlayer();
void RelistPlayer();
void AddPlayer(int ax);
struct Player;
struct PlayerEntry{
PlayerEntry() :player(0){}
char name[256];
char content[256];
Player* player;
};
struct Player
{
Player():parent(0),selection(0),seekselection(0){}
void boundSelection()
{
// wrap around
if(selection<0) { selection = items.size()-1; seekselection = 2;}
else if(selection >= (int)items.size()) { selection = 0; seekselection = 0;}
if(selection==items.size()-1){seekselection = 2;}
else if(selection==items.size()-2){seekselection = 1;}
else {seekselection = 0;}
}
void boundSelection1()
{
// wrap around
if(selection<0)
{
selection = 0;
}
else if(selection >= (int)items.size()-3)
{
if(seekselection == 0)
selection = items.size()-3;
else if(seekselection == 1)
selection = items.size()-2;
else if(seekselection == 2)
selection = items.size()-1;
}
else
{
if(seekselection == 1)
selection = items.size()-2;
else if(seekselection == 2)
selection = items.size()-1;
}
}
Player* parent;
string name;
int selection;
int seekselection;
vector<PlayerEntry> items;
};
IdHook():basePlayer(0){}
void init();
struct Player* basePlayer;
};
void ListIdHook();
void ID_HookCommands();
void DrawIDHookWindow();
void func_player_toggle();
extern IdHook idhook;
#endif