From 0e64d032b39ccf982b335038922e92e206040d01 Mon Sep 17 00:00:00 2001 From: Leonardo Pereira Santos Date: Fri, 5 Apr 2024 01:32:59 -0400 Subject: [PATCH] * Fixed auto-repair and consumable buttons for Classic patch 1.15.2. Updated ToC. Updated changelog. --- LunarSphere/Lib/moduleAPI.lua | 32 +++++------------- LunarSphere/Lib/moduleButton.lua | 50 +++++++--------------------- LunarSphere/Lib/moduleItems.lua | 4 +++ LunarSphere/LunarSphere.toc | 45 ------------------------- LunarSphere/LunarSphere_Mainline.toc | 22 ++++++------ LunarSphere/LunarSphere_TBC.toc | 45 ------------------------- LunarSphere/LunarSphere_Vanilla.toc | 22 ++++++------ LunarSphere/LunarSphere_Wrath.toc | 20 +++++------ LunarSphere/changelog.txt | 14 +++++++- 9 files changed, 69 insertions(+), 185 deletions(-) delete mode 100644 LunarSphere/LunarSphere.toc delete mode 100644 LunarSphere/LunarSphere_TBC.toc diff --git a/LunarSphere/Lib/moduleAPI.lua b/LunarSphere/Lib/moduleAPI.lua index c5eba9a..18c7ec8 100644 --- a/LunarSphere/Lib/moduleAPI.lua +++ b/LunarSphere/Lib/moduleAPI.lua @@ -2903,6 +2903,14 @@ function Lunar.API:GetBuildInfo() return t; end +function Lunar.API:SplitContainerItem(containerIndex, slotIndex, amount) + C_Container.SplitContainerItem(containerIndex, slotIndex, amount) +end + +function Lunar.API:UseContainerItem(containerIndex, slotIndex, unitToken, reagentBankOpen) + C_Container.UseContainerItem(containerIndex, slotIndex, unitToken, reagentBankOpen); +end + if ( Lunar.API:IsVersionClassic() ) then ------------------------------------------------------------------------------ @@ -2913,13 +2921,6 @@ if ( Lunar.API:IsVersionClassic() ) then ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ - function Lunar.API:SplitContainerItem(containerIndex, slotIndex, amount) - SplitContainerItem(containerIndex, slotIndex, amount) - end - - function Lunar.API:UseContainerItem(containerIndex, slotIndex, unitToken, reagentBankOpen) - UseContainerItem(containerIndex, slotIndex, unitToken, reagentBankOpen); - end -- -- Lunar.API:IsFlyableArea() @@ -2949,14 +2950,6 @@ elseif Lunar.API:IsVersionWotLK() then ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ - function Lunar.API:SplitContainerItem(containerIndex, slotIndex, amount) - C_Container.SplitContainerItem(containerIndex, slotIndex, amount) - end - - function Lunar.API:UseContainerItem(containerIndex, slotIndex, unitToken, reagentBankOpen) - C_Container.UseContainerItem(containerIndex, slotIndex, unitToken, reagentBankOpen); - end - function Lunar.API:IsFlyableArea() local zone_id = C_Map.GetBestMapForUnit("player") -- Dalaran. Check if we're in Krasus' Landing @@ -2989,15 +2982,6 @@ else ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ - - function Lunar.API:SplitContainerItem(containerIndex, slotIndex, amount) - C_Container.SplitContainerItem(containerIndex, slotIndex, amount) - end - - function Lunar.API:UseContainerItem(containerIndex, slotIndex, unitToken, reagentBankOpen) - C_Container.UseContainerItem(containerIndex, slotIndex, unitToken, reagentBankOpen); - end - function Lunar.API:IsFlyableArea() return IsFlyableArea() end diff --git a/LunarSphere/Lib/moduleButton.lua b/LunarSphere/Lib/moduleButton.lua index db4f198..271e42b 100644 --- a/LunarSphere/Lib/moduleButton.lua +++ b/LunarSphere/Lib/moduleButton.lua @@ -2454,7 +2454,6 @@ function Lunar.Button:UpdateLastUsedSubmenu(menuButton, childButton, clickType, elseif (attributeType == "item") then local objectType, stackTotal _,_,_,_,_,objectType,_,stackTotal = GetItemInfo(attributeValue); - if (IsConsumableItem(attributeValue) or (stackTotal > 1) or (objectType == Lunar.Items.reagentString)) then _G[menuButton:GetName() .. "Count"]:SetText(GetItemCount(attributeValue, nil, true)); @@ -3890,8 +3889,6 @@ function Lunar.Button:AssignByType(button, clickType, buttonType, stance, lastUs objectName = Lunar.Items:GetItem(Lunar.Items:GetCatagoryName(buttonType - 109), 3, true); end - --print("objectName (3893) : ", objectName) - -- Or grab our strongest -- elseif (math.fmod(buttonType, 10) == 1) then -- objectName = Lunar.Items:GetItem(Lunar.Items:GetCatagoryName(math.floor(buttonType / 10))); @@ -5538,7 +5535,14 @@ function Lunar.Button:Update(self, countOnly) end end elseif (self.buttonType) and ((self.buttonType == 130) or (self.buttonType == 131)) then - macroEquiped = IsEquippedItem(GetInventoryItemLink("player", self.buttonType - 117)); + -- 130-117=13==INVSLOT_TRINKET1 + -- 131-117=14==INVSLOT_TRINKET2 + local ilink = GetInventoryItemLink("player", self.buttonType - 117) + if ilink then + macroEquiped = IsEquippedItem(ilink); + else + macroEquiped = false; + end end -- Now, if the button is an item button ... @@ -7151,44 +7155,22 @@ function Lunar.Button:SetTooltip(self) -- buttonType = LunarSphereSettings.buttonData[self:GetID()]["buttonType" .. index]; itemCount = ""; - - --print("buttonType (7121):", buttonType) - if (buttonType) then - - --print("actionType (7125):", actionType) - if (actionType == "item") then - _, itemLink, _, _, _, objectMainType, objectType, stackTotal = GetItemInfo(actionName); - + local _, _, _, _, _, _, _, stackTotal, _, _, _, classID = GetItemInfo(actionName); -- Make sure we have a stackTotal (meaning, we have it in our in our inventory) -- Then, make sure the item is eligible for showing a count if (stackTotal) then - - if (IsConsumableItem(objectName) or (stackTotal > 1) or (objectType == Lunar.Items.reagentString) or (objectMainType == Lunar.Items:GetItemType("consume"))) then - - -- Grab the item ID and use that to find the item count based - -- on charges left, or if that fails, the actual item count - itemID = Lunar.API:GetItemID(itemLink); --- itemCount = Lunar.Items:GetCharges(itemID); --- if (itemCount) then --- itemCount = " (" .. itemCount .. ")"; --- else - itemCount = " (" .. GetItemCount(actionName, nil, true) .. ")"; --- end + -- classID == 0 is Consumable + if (IsConsumableItem(actionName) or (stackTotal > 1) or (classID == 0) ) then + itemCount = " (" .. GetItemCount(actionName, nil, true) .. ")"; end end end if (buttonType == 1) or ((buttonType >= 3) and (buttonType <= 6)) then - - --print("buttonType (7152):", buttonType, ", ", actionName) - if (actionName) and not ((actionName == "") or (actionName == " ")) then - - --print("buttonType (7169):", buttonType, ", ", actionName, ", ", actionType) - if (buttonType == 5) then itemCount = itemCount .. " |cFF00EE00" .. "[" .. Lunar.Locale["_SELFCAST"] .. "]|r"; elseif (buttonType == 6) then @@ -7217,11 +7199,7 @@ function Lunar.Button:SetTooltip(self) myGameTooltip:AddTexture("Interface\\Addons\\LunarSphere\\art\\tooltipMouse" .. index); else macroCommand = Lunar.API:MultiAddToTooltip(actionType, actionName, index, itemCount .. keybindText); - - --print("macroCommand : 7200, ", macroCommand) end - - --print("buttonType (7203):", buttonType, ", ", actionName, ", ", actionType) -- else -- Lunar.API:MultiAddToTooltip(actionType, actionName, index, itemCount); @@ -7236,9 +7214,7 @@ function Lunar.Button:SetTooltip(self) DrDamage:SetSpell(myGameTooltip, spellID); end end - --print("buttonType (7218):", buttonType, ", ", actionName, ", ", actionType) else - --print("buttonType (7220):", buttonType, ", ", actionName, ", ", actionType) if (buttonType == 3) then myGameTooltip:AddLine(buttonName .. Lunar.Locale["BUTTON_LASTSUBMENU"] .. ": " .. NONE .. keybindText, 1, 1, 1); myGameTooltip:AddTexture("Interface\\Addons\\LunarSphere\\art\\tooltipMouse" .. index); @@ -7262,8 +7238,6 @@ function Lunar.Button:SetTooltip(self) -- end -- end - --print("SetTooltip (7240)") - elseif (buttonType == 2) then --print("SetTooltip (7243)") if (index > 1) then diff --git a/LunarSphere/Lib/moduleItems.lua b/LunarSphere/Lib/moduleItems.lua index e45c487..a993f81 100644 --- a/LunarSphere/Lib/moduleItems.lua +++ b/LunarSphere/Lib/moduleItems.lua @@ -594,6 +594,10 @@ function Lunar.Items:BuildLookupStrings() -- local tempWeapon,tempArmor,_,tempConsume; -- local _, tempReagent = C_AuctionHouse.GetAuctionItemSubClasses(10); + -- This is the most retarded thing ever. GetItemInfo will return on the + -- 12th value the classID and on the 13th the subclassID, both of which do + -- _NOT_ change with the locale. Talk about reinventing the wheel. + if (not searchData.weapon) or (searchData.weapon == "") then searchData.weapon = tempWeapon; if (not searchData.weapon) or (searchData.weapon == "") then diff --git a/LunarSphere/LunarSphere.toc b/LunarSphere/LunarSphere.toc deleted file mode 100644 index def30c9..0000000 --- a/LunarSphere/LunarSphere.toc +++ /dev/null @@ -1,45 +0,0 @@ -## Interface: 100002 -## -## Version: v1.64 -## -## Author: Moongaze (Twisting Nether) -## Fixer: Shaun Voysey -## Fixer#2: Toludin (Stormrage) -## Fixer#3: Fullmoon (Sulfuras) -## -## Title: LunarSphere v.1.64 -## -## Notes: A universal sphere for all classes -## Title-zhTW: LunarSphere 全職業多功能球體插件 v.1.64 -## Notes-zhTW: 兼具快捷列/修裝/購物/騎乘/消耗品助手...等功能, 超完美的插件。中文化:恰恰@語風 -## Title-zhCN: LunarSphere 全职业多功能球体插件 v.1.64 -## Notes-zhCN: 兼具快捷列/修装/购物/座骑/消耗品助手...等功能, 超完美的插件。中文化:无名人士 -## Title-frFR: LunarSphere v.1.64 -## Notes-frFR: A universal sphere for all classes -## Title-deDE: LunarSphere v.1.64 -## Notes-deDE: A universal sphere for all classes -## Title-koKR: LunarSphere v.1.64 -## Notes-koKR: A universal sphere for all classes -## Title-ruRU: LunarSphere v.1.64 -## Notes-ruRU: A universal sphere for all classes -## Title-esES: LunarSphere v.1.64 -## Notes-esES: A universal sphere for all classes -## Title-esMX: LunarSphere v.1.64 -## Notes-esMX: A universal sphere for all classes -## -## SavedVariables: LunarSphereGlobal -## SavedVariablesPerCharacter: LunarSphereSettings, LunarSpeechLibrary - -lib\moduleLocale.lua -lib\moduleMemory.lua -lib\moduleAPI.lua -lib\moduleButton.lua -lib\moduleSphere.lua -lib\moduleTemplate.lua -lib\moduleItems.lua -lib\moduleObject.lua -lib\moduleSettings.lua -lib\moduleSpeech.lua -lib\templatesObject.xml -LunarSphere.lua -LunarSphere.xml diff --git a/LunarSphere/LunarSphere_Mainline.toc b/LunarSphere/LunarSphere_Mainline.toc index ca0a097..649cf53 100644 --- a/LunarSphere/LunarSphere_Mainline.toc +++ b/LunarSphere/LunarSphere_Mainline.toc @@ -1,30 +1,30 @@ -## Interface: 100107 +## Interface: 100206 ## -## Version: v1.66 +## Version: v1.67 ## ## Author: Moongaze (Twisting Nether) ## Fixer: Shaun Voysey ## Fixer#2: Toludin (Stormrage) ## Fixer#3: Fullmoon (Faerlina) ## -## Title: LunarSphere v.1.66 +## Title: LunarSphere v.1.67 ## ## Notes: A universal sphere for all classes -## Title-zhTW: LunarSphere 全職業多功能球體插件 v.1.66 +## Title-zhTW: LunarSphere 全職業多功能球體插件 v.1.67 ## Notes-zhTW: 兼具快捷列/修裝/購物/騎乘/消耗品助手...等功能, 超完美的插件。中文化:恰恰@語風 -## Title-zhCN: LunarSphere 全职业多功能球体插件 v.1.66 +## Title-zhCN: LunarSphere 全职业多功能球体插件 v.1.67 ## Notes-zhCN: 兼具快捷列/修装/购物/座骑/消耗品助手...等功能, 超完美的插件。中文化:无名人士 -## Title-frFR: LunarSphere v.1.66 +## Title-frFR: LunarSphere v.1.67 ## Notes-frFR: A universal sphere for all classes -## Title-deDE: LunarSphere v.1.66 +## Title-deDE: LunarSphere v.1.67 ## Notes-deDE: A universal sphere for all classes -## Title-koKR: LunarSphere v.1.66 +## Title-koKR: LunarSphere v.1.67 ## Notes-koKR: A universal sphere for all classes -## Title-ruRU: LunarSphere v.1.66 +## Title-ruRU: LunarSphere v.1.67 ## Notes-ruRU: A universal sphere for all classes -## Title-esES: LunarSphere v.1.66 +## Title-esES: LunarSphere v.1.67 ## Notes-esES: A universal sphere for all classes -## Title-esMX: LunarSphere v.1.66 +## Title-esMX: LunarSphere v.1.67 ## Notes-esMX: A universal sphere for all classes ## ## SavedVariables: LunarSphereGlobal diff --git a/LunarSphere/LunarSphere_TBC.toc b/LunarSphere/LunarSphere_TBC.toc deleted file mode 100644 index 3629434..0000000 --- a/LunarSphere/LunarSphere_TBC.toc +++ /dev/null @@ -1,45 +0,0 @@ -## Interface: 20504 -## -## Version: v1.64 -## -## Author: Moongaze (Twisting Nether) -## Fixer: Shaun Voysey -## Fixer#2: Toludin (Stormrage) -## Fixer#3: Fullmoon (Faerlina) -## -## Title: LunarSphere v.1.64 -## -## Notes: A universal sphere for all classes -## Title-zhTW: LunarSphere 全職業多功能球體插件 v.1.64 -## Notes-zhTW: 兼具快捷列/修裝/購物/騎乘/消耗品助手...等功能, 超完美的插件。中文化:恰恰@語風 -## Title-zhCN: LunarSphere 全职业多功能球体插件 v.1.64 -## Notes-zhCN: 兼具快捷列/修装/购物/座骑/消耗品助手...等功能, 超完美的插件。中文化:无名人士 -## Title-frFR: LunarSphere v.1.64 -## Notes-frFR: A universal sphere for all classes -## Title-deDE: LunarSphere v.1.64 -## Notes-deDE: A universal sphere for all classes -## Title-koKR: LunarSphere v.1.64 -## Notes-koKR: A universal sphere for all classes -## Title-ruRU: LunarSphere v.1.64 -## Notes-ruRU: A universal sphere for all classes -## Title-esES: LunarSphere v.1.64 -## Notes-esES: A universal sphere for all classes -## Title-esMX: LunarSphere v.1.64 -## Notes-esMX: A universal sphere for all classes -## -## SavedVariables: LunarSphereGlobal -## SavedVariablesPerCharacter: LunarSphereSettings, LunarSpeechLibrary - -lib\moduleLocale.lua -lib\moduleMemory.lua -lib\moduleAPI.lua -lib\moduleButton.lua -lib\moduleSphere.lua -lib\moduleTemplate.lua -lib\moduleItems.lua -lib\moduleObject.lua -lib\moduleSettings.lua -lib\moduleSpeech.lua -lib\templatesObject.xml -LunarSphere.lua -LunarSphere.xml diff --git a/LunarSphere/LunarSphere_Vanilla.toc b/LunarSphere/LunarSphere_Vanilla.toc index b992bc9..f5122ee 100644 --- a/LunarSphere/LunarSphere_Vanilla.toc +++ b/LunarSphere/LunarSphere_Vanilla.toc @@ -1,30 +1,30 @@ -## Interface: 11404 +## Interface: 11502 ## -## Version: v1.66 +## Version: v1.67 ## ## Author: Moongaze (Twisting Nether) ## Fixer: Shaun Voysey ## Fixer#2: Toludin (Stormrage) ## Fixer#3: Fullmoon (Faerlina) ## -## Title: LunarSphere v.1.66 +## Title: LunarSphere v.1.67 ## ## Notes: A universal sphere for all classes -## Title-zhTW: LunarSphere 全職業多功能球體插件 v.1.66 +## Title-zhTW: LunarSphere 全職業多功能球體插件 v.1.67 ## Notes-zhTW: 兼具快捷列/修裝/購物/騎乘/消耗品助手...等功能, 超完美的插件。中文化:恰恰@語風 -## Title-zhCN: LunarSphere 全职业多功能球体插件 v.1.66 +## Title-zhCN: LunarSphere 全职业多功能球体插件 v.1.67 ## Notes-zhCN: 兼具快捷列/修装/购物/座骑/消耗品助手...等功能, 超完美的插件。中文化:无名人士 -## Title-frFR: LunarSphere v.1.66 +## Title-frFR: LunarSphere v.1.67 ## Notes-frFR: A universal sphere for all classes -## Title-deDE: LunarSphere v.1.66 +## Title-deDE: LunarSphere v.1.67 ## Notes-deDE: A universal sphere for all classes -## Title-koKR: LunarSphere v.1.66 +## Title-koKR: LunarSphere v.1.67 ## Notes-koKR: A universal sphere for all classes -## Title-ruRU: LunarSphere v.1.66 +## Title-ruRU: LunarSphere v.1.67 ## Notes-ruRU: A universal sphere for all classes -## Title-esES: LunarSphere v.1.66 +## Title-esES: LunarSphere v.1.67 ## Notes-esES: A universal sphere for all classes -## Title-esMX: LunarSphere v.1.66 +## Title-esMX: LunarSphere v.1.67 ## Notes-esMX: A universal sphere for all classes ## ## SavedVariables: LunarSphereGlobal diff --git a/LunarSphere/LunarSphere_Wrath.toc b/LunarSphere/LunarSphere_Wrath.toc index aaaf036..652f6c4 100644 --- a/LunarSphere/LunarSphere_Wrath.toc +++ b/LunarSphere/LunarSphere_Wrath.toc @@ -1,30 +1,30 @@ ## Interface: 30403 ## -## Version: v1.66 +## Version: v1.67 ## ## Author: Moongaze (Twisting Nether) ## Fixer: Shaun Voysey ## Fixer#2: Toludin (Stormrage) ## Fixer#3: Fullmoon (Faerlina) ## -## Title: LunarSphere v.1.66 +## Title: LunarSphere v.1.67 ## ## Notes: A universal sphere for all classes -## Title-zhTW: LunarSphere 全職業多功能球體插件 v.1.66 +## Title-zhTW: LunarSphere 全職業多功能球體插件 v.1.67 ## Notes-zhTW: 兼具快捷列/修裝/購物/騎乘/消耗品助手...等功能, 超完美的插件。中文化:恰恰@語風 -## Title-zhCN: LunarSphere 全职业多功能球体插件 v.1.66 +## Title-zhCN: LunarSphere 全职业多功能球体插件 v.1.67 ## Notes-zhCN: 兼具快捷列/修装/购物/座骑/消耗品助手...等功能, 超完美的插件。中文化:无名人士 -## Title-frFR: LunarSphere v.1.66 +## Title-frFR: LunarSphere v.1.67 ## Notes-frFR: A universal sphere for all classes -## Title-deDE: LunarSphere v.1.66 +## Title-deDE: LunarSphere v.1.67 ## Notes-deDE: A universal sphere for all classes -## Title-koKR: LunarSphere v.1.66 +## Title-koKR: LunarSphere v.1.67 ## Notes-koKR: A universal sphere for all classes -## Title-ruRU: LunarSphere v.1.66 +## Title-ruRU: LunarSphere v.1.67 ## Notes-ruRU: A universal sphere for all classes -## Title-esES: LunarSphere v.1.66 +## Title-esES: LunarSphere v.1.67 ## Notes-esES: A universal sphere for all classes -## Title-esMX: LunarSphere v.1.66 +## Title-esMX: LunarSphere v.1.67 ## Notes-esMX: A universal sphere for all classes ## ## SavedVariables: LunarSphereGlobal diff --git a/LunarSphere/changelog.txt b/LunarSphere/changelog.txt index b537792..545b1c0 100644 --- a/LunarSphere/changelog.txt +++ b/LunarSphere/changelog.txt @@ -1,3 +1,15 @@ +LunarSphere Public Release +Version 1.67 Changelog + +====================== +Bug Fixes +====================== + +* Fixed auto-repair for Classic patch 1.15.2 +* Fixed consumable buttons for Classic patch 1.15.2 + +======================================================================================= + LunarSphere Public Release Version 1.66 Changelog @@ -5,7 +17,7 @@ Version 1.66 Changelog Bug Fixes ====================== -* Fixed buttons for WotLK Classic patch 3.4.3 and Clasic patch 1.14.4 +* Fixed buttons for WotLK Classic patch 3.4.3 and Classic patch 1.14.4 =======================================================================================