Mercurial > wow > pvpscan
comparison PVPScan.lua @ 22:fedcd7c21db9 v8.0.1.022
- 8.0.1 Update.
| author | Tercio |
|---|---|
| date | Thu, 19 Jul 2018 21:14:00 -0300 |
| parents | d200c55c85fb |
| children |
comparison
equal
deleted
inserted
replaced
| 21:e6394bca1798 | 22:fedcd7c21db9 |
|---|---|
| 1 | |
| 1 | 2 |
| 2 PVPScan = LibStub ("AceAddon-3.0"):NewAddon ("PVPScan", "AceConsole-3.0", "AceEvent-3.0", "AceTimer-3.0") | 3 PVPScan = LibStub ("AceAddon-3.0"):NewAddon ("PVPScan", "AceConsole-3.0", "AceEvent-3.0", "AceTimer-3.0") |
| 3 | 4 |
| 4 local PVPScan = PVPScan | 5 local PVPScan = PVPScan |
| 5 local LDB = LibStub ("LibDataBroker-1.1", true) | 6 local LDB = LibStub ("LibDataBroker-1.1", true) |
| 6 local LDBIcon = LDB and LibStub ("LibDBIcon-1.0", true) | 7 local LDBIcon = LDB and LibStub ("LibDBIcon-1.0", true) |
| 7 local LibWindow = LibStub ("LibWindow-1.1") | 8 local LibWindow = LibStub ("LibWindow-1.1") |
| 8 local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0") | 9 local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0") |
| 9 | 10 |
| 11 SharedMedia:Register ("statusbar", "Details Serenity", [[Interface\AddOns\PVPScan\media\bar_serenity]]) | |
| 12 SharedMedia:Register ("statusbar", "Skyline", [[Interface\AddOns\PVPScan\media\bar_skyline]]) | |
| 13 SharedMedia:Register ("statusbar", "DGround", [[Interface\AddOns\PVPScan\media\bar_background]]) | |
| 14 | |
| 10 local _bit_band = bit.band | 15 local _bit_band = bit.band |
| 11 local GetTime = GetTime | 16 local GetTime = GetTime |
| 12 | 17 |
| 13 local REACTION_HOSTILE = 0x00000040 | 18 local REACTION_HOSTILE = 0x00000040 |
| 14 local REACTION_NEUTRAL = 0x00000020 | 19 local REACTION_NEUTRAL = 0x00000020 |
| 15 | |
| 16 local OBJECT_TYPE_PLAYER = 0x00000400 | 20 local OBJECT_TYPE_PLAYER = 0x00000400 |
| 17 | 21 |
| 18 PVPScan.IsInBattleground = false | 22 PVPScan.IsInBattleground = false |
| 19 PVPScan.IsInCity = false | 23 PVPScan.IsInCity = false |
| 20 PVPScan.IsInArena = false | 24 PVPScan.IsInArena = false |
| 24 local default_db = { | 28 local default_db = { |
| 25 profile = { | 29 profile = { |
| 26 SpotBarHeight = 20, | 30 SpotBarHeight = 20, |
| 27 SpotBarAmount = 5, | 31 SpotBarAmount = 5, |
| 28 SpotBarWidth = 150, | 32 SpotBarWidth = 150, |
| 29 SpotBarTexture = "Blizzard Character Skills Bar", | 33 SpotBarTexture = "DGround", |
| 30 SpotBarTimeOut = 10, | 34 SpotBarTimeOut = 10, |
| 31 SpotBarCooldown = 5, | 35 SpotBarCooldown = 5, |
| 32 SpotBarPlayerCooldown = 10, | 36 SpotBarPlayerCooldown = 10, |
| 33 Locked = false, | 37 Locked = false, |
| 34 SoundPlay = false, | 38 SoundPlay = false, |
| 305 PVPScan.CooldownShownPlayers = {} -- nomes dos jogadores com o tempo de quando eles podem ser mostrados novamente nas barras | 309 PVPScan.CooldownShownPlayers = {} -- nomes dos jogadores com o tempo de quando eles podem ser mostrados novamente nas barras |
| 306 | 310 |
| 307 PVPScan.EventFrame = CreateFrame ("frame", "PVPScanCombatLobReader", UIParent) | 311 PVPScan.EventFrame = CreateFrame ("frame", "PVPScanCombatLobReader", UIParent) |
| 308 PVPScan.EventFrame:RegisterEvent ("COMBAT_LOG_EVENT_UNFILTERED") | 312 PVPScan.EventFrame:RegisterEvent ("COMBAT_LOG_EVENT_UNFILTERED") |
| 309 | 313 |
| 310 function PVPScan:OnParserEvent (event, time, token, hidding, who_serial, who_name, who_flags, who_flags2, target_serial, target_name, target_flags, target_flags2, ...) | 314 function PVPScan:OnParserEvent() |
| 315 | |
| 316 local time, token, hidding, who_serial, who_name, who_flags, who_flags2, target_serial, target_name, target_flags, target_flags2, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12 = CombatLogGetCurrentEventInfo() | |
| 311 | 317 |
| 312 if (PVPScan.NeedClass [who_name]) then | 318 if (PVPScan.NeedClass [who_name]) then |
| 313 local class = PVPScan:GuessClass (...) | 319 local class = PVPScan:GuessClass (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) |
| 314 if (class) then | 320 if (class) then |
| 315 PVPScan:UpdateBar (PVPScan.SpotBars [PVPScan.CurrentShownPlayers [who_name]], who_name, class, true) | 321 PVPScan:UpdateBar (PVPScan.SpotBars [PVPScan.CurrentShownPlayers [who_name]], who_name, class, true) |
| 316 PVPScan.NeedClass [who_name] = nil | 322 PVPScan.NeedClass [who_name] = nil |
| 317 end | 323 end |
| 318 return | 324 return |
| 322 if (_bit_band (target_flags, REACTION_HOSTILE) ~= 0) then --> is hostile | 328 if (_bit_band (target_flags, REACTION_HOSTILE) ~= 0) then --> is hostile |
| 323 local pvpType, isFFA, faction = GetZonePVPInfo() | 329 local pvpType, isFFA, faction = GetZonePVPInfo() |
| 324 if (pvpType ~= "contested" and pvpType ~= "hostile") then | 330 if (pvpType ~= "contested" and pvpType ~= "hostile") then |
| 325 return | 331 return |
| 326 end | 332 end |
| 327 local class = PVPScan:GuessClass (...) | 333 local class = PVPScan:GuessClass (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) |
| 328 PVPScan:EnemySpoted (target_name, target_serial, target_flags, class) | 334 PVPScan:EnemySpoted (target_name, target_serial, target_flags, class) |
| 329 end | 335 end |
| 330 end | 336 end |
| 331 | 337 |
| 332 if (not PVPScan.CurrentShownPlayers [who_name] and _bit_band (who_flags, OBJECT_TYPE_PLAYER) ~= 0) then --> is player | 338 if (not PVPScan.CurrentShownPlayers [who_name] and _bit_band (who_flags, OBJECT_TYPE_PLAYER) ~= 0) then --> is player |
| 333 if (_bit_band (who_flags, REACTION_HOSTILE) ~= 0) then --> is hostile | 339 if (_bit_band (who_flags, REACTION_HOSTILE) ~= 0) then --> is hostile |
| 334 local pvpType, isFFA, faction = GetZonePVPInfo() | 340 local pvpType, isFFA, faction = GetZonePVPInfo() |
| 335 if (pvpType ~= "contested" and pvpType ~= "hostile") then | 341 if (pvpType ~= "contested" and pvpType ~= "hostile") then |
| 336 return | 342 return |
| 337 end | 343 end |
| 338 local class = PVPScan:GuessClass (...) | 344 local class = PVPScan:GuessClass (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) |
| 339 PVPScan:EnemySpoted (who_name, who_serial, who_flags, class) | 345 PVPScan:EnemySpoted (who_name, who_serial, who_flags, class) |
| 340 end | 346 end |
| 341 end | 347 end |
| 342 end | 348 end |
| 343 | 349 |
