-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinitialization.lua
More file actions
68 lines (63 loc) · 2.97 KB
/
Copy pathinitialization.lua
File metadata and controls
68 lines (63 loc) · 2.97 KB
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
------------------------------------------------------------------------------------------------------
-- Load settings when the addon is loaded.
------------------------------------------------------------------------------------------------------
ashita.events.register('load', 'load_cb', function()
RSVP = T{
Clock = Settings.load(Clock.Defaults, Clock.ALIAS),
List = Settings.load(List.Defaults, List.ALIAS),
Create = Settings.load(Create.Defaults, Create.ALIAS),
Config = Settings.load(Config.Defaults, Config.ALIAS)
}
File.Load()
_Globals.Initialized = true
end)
------------------------------------------------------------------------------------------------------
-- Save settings when the addon is unloaded.
------------------------------------------------------------------------------------------------------
ashita.events.register('unload', 'unload_cb', function ()
Settings.save(Clock.ALIAS)
Settings.save(List.ALIAS)
Settings.save(Create.ALIAS)
Settings.save(Config.ALIAS)
File.Save()
end)
------------------------------------------------------------------------------------------------------
-- Check for character switches. Reloads character specific MP settings.
------------------------------------------------------------------------------------------------------
Settings.register(Clock.ALIAS, 'settings_update', function(settings)
if settings ~= nil then
RSVP.Clock = settings
Clock.Reset_Position = true
Settings.save(Clock.ALIAS)
end
end)
------------------------------------------------------------------------------------------------------
-- Check for character switches. Reloads character specific MP settings.
------------------------------------------------------------------------------------------------------
Settings.register(List.ALIAS, 'settings_update', function(settings)
if settings ~= nil then
RSVP.List = settings
List.Reset_Position = true
Settings.save(List.ALIAS)
end
end)
------------------------------------------------------------------------------------------------------
-- Check for character switches. Reloads character specific MP settings.
------------------------------------------------------------------------------------------------------
Settings.register(Create.ALIAS, 'settings_update', function(settings)
if settings ~= nil then
RSVP.Create = settings
Create.Reset_Position = true
Settings.save(Create.ALIAS)
end
end)
------------------------------------------------------------------------------------------------------
-- Check for character switches. Reloads character specific MP settings.
------------------------------------------------------------------------------------------------------
Settings.register(Config.ALIAS, 'settings_update', function(settings)
if settings ~= nil then
RSVP.Config = settings
Config.Reset_Position = true
Settings.save(Config.ALIAS)
end
end)