interface enhancements

esorochinskiy [06-07-22 - 08:23]
interface enhancements
Filename
.gitignore
WellEater.lua
WellEater.txt
diff --git a/.gitignore b/.gitignore
index b1565ac..7098a27 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,7 @@
 # Learn more about .gitignore:
 #     https://www.atlassian.com/git/tutorials/saving-changes/gitignore

+.gitignore
 # Compiled Java class files
 *.class
 *.jar
diff --git a/WellEater.lua b/WellEater.lua
index 0e62f9a..ae524bf 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.2"
+WellEater.Version = "1.0.3"
 WellEater.Author = "|c5EFFF5esorochinskiy|r"
 local NAMESPACE = {}
 NAMESPACE.settingsDefaults = {
@@ -120,6 +120,13 @@ NAMESPACE.skillUpItems = {
 }

 -- local functions
+
+local function hideOut()
+        WellEater.AnimOut:PlayFromStart()
+        WellEater.WeaponAnimOut:PlayFromStart()
+        WellEaterIndicator:SetHidden(true)
+end
+
 local function getActiveFoodBuff(abilityId)
     if NAMESPACE.blackList[abilityId] then
         return false
@@ -196,6 +203,8 @@ local function processAutoEat()
                                 WellEaterIndicatorLabel:SetText(formattedName)
                                 WellEater.AnimIn:PlayFromStart()
                                 WellEaterIndicator:SetHidden(false)
+                                zo_callLater(hideOut, 1000)
+
                             end
                             df("[%s] %s", WellEater.AddonName, formattedName)
                         end
@@ -246,6 +255,7 @@ local function checkEquippedWeapon()
                                 WellEaterIndicatorWeaponLabel:SetText(formattedName)
                                 WellEater.WeaponAnimIn:PlayFromStart()
                                 WellEaterIndicator:SetHidden(false)
+                                zo_callLater(hideOut, 1000)
                             end
                             break
                         end
@@ -273,11 +283,6 @@ local function TimersUpdate()

         haveFood = (bFood and (foodQuantity > 0))
         if haveFood then
-            if not WellEaterIndicator:IsHidden() then
-                WellEater.AnimOut:PlayFromStart()
-                WellEater.WeaponAnimOut:PlayFromStart()
-                WellEaterIndicator:SetHidden(true)
-            end
             --d(WellEater.AddonName .. "fq = " .. foodQuantity)
             break
         end
diff --git a/WellEater.txt b/WellEater.txt
index f71d1a4..2659742 100644
--- a/WellEater.txt
+++ b/WellEater.txt
@@ -31,7 +31,7 @@
 ## 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.2
+## Version: 1.0.3
 ## SavedVariables: WellEater_Settings
 ## DependsOn: LibAddonMenu-2.0>=28