castbar: use locale independent combat log parsing

This commit is contained in:
shagu
2017-02-05 00:11:53 +01:00
parent d43fdc7a3d
commit 4b5926d9b8
7 changed files with 32 additions and 52 deletions
-9
View File
@@ -36,15 +36,6 @@ pfLocaleShift["deDE"] = {
['wantBattleBerserkStance'] = "Muss in Kampfhaltung, Berserkerhaltung sein.",
}
pfLocaleSpellEvents["deDE"] = {
['SPELL_GAINS'] = "(.+) bekommt (.+).",
['SPELL_CAST'] = "(.+) beginnt (.+) zu wirken.",
['SPELL_PERFORM'] = "(.+) beginnt (.+) auszuf\195\188hren.",
['SPELL_AFFLICTED'] = "(.+) ist von (.+) betroffen.",
['SPELL_HIT'] = "(.+) von Euch trifft (.+) f\195\188r %d+\.",
['OTHER_SPELL_HIT'] = "%a+'s (.+) trifft (.+) f\195\188r %d+\.",
}
pfLocaleSpellInterrupts["deDE"] = {
["Schildhieb"] = true;
["Zuschlagen"] = true;
-9
View File
@@ -36,15 +36,6 @@ pfLocaleShift["enUS"] = {
['wantBattleBerserkStance'] = "Must be in Battle Stance, Berserker Stance",
}
pfLocaleSpellEvents["enUS"] = {
['SPELL_GAINS'] = "(.+) gains (.+).",
['SPELL_CAST'] = "(.+) begins to cast (.+).",
['SPELL_PERFORM'] = "(.+) begins to perform (.+).",
['SPELL_AFFLICTED'] = "(.+) %a+ afflicted by (.+).",
['SPELL_HIT'] = "Your (.+) %a%a?its (.+) for %d+\.",
['OTHER_SPELL_HIT'] = "%a+'s (.+) %a%a?its (.+) for %d+\.",
}
pfLocaleSpellInterrupts["enUS"] = {
["Shield Bash"] = true;
["Pummel"] = true;
-9
View File
@@ -36,15 +36,6 @@ pfLocaleShift["frFR"] = {
['wantBattleBerserkStance'] = "Requiert Posture de combat, Posture berserker",
}
pfLocaleSpellEvents["frFR"] = {
['SPELL_GAINS'] = "(.+) gagne (.+).",
['SPELL_CAST'] = "(.+) commence \195\160 incanter (.+).",
['SPELL_PERFORM'] = "(.+) commence \195\160 effectuer (.+).",
['SPELL_AFFLICTED'] = "(.+) %a+ affligé par (.+).",
['SPELL_HIT'] = "Votre (.+) touche (.+) pour %d+\.",
['OTHER_SPELL_HIT'] = "(.+) de %a+ touche (.+) pour %d+\.",
}
pfLocaleSpellInterrupts["frFR"] = {
["Coup de bouclier"] = true;
["Volée de coups"] = true;
-9
View File
@@ -36,15 +36,6 @@ pfLocaleShift["ruRU"] = {
['wantBattleBerserkStance'] = "Необходимо находиться в Боевая стойка, Стойка берсерка.",
}
pfLocaleSpellEvents["ruRU"] = {
['SPELL_GAINS'] = "(.+) получает эффект \"(.+)\".",
['SPELL_CAST'] = "(.+) начинает использовать \"(.+)\".",
['SPELL_PERFORM'] = "(.+) начинает выполнять действие \"(.+)\".",
['SPELL_AFFLICTED'] = "(.+) находится под воздействием эффекта \"(.+)\".",
['SPELL_HIT'] = "Ваше заклинание \"(.+)\" наносит (.+) %d+\ед. урона.",
['OTHER_SPELL_HIT'] = "\"%2$s\" %1$s наносит %3$s %4$d ед. урона.",
}
pfLocaleSpellInterrupts["ruRU"] = {
["Удар щитом"] = true;
["Зуботычина"] = true;
-9
View File
@@ -36,15 +36,6 @@ pfLocaleShift["zhCN"] = {
['wantBattleBerserkStance'] = "必须在战斗姿态, 狂暴姿态中",
}
pfLocaleSpellEvents["zhCN"] = {
['SPELL_GAINS'] = "(.+)获得了(.+)的效果",
['SPELL_CAST'] = "(.+)开始施放(.+)",
['SPELL_PERFORM'] = "(.+)开始施展(.+)",
['SPELL_AFFLICTED'] = "(.+)受到了(.+)效果的影响",
['SPELL_HIT'] = "你的(.+)使(.+)受到了(.+)。",
['OTHER_SPELL_HIT'] = "(.+)的(.+)击中(.+)造成(.+)",
}
pfLocaleSpellInterrupts["zhCN"] = {
["盾击"] = true;
["拳击"] = true;
+32 -6
View File
@@ -294,6 +294,24 @@ pfUI:RegisterModule("castbar", function ()
end
end)
-- Parse localized combatlog strings available in globalstrings.lua:
-- SPELL_CAST: (.+) begins to cast (.+).
-- SPELL_PERFORM: (.+) begins to perform (.+).
-- SPELL_GAINS: (.+) gains (.+).
-- SPELL_AFFLICTED: (.+) %a+ afflicted by (.+).
-- SPELL_HIT: Your (.+) %a hits (.+) for %d+\.
-- SPELL_CRIT: Your (.+) %a crits (.+) for %d+\.
-- OTHER_SPELL_HIT: %a+'s (.+) %a hits (.+) for %d+\.
-- OTHER_SPELL_CRIT: %a+'s (.+) %a crits (.+) for %d+\.
pfUI.castbar.target.SPELL_CAST = string.gsub(string.gsub(SPELLCASTOTHERSTART,"%d%$",""), "%%s", "(.+)")
pfUI.castbar.target.SPELL_PERFORM = string.gsub(string.gsub(SPELLPERFORMOTHERSTART,"%d%$",""), "%%s", "(.+)")
pfUI.castbar.target.SPELL_GAINS = string.gsub(string.gsub(AURAADDEDOTHERHELPFUL,"%d%$",""), "%%s", "(.+)")
pfUI.castbar.target.SPELL_AFFLICTED = string.gsub(string.gsub(AURAADDEDOTHERHARMFUL,"%d%$",""), "%%s", "(.+)")
pfUI.castbar.target.SPELL_HIT = string.gsub(string.gsub(string.gsub(SPELLLOGSELFOTHER,"%d%$",""),"%%d","%%d+"),"%%s","(.+)")
pfUI.castbar.target.SPELL_CRIT = string.gsub(string.gsub(string.gsub(SPELLLOGCRITSELFOTHER,"%d%$",""),"%%d","%%d+"),"%%s","(.+)")
pfUI.castbar.target.OTHER_SPELL_HIT = string.gsub(string.gsub(string.gsub(SPELLLOGOTHEROTHER,"%d%$",""), "%%s", "(.+)"), "%%d", "%%d+")
pfUI.castbar.target.OTHER_SPELL_CRIT = string.gsub(string.gsub(string.gsub(SPELLLOGOTHEROTHER,"%d%$",""), "%%s", "(.+)"), "%%d", "%%d+")
pfUI.castbar.target:RegisterEvent("CHAT_MSG_SPELL_SELF_DAMAGE")
pfUI.castbar.target:RegisterEvent("CHAT_MSG_SPELL_HOSTILEPLAYER_DAMAGE")
pfUI.castbar.target:RegisterEvent("CHAT_MSG_SPELL_HOSTILEPLAYER_BUFF")
@@ -318,29 +336,37 @@ pfUI:RegisterModule("castbar", function ()
pfUI.castbar.target:SetScript("OnEvent", function()
if (arg1 ~= nil) then
-- cast action
for mob, spell in string.gfind(arg1, pfLocaleSpellEvents[pfUI.cache["locale"]]['SPELL_CAST']) do
for mob, spell in string.gfind(arg1, pfUI.castbar.target.SPELL_CAST) do
pfUI.castbar.target:Action(mob, spell)
return
end
for mob, spell in string.gfind(arg1, pfLocaleSpellEvents[pfUI.cache["locale"]]['SPELL_PERFORM']) do
for mob, spell in string.gfind(arg1, pfUI.castbar.target.SPELL_PERFORM) do
pfUI.castbar.target:Action(mob, spell)
return
end
-- interrupt action
for mob, spell in string.gfind(arg1, pfLocaleSpellEvents[pfUI.cache["locale"]]['SPELL_GAINS']) do
for mob, spell in string.gfind(arg1, pfUI.castbar.target.SPELL_GAINS) do
pfUI.castbar.target:StopAction(mob, spell)
return
end
for mob, spell in string.gfind(arg1, pfLocaleSpellEvents[pfUI.cache["locale"]]['SPELL_AFFLICTED']) do
for mob, spell in string.gfind(arg1, pfUI.castbar.target.SPELL_AFFLICTED) do
pfUI.castbar.target:StopAction(mob, spell)
return
end
for spell, mob in string.gfind(arg1, pfLocaleSpellEvents[pfUI.cache["locale"]]['SPELL_HIT']) do
for spell, mob in string.gfind(arg1, pfUI.castbar.target.SPELL_HIT) do
pfUI.castbar.target:StopAction(mob, spell)
return
end
for spell, mob in string.gfind(arg1, pfLocaleSpellEvents[pfUI.cache["locale"]]['OTHER_SPELL_HIT']) do
for spell, mob in string.gfind(arg1, pfUI.castbar.target.SPELL_CRIT) do
pfUI.castbar.target:StopAction(mob, spell)
return
end
for spell, mob in string.gfind(arg1, pfUI.castbar.target.OTHER_SPELL_HIT) do
pfUI.castbar.target:StopAction(mob, spell)
return
end
for spell, mob in string.gfind(arg1, pfUI.castbar.target.OTHER_SPELL_CRIT) do
pfUI.castbar.target:StopAction(mob, spell)
return
end
-1
View File
@@ -32,7 +32,6 @@ pfLocaleBagtypes = {}
pfLocaleInvtypes = {}
pfLocaleShift = {}
pfLocaleSpells = {}
pfLocaleSpellEvents = {}
pfLocaleSpellInterrupts = {}
pfLocaleHunterbars = {}