Event for on-permissions-changed?

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
Kovus
Inserter
Inserter
Posts: 22
Joined: Sat Feb 27, 2016 5:25 pm
Contact:

Event for on-permissions-changed?

Post by Kovus »

Any chance that an event could be raised when the base-game permissions are changed?

I leave it up to the author of such a possible event as to whether it would raise with details for every change, or just general updates.

User avatar
kizrak
Inserter
Inserter
Posts: 46
Joined: Thu Jul 19, 2018 1:27 am
Contact:

Re: Event for on-permissions-changed?

Post by kizrak »

Kovus wrote:
Sat Mar 16, 2019 9:47 pm
Any chance that an event could be raised when the base-game permissions are changed?

I leave it up to the author of such a possible event as to whether it would raise with details for every change, or just general updates.
I would also love to have this feature!! :D

I would not even care if the event contained any permission change details...

And if multiple permissions changed in the same tick (assuming that changes happen during the GUI-close-tick (similar to on_runtime_mod_setting_changed event)) one event during that tick would be sufficient for what I'm trying to do.

Maybe there is just a way to tell when a user closed the permissions GUI? (Exploring this idea now...) :geek:

Please & Thanks!
-Kizrak

User avatar
kizrak
Inserter
Inserter
Posts: 46
Joined: Thu Jul 19, 2018 1:27 am
Contact:

Re: Event for on-permissions-changed?

Post by kizrak »

Code: Select all

local function on_gui_closed(event)
	local gui_type = event.gui_type

	if gui_type == defines.gui_type.permissions then
		log("resetPermissions()")
	end
end

script.on_event({
	defines.events.on_gui_closed,
},on_gui_closed)
I'm using this code to detect the permissions window closing. So far from ideal for detecting permissions change events (as it won't pick up mods/etc), it hopefully will get the job done.

Rseding91
Factorio Staff
Factorio Staff
Posts: 10789
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Event for on-permissions-changed?

Post by Rseding91 »

I'm not against adding this event but I want to make sure I'm understanding what kind of event is being asked for. Do you just want to know "when anything permissions changes" or more gradual?

Right now these are the sets of actions that can happen:

Player added/removed from permission group
Permission group created/deleted
Permission group permission enabled/disabled
Permission group all permissions enabled/disabled

A singular "something changed" event is easy. I just want to be sure that's ok rather than having to make a bunch of different logic for conveying all the permissions actions through events.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Modding interface requests”

Who is online

Users browsing this forum: No registered users