bug on EVENT_PLAYER_ACTIVATED fix

esorochinskiy [06-10-22 - 07:45]
bug on EVENT_PLAYER_ACTIVATED fix
Filename
WellEater.lua
WellEater.txt
lang/de.lua
lang/en.lua
lang/ru.lua
diff --git a/WellEater.lua b/WellEater.lua
index 4919661..8ad7abd 100644
--- a/WellEater.lua
+++ b/WellEater.lua
@@ -2,7 +2,7 @@ WellEater = WellEater or {}
 WellEater.WELLEATER_SAVED_VERSION = 1
 WellEater.AddonName = "WellEater"
 WellEater.DisplayName = "|cFFFFFFWell |c0099FFEater|r"
-WellEater.Version = "1.0.5"
+WellEater.Version = "1.0.6"
 WellEater.Author = "|c5EFFF5esorochinskiy|r"
 local NAMESPACE = {}
 NAMESPACE.settingsDefaults = {
@@ -24,6 +24,7 @@ NAMESPACE.settingsDefaults = {
     minCharges = 300,
 }
 NAMESPACE.conversation = false
+NAMESPACE.notifications = {}

 function WellEater:isWeaponCheckable()
     local settings = self:getAllUserPreferences()
@@ -194,27 +195,18 @@ local function processAutoEat()
                     local usable, onlyFromActionSlot = IsItemUsable(bagId, slotId)
                     if usable and not onlyFromActionSlot then

+                        tryToUseItem(bagId, slotId)
+
                         local itemLink = GetItemLink(bagId, slotId)
-                        local hasAbility, abilityHeader, abilityDescription = GetItemLinkOnUseAbilityInfo(itemLink)
+                        local _, _, abilityDescription = GetItemLinkOnUseAbilityInfo(itemLink)
                         local locale = WellEater:getLocale()
                         local formattedName = zo_strformat(locale.youEat, GetItemLinkName(itemLink)) -- no control codes

                         if formattedName and abilityDescription then
-                            local toScreen = locSettings.notifyToScreen
-                            if toScreen then
-                                WellEater.AnimIn:PlayFromStart()
-                                WellEaterIndicator:SetHidden(false)
-                                WellEaterIndicatorLabel:SetText(formattedName)
-                                zo_callLater(function()
-                                    hideOut(WellEaterIndicatorLabel, WellEater.AnimOut)
-                                end, 1500)
-
-                            end
-                            df("[%s] %s", WellEater.AddonName, formattedName)
+                            NAMESPACE.notifications.formattedName = formattedName
+                            NAMESPACE.notifications.abilityDescription = abilityDescription
                         end

-                        tryToUseItem(bagId, slotId)
-
                         break
                     end
                 end
@@ -296,6 +288,21 @@ local function TimersUpdate()
     if not haveFood then
         --d(WellEater.AddonName .. " Time To Eat")
         processAutoEat()
+    else
+        if NAMESPACE.notifications.formattedName and
+                NAMESPACE.notifications.abilityDescription then
+            local toScreen = WellEater:getUserPreference("notifyToScreen")
+            if toScreen then
+                WellEater.AnimIn:PlayFromStart()
+                WellEaterIndicator:SetHidden(false)
+                WellEaterIndicatorLabel:SetText(formattedName)
+                zo_callLater(function()
+                    hideOut(WellEaterIndicatorLabel, WellEater.AnimOut)
+                end, 1500)
+            end
+            df("[%s] %s", WellEater.AddonName, formattedName)
+        end
+        NAMESPACE.notifications = {}
     end

     local isCheckable = WellEater:isWeaponCheckable()
diff --git a/WellEater.txt b/WellEater.txt
index ef149d8..8bd0a06 100644
--- a/WellEater.txt
+++ b/WellEater.txt
@@ -30,8 +30,8 @@
 ## Title: |cFFFFFFWell |c0099FFEater|r
 ## Author: |c5EFFF5esorochinskiy|r
 ## APIVersion: 101033 101034
-## Description: Auto eat your preferred meals provided by your inventory after food or drink buff expiration.
-## Version: 1.0.5
+## Description: Auto eat your preferred meals provided by your inventory after food or drink buff expiration. Provides weapon autoload
+## Version: 1.0.6
 ## SavedVariables: WellEater_Settings
 ## DependsOn: LibAddonMenu-2.0>=28

diff --git a/lang/de.lua b/lang/de.lua
index 8e3355c..e111d9d 100644
--- a/lang/de.lua
+++ b/lang/de.lua
@@ -1,6 +1,7 @@
 WellEater = WellEater or {}
 local L = {
-    generalSetupDescription = "Lässt es Ihnen, nach die Essen- oder Trinken-Bufffs auslaufen, im Inventar gefundene Gericht automatisch essen",
+    generalSetupDescription = "Lässt es Ihnen, nach die Essen- oder Trinken-Bufffs auslaufen, im Inventar" ..
+            " gefundene Gericht automatisch essen. Auch gibt es eine Waffenautoeinladung",
     foodQualityHeader = "Die Qualität der suchenden Lebensmittel",
     foodQualityDescription = "Lasst die Qualität der Lebensmittel auswahlen",
     foods = {
diff --git a/lang/en.lua b/lang/en.lua
index 7d0f980..a6eda5d 100644
--- a/lang/en.lua
+++ b/lang/en.lua
@@ -1,6 +1,7 @@
 WellEater = WellEater or {}
 local L = {
-    generalSetupDescription = "Auto eat your preferred meals provided by your inventory after food or drink buff expiration",
+    generalSetupDescription = "Auto eat your preferred meals provided by your inventory after" ..
+            " food or drink buff expiration. Provides weapon autoload",
     foodQualityHeader = "Quality of food to search",
     foodQualityDescription = "Allows to choose the quality of the food",
     foods = {
diff --git a/lang/ru.lua b/lang/ru.lua
index adf5a3a..28d57b7 100644
--- a/lang/ru.lua
+++ b/lang/ru.lua
@@ -1,6 +1,7 @@
 WellEater = WellEater or {}
 local L = {
-    generalSetupDescription = "После истечения времени эффектов, которые дает еда, позволяет автоматически съесть найденное в инвентаре блюдо",
+    generalSetupDescription = "После истечения времени эффектов, которые дает еда, позволяет автоматически съесть" ..
+            " найденное в инвентаре блюдо. Автоподзарядка оружия",
     foodQualityHeader = "Качество искомой еды",
     foodQualityDescription = "Позволяет выбрать качество еды",
     foods = {