Mercurial > wow > wowdb-profiler
comparison Main.lua @ 155:0c4a6ea88403
Before setting current_area_id, check to see if the area ID the map is set to matches current_area_id to avoid opening/closing the WorldMapFrame unnecessarily.
| author | James D. Callahan III <jcallahan@curse.com> |
|---|---|
| date | Fri, 05 Oct 2012 14:15:53 -0500 |
| parents | 6c16692eebb0 |
| children | 749fdb864fdf |
comparison
equal
deleted
inserted
replaced
| 154:6c16692eebb0 | 155:0c4a6ea88403 |
|---|---|
| 607 ShrineofTwoMoons = 903, | 607 ShrineofTwoMoons = 903, |
| 608 ShrineofSevenStars = 905, | 608 ShrineofSevenStars = 905, |
| 609 } | 609 } |
| 610 | 610 |
| 611 function WDP:SetCurrentAreaID(event_name) | 611 function WDP:SetCurrentAreaID(event_name) |
| 612 local map_area_id = _G.GetCurrentMapAreaID() | |
| 613 | |
| 614 if map_area_id == current_area_id then | |
| 615 return | |
| 616 end | |
| 612 local world_map = _G.WorldMapFrame | 617 local world_map = _G.WorldMapFrame |
| 613 local map_visible = world_map:IsVisible() | 618 local map_visible = world_map:IsVisible() |
| 614 local map_area_id = _G.GetCurrentMapAreaID() | |
| 615 local sfx_value = _G.tonumber(_G.GetCVar("Sound_EnableSFX")) | 619 local sfx_value = _G.tonumber(_G.GetCVar("Sound_EnableSFX")) |
| 616 | 620 |
| 617 if not map_visible then | 621 if not map_visible then |
| 618 _G.SetCVar("Sound_EnableSFX", 0) | 622 _G.SetCVar("Sound_EnableSFX", 0) |
| 619 world_map:Show() | 623 world_map:Show() |
