Time to sleep


This Factorio mod allows you to sleep at night Multiplayer ready

Utilities
1 year, 7 months ago
1.1
430

b [fixed] compatibility

1 year, 8 months ago

In the mod all gui elements in screen are destroyed, which breaks other mods with things in screen. One should only destroy gui elements you know are yours.

But one example: https://i.imgur.com/eP5hvXn.jpeg

1 year, 8 months ago
(updated 1 year, 8 months ago)

I have some tweaks which should fix it on your side, but it won't help any mods that don't rebuild their GUI every on_configuration_changed:

1) changed destroy_gui to destroy_main_gui on many lines
2) changed the name on line 32 to name="TTS_main"..index,

3)Changed the last function to:
function destroy_main_gui(screen)
  for num,elm in pairs(screen.children) do
    if string.find(elm.name, "TTS_main") then
      elm.destroy()
    end
  end
end

1 year, 8 months ago

Forgot to add: if someone has a sleep gui open, this fix won't delete that sleep gui. I'm in the Factorio #mod-making room a lot, as well are other people who can offer advice.

1 year, 8 months ago

This fixes seems to help out but when somebody uses this Mod + Milestones ones read through this thread please: https://mods.factorio.com/mod/Milestones/discussion/62fd06d6663e048f964062bd

THere are two commands in the mod which helped me out.

1 year, 7 months ago
(updated 1 year, 7 months ago)

I have some tweaks which should fix it on your side, but it won't help any mods that don't rebuild their GUI every on_configuration_changed:

1) changed destroy_gui to destroy_main_gui on many lines
2) changed the name on line 32 to name="TTS_main"..index,

3)Changed the last function to:
function destroy_main_gui(screen)
  for num,elm in pairs(screen.children) do
    if string.find(elm.name, "TTS_main") then
      elm.destroy()
    end
  end
end

Thanks for the support, I'm pretty new at modding and I didn't realize that this could be a problem until I ran into it. Anyway I fixed destroying only elements of this mod, as you suggested.

This thread has been locked.