diff --git a/mods/HUD/craftingpack/crafting/creative.lua b/mods/HUD/craftingpack/crafting/creative.lua index 26663dcdc3..62680b6909 100644 --- a/mods/HUD/craftingpack/crafting/creative.lua +++ b/mods/HUD/craftingpack/crafting/creative.lua @@ -211,7 +211,10 @@ crafting.set_creative_formspec = function(player, start_i, pagenum, show, page, if name == "inv" then -- Survival inventory slots main_list = "image[-0.2,1.7;11.35,2.33;crafting_creative_bg.png]".. - "list[current_player;main;0,3.75;9,3;9]" + "list[current_player;main;0,3.75;9,3;9]".. + -- achievements button + "image_button[9,2;1,1;mcl_achievements_button.png;__mcl_achievements;]".. + "tooltip[__mcl_achievements;Achievements]" else inv_bg = inv_bg .. "^crafting_inventory_creative_scroll.png" -- Creative inventory slots diff --git a/mods/HUD/craftingpack/crafting/init.lua b/mods/HUD/craftingpack/crafting/init.lua index a3aa93f346..9a895918dd 100644 --- a/mods/HUD/craftingpack/crafting/init.lua +++ b/mods/HUD/craftingpack/crafting/init.lua @@ -81,6 +81,9 @@ local function set_inventory(player) -- crafting guide button "image_button[8,0;1,1;craftguide_book.png;__mcl_craftguide;]".. "tooltip[__mcl_craftguide;Show crafting recipes]".. + -- achievements button + "image_button[8,1;1,1;mcl_achievements_button.png;__mcl_achievements;]".. + "tooltip[__mcl_achievements;Achievements]".. -- for shortcuts "listring[current_player;main]".. "listring[current_player;craft]".. diff --git a/mods/HUD/mcl_achievements/README.txt b/mods/HUD/mcl_achievements/README.txt new file mode 100644 index 0000000000..352f9a1848 --- /dev/null +++ b/mods/HUD/mcl_achievements/README.txt @@ -0,0 +1 @@ +License of this mod (including textures and other data): WTFPL diff --git a/mods/HUD/mcl_achievements/init.lua b/mods/HUD/mcl_achievements/init.lua index 0ef7880e36..d3a6356bfb 100644 --- a/mods/HUD/mcl_achievements/init.lua +++ b/mods/HUD/mcl_achievements/init.lua @@ -200,3 +200,11 @@ awards.register_achievement("mcl:f_placeRails", { } }) + +-- Show achievements formspec when the button was pressed +minetest.register_on_player_receive_fields(function(player, formname, fields) + if fields.__mcl_achievements then + local name = player:get_player_name() + awards.show_to(name, name, nil, false) + end +end) diff --git a/mods/HUD/mcl_achievements/textures/mcl_achievements_button.png b/mods/HUD/mcl_achievements/textures/mcl_achievements_button.png new file mode 100644 index 0000000000..9c139d73cd Binary files /dev/null and b/mods/HUD/mcl_achievements/textures/mcl_achievements_button.png differ