#6 Adds the Wagon Properties button to wagons

Open
Maverick2797 wants to merge 1 commits from Maverick2797/wagonprops into rbduck/master
4 changed files with 17 additions and 105 deletions
  1. 5 30
      moretrains_gondola/init.lua
  2. 9 57
      moretrains_industrial/init.lua
  3. 1 6
      moretrains_steam/init.lua
  4. 2 12
      moretrains_vintage/init.lua

+ 5 - 30
moretrains_gondola/init.lua

@@ -17,12 +17,7 @@ advtrains.register_wagon("moretrains_wagon_gondola", {
 	collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
 	drops={"default:steelblock"},
 	has_inventory = true,
-	get_inventory_formspec = function(self, pname, invname)
-		return "size[8,11]"..
-			"list["..invname..";box;0,0;8,3;]"..
-			"list[current_player;main;0,5;8,4;]"..
-			"listring[]"
-	end,
+	get_inventory_formspec = advtrains.standard_inventory_formspec,
 	inventory_list_sizes = {
 		box=8*3,
 	},
@@ -40,12 +35,7 @@ advtrains.register_wagon("moretrains_wagon_gondola_mese", {
 	collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
 	drops={"default:steelblock"},
 	has_inventory = true,
-	get_inventory_formspec = function(self, pname, invname)
-		return "size[8,11]"..
-			"list["..invname..";box;0,0;8,3;]"..
-			"list[current_player;main;0,5;8,4;]"..
-			"listring[]"
-	end,
+	get_inventory_formspec = advtrains.standard_inventory_formspec,
 	inventory_list_sizes = {
 		box=8*3,
 	},
@@ -62,12 +52,7 @@ advtrains.register_wagon("moretrains_wagon_gondola_cobble", {
 	collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
 	drops={"default:steelblock"},
 	has_inventory = true,
-	get_inventory_formspec = function(self, pname, invname)
-		return "size[8,11]"..
-			"list["..invname..";box;0,0;8,3;]"..
-			"list[current_player;main;0,5;8,4;]"..
-			"listring[]"
-	end,
+	get_inventory_formspec = advtrains.standard_inventory_formspec,
 	inventory_list_sizes = {
 		box=8*3,
 	},
@@ -84,12 +69,7 @@ advtrains.register_wagon("moretrains_wagon_gondola_toiletpaper", {
 	collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
 	drops={"default:steelblock"},
 	has_inventory = true,
-	get_inventory_formspec = function(self, pname, invname)
-		return "size[8,11]"..
-			"list["..invname..";box;0,0;8,3;]"..
-			"list[current_player;main;0,5;8,4;]"..
-			"listring[]"
-	end,
+	get_inventory_formspec = advtrains.standard_inventory_formspec,
 	inventory_list_sizes = {
 		box=8*3,
 	},
@@ -106,12 +86,7 @@ advtrains.register_wagon("moretrains_wagon_gondola_rails", {
 	collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
 	drops={"default:steelblock"},
 	has_inventory = true,
-	get_inventory_formspec = function(self, pname, invname)
-		return "size[8,11]"..
-			"list["..invname..";box;0,0;8,3;]"..
-			"list[current_player;main;0,5;8,4;]"..
-			"listring[]"
-	end,
+	get_inventory_formspec = advtrains.standard_inventory_formspec,
 	inventory_list_sizes = {
 		box=8*3,
 	},

+ 9 - 57
moretrains_industrial/init.lua

@@ -16,12 +16,7 @@ advtrains.register_wagon("moretrains_wagon_tank", {
 	collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
 	drops={"default:steelblock 2"},
 	has_inventory = true,
-	get_inventory_formspec = function(self, pname, invname)
-		return "size[8,11]"..
-			"list["..invname..";box;0,0;8,3;]"..
-			"list[current_player;main;0,5;8,4;]"..
-			"listring[]"
-	end,
+	get_inventory_formspec = advtrains.standard_inventory_formspec,
 	inventory_list_sizes = {
 		box=8*3,
 	},
@@ -38,12 +33,7 @@ advtrains.register_wagon("moretrains_wagon_tank2", {
 	collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
 	drops={"default:steelblock 2"},
 	has_inventory = true,
-	get_inventory_formspec = function(self, pname, invname)
-		return "size[8,11]"..
-			"list["..invname..";box;0,0;8,3;]"..
-			"list[current_player;main;0,5;8,4;]"..
-			"listring[]"
-	end,
+	get_inventory_formspec = advtrains.standard_inventory_formspec,
 	inventory_list_sizes = {
 		box=8*3,
 	},
@@ -61,12 +51,7 @@ advtrains.register_wagon("moretrains_wagon_wood", {
 	collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
 	drops={"default:steelblock"},
 	has_inventory = true,
-	get_inventory_formspec = function(self, pname, invname)
-		return "size[8,11]"..
-			"list["..invname..";box;0,0;8,3;]"..
-			"list[current_player;main;0,5;8,4;]"..
-			"listring[]"
-	end,
+	get_inventory_formspec = advtrains.standard_inventory_formspec,
 	inventory_list_sizes = {
 		box=8*3,
 	},
@@ -83,12 +68,7 @@ advtrains.register_wagon("moretrains_wagon_wood_loaded", {
 	collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
 	drops={"default:steelblock"},
 	has_inventory = true,
-	get_inventory_formspec = function(self, pname, invname)
-		return "size[8,11]"..
-			"list["..invname..";box;0,0;8,3;]"..
-			"list[current_player;main;0,5;8,4;]"..
-			"listring[]"
-	end,
+	get_inventory_formspec = advtrains.standard_inventory_formspec,
 	inventory_list_sizes = {
 		box=8*3,
 	},
@@ -105,15 +85,7 @@ advtrains.register_wagon("moretrains_wagon_wood_acacia", {
 	collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
 	drops={"default:steelblock"},
 	has_inventory = true,
-	get_inventory_formspec = function(self, pname, invname)
-		return "size[8,11]"..
-			"list["..invname..";box;0,0;8,3;]"..
-			"list[current_player;main;0,5;8,4;]"..
-			"listring[]"
-	end,
-	inventory_list_sizes = {
-		box=8*3,
-	},
+	get_inventory_formspec = advtrains.standard_inventory_formspec,
 }, S("Industrial wood wagon (acacia)"), "moretrains_wagon_wood_acacia_inv.png")
 
 advtrains.register_wagon("moretrains_wagon_wood_jungle", {
@@ -127,12 +99,7 @@ advtrains.register_wagon("moretrains_wagon_wood_jungle", {
 	collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
 	drops={"default:steelblock"},
 	has_inventory = true,
-	get_inventory_formspec = function(self, pname, invname)
-		return "size[8,11]"..
-			"list["..invname..";box;0,0;8,3;]"..
-			"list[current_player;main;0,5;8,4;]"..
-			"listring[]"
-	end,
+	get_inventory_formspec = advtrains.standard_inventory_formspec,
 	inventory_list_sizes = {
 		box=8*3,
 	},
@@ -149,12 +116,7 @@ advtrains.register_wagon("moretrains_wagon_wood_pine", {
 	collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
 	drops={"default:steelblock"},
 	has_inventory = true,
-	get_inventory_formspec = function(self, pname, invname)
-		return "size[8,11]"..
-			"list["..invname..";box;0,0;8,3;]"..
-			"list[current_player;main;0,5;8,4;]"..
-			"listring[]"
-	end,
+	get_inventory_formspec = advtrains.standard_inventory_formspec,
 	inventory_list_sizes = {
 		box=8*3,
 	},
@@ -171,12 +133,7 @@ advtrains.register_wagon("moretrains_wagon_wood_aspen", {
 	collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
 	drops={"default:steelblock"},
 	has_inventory = true,
-	get_inventory_formspec = function(self, pname, invname)
-		return "size[8,11]"..
-			"list["..invname..";box;0,0;8,3;]"..
-			"list[current_player;main;0,5;8,4;]"..
-			"listring[]"
-	end,
+	get_inventory_formspec = advtrains.standard_inventory_formspec,
 	inventory_list_sizes = {
 		box=8*3,
 	},
@@ -195,12 +152,7 @@ advtrains.register_wagon("moretrains_wagon_box", {
 	collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
 	drops={"default:steelblock"},
 	has_inventory = true,
-	get_inventory_formspec = function(self, pname, invname)
-		return "size[8,11]"..
-			"list["..invname..";box;0,0;8,3;]"..
-			"list[current_player;main;0,5;8,4;]"..
-			"listring[]"
-	end,
+	get_inventory_formspec = advtrains.standard_inventory_formspec,
 	inventory_list_sizes = {
 		box=8*3,
 	},

+ 1 - 6
moretrains_steam/init.lua

@@ -101,12 +101,7 @@ advtrains.register_wagon("moretrains_tender", {
 	collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0},
 	drops={"default:steelblock 1"},
 	has_inventory = true,
-	get_inventory_formspec = function(self, pname, invname)
-		return "size[8,11]"..
-			"list["..invname..";box;0,0;8,3;]"..
-			"list[current_player;main;0,5;8,4;]"..
-			"listring[]"
-	end,
+	get_inventory_formspec = advtrains.standard_inventory_formspec,
 	inventory_list_sizes = {
 		box=1*8,
 	},

+ 2 - 12
moretrains_vintage/init.lua

@@ -65,12 +65,7 @@ advtrains.register_wagon("moretrains_minecart", {
 	collisionbox = {-0.8,-0.5,-0.7, 0.8,2,0.7},
 	drops={"default:wood"},
 	has_inventory = true,
-	get_inventory_formspec = function(self, pname, invname)
-		return "size[8,11]"..
-			"list["..invname..";box;0,0;8,3;]"..
-			"list[current_player;main;0,5;8,4;]"..
-			"listring[]"
-	end,
+	get_inventory_formspec = advtrains.standard_inventory_formspec,
 	inventory_list_sizes = {
 		box=1*4,
 	},
@@ -87,12 +82,7 @@ advtrains.register_wagon("moretrains_minecart_loaded", {
 	collisionbox = {-0.8,-0.5,-0.7, 0.8,2,0.7},
 	drops={"default:wood"},
 	has_inventory = true,
-	get_inventory_formspec = function(self, pname, invname)
-		return "size[8,11]"..
-			"list["..invname..";box;0,0;8,3;]"..
-			"list[current_player;main;0,5;8,4;]"..
-			"listring[]"
-	end,
+	get_inventory_formspec = advtrains.standard_inventory_formspec,
 	inventory_list_sizes = {
 		box=1*4,
 	},