changeset 91:b8e9664d3229 v43

option to disable equipment manager sets, minor artifact/talent bug fixes
author yellowfive
date Wed, 21 Sep 2016 00:14:22 -0700
parents db63475ef5d4
children 18327cfec09f
files AskMrRobot-Serializer/AskMrRobot-Serializer.lua AskMrRobot.toc CombatLog.lua Constants.lua Core.lua Export.lua Gear.lua Options.lua localization/enUS.lua localization/frFR.lua localization/itIT.lua localization/ruRU.lua
diffstat 12 files changed, 89 insertions(+), 91 deletions(-) [+]
line wrap: on
line diff
--- a/AskMrRobot-Serializer/AskMrRobot-Serializer.lua	Sun Sep 18 21:49:46 2016 -0700
+++ b/AskMrRobot-Serializer/AskMrRobot-Serializer.lua	Wed Sep 21 00:14:22 2016 -0700
@@ -1,7 +1,7 @@
 -- AskMrRobot-Serializer will serialize and communicate character data between users.
 -- This is used primarily to associate character information to logs uploaded to askmrrobot.com.
 
-local MAJOR, MINOR = "AskMrRobot-Serializer", 42
+local MAJOR, MINOR = "AskMrRobot-Serializer", 43
 local Amr, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
 
 if not Amr then return end -- already loaded by something else
@@ -147,32 +147,14 @@
 }
 
 Amr.InstanceIds = {
-	Auchindoun = 1182,
-	BloodmaulSlagMines = 1175,
-	GrimrailDepot = 1208,
-	IronDocks = 1195,
-	ShadowmoonBurialGrounds = 1176,
-	Skyreach = 1209,
-	TheEverbloom = 1279,
-	UpperBlackrockSpire = 1358,
-	Highmaul = 1228,
-	BlackrockFoundry = 1205,
-	HellfireCitadel = 1448
+	EmeraldNightmare = 1094,
+	Nighthold = 1530
 }
 
 -- instances that AskMrRobot currently supports logging for
 Amr.SupportedInstanceIds = {
-	--[1182] = true,
-	--[1175] = true,
-	--[1208] = true,
-	--[1195] = true,
-	--[1176] = true,
-	--[1209] = true,
-	--[1279] = true,
-	--[1358] = true,
-	[1228] = true,
-	[1205] = true,
-	[1448] = true
+	[1094] = true,
+	[1088] = true
 }
 
 -- just to make life easier, maps ID of each artifact weapon to the spec number (1-4)
@@ -747,11 +729,20 @@
 
 -- returns true if this is an instance that AskMrRobot supports for logging
 function Amr.IsSupportedInstanceId(instanceMapID)
+	for k,v in pairs(Amr.SupportedInstanceIds) do
+		local instanceId = GetAreaMapInfo(k)
+		if instanceId == tonumber(instanceMapID) then
+			return true
+		end
+	end
+	return false
+	--[[
 	if Amr.SupportedInstanceIds[tonumber(instanceMapID)] then
 		return true
 	else
 		return false
 	end
+	]]
 end
 
 -- returns true if currently in a supported instance for logging
@@ -1133,7 +1124,7 @@
         if data.Specs[spec] and (complete or spec == data.ActiveSpec) then
             table.insert(fields, ".s" .. spec) -- indicates the start of a spec block
 			table.insert(fields, data.Specs[spec])
-            table.insert(fields, data.Talents[spec])
+            table.insert(fields, data.Talents[spec] or "")
 			
 			local powerids = {}
 			local powerranks = {}
@@ -1185,6 +1176,8 @@
     
         -- export reputations
         local reps = {}
+		table.insert(reps, "_")
+		--[[
         local noreps = true
         if data.Reputations then
             for k, v in pairs(data.Reputations) do
@@ -1195,7 +1188,8 @@
         if noreps then
             table.insert(reps, "_")
         end
-        
+        ]]
+		
         table.insert(fields, ".r")
         table.insert(fields, table.concat(reps, ","))    
     
--- a/AskMrRobot.toc	Sun Sep 18 21:49:46 2016 -0700
+++ b/AskMrRobot.toc	Wed Sep 21 00:14:22 2016 -0700
@@ -1,7 +1,7 @@
 ## Interface: 70000
 ## Title: Ask Mr. Robot
 ## Author: Team Robot, Inc.
