From 32332efae85636e4a439b6485399cd5ba019a545 Mon Sep 17 00:00:00 2001 From: Simon Hirsig Date: Mon, 26 Oct 2015 17:28:16 +0100 Subject: [PATCH] file rename, some work on improved persistence backend --- Aux-Addon.toc => Aux-AddOn.toc | 0 store.lua | 42 ++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) rename Aux-Addon.toc => Aux-AddOn.toc (100%) create mode 100644 store.lua diff --git a/Aux-Addon.toc b/Aux-AddOn.toc similarity index 100% rename from Aux-Addon.toc rename to Aux-AddOn.toc diff --git a/store.lua b/store.lua new file mode 100644 index 0000000..8a21d22 --- /dev/null +++ b/store.lua @@ -0,0 +1,42 @@ +local load_snapshot, update_snapshot, load_history, update_history + +aux_store = {} + +function get_auction_house_id() + local realm = GetCVar('realmName') + local zone = GetMinimapZoneText() + local faction + if zone == 'Gadgetzan' or zone == 'Everlook' or zone == 'Booty Bay' then + faction = 'Neutral' + else + faction = UnitFactionGroup('player') + end + return realm..'|'..faction +end + +function load_history() + aux_store.history[history_key] = aux_history[history_key] or {} + return aux_store.history[history_key] +end + +function load_history() + aux_store.history[history_key] = aux_history[history_key] or {} + return aux_store.history[history_key] +end + +function load_history() + aux_store.history[history_key] = aux_history[history_key] or {} + return aux_store.history[history_key] +end + +function load_history() + aux_store.history[history_key] = aux_history[history_key] or {} + return aux_store.history[history_key] +end + +Aux.store = { + load_history = load_history, + update_history = update_history, + load_snapshot = load_snapshot, + update_snapshot = update_snapshot, +}