Skip to content

Commit

Permalink
* Fixed auto-repair and consumable buttons for Classic patch 1.15.2. …
Browse files Browse the repository at this point in the history
…Updated ToC. Updated changelog.
  • Loading branch information
leonardopsantos committed Apr 5, 2024
1 parent 81ac07f commit 0e64d03
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 185 deletions.
32 changes: 8 additions & 24 deletions LunarSphere/Lib/moduleAPI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

------------------------------------------------------------------------------
Expand All @@ -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()
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
50 changes: 12 additions & 38 deletions LunarSphere/Lib/moduleButton.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down Expand Up @@ -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)));
Expand Down Expand Up @@ -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 ...
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);

Expand All @@ -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);
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions LunarSphere/Lib/moduleItems.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
45 changes: 0 additions & 45 deletions LunarSphere/LunarSphere.toc

This file was deleted.

22 changes: 11 additions & 11 deletions LunarSphere/LunarSphere_Mainline.toc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
45 changes: 0 additions & 45 deletions LunarSphere/LunarSphere_TBC.toc

This file was deleted.

22 changes: 11 additions & 11 deletions LunarSphere/LunarSphere_Vanilla.toc
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading

0 comments on commit 0e64d03

Please sign in to comment.