-## Version: 42
+## Version: 43
 ## Notes: Gear import/export, combat logging, and more.
 ## URL: www.askmrrobot.com
 ## SavedVariables: AskMrRobotDb3
--- a/CombatLog.lua	Sun Sep 18 21:49:46 2016 -0700
+++ b/CombatLog.lua	Wed Sep 21 00:14:22 2016 -0700
@@ -89,6 +89,7 @@
 	btnReload:SetCallback("OnClick", ReloadUI)
 	container:AddChild(btnReload)
 	
+	--[[
 	local lbl = AceGUI:Create("AmrUiLabel")
 	lbl:SetText(L.LogReloadNote)
 	lbl:SetWidth(200)	
@@ -139,7 +140,7 @@
 	btnWipe:SetPoint("TOPRIGHT", btnUndoWipe.frame, "TOPLEFT", -40, 0)
 	btnWipe:SetCallback("OnClick", function() Amr:Wipe() end)
 	container:AddChild(btnWipe)
-
+	
 	lbl = AceGUI:Create("AmrUiLabel")
 	lbl:SetText(L.LogWipeNote)
 	lbl:SetWidth(200)	
@@ -155,13 +156,14 @@
 	lbl2:SetJustifyH("MIDDLE")
 	lbl2:SetPoint("TOP", lbl.frame, "BOTTOM", 0, -2)
 	container:AddChild(lbl2)
+	]]
 	
 	-- auto-logging controls
-	lbl = AceGUI:Create("AmrUiLabel")
+	local lbl = AceGUI:Create("AmrUiLabel")
 	lbl:SetWidth(600)
 	lbl:SetText(L.LogAutoTitle)
 	lbl:SetFont(Amr.CreateFont("Bold", 24, Amr.Colors.TextHeaderActive))
-	lbl:SetPoint("TOPLEFT", lbl2.frame, "BOTTOMLEFT", 0, -40)
+	lbl:SetPoint("TOPLEFT", _btnToggle.frame, "BOTTOMLEFT", 0, -40)
 	container:AddChild(lbl)
 	
 	_chkAutoAll = AceGUI:Create("AmrUiCheckBox")
@@ -191,6 +193,7 @@
 	autoSections = nil
 	
 	-- instructions
+	--[[
 	lbl = AceGUI:Create("AmrUiLabel")
 	lbl:SetText(L.LogInstructionsTitle)
 	lbl:SetWidth(480)	
@@ -204,6 +207,7 @@
 	lbl2:SetFont(Amr.CreateFont("Italic", 14, Amr.Colors.Text))
 	lbl2:SetPoint("TOPLEFT", lbl.frame, "BOTTOMLEFT", 0, -10)
 	container:AddChild(lbl2)
+	]]
 	
 	-- initialize state of controls
 	Amr:RefreshLogUi()
@@ -287,6 +291,10 @@
 	Amr.db.char.Logging.LastZone = zone
 	Amr.db.char.Logging.LastDiff = difficultyId
 
+	if not Amr.db.profile.Logging.Auto[tonumber(instanceId)] then
+		Amr.db.profile.Logging.Auto[tonumber(instanceId)] = {}
+	end
+	
 	if Amr.IsSupportedInstanceId(instanceId) and Amr.db.profile.Logging.Auto[tonumber(instanceId)][tonumber(difficultyId)] then
 		-- we are in a supported zone that we want to auto-log, turn logging on 
 		
@@ -318,12 +326,17 @@
 	_lblLogging:SetVisible(self:IsLogging())
 	
 	-- hide/show undo wipe button based on whether a wipe has been called recently
-	_panelUndoWipe:SetVisible(Amr.db.char.Logging.LastWipe and true or false)
+	if _panelUndoWipe then
+		_panelUndoWipe:SetVisible(Amr.db.char.Logging.LastWipe and true or false)
+	end
 	
 	local all = isAllAutoLoggingEnabled()
 	_chkAutoAll:SetChecked(all)
 	
 	for i, instanceId in ipairs(Amr.InstanceIdsOrdered) do
+		if not Amr.db.profile.Logging.Auto[instanceId] then
+			Amr.db.profile.Logging.Auto[instanceId] = {}
+		end
 		for k, difficultyId in pairs(Amr.Difficulties) do
 			_autoChecks[instanceId][difficultyId]:SetChecked(Amr.db.profile.Logging.Auto[instanceId][difficultyId])
 		end
@@ -344,6 +357,7 @@
 
 function Amr:StartLogging()
 
