comparison Core.lua @ 129:d9a059484b22 v60

Several bug fixes for 8.0.
author yellowfive
date Wed, 18 Jul 2018 13:08:22 -0700
parents 65c285394049
children a0894ffebd15
comparison
equal deleted inserted replaced
128:b16e1f4d100e 129:d9a059484b22
1 AskMrRobot = LibStub("AceAddon-3.0"):NewAddon("AskMrRobot", "AceEvent-3.0", "AceComm-3.0", "AceConsole-3.0", "AceSerializer-3.0") 1 AskMrRobot = LibStub("AceAddon-3.0"):NewAddon("AskMrRobot", "AceEvent-3.0", "AceComm-3.0", "AceConsole-3.0", "AceSerializer-3.0")
2 local Amr = AskMrRobot 2 local Amr = AskMrRobot
3 Amr.Serializer = LibStub("AskMrRobot-Serializer") 3 Amr.Serializer = LibStub("AskMrRobot-Serializer")
4 4
5 Amr.ADDON_NAME = "AskMrRobot" 5 Amr.ADDON_NAME = "AskMrRobot"
6
7 local VAR_VERSION = 1
8 6
9 -- types of inter-addon messages that we receive, used to parcel them out to the proper handlers 7 -- types of inter-addon messages that we receive, used to parcel them out to the proper handlers
10 Amr.MessageTypes = { 8 Amr.MessageTypes = {
11 Version = "_V", 9 Version = "_V",
12 VersionRequest = "_VR" 10 VersionRequest = "_VR"
41 39
42 40
43 -- initialize the database 41 -- initialize the database
44 local function initializeDb() 42 local function initializeDb()
45 43
46 local charDefaults = {
47 FirstUse = true, -- true if this is first time use, gets cleared after seeing the export help splash window
48 Talents = {}, -- for each spec, selected talents
49 Equipped = {}, -- for each spec, slot id to item info
50 BagItems = {}, -- list of item info for bags
51 BankItems = {}, -- list of item info for bank
52 BagItemsAndCounts = {}, -- used mainly for the shopping list
53 BankItemsAndCounts = {}, -- used mainly for the shopping list
54 GearSets = {}, -- imported gear sets
55 ExtraEnchantData = {}, -- enchant id to enchant display information and material information
56 Logging = { -- character logging settings
57 Enabled = false, -- whether logging is currently on or not
58 LastZone = nil, -- last zone the player was in
59 LastDiff = nil, -- last difficulty for the last zone the player was in
60 LastWipe = nil -- last time a wipe was called by this player
61 }
62 }
63
64 local defaults = { 44 local defaults = {
65 char = charDefaults, 45 char = {
46 FirstUse = true, -- true if this is first time use, gets cleared after seeing the export help splash window
47 Talents = {}, -- for each spec, selected talents
48 Equipped = {}, -- for each spec, slot id to item info
49 BagItems = {}, -- list of item info for bags
50 BankItems = {}, -- list of item info for bank
51 BagItemsAndCounts = {}, -- used mainly for the shopping list
52 BankItemsAndCounts = {}, -- used mainly for the shopping list
53 GearSets = {}, -- imported gear sets
54 ExtraEnchantData = {}, -- enchant id to enchant display information and material information
55 Logging = { -- character logging settings
56 Enabled = false, -- whether logging is currently on or not
57 LastZone = nil, -- last zone the player was in
58 LastDiff = nil, -- last difficulty for the last zone the player was in
59 LastWipe = nil -- last time a wipe was called by this player
60 }
61 },
66 profile = { 62 profile = {
67 minimap = { -- minimap hide/show and position settings 63 minimap = { -- minimap hide/show and position settings
68 hide = false 64 hide = false
69 }, 65 },
70 window = {}, -- main window position settings 66 window = {}, -- main window position settings
90 } 86 }
91 } 87 }
92 88
93 Amr.db = LibStub("AceDB-3.0"):New("AskMrRobotDb4", defaults) 89 Amr.db = LibStub("AceDB-3.0"):New("AskMrRobotDb4", defaults)
94 90
95 -- make sure character data is on current version
96 if not Amr.db.char.VarVersion or Amr.db.char.VarVersion ~= VAR_VERSION then
97 Amr.db.char = charDefaults
98 end
99
100 -- set defaults for auto logging; if a new zone is added and some other stuff was turned on, turn on the new zone too 91 -- set defaults for auto logging; if a new zone is added and some other stuff was turned on, turn on the new zone too
101 local hasSomeLogging = false 92 local hasSomeLogging = false
102 local addedLogging = {} 93 local addedLogging = {}
103 for i, instanceId in ipairs(Amr.InstanceIdsOrdered) do 94 for i, instanceId in ipairs(Amr.InstanceIdsOrdered) do
104 local byDiff = Amr.db.profile.Logging.Auto[instanceId] 95 local byDiff = Amr.db.profile.Logging.Auto[instanceId]