The International Simutrans Forum

 

Author Topic: alert dialog  (Read 300 times)

0 Members and 1 Guest are viewing this topic.

Offline THLeaderH

  • Coder/patcher
  • Devotee
  • *
  • Posts: 367
  • Languages: JP,EN
alert dialog
« 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.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4701
  • Languages: EN, DE, AT
Re: alert dialog
« Reply #1 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.

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1448
    • Simutrans-BLOG
  • Languages: ES
Re: alert dialog
« Reply #2 on: June 11, 2020, 03:17:53 PM »
This is a design choice *not* to bother players with such confirmation dialogs, which are most of the time ignored anyway.
Certainly . :p

Offline Freahk

  • Devotee
  • *
  • Posts: 1055
  • Languages: DE, EN
Re: alert dialog
« Reply #3 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
« Last Edit: June 12, 2020, 03:22:32 PM by Freahk »

Offline Isaac Eiland-Hall

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3792
  • Providing hosting for Simutrans projects
    • pc2.io
  • Languages: EN
Re: alert dialog
« Reply #4 on: June 11, 2020, 07:08:55 PM »
Just as long as there is an option to disable this…

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5642
  • Languages: EN, NO
Re: alert dialog
« Reply #5 on: June 11, 2020, 08:50:53 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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9989
  • Languages: De,EN,JP
Re: alert dialog
« Reply #6 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.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4701
  • Languages: EN, DE, AT
Re: alert dialog
« Reply #7 on: June 13, 2020, 08:56:23 AM »
There is always the possibility to grey out the button to make it inactive.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9989
  • Languages: De,EN,JP
Re: alert dialog
« Reply #8 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.