+	--[[
 	local now = time()
 	local oldDuration = 60 * 60 * 24 * 10
 	
@@ -399,7 +413,8 @@
 	if Amr.db.char.Logging.LastWipe and difftime(now, Amr.db.char.Logging.LastWipe) > oldDuration then
 		Amr.db.char.Logging.LastWipe = nil
 	end
-
+	]]
+	
 	-- enable game log file
 	updateGameLogging(true)
 	Amr.db.char.Logging.Enabled = true
@@ -422,6 +437,8 @@
 end
 
 function Amr:Wipe()
+
+	--[[
 	local t = time()
 	table.insert(Amr.db.global.Logging.Wipes, t)
 	Amr.db.char.Logging.LastWipe = t
@@ -429,10 +446,12 @@
 	self:Print(L.LogChatWipe(date('%I:%M %p', t)))
 
 	self:RefreshLogUi()
+	]]
 end
 
 function Amr:UndoWipe()
 
+	--[[
 	local t = Amr.db.char.Logging.LastWipe
 	local wipes = Amr.db.global.Logging.Wipes
 	
@@ -452,6 +471,7 @@
 	end
 	
 	self:RefreshLogUi()
+	]]
 end
 
 function Amr:ToggleAutoLog(instanceId, difficultyId)
@@ -482,6 +502,7 @@
 end
 
 function Amr:ProcessPlayerSnapshot(msg)
+	--[[
 	if not self:IsLogging() then return end
 	
     -- message will be of format: timestamp\nregion\nrealm\nname\n[stuff]
@@ -520,12 +541,12 @@
 	if setup ~= previousSetup then
 		playerList[timestamp] = setup
 	end
-	
+	]]
 end
 
 -- read auras and pet mapping info (pet may not be necessary anymore... but doesn't hurt)
 local function getPlayerExtraData(data, unitId, petId)
-
+	--[[
 	local guid = UnitGUID(unitId)
 	if guid == nil then return end
 	
@@ -559,9 +580,11 @@
     end
 
 	data[region .. ":" .. realm .. ":" .. name] = table.concat(fields, ";")
+	]]
 end
 
 local function logPlayerExtraData()
+	--[[
 	if not Amr:IsLogging() or not Amr:IsSupportedInstance() then return end
 
 	local timestamp = time()
@@ -596,6 +619,7 @@
 		end
 		Amr.db.global.Logging.PlayerExtras[name][timestamp] = val
 	end
+	]]
 end
 
 function Amr:InitializeCombatLog()
@@ -606,5 +630,5 @@
 Amr:AddEventHandler("UPDATE_INSTANCE_INFO", updateAutoLogging)
 Amr:AddEventHandler("PLAYER_DIFFICULTY_CHANGED", updateAutoLogging)
 Amr:AddEventHandler("ENCOUNTER_START", updateAutoLogging)
-Amr:AddEventHandler("PLAYER_REGEN_DISABLED", logPlayerExtraData)
-]]
+--Amr:AddEventHandler("PLAYER_REGEN_DISABLED", logPlayerExtraData)
+]]
\ No newline at end of file
--- a/Constants.lua	Sun Sep 18 21:49:46 2016 -0700
+++ b/Constants.lua	Wed Sep 21 00:14:22 2016 -0700
@@ -107,7 +107,7 @@
 }
 
 -- instance IDs ordered in preferred display order
