This repository has been archived by the owner on Sep 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
150 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
local _, SimpleAutoCombatLog = ...; | ||
|
||
L = SimpleAutoCombatLog.L; | ||
|
||
SimpleAutoCombatLog.Zones = { | ||
["ZoneOnly"] = { -- Only Zone must be entered | ||
L["The Molten Core"], | ||
L["Blackwing Lair"], | ||
L["Onyxia's Lair"], | ||
L["Ruins of Ahn'Qiraj"], | ||
L["Ahn'Qiraj"], | ||
L["Zul'Gurub"], | ||
L["Naxxramas"], | ||
}, | ||
["ZoneAndMob"] = { -- A Zone must be entered and a Mob must be targeted | ||
["Zones"] = { | ||
L["Duskwood"], | ||
L["Hinterlands"], | ||
L["Feralas"], | ||
L["Ashenvale"], | ||
L["Blasted Lands"], | ||
L["Azshara"], | ||
}, | ||
["Mobs"] = { | ||
L["Emeriss"], | ||
L["Lethon"], | ||
L["Ysondre"], | ||
L["Taerar "], | ||
L["Doomlord Kazzak"], | ||
L["Azuregos"], | ||
} | ||
} | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
local _, SimpleAutoCombatLog = ...; | ||
|
||
SimpleAutoCombatLog.L = {}; | ||
|
||
local function defaultFunc(L, key) | ||
-- If this function was called, we have no localization for this key. | ||
-- We could complain loudly to allow localizers to see the error of their ways, | ||
-- but, for now, just return the key as its own localization. This allows you to—avoid writing the default localization out explicitly. | ||
return key; | ||
end | ||
setmetatable(SimpleAutoCombatLog.L, {__index=defaultFunc}); | ||
|
||
if GetLocale() == "deDE" then | ||
-- Zones | ||
SimpleAutoCombatLog.L["The Molten Core"] = "Der Geschmolzene Kern"; | ||
SimpleAutoCombatLog.L["Onyxia's Lair"] = "Onyxias Hort"; | ||
SimpleAutoCombatLog.L["Blackwing Lair"] = "Pechschwingenhort"; | ||
SimpleAutoCombatLog.L["Ruins of Ahn'Qiraj"] = "Ruinen von Ahn'Qiraj"; | ||
SimpleAutoCombatLog.L["Ahn'Qiraj"] = "Ahn'Qiraj"; | ||
SimpleAutoCombatLog.L["Zul'Gurub"] = "Zul'Gurub"; | ||
SimpleAutoCombatLog.L["Naxxramas"] = "Naxxramas"; | ||
|
||
SimpleAutoCombatLog.L["Azshara"] = "Azshara"; | ||
SimpleAutoCombatLog.L["Blasted Lands"] = "Verwüstete Lande"; | ||
SimpleAutoCombatLog.L["Hinterlands"] = "Hinterland"; | ||
SimpleAutoCombatLog.L["Ashenvale"] = "Ashenvale"; | ||
SimpleAutoCombatLog.L["Feralas"] = "Feralas"; | ||
SimpleAutoCombatLog.L["Duskwood"] = "Dämmerwald"; | ||
|
||
-- Text | ||
SimpleAutoCombatLog.L["Combatlog enabled"] = "Kampflog aktiviert"; | ||
SimpleAutoCombatLog.L["Combatlog disabled"] = "Kampflog deaktiviert"; | ||
|
||
-- Mobs | ||
SimpleAutoCombatLog.L["Emeriss"] = "Emeriss"; | ||
SimpleAutoCombatLog.L["Lethon"] = "Lethon"; | ||
SimpleAutoCombatLog.L["Ysondre"] = "Ysondre"; | ||
SimpleAutoCombatLog.L["Taerar"] = "Taerar"; | ||
SimpleAutoCombatLog.L["Lord Kazzak"] = "Lord Kazzak"; | ||
SimpleAutoCombatLog.L["Azuregos"] = "Azuregos"; | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
local addonName, SimpleAutoCombatLog = ...; | ||
|
||
local EventHandler = CreateFrame("Frame"); | ||
local LookForMob = false; | ||
|
||
EventHandler:RegisterEvent("ZONE_CHANGED_NEW_AREA"); | ||
EventHandler:RegisterEvent("PLAYER_TARGET_CHANGED"); | ||
|
||
EventHandler:SetScript("OnEvent", function(self, event, ...) | ||
|
||
if event == "ZONE_CHANGED_NEW_AREA" then | ||
SimpleAutoCombatLog:OnZoneChanged(...); | ||
elseif LookForMob and event == "PLAYER_TARGET_CHANGED" then | ||
SimpleAutoCombatLog:OnTargetChanged(...); | ||
end | ||
end); | ||
|
||
|
||
function SimpleAutoCombatLog:OnZoneChanged(...) | ||
local zone = GetRealZoneText(); | ||
|
||
if self:IsInList( self.Zones.ZoneOnly, zone ) then -- No Mob needs to be tagged | ||
self:StartLog(); | ||
elseif self:IsInList( self.Zones.ZoneAndMob.Zones, zone ) then -- No Mobs need to be tagged | ||
LookForMob = true; | ||
else | ||
self:StopLog(); | ||
LookForMob = false; | ||
end | ||
|
||
end | ||
|
||
function SimpleAutoCombatLog:OnTargetChanged(...) | ||
local name = UnitName("target"); | ||
if self:IsInList( self.Zones.ZoneAndMob.Mobs, name ) then | ||
self:StartLog(); | ||
end | ||
end | ||
|
||
function SimpleAutoCombatLog:StartLog() | ||
if not LoggingCombat() then | ||
LoggingCombat(true); | ||
print("|cffffff00".. L["Combatlog enabled"] .."|r"); | ||
SetCVar("advancedCombatLogging", 1); | ||
end | ||
|
||
end | ||
|
||
function SimpleAutoCombatLog:StopLog() | ||
if LoggingCombat() then | ||
LoggingCombat(false); | ||
print("|cffffff00".. L["Combatlog disabled"] .."|r"); | ||
end | ||
end | ||
|
||
function SimpleAutoCombatLog:IsInList( list, search_value ) | ||
for _, value in pairs( list ) do | ||
if value == search_value then | ||
return true; | ||
end | ||
end | ||
return false; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
## Interface: 11302 | ||
## Title: |cff00ccffSimpleAutoCombatLog|r | ||
## Author: |cff00ccffKessedy|r | ||
## Version: 1.0 | ||
## Notes: Automatically starts /combatlog for raids | ||
|
||
Localization.lua | ||
Config.lua | ||
SimpleAutoCombatLog.lua |