Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vanilla namespace fixes #141

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions Libraries/VanillaConversion.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
if C_Container == nil then
C_Container = {}
function C_Container.GetContainerItemLink(bagIndex, slotIndex)
return GetContainerItemLink(bagIndex, slotIndex)
end
function C_Container.GetContainerItemInfo(bagIndex, slotIndex)
return GetContainerItemInfo(bagIndex, slotIndex)
end
function C_Container.GetContainerNumSlots(vBagIndex)
return GetContainerNumSlots(vBagIndex)
end
function C_Container.GetContainerNumFreeSlots(vBagIndex)
return GetContainerNumFreeSlots(vBagIndex)
end
function C_Container.GetContainerItemInfo(bagIndex, slotIndex)
icon, itemCount, locked, quality, readable, lootable, itemLink, isFiltered, noValue, itemID, isBound = GetContainerItemInfo(bagIndex, slotIndex)
containerItemInfo = {
["iconFileId"] = icon,
["stackCount"] = itemCount,
["isLocked"] = locked,
["quality"] = quality,
["isReadable"] = readable,
["hasLoot"] = lootable,
["hyperlink"] = itemLink,
["isFiltered"] = isFiltered,
["hasNoValue"] = noValue,
["itemID"] = itemID,
["isBound"] = isBound
};
return containerItemInfo
end
function C_Container.PickupContainerItem(containerIndex, slotIndex)
return PickupContainerItem(containerIndex, slotIndex)
end
function C_Container.ContainerIDToInventoryID(pBagIndex)
return ContainerIDToInventoryID(pBagIndex)
end
function C_Container.ShowContainerSellCursor(BagIndex, BagSlotIndex)
return ShowContainerSellCursor(BagIndex, BagSlotIndex)
end
function C_Container.UseContainerItem(BagIndex, BagSlotIndex)
return UseContainerItem(BagIndex, BagSlotIndex)
end
end

if C_Minimap == nil then
C_Minimap = {}
function C_Minimap.GetNumTrackingTypes()
return GetNumTrackingTypes()
end
function C_Minimap.GetTrackingInfo(vIndex)
return GetTrackingInfo(vIndex)
end
function C_Minimap.SetTracking(vIndex, pEnabled)
-- pEnabled was sometimes set to 1 instead of true. This forces true/false
return SetTracking(vIndex, pEnabled == true or pEnabled == 1)
end
end
66 changes: 66 additions & 0 deletions Outfitter-Vanilla.toc
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
## Interface: 11403
## Author: Gogo, LemonDrake Updates: GovtGeek
## X-Credits: Mundocani, Miv
## Title: Outfitter
## Version: 3.0.4
## Notes: Automate Gear Set Changes, and Build Gear Sets using Pawn Stat Weights
## OptionalDeps:
## RequiredDeps:
## SavedVariablesPerCharacter: gOutfitter_Settings
## SavedVariables: gOutfitter_GlobalSettings
## X-ReloadTag: 2
## X-Curse-Project-ID: 356701

Libraries/UTF8/utf8data.lua
Libraries/UTF8/utf8.lua

Libraries/LibStub.lua
Libraries/CallbackHandler-1.0.lua
Libraries/LibDataBroker-1.1.lua
Libraries/LibBabble-3.0.lua
Libraries/LibBabble-SubZone-3.0.lua
Libraries/LibBabble-Inventory-3.0.lua
Libraries/LibTipHooker-1.1.lua
Libraries/LibDropdown-1.0.lua

OutfitterPrefix.lua

Libraries/VanillaConversion.lua

Libraries/MC2AddonLib/MC2AddonLib.lua
Libraries/MC2DebugLib/MC2DebugLib.lua
Libraries/MC2SchedulerLib/MC2SchedulerLib.lua
Libraries/MC2EventLib/MC2EventLib.lua
Libraries/MC2UIElementsLib/MC2UIElementsLib.lua
Libraries/MC2ItemLinkLib/MC2ItemLinkLib.lua
Libraries/MC2TooltipLib/MC2TooltipLib.lua
Libraries/MC2ItemStatsLib/MC2ItemStatsLib.lua

