Module:Pets: Difference between revisions

getPetPageTable: Re-order icon/name columns for consistency with other tables
(Implement getExpansionIcon & add to a number of outputs; More robust guaranteed pet chance logic)
(getPetPageTable: Re-order icon/name columns for consistency with other tables)
Line 68: Line 68:
['Festive Cool Rock'] = { text = '[[Holiday Event 2021]]', useIcon = false },
['Festive Cool Rock'] = { text = '[[Holiday Event 2021]]', useIcon = false },
['Jerry the Giraffe'] = { text = '[[Golbin Raid|Golbin Raid Shop]]', useIcon = false },
['Jerry the Giraffe'] = { text = '[[Golbin Raid|Golbin Raid Shop]]', useIcon = false },
['Preston the Platypus'] = { text = '[[Golbin Raid|Golbin Raid Shop]]', useIcon = false }
['Preston the Platypus'] = { text = '[[Golbin Raid|Golbin Raid Shop]]', useIcon = false },
['Ty'] = { text = 'Mastery', useIcon = true },
['Golden Golbin'] = { text = Icons.Icon({'Golbin', type='monster'}) .. ' kills', useIcon = false},
['Saki'] = { text = 'Mastery', useIcon = true }
}
}
local petSourceText = nil
local petSourceText = nil
Line 210: Line 213:


result = '{|class="wikitable sortable lighttable stickyHeader"'
result = '{|class="wikitable sortable lighttable stickyHeader"'
result = result..'\r\n|- class="headerRow-0"\r\n! Name !! Image !! Acquired From !! Effect'
result = result..'\r\n|- class="headerRow-0"\r\n! colspan="2"| Pet !! Acquired From !! Effect'


for i, thisPet in ipairs(GameData.rawData.pets) do
for i, thisPet in ipairs(GameData.rawData.pets) do
result = result..'\r\n|-\r\n|'..Icons.Icon({thisPet.name, type='pet', noicon=true})
result = result..'\r\n|-\r\n|class="table-img" data-sort-value="' .. thisPet.name .. '"| ' .. Icons.Icon({thisPet.name, size='60', type='pet', notext=true})
result = result..'||style="text-align: center;"|' .. Icons.getExpansionIcon(thisPet.id) .. Icons.Icon({thisPet.name, size='60', type='pet', notext=true})
result = result..'||' .. Icons.getExpansionIcon(thisPet.id) ..Icons.Icon({thisPet.name, type='pet', noicon=true})
result = result..'||'..p._getPetSourceText(thisPet)
result = result..'||'..p._getPetSourceText(thisPet)
result = result..'||'..p._getPetEffect(thisPet)
result = result..'||'..p._getPetEffect(thisPet)