Help menu

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

Help menu

by BrunoMine » Tue Nov 04, 2014 21:18

I want to create a wiki from survival menu.
When you click on the button nothing happens.

minetest_game/mods/default/init.lua
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
default.wiki = "size[10,10]"..
   "textarea[1,1;4,4;Texto;texto;Descricao]"


default.gui_suvival_form = "size[8,8.5]"..
         default.gui_bg..
         default.gui_bg_img..
         default.gui_slots..
         "list[current_player;main;0,4.25;8,1;]"..
         "list[current_player;main;0,5.5;8,3;8]"..
         "list[current_player;craft;1.75,0.5;3,3;]"..
         "list[current_player;craftpreview;5.75,1.5;1,1;]"..
         "image[4.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]"..
         "image_button[5.80,2.5;2,1;default_image_question.png;question;Ajuda]"..
         default.get_hotbar_bg(0,4.25)

minetest.register_on_player_receive_fields(function(meta, fields, name, player)
   local meta = minetest.get_meta(pos)
   formspec = default.wiki
   if fields.question then
      meta:set_string("formspec",formspec)
      minetest.chat_send_player("singleplayer","Mensagem teste")
   end
end)
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: Help menu

by Krock » Wed Nov 05, 2014 19:06

brunob.santos wrote:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_on_player_receive_fields(function(meta, fields, name, player)
   local meta = minetest.get_meta(pos)
   formspec = default.wiki

And that's one of the bad things about register_on_player_receive_fields - it does not have a "pos" argument in the function.
You'll need to get the position of the node from somewhere.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 6 guests

cron