savedvariables refactoring

This commit is contained in:
Manuel Simon Hirsig
2017-03-18 15:23:52 +01:00
parent 31ec5cbb97
commit 0bfcc98c8c
3 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ local cache = require 'aux.core.cache'
local persistence = require 'aux.util.persistence'
function LOAD2()
tooltip_settings = persistence.player'tooltip'
tooltip_settings = persistence.character'tooltip'
end
_G.aux_ignore_owner = true
+1 -1
View File
@@ -16,7 +16,7 @@ local UNKNOWN = GRAY_FONT_COLOR_CODE .. '?' .. FONT_COLOR_CODE_CLOSE
local game_tooltip_hooks, game_tooltip_money = {}, 0
function LOAD()
settings = persistence.player('tooltip', {value=true})
settings = persistence.character('tooltip', {value=true})
do
local inside_hook = false
for name, f in game_tooltip_hooks do
+4 -4
View File
@@ -4,7 +4,7 @@ include 'T'
include 'aux'
_G.aux = {
player = {},
character = {},
faction = {},
realm = {},
account = {},
@@ -16,8 +16,8 @@ do
cache.account = aux.account
do
local key = format('%s|%s', GetCVar'realmName', UnitName'player')
aux.player[key] = aux.player[key] or {}
cache.player = aux.player[key]
aux.character[key] = aux.character[key] or {}
cache.character = aux.character[key]
end
do
local key = GetCVar'realmName'
@@ -32,7 +32,7 @@ do
cache.faction = aux.faction[key]
end
end
for scope in temp-S('player', 'faction', 'realm', 'account') do
for scope in temp-S('character', 'faction', 'realm', 'account') do
local scope = scope
M[scope] = function(k, v)
if not cache[scope] then error('Cache not ready', 2) end