I would like to have a GUI to make some settings in my Mod but i cant find any good tutorials on how to do it.
I was looking at other mods but i can not get it to work somehow.
Does someone have a good tutorial on that or can give some tips?
also i have a question for custome events
For example in the advanced logistics Mod there is a custom event
Code: Select all
script.on_event("ls-toggle-gui", function(event)
local index = event.player_index
local player = game.players[index]
local visible = global.guiVisible[index]
--- reset player position if in location view mode
local locationFlow = player.gui.center.locationFlow
if locationFlow ~= nil then
resetPosition(player, index)
end
if visible == 0 then
getLogisticNetworks(player.force)
showGUI(player, index)
else
hideGUI(player, index)
end
end)