Path of Exile Wiki

Wiki поддерживается сообществом, поэтому подумайте над тем, чтобы внести свой вклад.

ПОДРОБНЕЕ

Path of Exile Wiki
Первая страница
Вторая страница
 
(Новая страница: «------------------------------------------------------------------------------- -- -- Cargo table declaration for Module:Item2 -- ------------------------------...»)
 
Строка 5: Строка 5:
 
-------------------------------------------------------------------------------
 
-------------------------------------------------------------------------------
   
  +
local getArgs = require('Module:Arguments').getArgs
 
local m_util = require('Module:Util')
 
local m_util = require('Module:Util')
 
local m_cargo = require('Module:Cargo')
 
local m_cargo = require('Module:Cargo')
Строка 57: Строка 58:
 
-- type: type of the field
 
-- type: type of the field
 
return function(frame)
 
return function(frame)
local tpl_args = m_util.misc.get_args_raw(frame)
+
local tpl_args = getArgs(frame, {
  +
parentFirst = true
  +
})
  +
frame = m_util.misc.get_frame(frame)
  +
 
local dcl_args = {}
 
local dcl_args = {}
 
dcl_args._table = data.table
 
dcl_args._table = data.table
Строка 65: Строка 70:
 
for _, stat_data in pairs(core.stat_map) do
 
for _, stat_data in pairs(core.stat_map) do
 
if stat_data.field == key then
 
if stat_data.field == key then
for _, range_field in ipairs(c.range_fields) do
+
for _, range_fields in ipairs(c.range_fields) do
 
-- if the type is nil, use the parent type
 
-- if the type is nil, use the parent type
 
-- so this is set integer/float values correctly
 
-- so this is set integer/float values correctly
dcl_args[stat_data.field .. range_field.field] = range_field.type or field_data.type or 'Integer'
+
dcl_args[stat_data.field .. range_fields.field] = range_fields.type or field_data.type
 
end
 
end
 
break
 
break
Строка 78: Строка 83:
 
if dcl_args._table == 'weapons' then
 
if dcl_args._table == 'weapons' then
 
for _, dps_data in pairs(core.dps_map) do
 
for _, dps_data in pairs(core.dps_map) do
for _, range_field in ipairs(c.range_fields) do
+
for _, range_fields in ipairs(c.range_fields) do
 
-- since there is no parent, the default is float
 
-- since there is no parent, the default is float
dcl_args[dps_data.field .. range_field.field] = range_field.type or 'Float'
+
dcl_args[dps_data.field .. range_fields.field] = range_fields.type or 'Float'
 
end
 
end
 
end
 
end
 
end
 
end
 
 
if tpl_args.debug then
 
if tpl_args.debug then
 
mw.logObject(dcl_args)
 
mw.logObject(dcl_args)
 
end
 
end
return m_cargo.declare(dcl_args)
+
return m_cargo.declare(frame, dcl_args)
 
end
 
end
 
end
 
end
Строка 103: Строка 107:
 
html = core.map.html,
 
html = core.map.html,
 
html_extra = core.map.html_extra,
 
html_extra = core.map.html_extra,
infobox_html = core.map.infobox_html,
 
metabox_html = core.map.metabox_html,
 
 
implicit_stat_text = core.map.implicit_stat_text,
 
implicit_stat_text = core.map.implicit_stat_text,
 
explicit_stat_text = core.map.explicit_stat_text,
 
explicit_stat_text = core.map.explicit_stat_text,
Строка 308: Строка 310:
 
fields = {
 
fields = {
 
armour = core.map.armour,
 
armour = core.map.armour,
armour_min = core.map.armour_min,
 
armour_max = core.map.armour_max,
 
evasion = core.map.evasion,
 
evasion_min = core.map.evasion_min,
 
evasion_max = core.map.evasion_max,
 
 
energy_shield = core.map.energy_shield,
 
energy_shield = core.map.energy_shield,
energy_shield_min = core.map.energy_shield_min,
+
evasion = core.map.evasion,
energy_shield_max = core.map.energy_shield_max,
 
 
ward = core.map.ward,
 
ward = core.map.ward,
ward_min = core.map.ward_min,
 
ward_max = core.map.ward_max,
 
 
movement_speed = core.map.movement_speed,
 
movement_speed = core.map.movement_speed,
 
},
 
},
Строка 432: Строка 426:
 
fields = {
 
fields = {
 
cosmetic_type = core.map.cosmetic_type,
 
cosmetic_type = core.map.cosmetic_type,
theme = core.map.cosmetic_theme,
 
 
},
 
},
 
}
 
}
Строка 457: Строка 450:
 
fields = {
 
fields = {
 
is_master_doodad = core.map.is_master_doodad,
 
is_master_doodad = core.map.is_master_doodad,
 
master = core.map.master,
  +
master_level_requirement = core.map.master_level_requirement,
  +
master_favour_cost = core.map.master_favour_cost,
 
variation_count = core.map.variation_count,
 
variation_count = core.map.variation_count,
 
},
 
},
Строка 564: Строка 560:
 
item_id = {
 
item_id = {
 
field = 'item_id',
 
field = 'item_id',
  +
type = 'String',
  +
},
  +
item_metadata_id = {
  +
field = 'item_metadata_id',
 
type = 'String',
 
type = 'String',
 
},
 
},
Строка 696: Строка 696:
 
p.table_vendor_rewards = h.declare_factory(c.schema.vendor_rewards)
 
p.table_vendor_rewards = h.declare_factory(c.schema.vendor_rewards)
   
function p.append_schema(tpl_args, tables)
+
function p.append_schema(tpl_args, frame, tables)
 
--[[
 
--[[
 
This function adds specified table names to core.map. The range fields for
 
This function adds specified table names to core.map. The range fields for
Строка 749: Строка 749:
   
 
function p.debug_print_tables(frame)
 
function p.debug_print_tables(frame)
  +
frame = m_util.misc.get_frame(frame)
 
for key, data in pairs(c.schema) do
 
for key, data in pairs(c.schema) do
 
mw.logObject(data.table)
 
mw.logObject(data.table)
  +
end
  +
end
  +
  +
function p.debug_attach_test(frame)
  +
frame = m_util.misc.get_frame(frame)
  +
for key, data in pairs(c.schema) do
  +
m_cargo.attach(frame, {_table=data.table})
 
end
 
end
 
end
 
end