OutfitterStrings.lua
OutfitterStrings_de.lua
OutfitterStrings_fr.lua
OutfitterStrings_cn.lua
OutfitterStrings_tw.lua
OutfitterStrings_kr.lua
OutfitterStrings_ru.lua
OutfitterStrings_ru.lua

Outfitter.lua

OutfitterOutfits.lua
OutfitterInventory.lua
OutfitterEquipment.lua
OutfitterItemStats.lua
OutfitterOptimize.lua
OutfitterUITools.lua
OutfitterScripting.lua
OutfitterScriptDialog.lua
OutfitterQuickSlots.lua
OutfitterMinimapButton.lua
OutfitterBar.lua
OutfitterAbout.lua

OutfitterLDB.lua

Outfitter.xml
OutfitterBar.xml
8 changes: 5 additions & 3 deletions Outfitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7316,20 +7316,22 @@ function Outfitter:PlayerIsOnQuestID(pQuestID)
end

function Outfitter:GetTrackingEnabled(pTexture)
local vNumTypes = GetNumTrackingTypes()
local vNumTypes = C_Minimap.GetNumTrackingTypes()

for vIndex = 1, vNumTypes do
local vName, vTexture, vActive = GetTrackingInfo(vIndex)
local vName, vTexture, vActive = C_Minimap.GetTrackingInfo(vIndex)
if vTexture == pTexture then
return vActive, vIndex
end
end
return false, 0
end

function Outfitter:SetTrackingEnabled(pTexture, pEnabled)
local vActive, vIndex = self:GetTrackingEnabled(pTexture)
if pEnabled == 1 then pEnabled = true else pEnabled = false end
if vActive ~= pEnabled then
SetTracking(vIndex, pEnabled == true or pEnabled == 1)
C_Minimap.SetTracking(vIndex, pEnabled == true or pEnabled == 1)
end
end

Expand Down
4 changes: 2 additions & 2 deletions OutfitterBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ function Outfitter.OutfitBar:GetCursorTexture()
local vItemLink = C_Container.GetContainerItemLink(vBagIndex, vBagSlotIndex)

if vItemLink == vParam2 then
local itemInfo = C_Containeer.GetContainerItemInfo(vBagIndex, vBagSlotIndex)
local itemInfo = C_Container.GetContainerItemInfo(vBagIndex, vBagSlotIndex)
local vTexture = itemInfo.iconFileID

return vTexture
Expand Down Expand Up @@ -1311,7 +1311,7 @@ function Outfitter.OutfitBar.TextureSets.Inventory:Activate()

if vNumBagSlots > 0 then
for vSlotIndex = 1, vNumBagSlots do
local itemInfo = C_Containeer.GetContainerItemInfo(vBagIndex, vBagSlotIndex)
local itemInfo = C_Container.GetContainerItemInfo(vBagIndex, vBagSlotIndex)
local vTexture = itemInfo.iconFileID

if vTexture and not vUsedTextures[vTexture] then
Expand Down
4 changes: 2 additions & 2 deletions OutfitterScripting.lua
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ if event == "OUTFIT_EQUIPPED" then

if setting.EnableFishTracking then
setting.savedTracking = Outfitter:GetTrackingEnabled(133888)
Outfitter:SetTrackingEnabled(133888, 1)
Outfitter:SetTrackingEnabled(133888, true)
setting.didSetTracking = true
end

Expand Down Expand Up @@ -1168,7 +1168,7 @@ end

if select(1, ...) ~= "player" then return end

if UnitBuff("player", setting.buffName) then
if AuraUtil.FindAuraByName(setting.buffName, "player") then
equip = true
end

Expand Down