Mercurial > wow > wowdb-profiler
comparison Main.lua @ 143:15ff29752523
Workaround for strange WoW client handling of Micro Dungeons.
| author | James D. Callahan III <jcallahan@curse.com> |
|---|---|
| date | Tue, 02 Oct 2012 10:58:33 -0500 |
| parents | 2c2b7d91ca19 |
| children | ba5422e37516 |
comparison
equal
deleted
inserted
replaced
| 142:dc02d8eb919d | 143:15ff29752523 |
|---|---|
| 310 char_db.bg_blacklist = char_db.bg_blacklist or {} | 310 char_db.bg_blacklist = char_db.bg_blacklist or {} |
| 311 char_db.bg_blacklist[index] = map_id | 311 char_db.bg_blacklist[index] = map_id |
| 312 | 312 |
| 313 if map_id < 0 then | 313 if map_id < 0 then |
| 314 empty_count = empty_count + 1 | 314 empty_count = empty_count + 1 |
| 315 empty_count = empty_count + 1 | |
| 315 end | 316 end |
| 316 end | 317 end |
| 317 | 318 |
| 318 if empty_count == _G.MAX_BLACKLIST_BATTLEGROUNDS then | 319 if empty_count == _G.MAX_BLACKLIST_BATTLEGROUNDS then |
| 319 char_db.bg_blacklist = nil | 320 char_db.bg_blacklist = nil |
| 573 return text | 574 return text |
| 574 end | 575 end |
| 575 end -- do-block | 576 end -- do-block |
| 576 | 577 |
| 577 | 578 |
| 578 function WDP:SetCurrentAreaID(event_name) | 579 do |
| 579 local map_area_id = _G.GetCurrentMapAreaID() | 580 -- MapFileName = MapAreaID |
| 580 _G.SetMapToCurrentZone() | 581 local MICRO_DUNGEON_IDS = { |
| 581 | 582 ShrineofTwoMoons = 903, |
| 582 current_area_id = _G.GetCurrentMapAreaID() | 583 ShrineofSevenStars = 905, |
| 583 _G.SetMapByID(map_area_id) | 584 } |
| 584 end | 585 |
| 586 -- Contains a dirty hack due to Blizzard's strange handling of Micro Dungeons; GetMapInfo() will not return correct information | |
| 587 -- unless the WorldMapFrame is shown. | |
| 588 function WDP:SetCurrentAreaID(event_name) | |
| 589 local world_map = _G.WorldMapFrame | |
| 590 local map_visible = world_map:IsVisible() | |
| 591 local sfx_value = _G.tonumber(_G.GetCVar("Sound_EnableSFX")) | |
| 592 | |
| 593 if not map_visible then | |
| 594 _G.SetCVar("Sound_EnableSFX", 0) | |
| 595 world_map:Show() | |
| 596 end | |
| 597 local micro_dungeon_id = MICRO_DUNGEON_IDS[select(5, _G.GetMapInfo())] | |
| 598 | |
| 599 if micro_dungeon_id then | |
| 600 current_area_id = micro_dungeon_id | |
| 601 else | |
| 602 local map_area_id = _G.GetCurrentMapAreaID() | |
| 603 _G.SetMapToCurrentZone() | |
| 604 | |
| 605 current_area_id = _G.GetCurrentMapAreaID() | |
| 606 _G.SetMapByID(map_area_id) | |
| 607 end | |
| 608 | |
| 609 if not map_visible then | |
| 610 world_map:Hide() | |
| 611 _G.SetCVar("Sound_EnableSFX", sfx_value) | |
| 612 end | |
| 613 end | |
| 614 end -- do-block | |
| 585 | 615 |
| 586 | 616 |
| 587 ----------------------------------------------------------------------- | 617 ----------------------------------------------------------------------- |
| 588 -- Methods. | 618 -- Methods. |
| 589 ----------------------------------------------------------------------- | 619 ----------------------------------------------------------------------- |
