diff options
author | ShadowNinja <noreply@gmail.com> | 2013-10-02 23:25:07 -0400 |
---|---|---|
committer | ShadowNinja <noreply@gmail.com> | 2013-10-02 23:25:07 -0400 |
commit | 04600f64d879f87f54d4dd7b9654a7a921149a44 (patch) | |
tree | c7077a3c40a58c5ca3489ec61ff13835310b13d8 /register.lua | |
parent | ec328d8270796313e039d4f206d5791577e86475 (diff) |
API tweaks
Diffstat (limited to 'register.lua')
-rw-r--r-- | register.lua | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/register.lua b/register.lua index 9ca1f77..32b4cf9 100644 --- a/register.lua +++ b/register.lua @@ -118,7 +118,7 @@ unified_inventory.register_button("clear_inv", { unified_inventory.register_page("craft", { get_formspec = function(player, formspec) local player_name = player:get_player_name() - formspec = formspec.."background[0.06,0.99;7.92,7.52;ui_crafting_form.png]" + local formspec = "background[0.06,0.99;7.92,7.52;ui_crafting_form.png]" formspec = formspec.."label[0,0;Crafting]" formspec = formspec.."list[current_player;craftpreview;6,1;1,1;]" formspec = formspec.."list[current_player;craft;2,1;3,3;]" @@ -128,14 +128,14 @@ unified_inventory.register_page("craft", { formspec = formspec.."label[0,2.5;Refill:]" formspec = formspec.."list[detached:"..player_name.."refill;main;0,3;1,1;]" end - return formspec + return {formspec=formspec} end, }) unified_inventory.register_page("craftguide", { - get_formspec = function(player, formspec) + get_formspec = function(player) local player_name = player:get_player_name() - formspec = formspec.."background[0.06,0.99;7.92,7.52;ui_craftguide_form.png]" + local formspec = "background[0.06,0.99;7.92,7.52;ui_craftguide_form.png]" formspec = formspec.."label[0,0;Crafting Guide]" formspec = formspec.."list[detached:"..player_name.."craftrecipe;output;6,1;1,1;]" formspec = formspec.."label[2,0.5;Input:]" @@ -176,7 +176,7 @@ unified_inventory.register_page("craftguide", { if not craft then craftinv:set_stack("output", 1, nil) - return formspec + return {formspec=formspec} end craftinv:set_stack("output", 1, craft.output) @@ -209,6 +209,7 @@ unified_inventory.register_page("craftguide", { i = i + 1 end end - return formspec + return {formspec=formspec} end, }) + |