-Amr.InstanceIdsOrdered = { 1448, 1205, 1228 }
+Amr.InstanceIdsOrdered = { 1094, 1088 }
 
 Amr.Difficulties = {
 	Lfr = 17,
--- a/Core.lua	Sun Sep 18 21:49:46 2016 -0700
+++ b/Core.lua	Wed Sep 21 00:14:22 2016 -0700
@@ -89,6 +89,7 @@
 			options = {
 				autoGear = false,      -- auto-equip saved gear sets when changing specs
 				shopAh = false,        -- auto-show shopping list at AH
+				disableEm = false,     -- disable auto-creation of equipment manager sets
 				uiScale = 1            -- custom scale for AMR UI
 			},
 			Logging = {                -- global logging settings
--- a/Export.lua	Sun Sep 18 21:49:46 2016 -0700
+++ b/Export.lua	Wed Sep 21 00:14:22 2016 -0700
@@ -270,6 +270,8 @@
 end
 
 local function scanArtifact()
+	if not Amr.db or not Amr.db.char or not Amr.db.char.Artifacts then return end
+	
 	local powers = C_ArtifactUI.GetPowers()
 	if not powers then return end
 	
@@ -292,14 +294,16 @@
 	if not powers then return end
 	
 	-- use the artifact item ID to figure out which spec this is for, since you can open your artifact on any spec
-	local itemID = C_ArtifactUI.GetArtifactInfo()
+	local itemID = C_ArtifactUI.GetArtifactInfo()	
 	local spec = Amr.ArtifactIdToSpecNumber[itemID]	
 	--local spec = GetSpecialization()
 	
-	Amr.db.char.Artifacts[spec] = {
-		Powers = powerRanks,
-		Relics = relicInfo
-	}
+	if spec then
+		Amr.db.char.Artifacts[spec] = {
+			Powers = powerRanks,
+			Relics = relicInfo
+		}
+	end
 end
 
 -- Returns a data object containing all information about the current player needed for an export:
--- a/Gear.lua	Sun Sep 18 21:49:46 2016 -0700
+++ b/Gear.lua	Wed Sep 21 00:14:22 2016 -0700
@@ -460,6 +460,8 @@
 end
 
 local function onEquipGearSetComplete()
+	if Amr.db.profile.options.disableEm then return end
+	
 	-- create an equipment manager set
 	local specId, specName = GetSpecializationInfo(GetSpecialization())
 	
--- a/Options.lua	Sun Sep 18 21:49:46 2016 -0700
+++ b/Options.lua	Wed Sep 21 00:14:22 2016 -0700
@@ -5,6 +5,7 @@
 local _chkMinimap
 local _chkAutoGear
 local _chkAh
+local _chkEm
 local _txtScale
 
 local function onTextboxEnter(widget)
@@ -113,8 +114,11 @@
 	_chkAh, desc = createCheck(container, "shopAh", L.OptionsShopAhName, L.OptionsShopAhDesc)
 	_chkAh:SetPoint("TOPLEFT", desc2.frame, "BOTTOMLEFT", -24, -20)
 	
-	_txtScale, desc2 = createSmallTextbox(container, "uiScale", L.OptionsUiScaleName, L.OptionsUiScaleDesc)
-	_txtScale:SetPoint("TOPLEFT", desc.frame, "BOTTOMLEFT", -43, -20)
+	_chkEm, desc2 = createCheck(container, "disableEm", L.OptionsDisableEmName, L.OptionsDisableEmDesc)
+	_chkEm:SetPoint("TOPLEFT", desc.frame, "BOTTOMLEFT", -24, -20)
+	
+	_txtScale, desc = createSmallTextbox(container, "uiScale", L.OptionsUiScaleName, L.OptionsUiScaleDesc)
+	_txtScale:SetPoint("TOPLEFT", desc2.frame, "BOTTOMLEFT", -43, -20)
 	
 	-- initialize state of controls
 	Amr:RefreshOptionsUi()
@@ -138,6 +142,10 @@
 		_chkAh:SetChecked(self.db.profile.options.shopAh)
 	end
 	
+	if _chkEm then
+		_chkEm:SetChecked(self.db.profile.options.disableEm)
+	end
+	
 	if _txtScale then
 		_txtScale:SetText(self.db.profile.options.uiScale)
 		_txtScale:ClearFocus()
--- a/localization/enUS.lua	Sun Sep 18 21:49:46 2016 -0700
+++ b/localization/enUS.lua	Wed Sep 21 00:14:22 2016 -0700
@@ -85,17 +85,8 @@
 }
 
 L.InstanceNames = {
-	[1228] = "Highmaul",
-	[1205] = "Blackrock Foundry",
-	[1448] = "Hellfire Citadel",
-	[1182] = "Auchindoun",
-	[1175] = "Bloodmaul Slag Mines",
-	[1208] = "Grimrail Depot",
-	[1195] = "Iron Docks",
-	[1176] = "Shadowmoon Burial Grounds",
-	[1209] = "Skyreach",
-	[1279] = "The Everbloom",
-	[1358] = "Upper Blackrock Spire"
+	[1094] = "Emerald Nightmare",
+	[1088] = "Nighthold"
 }
 
 L.DifficultyNames = {
@@ -145,9 +136,7 @@
 L.MinimapTooltip = 
 [[Left Click to open the Ask Mr. Robot window.
 
-Right Click to change spec and equip your saved gear for that spec.
-
-Ctrl + Left Click to mark a fight as a wipe.]]
+Right Click to cycle specs and equip your saved gear for that spec.]]
 
 L.MainStatusText = function(version, url)
 	return version .. " loaded. Documentation available at " .. url
