--[[ Raid Light v0.1 An in-game indicator for entering dungeons Part of DKP Raid Organizer Author: James Pickup (Derendai.Shadow Moon) ]] RaidLight_Instances = { "Blackfathom Deeps", "Blackrock Depths", "Blackrock Spire", "Dire Maul", "Mauradon", "Molten Core", "Onyxia's Lair", "Scarlet Monastery", "Scholomance", "Stratholme", "The Deadmines", "The Stockades", "The Temple of Atal'hakkar", "Wailing Caverns", }; RaidLight_UpdateEvents = { "ZONE_CHANGE", "VARIABLES_LOADED", "PLAYER_ENTERING_WORLD" }; local raidLight = false; function RaidLight_OnEvent() for k, v in RaidLight_UpdateEvents do if ( event == v ) then UpdateRaidLight(); break; end end end function RaidLight_OnLoad() DEFAULT_CHAT_FRAME:AddMessage("RaidLight Loaded."); for k, v in RaidLight_UpdateEvents do this:RegisterEvent(v); end end function RaidLight_IsInInstance() local currentZone = GetRealZoneText(); if ( currentZone ) then for k, v in RaidLight_Instances do if ( v == currentZone ) then return true; end end end return false; end function UpdateRaidLight() local RaidLight_Button = getglobal("RaidLightMinimapButton"); if ( not RaidLight_Button ) then return; end raidLight = RaidLight_IsInInstance(); RaidLight_Button:Show(); if(raidLight == true) then RaidLightMinimapButton:SetNormalTexture("Interface\\AddOns\\DKPRaidOrg\\RaidLight\\Img\\LightGreen") elseif(raidLight == false) then RaidLightMinimapButton:SetNormalTexture("Interface\\AddOns\\DKPRaidOrg\\RaidLight\\Img\\LightGrey") else if ( not RaidLight-Error ) then RaidLight-Error = "RaidLight has encountered a logic bug. Please turn it off."); end DEFAULT_CHAT_FRAME:AddMessage(RaidLight-Error); end end