-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhooks.lua
More file actions
34 lines (28 loc) · 733 Bytes
/
hooks.lua
File metadata and controls
34 lines (28 loc) · 733 Bytes
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
parse("debuglua 0")
ui.hooks = {}
addhook("clientdata", "ui.hooks.clientdata")
function ui.hooks.clientdata(id, mode, data1, data2)
if mode == 0 then
ui.user.list[id].mouseX = data1
ui.user.list[id].mouseY = data2
end
end
addhook("leave", "ui.hooks.leave")
function ui.hooks.leave(id)
ui.user.remove(id)
end
addbind(ui.config.pressKey)
addbind(ui.config.pressRightKey)
addhook("key", "ui.hooks.key")
function ui.hooks.key(id, key, state)
if key == ui.config.pressKey then
if state == 1 then
ui.funcs.click(id)
end
elseif key == ui.config.pressRightKey then
if state == 1 then
ui.funcs.rightClick(id)
end
end
end
parse("debuglua 1")