1.1.6

esorochinskiy [10-18-22 - 13:47]
1.1.6
Filename
WellEater.lua
WellEater.txt
lang/de.lua
lang/en.lua
lang/ru.lua
diff --git a/WellEater.lua b/WellEater.lua
index 15169d3..e4bdfb7 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.1.5"
+WellEater.Version = "1.1.6"
 WellEater.Author = "|c5EFFF5esorochinskiy|r"
 local NAMESPACE = {}
 NAMESPACE.settingsDefaults = {
@@ -267,15 +267,17 @@ local function processAutoEat()
                     local usable, onlyFromActionSlot = IsItemUsable(bagId, slotId)
                     if usable and not onlyFromActionSlot then

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

-                        if formattedName and abilityDescription then
+                        tryToUseItem(bagId, slotId)
+                        if formattedName and chatFormattedName and abilityDescription then
                             NAMESPACE.notifications.formattedName = formattedName
+                            NAMESPACE.notifications.chatFormattedName = chatFormattedName
                             NAMESPACE.notifications.abilityDescription = abilityDescription
                         end

@@ -330,17 +332,25 @@ local function checkAndRepair()
                     if not itemInfo.stolen and IsItemNonGroupRepairKit(BAG_BACKPACK, slotId) then
                         local locale = WellEater:getLocale()
                         local formattedName
+                        local chatFormattedName
                         if IsItemNonCrownRepairKit(BAG_BACKPACK, slotId) then
-                            RepairItemWithRepairKit(BAG_WORN, testSlot, BAG_BACKPACK, slotId)
                             local iName = GetItemLinkName(GetItemLink(BAG_WORN, testSlot))
-                            formattedName = zo_strformat(locale.youRepair, iName) -- no control codes
+                            formattedName = zo_strformat(locale.youRepairScreen, iName) -- no control codes
+                            chatFormattedName = zo_strformat(locale.youRepair,
+                                    GetItemLink(BAG_WORN, testSlot, LINK_STYLE_BRACKETS),
+                                    GetItemLink(BAG_BACKPACK, slotId, LINK_STYLE_BRACKETS)
+                            )
+                            RepairItemWithRepairKit(BAG_WORN, testSlot, BAG_BACKPACK, slotId)
+
                         elseif locSettings.useCrownRepair then
-                            tryToUseItem(BAG_BACKPACK, slotId)
                             formattedName = locale.allRepair
+                            chatFormattedName = zo_strformat(locale.allRepairScreen,
+                                    GetItemLink(BAG_BACKPACK, slotId, LINK_STYLE_BRACKETS))
+                            tryToUseItem(BAG_BACKPACK, slotId)
                             wasCrownUsed = true
                         end
-                        if formattedName then
-                            df("[%s] %s", WellEater.AddonName, formattedName)
+                        if formattedName and chatFormattedName then
+                            df("[%s] %s", WellEater.AddonName, chatFormattedName)
                             local toScreen = locSettings.notifyToScreen
                             if toScreen then
                                 WellEater.WeaponAnimIn:PlayFromStart()
@@ -412,11 +422,15 @@ local function checkEquippedWeapon()
                         local useThis = (specializedItemType ~= SPECIALIZED_ITEMTYPE_CROWN_ITEM or
                                 (useCrownGems and specializedItemType == SPECIALIZED_ITEMTYPE_CROWN_ITEM))
                         if useThis then
-                            ChargeItemWithSoulGem(BAG_WORN, testSlot, BAG_BACKPACK, slotId)
                             local iName = GetItemLinkName(GetItemLink(BAG_WORN, testSlot))
                             local locale = WellEater:getLocale()
                             local formattedName = zo_strformat(locale.youCharge, iName) -- no control codes
-                            df("[%s] %s", WellEater.AddonName, formattedName)
+                            local chatFormattedName = zo_strformat(locale.youChargeScreen,
+                                    GetItemLink(BAG_WORN, testSlot, LINK_STYLE_BRACKETS),
+                                    GetItemLink(BAG_BACKPACK, slotId, LINK_STYLE_BRACKETS)
+                            )
+                            ChargeItemWithSoulGem(BAG_WORN, testSlot, BAG_BACKPACK, slotId)
+                            df("[%s] %s", WellEater.AddonName, chatFormattedName)
                             local toScreen = locSettings.notifyToScreen
                             if toScreen then
                                 WellEater.WeaponAnimIn:PlayFromStart()
@@ -461,6 +475,7 @@ local function TimersUpdate()
         processAutoEat()
     else
         if NAMESPACE.notifications.formattedName and
+                NAMESPACE.notifications.chatFormattedName and
                 NAMESPACE.notifications.abilityDescription then
             local toScreen = WellEater:getUserPreference("notifyToScreen")
             if toScreen then
@@ -471,7 +486,7 @@ local function TimersUpdate()
                     hideOut(WellEaterIndicatorLabel, WellEater.AnimOut)
                 end, 1500)
             end
