Changes

another item attempt. doesn't work. revert if needed.
Line 10: Line 10:  
local EquipmentGraphicKai = require("Module:EquipmentGraphicKai")
 
local EquipmentGraphicKai = require("Module:EquipmentGraphicKai")
 
local EquipmentCollection = require("Module:Data/Equipment")
 
local EquipmentCollection = require("Module:Data/Equipment")
 +
local ItemCollection = require('Module:Collection/Items')
 
-- local AllEquipmentCollection = require("Module:Collection/EquipmentByApiId")
 
-- local AllEquipmentCollection = require("Module:Collection/EquipmentByApiId")
 
local Development = require("Module:Development")
 
local Development = require("Module:Development")
Line 49: Line 50:  
     equipment = true
 
     equipment = true
 
     return U.imap(EquipmentCollection, function(e) return e._name end)
 
     return U.imap(EquipmentCollection, function(e) return e._name end)
 +
    end,
 +
    item = function()
 +
    item = true
 +
    return U.imap(ItemCollection, function(e) return e._name end)
 
     end,
 
     end,
 
     --[[
 
     --[[
Line 151: Line 156:  
     card = function(obj)
 
     card = function(obj)
 
     if not obj or not obj.lua_name then
 
     if not obj or not obj.lua_name then
     return ' '
+
     if equipment then --attempted to stop equipment from being filtered out, as equip cards weren't showing up. Don't know if this only works for equip and if I broke the original funtion's intention. This may not work at filtering out errors -chocolatecravinghobo
 +
    else
 +
    return ' '
 +
    end
 
     end
 
     end
 
         if obj.hp then
 
         if obj.hp then
Line 413: Line 421:  
        for _, e in ipairs(enumerating_function()) do
 
        for _, e in ipairs(enumerating_function()) do
 
        local ship
 
        local ship
        if equipment then
+
        if equipment or item then
 
        ship = Equipment(e)
 
        ship = Equipment(e)
 
        else
 
        else
Line 428: Line 436:  
if type(g) == 'function' then
 
if type(g) == 'function' then
 
obj = g(obj)
 
obj = g(obj)
 +
if type(obj) == 'nil' then
 +
obj = '??'
 +
break
 +
end
 
elseif type(g) == 'table' then
 
elseif type(g) == 'table' then
 
obj = g
 
obj = g
Line 515: Line 527:  
mw.log(interpret({"!Saiun", "?icon"}))
 
mw.log(interpret({"!Saiun", "?icon"}))
 
mw.log(interpret({"!Ayanami", "?scrap_string", "?scrap.fuel", "?scrap_fuel", "?_scrap_fuel"}))
 
mw.log(interpret({"!Ayanami", "?scrap_string", "?scrap.fuel", "?scrap_fuel", "?_scrap_fuel"}))
 +
mw.log(interpret({'@all_names', '~class.name~Akizuki Class', '?api_id', '?banner', '?link', '?japanese_name', '?code_link', '?class_number', '?firepower_max', '?torpedo_max', '?night_battle_power', '?aa_max', '?asw_max', '?los_max', '?luck', '?hp', '?armor_max', '?evasion_max', '?slots', '?fuel', '?ammo', sort = 'class_number,rarity,api_id'}))
 
end
 
end
  
advmod, cssedit, Interface administrators, janitor, Moderators, prechecked, Widget editors
7,932

edits