1.1.1

esorochinskiy [07-16-22 - 16:52]
1.1.1
Filename
UI.lua
WellEater.lua
WellEater.txt
lang/de.lua
lang/en.lua
lang/ru.lua
diff --git a/UI.lua b/UI.lua
index 44a35d4..7eae1c0 100644
--- a/UI.lua
+++ b/UI.lua
@@ -179,6 +179,12 @@ function WellEater:initSettingsMenu()
     }, "general", "useRepair")

     MakeControlEntry(sTable,{
+        type = "checkbox",
+        name = L.useCrownRepairTitle,
+        tooltip = L.useCrownRepairTitle_TT,
+    }, "general", "useCrownRepair")
+
+    MakeControlEntry(sTable,{
         type = "slider",
         name = L.repairPercent,
         tooltip = L.repairPercent,
diff --git a/WellEater.lua b/WellEater.lua
index d647ba7..e9cbec0 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.0"
+WellEater.Version = "1.1.1"
 WellEater.Author = "|c5EFFF5esorochinskiy|r"
 local NAMESPACE = {}
 NAMESPACE.settingsDefaults = {
@@ -25,6 +25,7 @@ NAMESPACE.settingsDefaults = {
     useCrownGems = true,
     useCrownFood = false,
     useRepair = true,
+    useCrownRepair = false,
     percent = 10
 }
 NAMESPACE.conversation = false
@@ -236,7 +237,7 @@ local function checkAndRepair()
     local bagC
     local locSettings = WellEater:getAllUserPreferences()

-    for _,testSlot in pairs(NAMESPACE.wearSlots) do
+    for _, testSlot in pairs(NAMESPACE.wearSlots) do
         local linkId = GetItemLink(BAG_WORN, testSlot)
         if HasItemInSlot(BAG_WORN, testSlot) and DoesItemLinkHaveArmorDecay(linkId) then
             local numPercent = GetItemLinkCondition(linkId)
@@ -252,22 +253,31 @@ local function checkAndRepair()

                 for _, itemInfo in pairs(bagC) do
                     local slotId = itemInfo.slotIndex
-                    if not itemInfo.stolen and IsItemRepairKit(BAG_BACKPACK, slotId) then
-                        RepairItemWithRepairKit(BAG_WORN, testSlot, BAG_BACKPACK, slotId)
-                        local iName = GetItemLinkName(GetItemLink(BAG_WORN, testSlot))
+
+                    if not itemInfo.stolen and IsItemNonGroupRepairKit(BAG_BACKPACK, slotId) then
                         local locale = WellEater:getLocale()
-                        local formattedName = zo_strformat(locale.youRepair, iName) -- no control codes
-                        df("[%s] %s", WellEater.AddonName, formattedName)
-                        local toScreen = locSettings.notifyToScreen
-                        if toScreen then
-                            WellEater.WeaponAnimIn:PlayFromStart()
-                            WellEaterIndicator:SetHidden(false)
-                            WellEaterIndicatorWeaponLabel:SetText(formattedName)
-                            zo_callLater(function()
-                                hideOut(WellEaterIndicatorWeaponLabel, WellEater.WeaponAnimOut)
-                            end, 1500)
+                        local formattedName
+                        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
+                        elseif locSettings.useCrownRepair then
+                            tryToUseItem(BAG_BACKPACK, slotId)
+                            formattedName = locale.allRepair
+                        end
+                        if formattedName then
+                            df("[%s] %s", WellEater.AddonName, formattedName)
+                            local toScreen = locSettings.notifyToScreen
+                            if toScreen then
+                                WellEater.WeaponAnimIn:PlayFromStart()
+                                WellEaterIndicator:SetHidden(false)
+                                WellEaterIndicatorWeaponLabel:SetText(formattedName)
+                                zo_callLater(function()
+                                    hideOut(WellEaterIndicatorWeaponLabel, WellEater.WeaponAnimOut)
+                                end, 1500)
+                            end
+                            break
                         end
-                        break
                     end
                 end
             end
diff --git a/WellEater.txt b/WellEater.txt
index 193440c..3c9259f 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. Provides weapon autoload and armor autorepair
-## Version: 1.1.0
+## Version: 1.1.1
 ## SavedVariables: WellEater_Settings
 ## DependsOn: LibAddonMenu-2.0>=28

diff --git a/lang/de.lua b/lang/de.lua
index 5e1b918..f822d92 100644
--- a/lang/de.lua
+++ b/lang/de.lua
@@ -19,6 +19,7 @@ local L = {
     youEat = "Sie haben <<1>> gegessen",
     youCharge = "Eingeladen <<1>>",
     youRepair = "Reparieren <<1>>",
+    allRepair = "alles",
     outputSetupHeader = "Anzeigen die Nachricht",
     outputOnScreen = "Auf den Bildschirm",
     outputSetupHeader_TT = "Wenn die Einstellung aktiviert ist, wird eine Nachricht über das gegessene Gericht" ..
@@ -52,6 +53,9 @@ local L = {
     repairSetupCheck = "Automatische Reparatur",
     repairSetupCheck_TT = "Sollen Sie einen Reparatursatz haben, um zu autoreparieren",
     repairPercent = "Minimum Verfall %",
+
+    useCrownRepairTitle = "Kronreparatursatz benutzen",
+    useCrownRepairTitle_TT = "Kronreparatursatz benutzen",
 }

 for k, v in pairs(L) do
diff --git a/lang/en.lua b/lang/en.lua
index 066c95f..6884c4b 100644
--- a/lang/en.lua
+++ b/lang/en.lua
@@ -18,6 +18,7 @@ local L = {
     youEat = "You have eaten <<1>>",
     youCharge = "Charged <<1>>",
     youRepair = "Repaired <<1>>",
+    allRepair = "all",
     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",
@@ -50,6 +51,10 @@ local L = {
     repairSetupCheck_TT = "There should be a repair kit in the inventory to get this to work",
     repairPercent = "Minimum % of decay",

+    useCrownRepairTitle = "Use crown repair kits",
+    useCrownRepairTitle_TT = "Use crown repair kits",
+
+
 }

 for k, v in pairs(L) do
diff --git a/lang/ru.lua b/lang/ru.lua
index 85f534e..dbe32ab 100644
--- a/lang/ru.lua
+++ b/lang/ru.lua
@@ -19,6 +19,7 @@ local L = {
     youEat = "Вы съели: <<1>>",
     youCharge = "Заряжено <<1>>",
     youRepair = "Отремонтировано <<1>>",
+    allRepair = "все",
     outputSetupHeader = "Вывод сообщения",
     outputOnScreen = "На экран",
     outputSetupHeader_TT = "При включенной настройке сообщение о съеденном блюде или перезарядке оружия будет выведено на экран, а не только" ..
@@ -53,6 +54,9 @@ local L = {
     repairSetupCheck_TT = "Для автоматического ремонта снаряжения необходим ремонтный набор в инвентаре",
     repairPercent = "Минимальный % повреждения",

+    useCrownRepairTitle = "Использовать кронные ремнаборы",
+    useCrownRepairTitle_TT = "Использовать кронные ремонтные наборы",
+
 }

 for k, v in pairs(L) do