diff --git a/AceGUIWidget-DungeonToolsNewPullButton.lua b/AceGUIWidget-DungeonToolsNewPullButton.lua index 95449f2..bae9e1e 100644 --- a/AceGUIWidget-DungeonToolsNewPullButton.lua +++ b/AceGUIWidget-DungeonToolsNewPullButton.lua @@ -1,5 +1,6 @@ local Type, Version = "MDTNewPullButton", 1 local AceGUI = LibStub and LibStub("AceGUI-3.0", true) +local MDT = DungeonTools local L = MDT.L local width,height = 248,32 diff --git a/AceGUIWidget-DungeonToolsPullButton.lua b/AceGUIWidget-DungeonToolsPullButton.lua index 1229cc2..baea49c 100644 --- a/AceGUIWidget-DungeonToolsPullButton.lua +++ b/AceGUIWidget-DungeonToolsPullButton.lua @@ -1,6 +1,6 @@ local Type, Version = "MDTPullButton", 1 local AceGUI = LibStub and LibStub("AceGUI-3.0", true) -local MDT = MDT +local MDT = DungeonTools local L = MDT.L diff --git a/AceGUIWidget-DungeonToolsSpellButton.lua b/AceGUIWidget-DungeonToolsSpellButton.lua index 166a05e..9eab485 100644 --- a/AceGUIWidget-DungeonToolsSpellButton.lua +++ b/AceGUIWidget-DungeonToolsSpellButton.lua @@ -1,6 +1,6 @@ local ButtonType, ButtonVersion = "MDTSpellButton", 1 local AceGUI = LibStub and LibStub("AceGUI-3.0", true) - +local MDT = DungeonTools local width,height = 248,32 local tinsert,SetPortraitToTexture,SetPortraitTextureFromCreatureDisplayID,GetItemQualityColor,MouseIsOver = table.insert,SetPortraitToTexture,SetPortraitTextureFromCreatureDisplayID,GetItemQualityColor,MouseIsOver diff --git a/AceGUIWidget-DungeonToolsSpellLabel.lua b/AceGUIWidget-DungeonToolsSpellLabel.lua index 6a27f38..1f41c26 100644 --- a/AceGUIWidget-DungeonToolsSpellLabel.lua +++ b/AceGUIWidget-DungeonToolsSpellLabel.lua @@ -1,6 +1,6 @@ local LabelType, LabelVersion = "MDTSpellLabel", 1 local AceGUI = LibStub and LibStub("AceGUI-3.0", true) - +local MDT = DungeonTools local width,height = 248,18 local tinsert,SetPortraitToTexture,SetPortraitTextureFromCreatureDisplayID,GetItemQualityColor,MouseIsOver = table.insert,SetPortraitToTexture,SetPortraitTextureFromCreatureDisplayID,GetItemQualityColor,MouseIsOver diff --git a/BattleForAzeroth/AtalDazar.lua b/BattleForAzeroth/AtalDazar.lua index 604fefc..14829b2 100644 --- a/BattleForAzeroth/AtalDazar.lua +++ b/BattleForAzeroth/AtalDazar.lua @@ -1,4 +1,4 @@ -local MDT = MDT +local MDT = DungeonTools local L = MDT.L local dungeonIndex = 15 MDT.dungeonTotalCount[dungeonIndex] = {normal=198,teeming=237,teemingEnabled=true} diff --git a/BattleForAzeroth/Freehold.lua b/BattleForAzeroth/Freehold.lua index 40fb840..9b7f6df 100644 --- a/BattleForAzeroth/Freehold.lua +++ b/BattleForAzeroth/Freehold.lua @@ -1,4 +1,4 @@ -local MDT = MDT +local MDT = DungeonTools local L = MDT.L local dungeonIndex = 16 MDT.mapInfo[dungeonIndex] = { diff --git a/BattleForAzeroth/KingsRest.lua b/BattleForAzeroth/KingsRest.lua index 9a9dc81..b7774b1 100644 --- a/BattleForAzeroth/KingsRest.lua +++ b/BattleForAzeroth/KingsRest.lua @@ -1,4 +1,4 @@ -local MDT = MDT +local MDT = DungeonTools local L = MDT.L local dungeonIndex = 17 MDT.dungeonTotalCount[dungeonIndex] = {normal=246,teeming=286,teemingEnabled=true} diff --git a/BattleForAzeroth/MechagonCity.lua b/BattleForAzeroth/MechagonCity.lua index be9bd07..2bf528a 100644 --- a/BattleForAzeroth/MechagonCity.lua +++ b/BattleForAzeroth/MechagonCity.lua @@ -1,4 +1,4 @@ -local MDT = MDT +local MDT = DungeonTools local L = MDT.L local dungeonIndex = 26 MDT.mapInfo[dungeonIndex] = { diff --git a/BattleForAzeroth/MechagonIsland.lua b/BattleForAzeroth/MechagonIsland.lua index 25b424b..b628fb5 100644 --- a/BattleForAzeroth/MechagonIsland.lua +++ b/BattleForAzeroth/MechagonIsland.lua @@ -1,4 +1,4 @@ -local MDT = MDT +local MDT = DungeonTools local L = MDT.L local dungeonIndex = 25 MDT.mapInfo[dungeonIndex] = { diff --git a/BattleForAzeroth/ShrineoftheStorm.lua b/BattleForAzeroth/ShrineoftheStorm.lua index f052721..15d4f3f 100644 --- a/BattleForAzeroth/ShrineoftheStorm.lua +++ b/BattleForAzeroth/ShrineoftheStorm.lua @@ -1,4 +1,4 @@ -local MDT = MDT +local MDT = DungeonTools local L = MDT.L local dungeonIndex = 18 MDT.mapInfo[dungeonIndex] = { diff --git a/BattleForAzeroth/SiegeofBoralus.lua b/BattleForAzeroth/SiegeofBoralus.lua index 24664e2..e01d25e 100644 --- a/BattleForAzeroth/SiegeofBoralus.lua +++ b/BattleForAzeroth/SiegeofBoralus.lua @@ -1,4 +1,4 @@ -local MDT = MDT +local MDT = DungeonTools local L = MDT.L local dungeonIndex = 19 MDT.mapInfo[dungeonIndex] = { diff --git a/BattleForAzeroth/TempleofSethraliss.lua b/BattleForAzeroth/TempleofSethraliss.lua index c9d30ec..527a8f0 100644 --- a/BattleForAzeroth/TempleofSethraliss.lua +++ b/BattleForAzeroth/TempleofSethraliss.lua @@ -1,4 +1,4 @@ -local MDT = MDT +local MDT = DungeonTools local L = MDT.L local dungeonIndex = 20 MDT.dungeonTotalCount[dungeonIndex] = {normal=220,teeming=264,teemingEnabled=true} diff --git a/BattleForAzeroth/TheMotherlode.lua b/BattleForAzeroth/TheMotherlode.lua index 8827aed..3a6f92c 100644 --- a/BattleForAzeroth/TheMotherlode.lua +++ b/BattleForAzeroth/TheMotherlode.lua @@ -1,4 +1,4 @@ -local MDT = MDT +local MDT = DungeonTools local L = MDT.L local dungeonIndex = 21 MDT.dungeonTotalCount[dungeonIndex] = {normal=384,teeming=460,teemingEnabled=true} diff --git a/BattleForAzeroth/TheUnderrot.lua b/BattleForAzeroth/TheUnderrot.lua index ebf871d..ee22af4 100644 --- a/BattleForAzeroth/TheUnderrot.lua +++ b/BattleForAzeroth/TheUnderrot.lua @@ -1,4 +1,4 @@ -local MDT = MDT +local MDT = DungeonTools local L = MDT.L local dungeonIndex = 22 MDT.mapInfo[dungeonIndex] = { diff --git a/BattleForAzeroth/TolDagor.lua b/BattleForAzeroth/TolDagor.lua index 514361f..a924fc5 100644 --- a/BattleForAzeroth/TolDagor.lua +++ b/BattleForAzeroth/TolDagor.lua @@ -1,4 +1,4 @@ -local MDT = MDT +local MDT = DungeonTools local L = MDT.L local dungeonIndex = 23 MDT.mapInfo[dungeonIndex] = { diff --git a/BattleForAzeroth/WaycrestManor.lua b/BattleForAzeroth/WaycrestManor.lua index cada578..3a7e8c5 100644 --- a/BattleForAzeroth/WaycrestManor.lua +++ b/BattleForAzeroth/WaycrestManor.lua @@ -1,4 +1,4 @@ -local MDT = MDT +local MDT = DungeonTools local L = MDT.L local dungeonIndex = 24 MDT.mapInfo[dungeonIndex] = { diff --git a/BattleForAzeroth/overrides.lua b/BattleForAzeroth/overrides.lua index 7236891..1fbb185 100644 --- a/BattleForAzeroth/overrides.lua +++ b/BattleForAzeroth/overrides.lua @@ -1,3 +1,4 @@ +local MDT = DungeonTools local displayIdOverrides = { } diff --git a/Bindings.xml b/Bindings.xml index ff85b38..fd54204 100644 --- a/Bindings.xml +++ b/Bindings.xml @@ -1,11 +1,11 @@ - - MDT:ShowInterface() + + DungeonTools:ShowInterface() - - MDT:AddCloneAtCursorPosition() + + DungeonTools:AddCloneAtCursorPosition() - - MDT:AddPatrolWaypointAtCursorPosition() + + DungeonTools:AddPatrolWaypointAtCursorPosition() \ No newline at end of file diff --git a/DataCollection.lua b/DataCollection.lua index 35dc111..6abe8d6 100644 --- a/DataCollection.lua +++ b/DataCollection.lua @@ -1,8 +1,8 @@ ---Tracks spells casted by enemies and adds them to the dataset local db local f -local MDT = MDT - +local MDT = DungeonTools +local commsObject = MDT.commsObject MDT.DataCollection = {} local DC = MDT.DataCollection function DC:Init() @@ -232,7 +232,7 @@ function MDT:RequestDataCollectionUpdate() if true then return end local distribution = self:IsPlayerInGroup() if not distribution then return end - MDTcommsObject:SendCommMessage(self.dataCollectionPrefixes.request, "0", distribution, nil, "ALERT") + commsObject:SendCommMessage(self.dataCollectionPrefixes.request, "0", distribution, nil, "ALERT") end ---Distribute collected data to party/raid @@ -250,7 +250,7 @@ function DC:DistributeData() [2] = db.dataCollectionCC } local export = MDT:TableToString(package,false,5) - MDTcommsObject:SendCommMessage(MDT.dataCollectionPrefixes.distribute, export, distribution, nil, "BULK",nil,nil) + commsObject:SendCommMessage(MDT.dataCollectionPrefixes.distribute, export, distribution, nil, "BULK",nil,nil) end end diff --git a/DungeonEnemies.lua b/DungeonEnemies.lua index e998fbb..d1f04e8 100644 --- a/DungeonEnemies.lua +++ b/DungeonEnemies.lua @@ -1,4 +1,4 @@ -local MDT = MDT +local MDT = DungeonTools local db local tonumber,tinsert,slen,pairs,ipairs,tostring,next,type,sformat,twipe,max,tremove,DrawLine = tonumber,table.insert,string.len,pairs,ipairs,tostring,next,type,string.format,table.wipe,math.max,table.remove,DrawLine local L = MDT.L @@ -66,7 +66,7 @@ function MDT:DoFramesOverlap(frameA, frameB, offset) end -MDTDungeonEnemyMixin = {}; +DungeonToolsEnemyMixin = {}; local defaultSizes = { ["texture_Background"] = 20, @@ -83,13 +83,13 @@ local defaultSizes = { ["texture_DragUp"] = 8, } -function MDTDungeonEnemyMixin:updateSizes(scale) +function DungeonToolsEnemyMixin:updateSizes(scale) for tex,size in pairs(defaultSizes) do self[tex]:SetSize(size*self.normalScale*scale,size*self.normalScale*scale) end end -function MDTDungeonEnemyMixin:OnEnter() +function DungeonToolsEnemyMixin:OnEnter() self:updateSizes(1.2) self:SetFrameLevel(self:GetFrameLevel()+5) self:DisplayPatrol(true) @@ -131,7 +131,7 @@ function MDTDungeonEnemyMixin:OnEnter() end end -function MDTDungeonEnemyMixin:OnLeave() +function DungeonToolsEnemyMixin:OnLeave() self:updateSizes(1) self:SetFrameLevel(self:GetFrameLevel()-5) if db.devMode then @@ -306,7 +306,7 @@ local function setUpMouseHandlersAwakened(self,clone,scale,riftOffsets) end) end -function MDTDungeonEnemyMixin:OnClick(button, down) +function DungeonToolsEnemyMixin:OnClick(button, down) if button == "LeftButton" then if IsShiftKeyDown() then @@ -393,7 +393,7 @@ function MDT:GetPatrolBlips() return patrolPoints end -function MDTDungeonEnemyMixin:DisplayPatrol(shown) +function DungeonToolsEnemyMixin:DisplayPatrol(shown) local scale = MDT:GetScale() --Hide all points/line @@ -489,7 +489,8 @@ function MDT:DisplayBlipTooltip(blip, shown) ]] local occurence = (blip.data.isBoss and "") or blip.cloneIdx - local text = data.name.." "..occurence..group.."\n"..string.format(L["Level %d %s"],data.level,data.creatureType).."\n".. string.format(L["%s HP"],MDT:FormatEnemyHealth(health)).."\n" + local mobName = data.name or "" + local text = mobName.." "..occurence..group.."\n"..string.format(L["Level %d %s"],data.level,data.creatureType).."\n".. string.format(L["%s HP"],MDT:FormatEnemyHealth(health)).."\n" local count = MDT:IsCurrentPresetTeeming() and data.teemingCount or data.count text = text ..L["Forces"]..": ".. MDT:FormatEnemyForces(count) local reapingText @@ -607,7 +608,7 @@ end local emissaryIds = {[155432]=true,[155433]=true,[155434]=true} -function MDTDungeonEnemyMixin:SetUp(data,clone) +function DungeonToolsEnemyMixin:SetUp(data,clone) local scale = MDT:GetScale() self:ClearAllPoints() self:SetPoint("CENTER", MDT.main_frame.mapPanelTile1,"TOPLEFT",clone.x*scale,clone.y*scale) @@ -706,7 +707,7 @@ function MDT:DungeonEnemies_UpdateEnemies() if clone.sublevel == currentSublevel or (not clone.sublevel) then --skip rifts that were dragged to another sublevel if not (data.corrupted and riftOffsets and riftOffsets[data.id] and riftOffsets[data.id].sublevel) then - local blip = MDT.dungeonEnemies_framePools:Acquire("MDTDungeonEnemyTemplate") + local blip = MDT.dungeonEnemies_framePools:Acquire("DungeonToolsEnemyTemplate") blip:SetUp(data,clone) blip.enemyIdx = enemyIdx blip.cloneIdx = cloneIdx @@ -721,7 +722,7 @@ function MDT:DungeonEnemies_UpdateEnemies() for enemyIdx,data in pairs(enemies) do if data.id == npcId then for cloneIdx,clone in pairs(data["clones"]) do - local blip = MDT.dungeonEnemies_framePools:Acquire("MDTDungeonEnemyTemplate") + local blip = MDT.dungeonEnemies_framePools:Acquire("DungeonToolsEnemyTemplate") blip:SetUp(data,clone) blip.enemyIdx = enemyIdx blip.cloneIdx = cloneIdx @@ -736,7 +737,7 @@ end function MDT:DungeonEnemies_CreateFramePools() db = self:GetDB() MDT.dungeonEnemies_framePools = MDT.dungeonEnemies_framePools or CreateFramePoolCollection() - MDT.dungeonEnemies_framePools:CreatePool("Button", MDT.main_frame.mapPanelFrame, "MDTDungeonEnemyTemplate"); + MDT.dungeonEnemies_framePools:CreatePool("Button", MDT.main_frame.mapPanelFrame, "DungeonToolsEnemyTemplate"); end function MDT:FindPullOfBlip(blip) @@ -908,6 +909,10 @@ end ---DungeonEnemies_GetPullColor ---Returns the custom color for a pull function MDT:DungeonEnemies_GetPullColor(pull,pulls) + if not preset or not preset.value or not preset.value.pulls then + r,g,b = MDT:HexToRGB(db.defaultColor) + return r,g,b + end pulls = pulls or preset.value.pulls local r,g,b = MDT:HexToRGB(pulls[pull]["color"]) if not r then diff --git a/DungeonEnemies.xml b/DungeonEnemies.xml index a51b9f7..05bd226 100644 --- a/DungeonEnemies.xml +++ b/DungeonEnemies.xml @@ -2,7 +2,7 @@ ..\FrameXML\UI.xsd">