Remove alignment flow

- This should also help with longer entity names
This commit is contained in:
badgamernl
2020-09-08 17:13:18 +02:00
parent afcd16c56e
commit 7449535aa7

View File

@@ -241,21 +241,23 @@ Gui.element(function(event_trigger, parent)
local tables = {} local tables = {}
-- Draw a section for the element -- Draw a section for the element
local entity_table = section(scroll_table, setting.entity, 3) local entity_table = section(scroll_table, setting.entity, 3)
-- Add some padding around the table
entity_table.style.padding = 3 entity_table.style.padding = 3
-- Make sure each collumn is alignment top center
entity_table.style.column_alignments[1] = 'top-center'
entity_table.style.column_alignments[2] = 'top-center'
entity_table.style.column_alignments[3] = 'top-center'
-- Loop over each item category -- Loop over each item category
for _, category in pairs(config.categories) do for _, category in pairs(config.categories) do
if not table_sizes[category] then table_sizes[category] = 0 end if not table_sizes[category] then table_sizes[category] = 0 end
-- Draw a alignment gui to make sure the gui is floating to the top of the parent
local alignment = Gui.alignment(entity_table, category..'-'..setting.entity, 'center', 'top')
alignment.style.padding = 0
-- Draw table -- Draw table
local category_table = alignment.add{ local category_table = entity_table.add{
type = 'table', type = 'table',
name = 'category-table', name = category..'-category',
column_count = 2 column_count = 2
} }
-- Add padding between each item
category_table.style.vertical_spacing = 1 category_table.style.vertical_spacing = 1
category_table.parent.style.padding = 0
tables[category] = category_table tables[category] = category_table
-- Add item autofill setting gui elements to the table -- Add item autofill setting gui elements to the table
for _, item in pairs(setting.items) do for _, item in pairs(setting.items) do