Skip to content

Commit

Permalink
Minor fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardopsantos committed Jan 20, 2023
1 parent f5712a0 commit 2001c29
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 15 deletions.
48 changes: 42 additions & 6 deletions LunarSphere/Lib/moduleAPI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1150,11 +1150,11 @@ function Lunar.API:Load()

-- From the bank
if (itemIndex <= NUM_BANKGENERIC_SLOTS) then
UseContainerItem(BANK_CONTAINER, itemIndex);
Lunar.API:UseContainerItem(BANK_CONTAINER, itemIndex);

-- From a bank bag
else
UseContainerItem(currentBag + NUM_BAG_SLOTS, currentSlot);
Lunar.API:UseContainerItem(currentBag + NUM_BAG_SLOTS, currentSlot);
end

restockCounter = 0 --restockCounter - maxBuyAmount
Expand Down Expand Up @@ -1301,20 +1301,20 @@ function Lunar.API:Load()

-- If it's armor and we're selling armor, sell it and update the receipt
if ((itemType == armorType) and not (keepAllArmor)) then
UseContainerItem(bagIndex, slotIndex);
Lunar.API:UseContainerItem(bagIndex, slotIndex);
sellReceipt = sellReceipt + Lunar.API.sellPrice;
end

-- If it's a weapon and we're selling weapons, sell it and update the receipt
if ((itemType == weaponType) and not (keepAllWeapons)) then
UseContainerItem(bagIndex, slotIndex);
Lunar.API:UseContainerItem(bagIndex, slotIndex);
sellReceipt = sellReceipt + Lunar.API.sellPrice;
end

-- If it's not armor or a weapon, and we're selling non-equipment, sell it
-- and update the receipt
if ((not(itemType == armorType)) and (not(itemType == weaponType)) and not (keepNonEquip)) then
UseContainerItem(bagIndex, slotIndex);
Lunar.API:UseContainerItem(bagIndex, slotIndex);
sellReceipt = sellReceipt + Lunar.API.sellPrice;
end

Expand Down Expand Up @@ -2907,13 +2907,24 @@ function Lunar.API:GetBuildInfo()
return t;
end


if ( Lunar.API:IsVersionClassic() ) then

------------------------------------------------------------------------------
------------------------------------------------------------------------------
--- ---
--- SoM Functions ---
--- ---
------------------------------------------------------------------------------
------------------------------------------------------------------------------

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 All @@ -2934,10 +2945,22 @@ if ( Lunar.API:IsVersionClassic() ) then

elseif Lunar.API:IsVersionWotLK() then

------------------------------------------------------------------------------
------------------------------------------------------------------------------
--- ---
--- WotLK Functions ---
--- ---
------------------------------------------------------------------------------
------------------------------------------------------------------------------

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 All @@ -2962,10 +2985,23 @@ elseif Lunar.API:IsVersionWotLK() then

else

------------------------------------------------------------------------------
------------------------------------------------------------------------------
--- ---
--- Retail Functions ---
--- ---
------------------------------------------------------------------------------
------------------------------------------------------------------------------


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
9 changes: 0 additions & 9 deletions LunarSphere/Lib/moduleButton.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2536,7 +2536,6 @@ function Lunar.Button:ContinueTrade()

-- Pickup the item and drop it into the trade window
SplitContainerItem(bagID, slotID, count);
-- PickupContainerItem(bagID, slotID);
ClickTradeButton(tradeSlot);

-- If we hit our limit, or ran out of this item, we stop messing
Expand All @@ -2558,19 +2557,11 @@ function Lunar.Button:ContinueTrade()
table.remove(Lunar.Button.tradingQueue, 1);
end

-- PickupContainerItem(0,2);
-- ClickTradeButton(2);
else
-- Needs refresh first
Lunar.Button.tradingStage = 3
-- AcceptTrade();
-- end
end
Lunar.Button.tradingStage = 3

-- PickupContainerItem(0,1);
-- ClickTradeButton(1-7);
-- AcceptTrade();
end

function Lunar.Button:ButtonTypeClick(buttonType)
Expand Down

0 comments on commit 2001c29

Please sign in to comment.