Editing Module:Room features
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 7: | Line 7: | ||
local infobox_cat_map = { |
local infobox_cat_map = { |
||
[' |
['Monster'] = 'Monsters', |
||
[' |
['NPC'] = 'Non-player characters', |
||
[' |
['Scenery'] = 'Scenery', |
||
[' |
['Skill_node'] = 'Nodes', |
||
[' |
['Venture'] = 'Ventures', |
||
[' |
['Shop'] = 'Shops', |
||
['Variant_Category'] = 'Nodes', -- merge with nodes, since the only variants with locations should be nodes |
|||
['variant_category'] = 'Variants', |
|||
} |
} |
||
Line 27: | Line 27: | ||
'?Location object.Image#-=image_sub', |
'?Location object.Image#-=image_sub', |
||
'?Location object.Infobox=infobox_sub', |
'?Location object.Infobox=infobox_sub', |
||
'?Location object.Variant type=vartype_sub', |
|||
'?Location quantity', |
'?Location quantity', |
||
'?#-', |
'?#-', |
||
Line 49: | Line 48: | ||
results_by_type[v] = {} |
results_by_type[v] = {} |
||
end |
end |
||
-- FIXME: Variant category pages (like [[Sparring Guard]]) do not |
|||
-- have an infobox so are not shown |
|||
for i,v in ipairs(query) do |
for i,v in ipairs(query) do |
||
local |
local key = infobox_cat_map[v.infobox_sub or v.infobox] |
||
--convert to all lower case with underscores instead of spaces, for best possible matching |
|||
infobox_type = string.lower(infobox_type) |
|||
infobox_type = string.gsub(infobox_type,' ','_') |
|||
local key = infobox_cat_map[infobox_type] |
|||
-- Can be nil - See East Beach for example |
-- Can be nil - See East Beach for example |
||
if key ~= nil then |
if key ~= nil then |