Remove hard-coding of table metrics and calculate spacing/sizes

This commit is contained in:
Hugues Ross 2021-11-23 07:59:59 -05:00
parent f38836d31b
commit 395e142fca
3 changed files with 536 additions and 330 deletions

View File

@ -43,4 +43,4 @@ cartographer = {
materials = materials,
-- scanner.lua: Exposes functions for queuing and performing terrain scans
scanner = scanner,
};
}

View File

@ -32,10 +32,14 @@ return {
node_texture = "cartographer_simple_table.png",
background = {
margin_x = 0.125,
margin_y = 0.125,
texture = "cartographer_simple_table_bg",
radius = 16,
},
inner_background = {
margin_x = 0.125,
margin_y = 0.125,
texture = "cartographer_simple_table_bg_2",
radius = 4,
},
@ -47,21 +51,40 @@ return {
hovered_texture = "cartographer_simple_table_button_hovered",
pressed_texture = "cartographer_simple_table_button_pressed",
radius = 8,
width = 2,
height = 0.5,
},
slot = {
texture = "cartographer_simple_table_slot",
radius = 8,
width = 1,
height = 1,
},
separator = {
texture = "cartographer_simple_table_separator",
radius = "9,1",
},
material_indicator = {
width = 1,
height = 0.25,
spacing = 0.25
},
label = {
margin_x = 0,
margin_y = 0,
font_color = "#694a3a",
texture = "cartographer_simple_table_slot",
radius = 8,
},
radio = {
width = 0.5,
height = 0.5,
margin_x = 0.25,
margin_y = 0.25,
},
tab = {
width = 1.5,
height = 0.55,
font_color = "#694a3a",
texture = "cartographer_simple_table_tab",
selected_texture = "cartographer_simple_table_tab_selected",
@ -76,10 +99,14 @@ return {
node_mesh = "cartographer_standard_table.obj",
node_texture = "cartographer_standard_table.png",
background = {
margin_x = 0.125,
margin_y = 0.125,
texture = "cartographer_standard_table_bg",
radius = 16,
},
inner_background = {
margin_x = 0.125,
margin_y = 0.125,
texture = "cartographer_standard_table_bg_2",
radius = 4,
},
@ -91,21 +118,40 @@ return {
hovered_texture = "cartographer_simple_table_button_hovered",
pressed_texture = "cartographer_simple_table_button_pressed",
radius = 8,
width = 2,
height = 0.5,
},
slot = {
texture = "cartographer_standard_table_slot",
radius = 8,
width = 1,
height = 1,
},
separator = {
texture = "cartographer_standard_table_separator",
radius = "9,1",
},
material_indicator = {
width = 1,
height = 0.25,
spacing = 0.25
},
label = {
margin_x = 0,
margin_y = 0,
font_color = "#694a3a",
texture = "cartographer_standard_table_slot",
radius = 8,
},
radio = {
width = 0.5,
height = 0.5,
margin_x = 0.25,
margin_y = 0.25,
},
tab = {
width = 1.5,
height = 0.55,
font_color = "#694a3a",
texture = "cartographer_standard_table_tab",
selected_texture = "cartographer_standard_table_tab_selected",
@ -120,10 +166,14 @@ return {
node_mesh = "cartographer_advanced_table.obj",
node_texture = "cartographer_advanced_table.png",
background = {
margin_x = 0.125,
margin_y = 0.125,
texture = "cartographer_advanced_table_bg",
radius = 16,
},
inner_background = {
margin_x = 0.125,
margin_y = 0.125,
texture = "cartographer_advanced_table_bg_2",
radius = 2,
},
@ -135,21 +185,40 @@ return {
hovered_texture = "cartographer_advanced_table_button_hovered",
pressed_texture = "cartographer_advanced_table_button_pressed",
radius = 8,
width = 2,
height = 0.5,
},
slot = {
texture = "cartographer_advanced_table_slot",
radius = 8,
width = 1,
height = 1,
},
separator = {
texture = "cartographer_advanced_table_separator",
radius = "9,1",
},
material_indicator = {
width = 1,
height = 0.25,
spacing = 0.25
},
label = {
margin_x = 0,
margin_y = 0,
font_color = "#1f2533",
texture = "cartographer_advanced_table_slot",
radius = 8,
},
radio = {
width = 0.5,
height = 0.5,
margin_x = 0.25,
margin_y = 0.25,
},
tab = {
width = 1.75,
height = 0.75,
font_color = "#1f2533",
texture = "cartographer_advanced_table_tab",
selected_texture = "cartographer_advanced_table_tab_selected",
@ -199,4 +268,7 @@ return {
-- The texture of the height toggle button when inactive
flat_button_texture = "cartographer_flat_button",
};
player_inv_columns = 8,
player_inv_rows = 4,
}

790
table.lua

File diff suppressed because it is too large Load Diff