From 543ed14eb976cad753c846ddb01e41a9f22435e8 Mon Sep 17 00:00:00 2001 From: Kevin Lyles Date: Sat, 20 Jul 2013 09:10:55 -0500 Subject: [PATCH] Handle newly-learned professions --- Locales/enUS/base.lua | 5 +++-- WeightsWatcher.lua | 10 +++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Locales/enUS/base.lua b/Locales/enUS/base.lua index 9748a15..b88d4f5 100644 --- a/Locales/enUS/base.lua +++ b/Locales/enUS/base.lua @@ -154,8 +154,9 @@ L["Quiver"] = "Quiver" L["Gem"] = "Gem" L["Consumable"] = "Consumable" L["Recipe"] = "Recipe" -L["PROF_SKILL_UP"] = "^Your skill in ([A-Z][A-Za-z '-]+) has increased to (%d+)%.$" -L["REP_CHANGE"] = "^Reputation with ([A-Z][A-Za-z ':-]+) ([di][en]creased) by (%d+)%." +L["PROF_NEW"] = "^You have gained the ([A-Z][%a '-]+) skill%.$" +L["PROF_SKILL_UP"] = "^Your skill in ([A-Z][%a '-]+) has increased to (%d+)%.$" +L["REP_CHANGE"] = "^Reputation with ([A-Z][%a ':-]+) ([di][en]creased) by (%d+)%." L["increased"] = "increased" -- weights.lua diff --git a/WeightsWatcher.lua b/WeightsWatcher.lua index 437239b..141e5ce 100644 --- a/WeightsWatcher.lua +++ b/WeightsWatcher.lua @@ -332,7 +332,15 @@ function WeightsWatcher:eventHandler(event, message, ...) WeightsWatcher.ResetEnchantCache() end else - populateProfessions() + skill = message:match(L["PROF_NEW"]) + if skill then + if WeightsWatcher.player.professions[skill] then + WeightsWatcher.player.professions[skill] = 1 + WeightsWatcher.ResetEnchantCache() + end + else + populateProfessions() + end end elseif event == "CHAT_MSG_COMBAT_FACTION_CHANGE" then -- "Reputation with X (in|de)creased by y." -- 1.7.9.5