Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mod should disable itself when FactorioMaps is generating a map #60

Open
OvermindDL1 opened this issue Oct 8, 2019 · 1 comment
Open

Comments

@OvermindDL1
Copy link

When the FactorioMaps mod is generating a map bottleneck needs to disable itself as it doesn't make sense for the indicators to be on the satellite view of the FactorioMaps generation, especially as it's only near a single player and not the others or on anything else that isn't near a player. Currently Bottleneck, if left on, is generating a lot of dots as noise on the FactorioMaps map such as at:
https://overminddl1.com/Factorio/maps/Space1/#1/nauvis/19/70/-44/0/4

FactorioMaps has an API for detecting if it's generating a map or not specifically to be able to disable things like these when it is generating.

@L0laapk3
Copy link

L0laapk3 commented Oct 8, 2019

Hey there! I'm the dev of factoriomaps. I thought I'd join in and help a little bit with the API to make the process a little easier.

I originally was going to make a pull request, but decided to let you take care of your mods elements the way you want to.

I've got a template compat/factoriomaps.lua file for you:

Compat = Compat or { }

local function disable_bottleneck_on_factoriomaps()
	print("Starting factoriomaps-bottleneck integration script")

	-- destroy all elements not suitable for map view here. Note that screenshots are taken at the end of this tick.
end

function Compat.handle_factoriomaps()
	if remote.interfaces.factoriomaps then
		script.on_event(remote.call("factoriomaps", "get_start_capture_event_id"), disable_bottleneck_on_factoriomaps)
	end
end

You would then call Compat.handle_factoriomaps() in your on_init and on_load events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants