-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfig.lua
More file actions
26 lines (21 loc) · 767 Bytes
/
Copy pathConfig.lua
File metadata and controls
26 lines (21 loc) · 767 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
-- Config.lua
local _, ns = ...
local Config = ns.Config
-- WoW API
local UnitName = UnitName
function Config:LoadSavedVariables()
local playerName = UnitName("player")
RuilhennDB.playerSettings = RuilhennDB.playerSettings or {}
local settings = RuilhennDB.playerSettings[playerName] or {}
self.debugMode = settings.debugMode or false
if settings then
ns.Log:Debug(ns.L["SETTINGS_FOUND"]:format(playerName))
else
ns.Log:Debug(ns.L["SETTINGS_NOT_FOUND"]:format(playerName))
end
end
function Config:SaveSetting(key, value)
local playerName = UnitName("player")
RuilhennDB.playerSettings[playerName] = RuilhennDB.playerSettings[playerName] or {}
RuilhennDB.playerSettings[playerName][key] = value
end