BattleHerald_NextScoreAlert = 0; -- In seconds, when's the next score alert? |
BattleHerald_ScoreElapsed = 0; |
|
BattleHerald_ScoreModules = { |
["Arathi Basin"] = { |
GetAllianceScore = function() |
local _, state, _, text = GetWorldStateUIInfo(1); |
return tonumber(strsub(text, strfind(text, "Resources: ")+11, strfind(text, "/1600")-1)); |
end, |
GetHordeScore = function() |
local _, state, _, text = GetWorldStateUIInfo(2); |
return tonumber(strsub(text, strfind(text, "Resources: ")+11, strfind(text, "/1600")-1)); |
end, |
GetPointsSoundKeys = function() |
return "GENERAL", "RESOURCES"; |
end, |
GetPointsText = function() |
return BHSTR_RESOURCES; |
end |
}, |
["Alterac Valley"] = { |
GetAllianceScore = function() |
local _, state, _, text = GetWorldStateUIInfo(1); |
return tonumber(strsub(text, strfind(text, "Reinforcements: ")+16)); |
end, |
GetHordeScore = function() |
local _, state, _, text = GetWorldStateUIInfo(2); |
return tonumber(strsub(text, strfind(text, "Reinforcements: ")+16)); |
end, |
GetPointsSoundKeys = function() |
return "GENERAL", "REINFORCEMENTS"; |
end, |
GetPointsText = function() |
return BHSTR_REINFORCEMENTS; |
end |
}, |
["Isle of Conquest"] = { |
GetAllianceScore = function() |
local _, state, _, text = GetWorldStateUIInfo(1); |
return tonumber(strsub(text, strfind(text, "Reinforcements: ")+16)); |
end, |
GetHordeScore = function() |
local _, state, _, text = GetWorldStateUIInfo(2); |
return tonumber(strsub(text, strfind(text, "Reinforcements: ")+16)); |
end, |
GetPointsSoundKeys = function() |
return "GENERAL", "REINFORCEMENTS"; |
end, |
GetPointsText = function() |
return BHSTR_REINFORCEMENTS; |
end |
}, |
["The Battle for Gilneas"] = { |
GetAllianceScore = function() |
local _, state, _, text = GetWorldStateUIInfo(1); |
return tonumber(strsub(text, strfind(text, "Resources: ")+11, strfind(text, "/1600")-1)); |
end, |
GetHordeScore = function() |
local _, state, _, text = GetWorldStateUIInfo(2); |
return tonumber(strsub(text, strfind(text, "Resources: ")+11, strfind(text, "/1600")-1)); |
end, |
GetPointsSoundKeys = function() |
return "GENERAL", "RESOURCES"; |
end, |
GetPointsText = function() |
return BHSTR_RESOURCES; |
end |
}, |
["Eye of the Storm"] = { |
GetAllianceScore = function() |
local _, state, _, text = GetWorldStateUIInfo(2); |
return tonumber(strsub(text, strfind(text, "Victory Points: ")+16, strfind(text, "/1600")-1)); |
end, |
GetHordeScore = function() |
local _, state, _, text = GetWorldStateUIInfo(3); |
return tonumber(strsub(text, strfind(text, "Victory Points: ")+16, strfind(text, "/1600")-1)); |
end, |
GetPointsSoundKeys = function() |
return "GENERAL", "POINTS"; |
end, |
GetPointsText = function() |
return BHSTR_POINTS; |
end |
} |
} |
|
function BattleHerald_InitializeScoreFrame() |
|
CreateFrame("Frame", "BattleHerald_ScoreMonitorFrame"); |
BattleHerald_ScoreMonitorFrame:Hide(); |
BattleHerald_ScoreMonitorFrame:RegisterEvent("PLAYER_ENTERING_BATTLEGROUND"); |
BattleHerald_ScoreMonitorFrame:RegisterEvent("PLAYER_ENTERING_WORLD"); |
BattleHerald_ScoreMonitorFrame:SetScript("OnEvent", BattleHerald_ScoreMonitorEvent); |