Module:Sandbox: Difference between revisionsGive feedback
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
local p = {} | |||
function p.get_all_item_names() | function p.get_all_item_names() | ||
local items = {} | local items = {} | ||
Revision as of 20:00, 21 April 2025
Documentation for this module may be created at Module:Sandbox/doc
local p = {}
function p.get_all_item_names()
local items = {}
for item_key, item_data in pairs(items_data) do
if item_data["Name"] ~= nil and item_data["IsDisabled"] == false then
local lang_code = lang_module.get_lang_code()
local item_name_local = lang_module.get_string(item_key, lang_code)
if item_name_local and item_name_local ~= "" then
table.insert(items, item_name_local)
end
end
end
-- Сортируем имена предметов по алфавиту
table.sort(items)
-- Объединяем через запятую
return table.concat(items, ", ")
end
return p