sullerandras / UtilizationMonitor

UtilizationMonitor: Factorio mod to see if factories are fully utilized
MIT License
0 stars 6 forks source link

Improve performance #7

Closed sullerandras closed 6 years ago

ST-DDT commented 6 years ago

I will look at it in detail tomorrow. Looks good to me, i will probably suggest some variable renames to make it more consistent throughout the mod.

sullerandras commented 6 years ago

@ST-DDT To make collaboration a bit easier, i invited you as a collaborator to this github repo so you should be able to push commits directly into this PR.

ST-DDT commented 6 years ago

Ah during playtesting just now I encountered some labels that did not clean up after the owner was destroyed and they lived until their next update (which based on factory size may take a while)

Maybe we need to subscribe to a destroy event as well?

lonelylabel

sullerandras commented 6 years ago

Yes i think we need to subscribe for destroy events as well, so we know when to destroy the labels.

ST-DDT commented 6 years ago

Yes i think we need to subscribe for destroy events as well, so we know when to destroy the labels.

I added 3 of them. I hope that covers them all.

script.on_event({defines.events.on_entity_died, defines.events.on_player_mined_entity, defines.events.on_robot_mined_entity}, on_destroyed)

Anything else missing?

sullerandras commented 6 years ago

I'll release it soon.