remijouannet / graftorio2

(fork of graftorio) factorio mod for creating grafana dashboard
MIT License
77 stars 21 forks source link

Fix YARM compatibility #13

Closed trigrab closed 2 years ago

trigrab commented 2 years ago

Yarm metrics only works when the game first start or the mods change. This is because on_load the event_id of the site update is not known.

At runtime of on_load, we don't have the game object and remote.call("YARM", "get_on_site_updated_event_id") will also return nil.

Therefor I had the idea of a global variable for the event_id. It also treats as a toggle if yarm is installed or not in on_load.

Feedback is very welcome. Thanks for maintaning this mod 👍