TheFatController
TheFatController copied to clipboard
Enhancment - Replace fake train viewer with Camera gui element
Would allow you to get rid of the fake player and all bugs associated with it. Example code below,
local function get_or_create_camera(player, factory)
local gui = player.gui.goal.factory_camera
if not gui then
gui = player.gui.goal.add{
type = "camera",
name = "factory_camera",
position={x=factory.inside_x,y= factory.inside_y},
surface_index = factory.inside_surface.index
}
else
gui.position={x=factory.inside_x, y=factory.inside_y}
gui.surface_index = factory.inside_surface.index
end
gui.style.minimal_width= 300
gui.style.minimal_height = 300
return gui
end
local function destroy_camera(player)
local gui = player.gui.goal.factory_camera
return gui and gui.destroy()
end
I tested it quickly (27 days ago :D ) and i found you couldn't control the train, just watch it.