mirror of
https://github.com/minetest-mods/technic.git
synced 2025-07-02 16:20:38 +02:00
Add listring functionality
Add shift-click functionality
This commit is contained in:
@ -71,13 +71,21 @@ function technic.register_battery_box(data)
|
||||
"label[3,0;"..S("Charge").."]"..
|
||||
"label[5,0;"..S("Discharge").."]"..
|
||||
"label[1,3;"..S("Power level").."]"..
|
||||
"list[current_player;main;0,5;8,4;]"
|
||||
|
||||
"list[current_player;main;0,5;8,4;]"..
|
||||
"listring[current_name;dst]"..
|
||||
"listring[current_player;main]"..
|
||||
"listring[current_name;src]"..
|
||||
"listring[current_player;main]"
|
||||
|
||||
if data.upgrade then
|
||||
formspec = formspec..
|
||||
"list[current_name;upgrade1;3.5,3;1,1;]"..
|
||||
"list[current_name;upgrade2;4.5,3;1,1;]"..
|
||||
"label[3.5,4;"..S("Upgrade Slots").."]"
|
||||
"label[3.5,4;"..S("Upgrade Slots").."]"..
|
||||
"listring[current_name;upgrade1]"..
|
||||
"listring[current_player;main]"..
|
||||
"listring[current_name;upgrade2]"..
|
||||
"listring[current_player;main]"
|
||||
end
|
||||
|
||||
local run = function(pos, node)
|
||||
|
@ -32,7 +32,8 @@ function technic.register_generator(data)
|
||||
"label[0,0;"..S("Fuel-Fired %s Generator"):format(tier).."]"..
|
||||
"list[current_name;src;3,1;1,1;]"..
|
||||
"image[4,1;1,1;default_furnace_fire_bg.png]"..
|
||||
"list[current_player;main;0,5;8,4;]"
|
||||
"list[current_player;main;0,5;8,4;]"..
|
||||
"listring[]"
|
||||
|
||||
local desc = S("Fuel-Fired %s Generator"):format(tier)
|
||||
|
||||
@ -81,7 +82,8 @@ function technic.register_generator(data)
|
||||
"list[current_name;src;3, 1;1, 1;]"..
|
||||
"image[4, 1;1, 1;default_furnace_fire_bg.png^[lowpart:"..
|
||||
(percent)..":default_furnace_fire_fg.png]"..
|
||||
"list[current_player;main;0, 5;8, 4;]")
|
||||
"list[current_player;main;0, 5;8, 4;]"..
|
||||
"listring[]")
|
||||
end
|
||||
|
||||
minetest.register_node("technic:"..ltier.."_generator", {
|
||||
@ -159,7 +161,8 @@ function technic.register_generator(data)
|
||||
"list[current_name;src;3, 1;1, 1;]"..
|
||||
"image[4, 1;1, 1;default_furnace_fire_bg.png^[lowpart:"..
|
||||
(percent)..":default_furnace_fire_fg.png]"..
|
||||
"list[current_player;main;0, 5;8, 4;]")
|
||||
"list[current_player;main;0, 5;8, 4;]"..
|
||||
"listring[]")
|
||||
return true
|
||||
end,
|
||||
})
|
||||
|
@ -42,12 +42,20 @@ function technic.register_base_machine(data)
|
||||
"list[current_name;src;"..(4-input_size)..",1;"..input_size..",1;]"..
|
||||
"list[current_name;dst;5,1;2,2;]"..
|
||||
"list[current_player;main;0,5;8,4;]"..
|
||||
"label[0,0;"..machine_desc:format(tier).."]"
|
||||
"label[0,0;"..machine_desc:format(tier).."]"..
|
||||
"listring[current_name;dst]"..
|
||||
"listring[current_player;main]"..
|
||||
"listring[current_name;src]"..
|
||||
"listring[current_player;main]"
|
||||
if data.upgrade then
|
||||
formspec = formspec..
|
||||
"list[current_name;upgrade1;1,3;1,1;]"..
|
||||
"list[current_name;upgrade2;2,3;1,1;]"..
|
||||
"label[1,4;"..S("Upgrade Slots").."]"
|
||||
"label[1,4;"..S("Upgrade Slots").."]"..
|
||||
"listring[current_name;upgrade1]"..
|
||||
"listring[current_player;main]"..
|
||||
"listring[current_name;upgrade2]"..
|
||||
"listring[current_player;main]"
|
||||
end
|
||||
|
||||
local run = function(pos, node)
|
||||
|
Reference in New Issue
Block a user