From 9c52da4e7c0444481e67c3da9d0fbf010c93206b Mon Sep 17 00:00:00 2001 From: Road-block Date: Sat, 13 Jan 2024 19:50:40 +0200 Subject: [PATCH 1/5] add support for engraved items in SoD change up binding save logic a bit --- ItemRack/ItemRack.lua | 64 ++++++++++++++++++++++++----- ItemRack/ItemRack.toc | 8 ++-- ItemRackOptions/ItemRackOptions.toc | 6 +-- 3 files changed, 61 insertions(+), 17 deletions(-) diff --git a/ItemRack/ItemRack.lua b/ItemRack/ItemRack.lua index c7d497a..6a92973 100644 --- a/ItemRack/ItemRack.lua +++ b/ItemRack/ItemRack.lua @@ -17,10 +17,15 @@ function ItemRack.IsWrath() return WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC end -local GetContainerNumSlots, GetContainerItemLink, GetContainerItemCooldown, GetContainerItemInfo, GetItemCooldown, PickupContainerItem, ContainerIDToInventoryID +function ItemRack.IsEngravingActive() + return C_Engraving and C_Engraving.IsEngravingEnabled() +end + +local GetContainerNumSlots, GetContainerItemLink, GetContainerItemID, GetContainerItemCooldown, GetContainerItemInfo, GetItemCooldown, PickupContainerItem, ContainerIDToInventoryID if C_Container then GetContainerNumSlots = C_Container.GetContainerNumSlots GetContainerItemLink = C_Container.GetContainerItemLink + GetContainerItemID = C_Container.GetContainerItemID GetContainerItemCooldown = C_Container.GetContainerItemCooldown GetItemCooldown = C_Container.GetItemCooldown PickupContainerItem = C_Container.PickupContainerItem @@ -34,8 +39,8 @@ if C_Container then end end else - GetContainerNumSlots, GetContainerItemLink, GetContainerItemCooldown, GetContainerItemInfo, GetItemCooldown, PickupContainerItem, ContainerIDToInventoryID = - _G.GetContainerNumSlots, _G.GetContainerItemLink, _G.GetContainerItemCooldown, _G.GetContainerItemInfo, _G.GetItemCooldown, _G.PickupContainerItem, _G.ContainerIDToInventoryID + GetContainerNumSlots, GetContainerItemLink, GetContainerItemID, GetContainerItemCooldown, GetContainerItemInfo, GetItemCooldown, PickupContainerItem, ContainerIDToInventoryID = + _G.GetContainerNumSlots, _G.GetContainerItemLink, _G.GetContainerItemID, _G.GetContainerItemCooldown, _G.GetContainerItemInfo, _G.GetItemCooldown, _G.PickupContainerItem, _G.ContainerIDToInventoryID end local LDB = LibStub("LibDataBroker-1.1") @@ -612,6 +617,30 @@ function ItemRack.GetIRString(inputString,baseid,regular) return string.match(inputString or "", (baseid and (regular and ItemRack.iSPatternBaseIDFromRegular or ItemRack.iSPatternBaseIDFromIR) or ItemRack.iSPatternRegularToIR)) or 0 end +-- [[ Season of Discovery Runes ]] +if ItemRack.IsEngravingActive() then + function ItemRack.AppendRuneID(bag, slot) + local inv_slot + if slot then + local item_id = GetContainerItemID(bag, slot) + if item_id then + inv_slot = C_Item.GetItemInventoryTypeByID(item_id) + end + else + inv_slot = bag + end + if inv_slot and C_Engraving.IsEquipmentSlotEngravable(inv_slot) then + local rune_info = C_Engraving.GetRuneForEquipmentSlot(inv_slot) + if rune_info then + return ":runeid:"..tostring(rune_info.skillLineAbilityID) + else + return ":runeid:0" + end + end + return "" + end +end + -- itemrack itemstring updater. -- takes a saved ItemRack-style ID and returns an updated version with the latest player level and spec injected, which helps us update outdated IDs saved when the player was lower level or different spec function ItemRack.UpdateIRString(itemRackID) @@ -628,6 +657,7 @@ end -- bag,nil = inventory slot; bag,slot = container slot function ItemRack.GetID(bag,slot) local _, itemLink + local runeSuffix = "" if slot then itemLink = GetContainerItemLink(bag,slot) else @@ -637,7 +667,10 @@ function ItemRack.GetID(bag,slot) itemLink = GetInventoryItemLink("player",bag) end end - return ItemRack.GetIRString(itemLink) + if ItemRack.AppendRuneID then + runeSuffix = ItemRack.AppendRuneID(bag,slot) + end + return ItemRack.GetIRString(itemLink)..runeSuffix end -- takes two ItemRack-style IDs (one or both of the parameters can be a baseID instead if needed) and returns true if those items share the same base itemID @@ -1979,10 +2012,21 @@ function ItemRack.ToggleHidden(id) end --[[ Key bindings ]] - +local retryCount = 0 function ItemRack.SetSetBindings() - local inLockdown = InCombatLockdown() - if not inLockdown then + if InCombatLockdown() then + ItemRack.Print("Cannot save hotkeys in combat, please try again out of combat!") + return + end + if retryCount > 3 then return end + local bindingSet = GetCurrentBindingSet() + if not bindingSet or not (Enum.BindingSet and tContains(Enum.BindingSet, bindingSet)) then + retryCount = retryCount + 1 + C_Timer.After(5, function() + ItemRack.SetSetBindings() + end) + return + else local buttonName,button for i in pairs(ItemRackUser.Sets) do if ItemRackUser.Sets[i].key then @@ -2003,9 +2047,9 @@ function ItemRack.SetSetBindings() SetBindingClick(ItemRackUser.Sets[i].key,buttonName) end end - SaveBindings(GetCurrentBindingSet()) - else - ItemRack.Print("Cannot save hotkeys in combat, please try again out of combat!") + local bindingSet = GetCurrentBindingSet() + SaveBindings(bindingSet) + retryCount = 0 end end diff --git a/ItemRack/ItemRack.toc b/ItemRack/ItemRack.toc index 2e59e01..9fbf0f0 100644 --- a/ItemRack/ItemRack.toc +++ b/ItemRack/ItemRack.toc @@ -1,9 +1,9 @@ -## Interface: 30401 -## Interface-Classic: 11403 +## Interface: 30403 +## Interface-Classic: 11500 ## Interface-BCC: 20504 -## Interface-WOTLKC: 30401 +## Interface-WOTLKC: 30403 ## Title: ItemRack - Classic -## Version: 3.75 +## Version: 3.77 ## Author: Gello - Updated for Classic by Rottenbeer,Roadblock ## SavedVariables: ItemRackSettings, ItemRackItems, ItemRackEvents ## SavedVariablesPerCharacter: ItemRackUser diff --git a/ItemRackOptions/ItemRackOptions.toc b/ItemRackOptions/ItemRackOptions.toc index a74e0f6..407fc68 100644 --- a/ItemRackOptions/ItemRackOptions.toc +++ b/ItemRackOptions/ItemRackOptions.toc @@ -1,7 +1,7 @@ -## Interface: 30401 -## Interface-Classic: 11403 +## Interface: 30403 +## Interface-Classic: 11500 ## Interface-BCC: 20504 -## Interface-WOTLKC: 30401 +## Interface-WOTLKC: 30403 ## Title: ItemRackOptions ## Notes: Load-On-Demand modules for ItemRack ## Dependencies: ItemRack, Blizzard_MacroUI From 8e0ef254ab3429eb015acc0d51721b047b5a4c40 Mon Sep 17 00:00:00 2001 From: Road-block Date: Sun, 14 Jan 2024 12:26:20 +0200 Subject: [PATCH 2/5] another attempt at solving keybind persistence for some players --- ItemRack/ItemRack.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ItemRack/ItemRack.lua b/ItemRack/ItemRack.lua index 6a92973..0fea9b6 100644 --- a/ItemRack/ItemRack.lua +++ b/ItemRack/ItemRack.lua @@ -215,6 +215,7 @@ function ItemRack.InitEventHandlers() handler.CHARACTER_POINTS_CHANGED = ItemRack.UpdateClassSpecificStuff handler.PLAYER_TALENT_UPDATE = ItemRack.UpdateClassSpecificStuff handler.PLAYER_ENTERING_WORLD = ItemRack.OnEnterWorld + handler.PLAYER_LOGOUT = ItemRack.OnPlayerLogout handler.ACTIVE_TALENT_GROUP_CHANGED = ItemRack.UpdateClassSpecificStuff -- handler.PET_BATTLE_OPENING_START = ItemRack.OnEnteringPetBattle -- handler.PET_BATTLE_CLOSE = ItemRack.OnLeavingPetBattle @@ -266,10 +267,19 @@ function ItemRack.OnPlayerLogin() ItemRack.InitEvents() end -function ItemRack.OnEnterWorld() +function ItemRack.OnPlayerLogout() ItemRack.SetSetBindings() end +function ItemRack.OnEnterWorld(self,event,...) + local isLogin,isReload = ... + if isLogin or isReload then + C_Timer.After(15,function() + ItemRack.SetSetBindings() + end) + end +end + local loader = CreateFrame("Frame",nil, self, BackdropTemplateMixin and "BackdropTemplate") -- need a new temp frame here, ItemRackFrame is not created yet loader:RegisterEvent("PLAYER_LOGIN") From 4d9004390c791434e42ff46bee92a44e79fe1efa Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Sat, 20 Jan 2024 09:53:37 +0100 Subject: [PATCH 3/5] Release 3.75 --- Changelog.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 432d99a..6b454df 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,6 +1,6 @@ __ New in 3.75 - By Roadblock __ -* WOTLK 3.4.1 compatibility -* Fix a flyout menu tooltip error +* Support for SoD +* Fix for missing keybinds __ New in 3.74 - By Roadblock __ * WOTLK fix for Polearms + Titan's Grip. From df69185f2f20582edd39e3442d7b6d7c9a884e57 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Sat, 20 Jan 2024 09:56:02 +0100 Subject: [PATCH 4/5] Release 3.76 Mistakes were made --- Changelog.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index 6b454df..50a9d54 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,7 +1,11 @@ -__ New in 3.75 - By Roadblock __ +__ New in 3.76 - By Roadblock __ * Support for SoD * Fix for missing keybinds +__ New in 3.75 - By Roadblock __ +* WOTLK 3.4.1 compatibility +* Fix a flyout menu tooltip error + __ New in 3.74 - By Roadblock __ * WOTLK fix for Polearms + Titan's Grip. * Fix for ammo slot not equipping the set ammo. From ae8532154573ea301271527ea251be6244a6df71 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Sat, 20 Jan 2024 10:01:45 +0100 Subject: [PATCH 5/5] Release 3.77 --- Changelog.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Changelog.txt b/Changelog.txt index 50a9d54..1cc8649 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,3 +1,6 @@ +__ New in 3.77 - By Rottenbeer __ +* Fix curseforge release, don't commit before 10am + __ New in 3.76 - By Roadblock __ * Support for SoD * Fix for missing keybinds