Advertisement
Guest User

Untitled

a guest
Aug 14th, 2019
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.40 KB | None | 0 0
  1. local car_gridw, car_gridh = string.match(settings.startup["VehicleGrid-car"].value, "(%d+)x(%d+)")
  2. log("VehicleGrid-car = "..tostring(settings.startup["VehicleGrid-car"].value).." "..tostring(car_gridw)..", "..tostring(car_gridh))
  3.  
  4. local tank_gridw, tank_gridh = string.match(settings.startup["VehicleGrid-tank"].value, "(%d+)x(%d+)")
  5. log("VehicleGrid-tank = "..tostring(settings.startup["VehicleGrid-tank"].value).." "..tostring(tank_gridw)..", "..tostring(tank_gridh))
  6.  
  7. local loco_gridw, loco_gridh = string.match(settings.startup["VehicleGrid-loco"].value, "(%d+)x(%d+)")
  8. log("VehicleGrid-loco = "..tostring(settings.startup["VehicleGrid-loco"].value).." "..tostring(loco_gridw)..", "..tostring(loco_gridh))
  9.  
  10. local wagon_gridw, wagon_gridh = string.match(settings.startup["VehicleGrid-wagon"].value, "(%d+)x(%d+)")
  11. log("VehicleGrid-wagon = "..tostring(settings.startup["VehicleGrid-wagon"].value).." "..tostring(wagon_gridw)..", "..tostring(wagon_gridh))
  12.  
  13. local art_wagon_gridw, art_wagon_gridh = string.match(settings.startup["VehicleGrid-artillery-wagon"].value, "(%d+)x(%d+)")
  14. log("VehicleGrid-artillery-wagon = "..tostring(settings.startup["VehicleGrid-artillery-wagon"].value).." "..tostring(art_wagon_gridw)..", "..tostring(art_wagon_gridh))
  15.  
  16. data:extend(
  17. {
  18.   {
  19.     type = "equipment-grid",
  20.     name = "car-equipment-grid",
  21.     width = car_gridw or 8,
  22.     height = car_gridh or 8,
  23.     equipment_categories = {"armor", "universal-equipment", "vehicle-equipment", "vehicle-motor"}
  24.   },
  25.   {
  26.     type = "equipment-grid",
  27.     name = "tank-equipment-grid",
  28.     width = tank_gridw or 12,
  29.     height = tank_gridh or 10,
  30.     equipment_categories = {"armor", "universal-equipment", "vehicle-equipment", "vehicle-motor"}
  31.   },
  32.   {
  33.     type = "equipment-grid",
  34.     name = "loco-equipment-grid",
  35.     width = loco_gridw or 10,
  36.     height = loco_gridh or 8,
  37.     equipment_categories = {"armor", "universal-equipment", "vehicle-equipment", "vehicle-motor"}
  38.   },
  39.   {
  40.     type = "equipment-grid",
  41.     name = "wagon-equipment-grid",
  42.     width = wagon_gridw or 10,
  43.     height = wagon_gridh or 6,
  44.     equipment_categories = {"armor", "universal-equipment", "vehicle-equipment"}
  45.   },
  46.   {
  47.     type = "equipment-grid",
  48.     name = "artillery-wagon-equipment-grid",
  49.     width = art_wagon_gridw or 10,
  50.     height = art_wagon_gridh or 8,
  51.     equipment_categories = {"armor", "universal-equipment", "vehicle-equipment"}
  52.   },
  53. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement