• Welcome to the Kancolle Wiki!
  • If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord

Changes

Jump to navigation Jump to search
hue
Line 160: Line 160:  
     return args.format == "table" and ("|" .. arg .. "\n") or arg
 
     return args.format == "table" and ("|" .. arg .. "\n") or arg
 
end
 
end
 +
 +
local env = {}
    
function interpret_setter(s)
 
function interpret_setter(s)
Line 165: Line 167:  
     local k = kv[1]
 
     local k = kv[1]
 
     local v = kv[2]
 
     local v = kv[2]
     if k and v then
+
    local c = kv[3]
 +
     if k and v and c then
 +
        env[c] = env[c] or require("Module:" .. c)
 +
        env[k] = env[c](v)
 +
        return true
 +
    elseif k and v then
 
         if k == "_equipment" then
 
         if k == "_equipment" then
 
             local equipment = {}
 
             local equipment = {}
Line 184: Line 191:  
             end
 
             end
 
         else
 
         else
             if v ~= "nil" then
+
             if v ~= "nil" and ship then
 
                 ship[k] = tonumber(v)
 
                 ship[k] = tonumber(v)
 +
            else
 +
                env[k] = v
 
             end
 
             end
 
         end
 
         end
Line 239: Line 248:  
             return format_arg(format_value(string.sub(arg, 3), target, ship))
 
             return format_arg(format_value(string.sub(arg, 3), target, ship))
 
         elseif prefix2 == "?#" then
 
         elseif prefix2 == "?#" then
             return frame:preprocess(format{ '{{${template}|${ship}}}', template = string.sub(arg, 3), ship = ship:name('/') })
+
             return frame:preprocess(format{string.sub(arg, 3), this = env[this] or ""})
 
         else
 
         else
 
             return format_arg(format_value(string.sub(arg, 2), ship, target))
 
             return format_arg(format_value(string.sub(arg, 2), ship, target))
cssedit, gkautomate
6,940

edits

Navigation menu