Add shift-click, double ink capacity, improve textures

fork-master
A S Lewis 2020-09-23 17:01:39 +01:00
parent 71ad95668e
commit bd4ff1d500
44 changed files with 135 additions and 49 deletions

View File

@ -313,7 +313,7 @@ if metrosigns.create_all_flag or metrosigns.create_london_flag then
minetest.register_node(node, {
description = city_descrip.." "..line_descrip.." "..unit_descrip.." sign",
tiles = {img},
tiles = {img, img, img, img, img.."^[transform4", img},
inventory_image = img,
groups = {cracky = 3},
light_source = 5,
@ -779,7 +779,7 @@ if metrosigns.create_all_flag or metrosigns.create_stockholm_flag then
minetest.register_node(node, {
description = cap_city.." "..route.. " station sign ("..side_descrip.." terminus)",
tiles = {img},
tiles = {img, img, img, img, img.."^[transform4", img},
inventory_image = img,
groups = {cracky = 3},
light_source = 5,

View File

@ -22,6 +22,7 @@ if HAVE_SIGNS_API_FLAG and (metrosigns.create_all_flag or metrosigns.create_text
for width, width_descrip in pairs(width_table) do
-- Default sign: text on a white background
signs_api.register_sign(
":signs_road",
"metrosigns_text_"..width_descrip,
@ -35,7 +36,7 @@ if HAVE_SIGNS_API_FLAG and (metrosigns.create_all_flag or metrosigns.create_text
color = "#000",
},
node_fields = {
description = "Metrosigns Map Text ("..width_descrip..")",
description = "Metrosigns Text Sign ("..width_descrip..")",
tiles = {
"metrosigns_text_side.png",
"metrosigns_text_side.png",
@ -56,6 +57,44 @@ if HAVE_SIGNS_API_FLAG and (metrosigns.create_all_flag or metrosigns.create_text
minetest.override_item("signs_road:metrosigns_text_"..width_descrip, { light_source = 5 })
-- "You are here sign": text on a reddish background
signs_api.register_sign(
":signs_road",
"metrosigns_here_"..width_descrip,
{
depth = 2/16,
width = width,
height = 1,
entity_fields = {
size = { x = width, y = 12/16 },
maxlines = 3,
color = "#000",
},
node_fields = {
description = "Metrosigns You Are Here Sign ("..width_descrip..")",
tiles = {
"metrosigns_text_side.png",
"metrosigns_text_side.png",
"metrosigns_text_side.png",
"metrosigns_text_side.png",
"metrosigns_text_side.png",
"metrosigns_here_front.png",
},
inventory_image = "metrosigns_here_width_"..width_descrip.."_inv.png",
},
}
)
metrosigns.register_sign(
category,
"signs_road:metrosigns_here_"..width_descrip,
(metrosigns.writer.text_units * width)
)
minetest.override_item(
"signs_road:metrosigns_here_"..width_descrip,
{ light_source = 5 }
)
end
end

View File

@ -174,7 +174,8 @@ function add_map_unit(
minetest.register_node(node, {
description = description,
tiles = {img},
-- Reverse the back image, so map signs can be viewed from the front or back
tiles = {img, img, img, img, img.."^[transform4", img},
inventory_image = img,
groups = {cracky = 3},
light_source = 5,

View File

@ -36,7 +36,7 @@
metrosigns = {}
metrosigns.name = "metrosigns"
metrosigns.ver_max = 1
metrosigns.ver_min = 10
metrosigns.ver_min = 18
metrosigns.ver_rev = 0
metrosigns.writer = {}
@ -87,10 +87,11 @@ metrosigns.writer.cartridge_max = 60000
-- Amount of ink used for one unit
metrosigns.writer.cartridge_min = 1000
-- Number of units used for printing various kinds of sign
metrosigns.writer.box_units = 30
metrosigns.writer.sign_units = 6
metrosigns.writer.map_units = 12
metrosigns.writer.text_units = 12
-- (The printing capacity of a cartridge was doubled in v1.12.0)
metrosigns.writer.box_units = 15
metrosigns.writer.sign_units = 3
metrosigns.writer.map_units = 6
metrosigns.writer.text_units = 6
-- Used in material copied from advtrains_subwayblocks and trainblocks
box_groups = {cracky = 3}

View File

@ -97,7 +97,13 @@ function metrosigns.writer.populateoutput(pos)
local dropdown_index = 1
inv:set_list("output", {})
inv:set_size("output", typescount)
-- For aesthetic reasons, I prefer that the first page is a full 8x5 grid, even if all of the
-- slots are empty. Later pages, however, can have exactly as many slots as they need
if typescount > 40 then
inv:set_size("output", typescount)
else
inv:set_size("output", 40)
end
if metrosigns.writer.check_supplies(pos) then
@ -126,26 +132,35 @@ function metrosigns.writer.populateoutput(pos)
meta:set_string("formspec", "size[11,10]"..
-- Cartridges
"label[0,0;Red\nCartridge]" ..
"list[current_name;redcart;1.5,0;1,1;]" ..
"label[0,1;Green\nCartridge]" ..
"list[current_name;greencart;1.5,1;1,1;]" ..
"label[0,2;Blue\nCartridge]" ..
"list[current_name;bluecart;1.5,2;1,1;]" ..
"label[0,0;Red\nCartridge]"..
"list[current_name;redcart;1.5,0;1,1;]"..
"label[0,1;Green\nCartridge]"..
"list[current_name;greencart;1.5,1;1,1;]"..
"label[0,2;Blue\nCartridge]"..
"list[current_name;bluecart;1.5,2;1,1;]"..
-- Plastic
"label[0,3;Plastic\nSheet]" ..
"list[current_name;plastic;1.5,3;1,1;]" ..
"label[0,3;Plastic\nSheet]"..
"list[current_name;plastic;1.5,3;1,1;]"..
-- Sign categories
"label[0,5;Sign\nCategory]" ..
"dropdown[1.5,5;3.75,1;category;"..dropdown_string..";"..tostring(dropdown_index).."]" ..
"label[0,5;Sign\nCategory]"..
"dropdown[1.5,5;3.75,1;category;"..dropdown_string..";"..tostring(dropdown_index).."]"..
-- List of signs
"list[current_name;output;2.8,0;8,5;"..tostring((page-1)*pagesize).."]" ..
"list[current_name;output;2.8,0;8,5;"..tostring((page-1)*pagesize).."]"..
-- Player inventory
"list[current_player;main;1.5,6.25;8,4;]"..
-- Page buttons
"button[5.5,5;1,1;prevpage;<<<]"..
"button[8.5,5;1,1;nextpage;>>>]"..
"label[6.75,5.25;Page "..page.." of "..maxpage.."]"
"label[6.75,5.25;Page "..page.." of "..maxpage.."]"..
-- List rings
"listring[current_player;main]"..
"listring[current_name;redcart]"..
"listring[current_player;main]"..
"listring[current_name;greencart]"..
"listring[current_player;main]"..
"listring[current_name;bluecart]"..
"listring[current_player;main]"..
"listring[current_name;plastic]"
)
meta:set_int("maxpage",maxpage)
@ -157,44 +172,56 @@ end
function metrosigns.writer.allow_metadata_inventory_put(pos, listname, index, stack, player)
if listname == "redcart" then
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local player_inv = player:get_inventory()
local move_flag
if stack:get_name() == "metrosigns:cartridge_red" then
return 1
else
return 0
if listname == "redcart" and stack:get_name() == "metrosigns:cartridge_red" then
return 1
elseif listname == "greencart" and stack:get_name() == "metrosigns:cartridge_green" then
return 1
elseif listname == "bluecart" and stack:get_name() == "metrosigns:cartridge_blue" then
return 1
elseif listname == "plastic" and stack:get_name() == "basic_materials:plastic_sheet" then
return stack:get_count()
end
-- Cannot rely on the listring to put the right type of cartridge into the right slot;
-- a green cartridge would be put into the red cartridge slot
-- The workaround is to move the green cartridge into the green slot directly
if stack:get_name() == "metrosigns:cartridge_green" and inv:is_empty("greencart") then
if player_inv:remove_item("main", stack) then
inv:add_item("greencart", stack)
move_flag = true
end
elseif listname == "greencart" then
elseif stack:get_name() == "metrosigns:cartridge_blue" and inv:is_empty("bluecart") then
if stack:get_name() == "metrosigns:cartridge_green" then
return 1
else
return 0
if player_inv:remove_item("main", stack) then
inv:add_item("bluecart", stack)
move_flag = true
end
elseif listname == "bluecart" then
elseif stack:get_name() == "basic_materials:plastic_sheet" and inv:is_empty("plastic") then
if stack:get_name() == "metrosigns:cartridge_blue" then
return 1
else
return 0
if player_inv:remove_item("main", stack) then
inv:add_item("plastic", stack)
move_flag = true
end
elseif listname == "plastic" then
if stack:get_name() == "basic_materials:plastic_sheet" then
return stack:get_count()
else
return 0
end
else
return 0
end
-- In this situation, the list of writeable signs is not updated automatically
if move_flag then
metrosigns.writer.populateoutput(pos)
end
-- Having put the green cartridge in the green slot, don't put the greed cartridge in the red
-- slot (etc), as well
return 0
end
function metrosigns.writer.can_dig(pos)

View File

@ -38,6 +38,7 @@ if metrosigns.create_all_flag or metrosigns.create_tabyss_flag then
metrosigns.writer.box_units
)
-- Trains
add_sign(server, server_descrip, "s1", "Abyssal Express", 1, 1)
add_sign(server, server_descrip, "s2", "Fractal Plains", 1, 1)
add_sign(server, server_descrip, "s3", "Erosion Trap", 1, 1)
@ -48,11 +49,24 @@ if metrosigns.create_all_flag or metrosigns.create_tabyss_flag then
add_sign(server, server_descrip, "r1", "Narsh Express", 1, 1)
add_sign(server, server_descrip, "t1", "Tommy's Line", 1, 1)
add_sign(server, server_descrip, "t2", "Subway", 1, 1)
-- GS Metro
add_sign(server, server_descrip, "gsm1", "GSM Line 1", 3, 3)
add_sign(server, server_descrip, "gsm2", "GSM Line 2", 3, 3)
add_sign(server, server_descrip, "gsm3", "GSM Line 3", 3, 3)
add_sign(server, server_descrip, "gsm4a", "GSM Line 4A", 3, 3)
add_sign(server, server_descrip, "gsm4b", "GSM Line 4B", 3, 3)
add_sign(server, server_descrip, "gsm5a", "GSM Line 5A", 3, 3)
add_sign(server, server_descrip, "gsm5b", "GSM Line 5B", 3, 3)
add_sign(server, server_descrip, "gsm6", "GSM Line 6", 3, 3)
add_sign(server, server_descrip, "gsm7", "GSM Line 7", 3, 3)
add_sign(server, server_descrip, "gsm8a", "GSM Line 8A", 3, 3)
add_sign(server, server_descrip, "gsm8b", "GSM Line 8B", 3, 3)
add_map(
server,
server_descrip,
{
-- Trains
["s1"] = "Abyssal Express",
["s2"] = "Fractal Plains",
["s3"] = "Erosion Trap",
@ -63,6 +77,10 @@ if metrosigns.create_all_flag or metrosigns.create_tabyss_flag then
["r1"] = "Narsh Express",
["t1"] = "Tommy's Line",
["t2"] = "Subway",
-- GS Metro (lines 1-3, 4A, 5A, 6-7, 8A use the same colours as above)
["gsm4b"] = "GSM Line 4B",
["gsm5b"] = "GSM Line 5B",
["gsm8b"] = "GSM Line 8B",
},
{
["line"] = "Line",

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 226 B

After

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 226 B

After

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 B

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 321 B

After

Width:  |  Height:  |  Size: 449 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 B

After

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

After

Width:  |  Height:  |  Size: 405 B