diff options
author | Fernando Carmona Varo <ferkiwi@gmail.com> | 2015-10-24 22:13:27 +0200 |
---|---|---|
committer | Fernando Carmona Varo <ferkiwi@gmail.com> | 2015-10-24 22:13:27 +0200 |
commit | 65f7603ae3aac553716c8d4e9141914251b430d5 (patch) | |
tree | c8b24a397e90ce4ed2b320c4ae9e24fff90a545b | |
parent | aa2ae43852a927693f44b0643e98d617a68bff86 (diff) | |
parent | 158bc2f2b49fbb370afcf8f71ef96f8ecb97527d (diff) |
Merge branch 'master' of https://github.com/DonBatman/myarcade
-rw-r--r-- | myhighscore/init.lua | 36 | ||||
-rw-r--r-- | myhighscore/textures/myhighscore_form_bg.png | bin | 0 -> 471 bytes |
2 files changed, 35 insertions, 1 deletions
diff --git a/myhighscore/init.lua b/myhighscore/init.lua index 4da6a0e..0eab03c 100644 --- a/myhighscore/init.lua +++ b/myhighscore/init.lua @@ -1,3 +1,26 @@ + + +local button_form = "size[6,8;]".. + "background[0,0;6,8;myhighscore_form_bg.png]".. + "label[1,0.5;HIGH SCORES]".. + "button[1,1;4,1;game;label]".. + "button_exit[4,7;1,2;exit;Exit]" + +--place holders +local game_name = "the game" +local game_player_name = "the player" +local game_player_score = "648138" + +local game_form = "size[6,8;]".. + "background[0,0;6,8;myhighscore_form_bg.png]".. + "label[1,0.5;HIGH SCORES FOR "..game_name.."]".. + "label[1,1.5;PLAYER]".. + "label[3.5,1.5;SCORE]".. + "label[0.5,2;"..game_player_name.."]".. + "label[3,2;"..game_player_score.."]".. + "button[2,7;1,2;back;Back]".. + "button_exit[4,7;1,2;exit;Exit]" + minetest.register_node("myhighscore:score_board", { description = "Score Board", tiles = { @@ -24,7 +47,18 @@ minetest.register_node("myhighscore:score_board", { } }, -on_rightclick = function(pos, node, player, itemstack, pointed_thing) +on_construct = function(pos) + local meta = minetest.env:get_meta(pos) + meta:set_string("formspec", button_form) + meta:set_string("infotext", "High Scores") +end, +on_receive_fields = function(pos, formname, fields, sender) + local meta = minetest.env:get_meta(pos) + if fields['game'] then + meta:set_string('formspec', game_form) + elseif fields["back"] then + meta:set_string('formspec', button_form) + end end, }) diff --git a/myhighscore/textures/myhighscore_form_bg.png b/myhighscore/textures/myhighscore_form_bg.png Binary files differnew file mode 100644 index 0000000..d6a8e18 --- /dev/null +++ b/myhighscore/textures/myhighscore_form_bg.png |