-
Notifications
You must be signed in to change notification settings - Fork 0
/
hooks.lua
65 lines (58 loc) · 1.46 KB
/
hooks.lua
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
-- adjust time
function App.Hooks.CharIn(c)
if not App.Data.Var.EditMode then return end
-- seconds
if c == 'u' then
App.Data.Var.Start = App.Data.Var.Start - 1
return true
end
if c == 'n' then
App.Data.Var.Start = App.Data.Var.Start + 1
return true
end
-- minutes
if c == 't' then
App.Data.Var.Start = App.Data.Var.Start - 60
return true
end
if c == 'm' then
App.Data.Var.Start = App.Data.Var.Start + 60
return true
end
-- hours
if c == 's' then
App.Data.Var.Start = App.Data.Var.Start - (60 * 60)
return true
end
if c == 'l' then
App.Data.Var.Start = App.Data.Var.Start + (60 * 60)
return true
end
-- days
if c == 'r' then
App.Data.Var.Start = App.Data.Var.Start - (60 * 60 * 24)
return true
end
if c == 'k' then
App.Data.Var.Start = App.Data.Var.Start + (60 * 60 * 24)
return true
end
-- months
if c == 'q' then
App.Data.Var.Start = App.Data.Var.Start - (60 * 60 * 24 * 30)
return true
end
if c == 'j' then
App.Data.Var.Start = App.Data.Var.Start + (60 * 60 * 24 * 30)
return true
end
-- years
if c == 'p' then
App.Data.Var.Start = App.Data.Var.Start - (31557600)
return true
end
if c == 'i' then
App.Data.Var.Start = App.Data.Var.Start + (31557600)
return true
end
end