Skip to content

Commit

Permalink
Change scope of few globals to local
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbuds authored and Rottenbeer committed May 20, 2021
1 parent ab7acb8 commit e51632d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
10 changes: 7 additions & 3 deletions ItemRack/ItemRack.lua
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ end
function ItemRack.IsSoulbound(bag,slot)
ItemRackTooltip:SetBagItem(bag,slot)
for i=2,5 do
text = _G["ItemRackTooltipTextLeft"..i]:GetText()
local text = _G["ItemRackTooltipTextLeft"..i]:GetText()
if text==ITEM_SOULBOUND or text==ITEM_BIND_QUEST or text==ITEM_CONJURED then
return 1
end
Expand Down Expand Up @@ -1027,7 +1027,7 @@ function ItemRack.BuildMenu(id,menuInclude,masqueGroup)
-- display outward from docking point
local col,row,xpos,ypos = 0,0,ItemRack.DockInfo[ItemRack.currentDock].xstart,ItemRack.DockInfo[ItemRack.currentDock].ystart
local max_cols = 1
local button
local button, icon

if ItemRackUser.SetMenuWrap=="ON" then
max_cols = ItemRackUser.SetMenuWrapValue
Expand Down Expand Up @@ -1707,6 +1707,7 @@ end

function ItemRack.DockMenuToCharacterSheet(self)
local name = self:GetName()
local slot
for i=0,19 do
if name=="Character"..ItemRack.SlotInfo[i].name then
slot = i
Expand Down Expand Up @@ -1868,6 +1869,9 @@ end

function ItemRack.SetFont(button)
local item = _G[button.."Time"]
if not item then
return
end
if ItemRackSettings.LargeNumbers=="ON" then
item:SetFont("Fonts\\FRIZQT__.TTF",16,"OUTLINE")
item:SetTextColor(1,.82,0,1)
Expand Down Expand Up @@ -2073,7 +2077,7 @@ end
-- pushes setname from bags/worn to bank
function ItemRack.PutBankedSet(setname)
if SpellIsTargeting() or GetCursorInfo() then return end
local bag,slot,freeBag,freeSlot
local inv,bag,slot,freeBag,freeSlot
ItemRack.ClearLockList()
for _,i in pairs(ItemRackUser.Sets[setname].equip) do
if i~=0 then
Expand Down
2 changes: 1 addition & 1 deletion ItemRack/ItemRackButtons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ function ItemRack.WriteButtonCooldowns()
end

function ItemRack.UpdateButtonLocks()
local isLocked
local isLocked, alreadyLocked
for i in pairs(ItemRackUser.Buttons) do
if i<20 then
isLocked = IsInventoryItemLocked(i)
Expand Down
2 changes: 1 addition & 1 deletion ItemRack/ItemRackEquip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ function ItemRack.IterateSwapList(setname)
ItemRack.AbortSwap = nil
ItemRack.ClearLockList()

local skip = nil
local skip, inv, bag, slot
for i=0,19 do -- go in order to handle skips correctly
if skip or ItemRack.AbortSwap then
skip = nil
Expand Down
4 changes: 2 additions & 2 deletions ItemRack/ItemRackQueue.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function ItemRack.ProcessAutoQueue(slot)

local list = ItemRack.GetQueues()[slot]

local candidate,bag,s
local candidate,bag
for i=1,#(list) do
candidate = string.match(list[i],"(%d+)") --FIXME: not sure what list[i] is; it might simply be cleaning up some sort of slot number to make sure it is numeric, OR it might actually be an itemID... if it is the latter then this (conversion to baseID) should be handled by either ItemRack.GetIRString(list[i],true) if list[i] is an ItemRack-style ID or ItemRack.GetIRString(list[i],true,true) if list[i] is a regular ItemLink/ItemString, MOST things point to it being an ItemRack-style ID, but I do not want to mess anything up if this is in fact just a regular number, so I'll leave the line as it is
if list[i]==0 then
Expand All @@ -69,7 +69,7 @@ function ItemRack.ProcessAutoQueue(slot)
if not ready or enable==0 or (ItemRackItems[candidate] and ItemRackItems[candidate].priority) then
if ItemRack.ItemNearReady(candidate) then
if GetItemCount(candidate)>0 and not IsEquippedItem(candidate) then
_,bag,s = ItemRack.FindItem(list[i])
_,bag = ItemRack.FindItem(list[i])
if bag then
if ItemRack.CombatQueue[slot]~=list[i] then
ItemRack.EquipItemByID(list[i],slot)
Expand Down

0 comments on commit e51632d

Please sign in to comment.