EarendelDevelopers / factorio-mods

This is a public repository for tracking issues with Earendel's factorio mods.
18 stars 3 forks source link

Remote interfaces for cargo landing pads #208

Closed billbo99 closed 2 years ago

billbo99 commented 2 years ago

I want to integrate one of the mods I look after with SE .. ("Additional Paste Settings" I forked a while back) .. I recently added the ability to paste the contents of a container/assembly machine/combinator onto a train station. Each time you pasted to the station it would cycle though them item list renaming the station alternately between load/unload.

I would like to add support for renaming cargo landing pads in a similar manner, but in order to do so I would need to get 2x remote interfaces added to SE (scripts\remote-interface.lua).

-- returns the current name of the cargo landing pad
--/c remote.call("space-exploration", "get_landing_pad", {unit_number=76})
        get_landing_pad = function(data)
            if data and data.unit_number and global.rocket_landing_pads[data.unit_number] then
                return global.rocket_landing_pads[data.unit_number].name
            end
        end,

-- allows cargo landing pad name to be changed
--/c remote.call("space-exploration", "set_landing_pad", {unit_number=76, name="[img=item/iron-ore] iron-ore"})
        set_landing_pad = function(data)
            if data and data.unit_number and data.name and global.rocket_landing_pads[data.unit_number] then
                global.rocket_landing_pads[data.unit_number].name = data.name
            end
        end,

image