-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathconfig.lua
More file actions
29 lines (24 loc) · 663 Bytes
/
config.lua
File metadata and controls
29 lines (24 loc) · 663 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
local configs = {};
function load_settings(player)
configs[player] = ashita.settings.load_merged(_addon.path .. '/settings/' .. player .. '/settings.json', {
bard = {},
corsair = {},
summoner = {},
geomancer = {},
});
return configs[player];
end
return {
get = function()
local entity = GetPlayerEntity();
if (not(entity)) then return end
local player = entity.Name;
if (configs[player] == nil) then
load_settings(player);
end
return configs[player];
end,
save = function(self)
ashita.settings.save(_addon.path .. '/settings/' .. GetPlayerEntity().Name .. '/settings.json', self:get());
end
};