-            df("[%s] %s", WellEater.AddonName, NAMESPACE.notifications.formattedName)
+            df("[%s] %s", WellEater.AddonName, NAMESPACE.notifications.chatFormattedName)
         end
         NAMESPACE.notifications = {}
     end
diff --git a/WellEater.txt b/WellEater.txt
index b03c913..bc6dd79 100644
--- a/WellEater.txt
+++ b/WellEater.txt
@@ -29,9 +29,9 @@

 ## Title: |cFFFFFFWell |c0099FFEater|r
 ## Author: |c5EFFF5esorochinskiy|r
-## APIVersion: 101033 101034 101035
+## APIVersion: 101033 101034 101035 101036
 ## Description: Auto eat your preferred meals provided by your inventory after food or drink buff expiration. Provides weapon autoload and armor autorepair
-## Version: 1.1.5
+## Version: 1.1.6
 ## SavedVariables: WellEater_Settings
 ## DependsOn: LibAddonMenu-2.0>=28

diff --git a/lang/de.lua b/lang/de.lua
index 694c6b5..2b60238 100644
--- a/lang/de.lua
+++ b/lang/de.lua
@@ -17,9 +17,12 @@ local L = {
             " Weile ohne Nahrung in einer kritischen Situation",

     youEat = "Sie haben <<1>> gegessen",
-    youCharge = "Eingeladen <<1>>",
-    youRepair = "Reparieren <<1>>",
+    youCharge = "Eingeladen <<1>> mit <<2>>",
+    youChargeScreen = "Eingeladen <<1>>",
+    youRepair = "Reparieren <<1>> mit <<2>>",
+    youRepairScreen = "Reparieren <<1>>",
     allRepair = "Alles wird repariert",
+    allRepairScreen = "Alles wird repariert mit <<1>>",
     outputSetupHeader = "Anzeigen die Nachricht",
     outputOnScreen = "Auf den Bildschirm",
     outputSetupHeader_TT = "Wenn die Einstellung aktiviert ist, wird eine Nachricht über das gegessene Gericht" ..
diff --git a/lang/en.lua b/lang/en.lua
index 1273489..1b40580 100644
--- a/lang/en.lua
+++ b/lang/en.lua
@@ -16,9 +16,12 @@ local L = {
             "you can run out of food for a long time in critical situation",

     youEat = "You have eaten <<1>>",
-    youCharge = "Charged <<1>>",
-    youRepair = "Repaired <<1>>",
+    youCharge = "Charged <<1>> with <<2>>",
+    youChargeScreen = "Charged <<1>>",
+    youRepair = "Repaired <<1>> with <<2>>",
+    youRepairScreen = "Repaired <<1>>",
     allRepair = "All repaired",
+    allRepairScreen = "All repaired with <<1>>",
     outputSetupHeader = "notification output",
     outputOnScreen = "On screen",
     outputSetupHeader_TT = "When on the notification about the meal eaten or weapon recharged is written to the screen not only to the debug log",
diff --git a/lang/ru.lua b/lang/ru.lua
index 248239c..0fde2be 100644
--- a/lang/ru.lua
+++ b/lang/ru.lua
@@ -16,10 +16,13 @@ local L = {
             " Большее значение - меньше нагрузка но большая вероятность оказаться без еды на некоторое время" ..
             " в критической ситуации",

-    youEat = "Вы съели: <<1>>",
-    youCharge = "Заряжено <<1>>",
-    youRepair = "Отремонтировано <<1>>",
+    youEat = "Вы съели <<1>>",
+    youCharge = "Заряжено <<1>> при помощи <<2>>",
+    youChargeScreen = "Заряжено <<1>>",
+    youRepair = "Отремонтировано <<1>> при помощи <<2>>",
+    youRepairScreen = "Отремонтировано <<1>>",
     allRepair = "Все отремонтировано",
+    allRepairScreen = "Все отремонтировано при помощи <<1>>",
     outputSetupHeader = "Вывод сообщения",
     outputOnScreen = "На экран",
     outputSetupHeader_TT = "При включенной настройке сообщение о съеденном блюде или перезарядке оружия будет выведено на экран, а не только" ..