cleaned up some things
This commit is contained in:
@@ -589,6 +589,10 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame)
|
|||||||
|
|
||||||
-- Hide the Filter Check-Box
|
-- Hide the Filter Check-Box
|
||||||
AtlasLootFilterCheck:Hide();
|
AtlasLootFilterCheck:Hide();
|
||||||
|
|
||||||
|
--Hide the Difficulty selector will show if needed
|
||||||
|
AtlasLootMythicButton:Hide();
|
||||||
|
AtlasLoot_DifficultySelect:Hide();
|
||||||
|
|
||||||
dataSource_backup = dataSource;
|
dataSource_backup = dataSource;
|
||||||
if dataID == "SearchResult" or dataID == "WishList" then
|
if dataID == "SearchResult" or dataID == "WishList" then
|
||||||
@@ -659,12 +663,9 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame)
|
|||||||
--Check to see if loaded table is different Difficulty then options set
|
--Check to see if loaded table is different Difficulty then options set
|
||||||
local dif = false;
|
local dif = false;
|
||||||
if(dataSource[dataID].Dif ~= nil) then
|
if(dataSource[dataID].Dif ~= nil) then
|
||||||
if (dataSource[dataID].Raid ~= nil) then
|
--Raid tables only have 4 Difficulties, this helps set it if previous selection was possibly dungeon
|
||||||
if(AtlasLoot.db.profile.MythicPlussTier > 4) then
|
if dataSource[dataID].Raid ~= nil then AtlasLoot.db.profile.MythicPlussTier = math.min(4, AtlasLoot.db.profile.MythicPlussTier) end
|
||||||
AtlasLoot.db.profile.MythicPlussTier = 4;
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
dif = not (dataSource[dataID].Dif == AtlasLoot.db.profile.MythicPlussTier);
|
dif = not (dataSource[dataID].Dif == AtlasLoot.db.profile.MythicPlussTier);
|
||||||
if dif then
|
if dif then
|
||||||
--Set this page to the new Difficulty
|
--Set this page to the new Difficulty
|
||||||
@@ -675,7 +676,6 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame)
|
|||||||
--Iterate through each item object and set its properties
|
--Iterate through each item object and set its properties
|
||||||
for i = 1, 30, 1 do
|
for i = 1, 30, 1 do
|
||||||
--Check for a valid object (that it exists, and that it has a name)
|
--Check for a valid object (that it exists, and that it has a name)
|
||||||
local itemId = 0;
|
|
||||||
if(dataSource[dataID][i] ~= nil and dataSource[dataID][i][4] ~= "") then
|
if(dataSource[dataID][i] ~= nil and dataSource[dataID][i][4] ~= "") then
|
||||||
|
|
||||||
if string.sub(dataSource[dataID][i][2], 1, 1) == "s" then
|
if string.sub(dataSource[dataID][i][2], 1, 1) == "s" then
|
||||||
@@ -683,28 +683,23 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame)
|
|||||||
else
|
else
|
||||||
isItem = true;
|
isItem = true;
|
||||||
end
|
end
|
||||||
|
|
||||||
itemId = dataSource[dataID][i][2]
|
|
||||||
|
|
||||||
if isItem then
|
if isItem then
|
||||||
if itemId < 0 then
|
|
||||||
--Items that are set to be ignored by difficulty changed need to be flipped positive
|
--If difficulty has changed, find new id and set it.
|
||||||
itemId = math.abs(itemId);
|
if dif and dataSource[dataID][i][2] ~= 0 then
|
||||||
elseif dif and itemId ~= 0 then
|
--Some items have an entry in the Difficulty table but are not in the game, will look into seperating later
|
||||||
--If difficulty has changed, find new id and set it.
|
dataSource[dataID][i][2] = AL_FindId(string.sub(dataSource[dataID][i][4], 5), dataSource[dataID].Dif) or dataSource[dataID][i][2]; --No need for negatives anymore :D
|
||||||
itemId = AL_FindId(string.sub(dataSource[dataID][i][4], 5), dataSource[dataID].Dif) or dataSource[dataID][i][2];
|
|
||||||
dataSource[dataID][i][2] = itemId;
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
itemName, itemLink, itemQuality, itemLevel, itemMinLevel, itemType, itemSubType, itemCount, itemEquipLoc, itemTexture = GetItemInfo(dataSource[dataID][i][2]);
|
||||||
itemName, itemLink, itemQuality, itemLevel, itemMinLevel, itemType, itemSubType, itemCount, itemEquipLoc, itemTexture = GetItemInfo(itemId);
|
|
||||||
--If the client has the name of the item in cache, use that instead.
|
--If the client has the name of the item in cache, use that instead.
|
||||||
--This is poor man's localisation, English is replaced be whatever is needed
|
--This is poor man's localisation, English is replaced be whatever is needed
|
||||||
if(GetItemInfo(itemId)) then
|
if(GetItemInfo(dataSource[dataID][i][2])) then
|
||||||
_, _, _, itemColor = GetItemQualityColor(itemQuality);
|
_, _, _, itemColor = GetItemQualityColor(itemQuality);
|
||||||
text = itemColor..itemName;
|
text = itemColor..itemName;
|
||||||
else
|
else
|
||||||
if(GetItemInfo(itemId)) then
|
if(GetItemInfo(dataSource[dataID][i][2])) then
|
||||||
_, _, _, itemColor = GetItemQualityColor(itemQuality);
|
_, _, _, itemColor = GetItemQualityColor(itemQuality);
|
||||||
text = itemColor..itemName;
|
text = itemColor..itemName;
|
||||||
else
|
else
|
||||||
@@ -749,7 +744,7 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame)
|
|||||||
if dataSource[dataID][i][3] == "?" then
|
if dataSource[dataID][i][3] == "?" then
|
||||||
iconFrame:SetTexture("Interface\\Icons\\INV_Misc_QuestionMark");
|
iconFrame:SetTexture("Interface\\Icons\\INV_Misc_QuestionMark");
|
||||||
elseif dataSource[dataID][i][3] == "" then
|
elseif dataSource[dataID][i][3] == "" then
|
||||||
iconFrame:SetTexture(GetItemIcon(itemId));
|
iconFrame:SetTexture(GetItemIcon(dataSource[dataID][i][2]));
|
||||||
elseif (not isItem) and (spellIcon) then
|
elseif (not isItem) and (spellIcon) then
|
||||||
if tonumber(dataSource[dataID][i][3]) then
|
if tonumber(dataSource[dataID][i][3]) then
|
||||||
iconFrame:SetTexture(GetItemIcon(tonumber(dataSource[dataID][i][3])));
|
iconFrame:SetTexture(GetItemIcon(tonumber(dataSource[dataID][i][3])));
|
||||||
@@ -788,7 +783,7 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame)
|
|||||||
itemButton.itemID = dataSource[dataID][i][3];
|
itemButton.itemID = dataSource[dataID][i][3];
|
||||||
itemButton.spellitemID = dataSource[dataID][i][3];
|
itemButton.spellitemID = dataSource[dataID][i][3];
|
||||||
else
|
else
|
||||||
itemButton.itemID = itemId;
|
itemButton.itemID = dataSource[dataID][i][2];
|
||||||
if tonumber(dataSource[dataID][i][3]) then
|
if tonumber(dataSource[dataID][i][3]) then
|
||||||
itemButton.spellitemID = dataSource[dataID][i][3];
|
itemButton.spellitemID = dataSource[dataID][i][3];
|
||||||
else
|
else
|
||||||
@@ -858,16 +853,9 @@ function AtlasLoot_ShowItemsFrame(dataID, dataSource, boss, pFrame)
|
|||||||
AtlasLoot_QuickLooks:Show();
|
AtlasLoot_QuickLooks:Show();
|
||||||
AtlasLootQuickLooksButton:Show();
|
AtlasLootQuickLooksButton:Show();
|
||||||
|
|
||||||
if (AtlasLoot_Data[dataID].Dif ~= nil and AtlasLoot_Data[dataID].Raid ~= nil) then
|
if (AtlasLoot_Data[dataID].Dif ~= nil) then
|
||||||
|
if AtlasLoot_Data[dataID].Raid ~= nil then AtlasLootMythicButton:SetScript("OnClick", AtlasLoot_ShowRaidSelect) else AtlasLootMythicButton:SetScript("OnClick", AtlasLoot_ShowMythicSelect) end;
|
||||||
AtlasLootMythicButton:Show();
|
AtlasLootMythicButton:Show();
|
||||||
AtlasLootMythicButton:SetScript("OnClick", AtlasLoot_ShowRaidSelect);
|
|
||||||
AtlasLoot_DifficultySelect:Show();
|
|
||||||
elseif (AtlasLoot_Data[dataID].Dif ~= nil) then
|
|
||||||
AtlasLootMythicButton:Show();
|
|
||||||
AtlasLootMythicButton:SetScript("OnClick", AtlasLoot_ShowMythicSelect);
|
|
||||||
AtlasLoot_DifficultySelect:Show();
|
|
||||||
else
|
|
||||||
AtlasLootMythicButton:Hide();
|
|
||||||
AtlasLoot_DifficultySelect:Show();
|
AtlasLoot_DifficultySelect:Show();
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user