The International Simutrans Forum

Development => Patches & Projects => Topic started by: THLeaderH on June 11, 2020, 12:15:08 PM

Title: alert dialog
Post by: THLeaderH on June 11, 2020, 12:15:08 PM
This patch provides a gui component to show an alert. This component is intended to be used as the confirmation dialog.

Simutrans has a lot of dangerous operations, such as "sell convoy" button. Such operations should show a dialog to confirm that the player really want to do that before they are executed. The attached patch contains the alert gui component and the application to "sell convoy" button. You can define multiple items to select in the dialog with alert_dialog class. confirmation_dialog class provides an alert dialog with only "OK" and "cancel" buttons, which is typically useful for the confirmation.
Title: Re: alert dialog
Post by: Dwachs on June 11, 2020, 12:23:56 PM
This is a design choice *not* to bother players with such confirmation dialogs, which are most of the time ignored anyway.
Title: Re: alert dialog
Post by: Yona-TYT on June 11, 2020, 03:17:53 PM
Quote from: Dwachs on June 11, 2020, 12:23:56 PMThis is a design choice *not* to bother players with such confirmation dialogs, which are most of the time ignored anyway.
Certainly . :p
Title: Re: alert dialog
Post by: Mariculous on June 11, 2020, 04:04:33 PM
I agree with the idea in general, but I do not think a confirm dialog is the way to go.
A system to first enable those buttons and then allow these to be used until the window gets closed, might be a less annoying protection mechanism
Title: Re: alert dialog
Post by: Isaac Eiland-Hall on June 11, 2020, 07:08:55 PM
Just as long as there is an option to disable this...
Title: Re: alert dialog
Post by: Ters on June 11, 2020, 08:50:53 PM
Quote from: Freahk on June 11, 2020, 04:04:33 PM
I agree with the idea in general, but I do not think a confirm dialog is the way to go.
A system to first enable those buttons and then allow these to be used until the window might be a less annoying protection mechanism
And probably one that works better as well. People don't read these alerts, at least after a while, and probably think it is a confirmation for what the user wanted to do, not what the user actually clicked on. Having to "unsafe" the buttons might work better, and is a common method of preventing unintended triggering of anything from guns via fire alarms to phones.

The main technical challenge with such dialog boxes is also that they need to know when things taking place in the game make one or more of the options presented illegal, or the entire dialog itself meaningless. Which is why a lot of such dialogs won't let the user do anything else, but that won't work when playing against other players.
Title: Re: alert dialog
Post by: prissi on June 12, 2020, 12:56:32 PM
AN unsafe button could be very simple to add. One would need a third state however for the skins.
Title: Re: alert dialog
Post by: Dwachs on June 13, 2020, 08:56:23 AM
There is always the possibility to grey out the button to make it inactive.
Title: Re: alert dialog
Post by: prissi on June 13, 2020, 12:02:58 PM
Yes, but I think the unsafe button is a button you have to deliberately click twice. Hence it should be a normal clickable button, on second click somewhat activated. If the next mouse event is not for this button (i.e. looses focus) or 5 seconds have passed the button returns to normal. If there is a second click, then the action will be done.

Having a clickable greyed out button is somewhat confusing, I think.