mirror of
https://github.com/Xevion/project-cybersyn.git
synced 2025-12-14 10:12:42 -06:00
Trains tab initial testing
This commit is contained in:
@@ -64,27 +64,26 @@ end
|
||||
function util.slot_table_build_from_manifest(manifest, color)
|
||||
---@type GuiElemDef[]
|
||||
local children = {}
|
||||
for _, item in pairs(manifest) do
|
||||
local name = item.name
|
||||
local sprite
|
||||
if item.type then
|
||||
sprite = item.type .. "/" .. name
|
||||
else
|
||||
sprite = string.gsub(name, ",", "/")
|
||||
end
|
||||
if game.is_valid_sprite_path(sprite) then
|
||||
children[#children + 1] = {
|
||||
type = "sprite-button",
|
||||
enabled = false,
|
||||
style = "ltnm_small_slot_button_" .. color,
|
||||
sprite = sprite,
|
||||
tooltip = {
|
||||
"",
|
||||
"[img=" .. sprite .. "]",
|
||||
{ "item-name." .. name },
|
||||
"\n"..format.number(count),
|
||||
},
|
||||
}
|
||||
if manifest then
|
||||
for _, item in pairs(manifest) do
|
||||
local name = item.name
|
||||
local count = item.count
|
||||
local sprite, img_path, item_string = util.generate_item_references(name)
|
||||
if game.is_valid_sprite_path(sprite) then
|
||||
children[#children + 1] = {
|
||||
type = "sprite-button",
|
||||
enabled = false,
|
||||
style = "ltnm_small_slot_button_" .. color,
|
||||
sprite = sprite,
|
||||
number = count,
|
||||
tooltip = {
|
||||
"",
|
||||
img_path,
|
||||
{ item_string },
|
||||
"\n"..format.number(count),
|
||||
},
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
return children
|
||||
|
||||
Reference in New Issue
Block a user