Make .enabled work on frames
Posted: Sat Aug 03, 2019 8:27 am
We now have the ability to do moveable windows, which is great. What this allows is to have true 'pop-up' windows that are overlaid on your base interface. This is obviously nicer than having to hide the main interface when the dialog is open, and show it again when the dialog is closed.
Now one problem with this approach is that the user could still click things on the main interface when the dialog is open, which might be bad for data consistency and such, because existing mods don't expect them to be able to do this. It would be a lot of work to correct/prevent this.
A solution employed elsewhere is to make the main window unclickable when a dialog is open. You can currently do this with .ignored_by_interaction. This is fine, but it doesn't convey to the user that he needs to close the dialog to be able to use the main interface again. What would be great if setting .enabled on a frame would work, and 'disable' the frame you set it on.
I imagine that the effects would be a dimming of the whole frame, like a grey overlay (similar to this). In addition, the frame could display it's tooltip whenever you hover over it, so modders can set a message explaining what is going on, if they want to. It could also play an error-like sound when you click on it, to further emphasize the disabled-state of the frame.
Now one problem with this approach is that the user could still click things on the main interface when the dialog is open, which might be bad for data consistency and such, because existing mods don't expect them to be able to do this. It would be a lot of work to correct/prevent this.
A solution employed elsewhere is to make the main window unclickable when a dialog is open. You can currently do this with .ignored_by_interaction. This is fine, but it doesn't convey to the user that he needs to close the dialog to be able to use the main interface again. What would be great if setting .enabled on a frame would work, and 'disable' the frame you set it on.
I imagine that the effects would be a dimming of the whole frame, like a grey overlay (similar to this). In addition, the frame could display it's tooltip whenever you hover over it, so modders can set a message explaining what is going on, if they want to. It could also play an error-like sound when you click on it, to further emphasize the disabled-state of the frame.