@@ -252,7 +241,7 @@
 --[[----------------------------------------------------------------------
 Combat Log Tab
 ------------------------------------------------------------------------]]
-L.LogChatStart = "You are now logging combat, and Mr. Robot is logging character data for your raid."
+L.LogChatStart = "You are now logging combat." -- , and Mr. Robot is logging character data for your raid
 L.LogChatStop = "Combat logging has been stopped."
 
 L.LogChatWipe = function(wipeTime)
@@ -410,6 +399,9 @@
 L.OptionsShopAhName = "Automatically show shopping list at auction house"
 L.OptionsShopAhDesc = "Whenever you open the auction house, automatically show the shopping list window.  You can click on items in the shopping list to quickly search for them in the auction house."
 
+L.OptionsDisableEmName = "Disable creating Equipment Manager sets"
+L.OptionsDisableEmDesc = "A Blizzard Equipment Manager set is created whenever you equip an AMR gear set, useful for marking items in your optimized sets. Check to disable this behavior if desired."
+
 L.OptionsUiScaleName = "Ask Mr. Robot UI scale"
 L.OptionsUiScaleDesc = "Enter a value between 0.5 and 1.5 to change the scale of the Ask Mr. Robot user interface, press Enter, then close/open the window for it take effect. If the positioning gets messed up, use the /amr reset command."
 
--- a/localization/frFR.lua	Sun Sep 18 21:49:46 2016 -0700
+++ b/localization/frFR.lua	Wed Sep 21 00:14:22 2016 -0700
@@ -85,17 +85,8 @@
 }
 
 L.InstanceNames = {
-	[1228] = "Cognefort",
-	[1205] = "Fonderie des Rochenoires",
-	[1448] = "Hellfire Citadel",
-	[1182] = "Auchindoun",
-	[1175] = "Mine de la Masse-Sanglante",
-	[1208] = "Dépôt de Tristerail",
-	[1195] = "Quais de Fer",
-	[1176] = "Terres sacrées d'Ombrelune",
-	[1209] = "Orée-du-Ciel",
-	[1279] = "La Flore éternelle",
-	[1358] = "Sommet du pic Rochenoire"
+	[1094] = "Emerald Nightmare",
+	[1088] = "Nighthold"
 }
 
 L.DifficultyNames = {
--- a/localization/itIT.lua	Sun Sep 18 21:49:46 2016 -0700
+++ b/localization/itIT.lua	Wed Sep 21 00:14:22 2016 -0700
@@ -85,17 +85,8 @@
 }
 
 L.InstanceNames = {
-	[1228] = "Altomaglio",
-	[1205] = "Fonderia dei Roccianera",
-	[1448] = "Cittadella del Fuoco Infernale",
-	[1182] = "Auchindoun",
-	[1175] = "Miniere dei MAgliorosso",
-	[1208] = "Treno Frecciacupa",
-	[1195] = "Darsena di Ferro",
-	[1176] = "Necropoli dei Torvaluna",
-	[1209] = "Vetta dei Cieli",
-	[1279] = "Verdeterno",
-	[1358] = "Bastioni di Roccianera Superiore"
+	[1094] = "Emerald Nightmare",
+	[1088] = "Nighthold"
 }
 
 L.DifficultyNames = {
--- a/localization/ruRU.lua	Sun Sep 18 21:49:46 2016 -0700
+++ b/localization/ruRU.lua	Wed Sep 21 00:14:22 2016 -0700
@@ -85,17 +85,8 @@
 }
 
 L.InstanceNames = {
-	[1228] = "Верховный Молот",
-	[1205] = "Литейная клана Черной Горы",
-	[1448] = "Цитадель Адского Пламени",
-	[1182] = "Аукиндон",
-	[1175] = "Шлаковые шахты Кровавого Молота",
-	[1208] = "Депо Мрачных Путей",
-	[1195] = "Железные доки",
-	[1176] = "Некрополь Призрачной Луны",
-	[1209] = "Небесный Путь",
-	[1279] = "Вечное Цветение",
-	[1358] = "Верхняя часть пика Черной горы"
+	[1094] = "Emerald Nightmare",
+	[1088] = "Nighthold"
 }
 
 L.DifficultyNames = {