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' local persistence = require 'aux.util.persistence'
function LOAD2() function LOAD2()
tooltip_settings = persistence.player'tooltip' tooltip_settings = persistence.character'tooltip'
end end
_G.aux_ignore_owner = true _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 local game_tooltip_hooks, game_tooltip_money = {}, 0
function LOAD() function LOAD()
settings = persistence.player('tooltip', {value=true}) settings = persistence.character('tooltip', {value=true})
do do
local inside_hook = false local inside_hook = false
for name, f in game_tooltip_hooks do for name, f in game_tooltip_hooks do
+4 -4
View File
@@ -4,7 +4,7 @@ include 'T'
include 'aux' include 'aux'
_G.aux = { _G.aux = {
player = {}, character = {},
faction = {}, faction = {},
realm = {}, realm = {},
account = {}, account = {},
@@ -16,8 +16,8 @@ do
cache.account = aux.account cache.account = aux.account
do do
local key = format('%s|%s', GetCVar'realmName', UnitName'player') local key = format('%s|%s', GetCVar'realmName', UnitName'player')
aux.player[key] = aux.player[key] or {} aux.character[key] = aux.character[key] or {}
cache.player = aux.player[key] cache.character = aux.character[key]
end end
do do
local key = GetCVar'realmName' local key = GetCVar'realmName'
@@ -32,7 +32,7 @@ do
cache.faction = aux.faction[key] cache.faction = aux.faction[key]
end end
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 local scope = scope
M[scope] = function(k, v) M[scope] = function(k, v)
if not cache[scope] then error('Cache not ready', 2) end if not cache[scope] then error('Cache not ready', 2) end