From 54b119cffacf79cee11ac8b108204e4aa6cbb08a Mon Sep 17 00:00:00 2001 From: AFCMS Date: Sat, 18 Sep 2021 11:05:17 +0200 Subject: [PATCH] some things --- mods/HUD/mcl_formspec/FORMSPEC_GUIDE.md | 13 ++++++++----- mods/ITEMS/mcl_hoppers/init.lua | 12 ++++++------ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/mods/HUD/mcl_formspec/FORMSPEC_GUIDE.md b/mods/HUD/mcl_formspec/FORMSPEC_GUIDE.md index 20673a682..838e5cbdd 100644 --- a/mods/HUD/mcl_formspec/FORMSPEC_GUIDE.md +++ b/mods/HUD/mcl_formspec/FORMSPEC_GUIDE.md @@ -1,19 +1,22 @@ -Formspecs are an important part of game and mod development. +# MineClone2 Formspec Guide -This guide will learn you rules about creation of formspecs for the MineClone2 game. +***This guide will learn you rules about creation of formspecs for the MineClone2 game.*** + +Formspecs are an important part of game and mod development. First of all, MineClone2 aims to support ONLY last formspec version. Many utility functions will not work with formspec v1 or v2. Label font size should be 25 to be minecraft like. We arent modifying formspec prepend in order to not break existing mods. -Just use this code to apply it to your formspec: +Just add this code to apply it to your formspec: ```lua -"style_type[label;font_size=25]", +mcl_formspec.apply_label_size ``` -The typical width of an inventory formspec is `0.375 + 9 + ((9-1) * 0.25) + 0.375 = 11.75` +The typical width of an 9 slots width inventory formspec is `0.375 + 9 + ((9-1) * 0.25) + 0.375 = 11.75` Margins is 0.375 + Space between 1st inventory line and the rest of inventory is 0.45 Labels should have 0.375 space above if there is no other stuff above and 0.45 between content diff --git a/mods/ITEMS/mcl_hoppers/init.lua b/mods/ITEMS/mcl_hoppers/init.lua index 15bc922ff..62b358c64 100644 --- a/mods/ITEMS/mcl_hoppers/init.lua +++ b/mods/ITEMS/mcl_hoppers/init.lua @@ -13,16 +13,16 @@ end local mcl_hoppers_formspec = table.concat({ "size[9,7]", - "label[2,0;" .. F(C("#313131", S("Hopper"))) .. "]", + "label[2,0;"..F(C(mcl_formspec.label_color, S("Hopper"))).."]", "list[context;main;2,0.5;5,1;]", - mcl_formspec.get_itemslot_bg(2, 0.5, 5, 1), - "label[0,2;" .. F(C("#313131", S("Inventory"))) .. "]", + mcl_formspec.get_itemslot_bg(2,0.5,5,1), + "label[0,2;"..F(C(mcl_formspec.label_color, S("Inventory"))).."]", "list[current_player;main;0,2.5;9,3;9]", - mcl_formspec.get_itemslot_bg(0, 2.5, 9, 3), + mcl_formspec.get_itemslot_bg(0,2.5,9,3), "list[current_player;main;0,5.74;9,1;]", - mcl_formspec.get_itemslot_bg(0, 5.74, 9, 1), + mcl_formspec.get_itemslot_bg(0,5.74,9,1), "listring[context;main]", - "listring[current_player;main]", + "listring[current_player;main]" }) -- Downwards hopper (base definition)