@@ -6,10 +6,11 @@ local update_formspec = function(meta)
6
6
local name = meta :get_string (" name" )
7
7
local icon = meta :get_string (" icon" ) or " home"
8
8
local url = meta :get_string (" url" ) or " "
9
+ local image = meta :get_string (" image" ) or " "
9
10
10
11
meta :set_string (" infotext" , " POI, name:" .. name .. " , icon:" .. icon )
11
12
12
- meta :set_string (" formspec" , " size[8,4 ;]" ..
13
+ meta :set_string (" formspec" , " size[8,5 ;]" ..
13
14
-- col 1
14
15
" field[0.2,1;4,1;name;Name;" .. name .. " ]" ..
15
16
" field[4.2,1;4,1;icon;Icon;" .. icon .. " ]" ..
@@ -18,7 +19,10 @@ local update_formspec = function(meta)
18
19
" field[0.2,2;8,1;url;URL;" .. url .. " ]" ..
19
20
20
21
-- col 3
21
- " button_exit[0,3;8,1;save;Save]" ..
22
+ " field[0.2,3;8,1;image;Image;" .. image .. " ]" ..
23
+
24
+ -- col 4
25
+ " button_exit[0,4;8,1;save;Save]" ..
22
26
" " )
23
27
24
28
end
@@ -34,6 +38,7 @@ local on_receive_fields = function(pos, formname, fields, sender)
34
38
if fields .save then
35
39
meta :set_string (" name" , fields .name )
36
40
meta :set_string (" url" , fields .url )
41
+ meta :set_string (" image" , fields .image )
37
42
meta :set_string (" icon" , fields .icon or " home" )
38
43
end
39
44
@@ -60,6 +65,7 @@ local register_poi = function(color, dye)
60
65
meta :set_string (" name" , " <unconfigured>" )
61
66
meta :set_string (" icon" , " home" )
62
67
meta :set_string (" url" , " " )
68
+ meta :set_string (" image" , " " )
63
69
64
70
update_formspec (meta )
65
71
end ,
0 commit comments