Page MenuHomeWildfire Games

Quit confirmation dialog hotkey and button
AbandonedPublic

Authored by Langbart on Mar 30 2021, 11:17 AM.

Details

Summary

This diff aims to add an additional hotkey Shift+Escape to open the exit confirmation dialog and the dialog itself contains an additional button to quickly return to the home screen or lobby page.

The function quitConfirmationDialog is from @nani's Autociv mod, that was too difficult for me.

The idea came from @submariner, I just tried to implement it.

This is the current situation:


Out of date:

Test Plan

Didn't intend to actually implement this in the core game, just something I used in my mod. But @Freagarach asked me to upload it here.

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
/ps/trunk
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 16511
Build 37339: arc lint + arc unit

Event Timeline

Langbart created this revision.Mar 30 2021, 11:17 AM
Owners added a subscriber: Restricted Owners Package.Mar 30 2021, 11:17 AM
Langbart requested review of this revision.Mar 30 2021, 11:17 AM
Langbart edited the summary of this revision. (Show Details)Mar 30 2021, 11:19 AM
Freagarach added inline comments.Mar 30 2021, 11:24 AM
binaries/data/config/default.cfg
165

openquit may not be the best of names.

binaries/data/mods/public/gui/session/session.js
516

I'm not sure what this does, I'll have to play with it a little I guess.

568

Basically what you want differently is this part?

AFAIK home and stats are unknown UI words for a usual player, we have main menu, lobby, summary.

Freagarach added inline comments.Mar 30 2021, 11:33 AM
binaries/data/mods/public/gui/session/message_box/QuitConfirmation.js
21–23

E.g.
And you'd want a third option, "quit to lobby"?

Silier added a subscriber: Silier.Mar 30 2021, 12:23 PM

generally in game when there is some confirmation dialog, shift hotkey is skipping it, having it here the opposite way is counterintuitive

Imarok added a subscriber: Imarok.Mar 30 2021, 12:25 PM

So the aim of the diff is to introduce a hotkey for quitting and giving the option to skip the summary, right?

So what about using the labels "No", "Yes, skip summary" and "Yes"?
An alternative also might be just keeping "No" and "Yes" but adding a checkbox with "skip summary"(The checkbox could even remember its state).

So what about using the labels "No", "Yes, skip summary" and "Yes"?
An alternative also might be just keeping "No" and "Yes" but adding a checkbox with "skip summary"(The checkbox could even remember its state).

Yes, I think I will go for "No", "Yes, skip summary" and "Yes", this would satisfy the concerns of @Freagarach (Tue, Mar 30, 11:33) and @vladislavbelov (Tue, Mar 30, 11:29). I didn't think of the checkbox, but it would cause me to have an extra click every time I change the toggle, which I would rather avoid.

In D3768#163923, @Angen wrote:

generally in game when there is some confirmation dialog, shift hotkey is skipping it, having it here the opposite way is counterintuitive

Yes, that is a good point. Is it possible to have a hotkey that gets triggered when a user quickly presses the Escape key twice in a row?

Langbart updated this revision to Diff 16843.EditedMar 31 2021, 4:45 AM
Langbart edited the test plan for this revision. (Show Details)

Changed the hotkey name from "openquit" to "opendialog". Adjusted the naming of the selection options. The size of the dialog box has been slightly increased, but the ratio has been kept.

This is the current situation:
Remaining problems, find a better hotkey than Shift+Escape and adjust the function endHome().

Langbart edited the summary of this revision. (Show Details)Mar 31 2021, 4:56 AM

So what I'd do regarding the End* functions is to have three functions:

  • EndGame, which does the duplicated stuff (call the engine function, add replay to cache and unregister MP game).
  • EndGameToMainMenu, which does as the function name says, it calls EndGame and then switches to the main menu.
  • EndGameToSummary, which calls EndGame and switches to the summary.
binaries/data/mods/public/gui/session/message_box/QuitConfirmationReplay.js
25

The "replayFinished is the context translators receive when viewing this string (Yes), so you need to keep the same function. (And add the context below.)

wraitii requested changes to this revision.Mar 31 2021, 8:27 AM
wraitii added a subscriber: wraitii.

You need to forward the campaign data in all paths (which I believe is buggy right now, by the way)

This revision now requires changes to proceed.Mar 31 2021, 8:27 AM
Langbart abandoned this revision.May 13 2021, 5:42 PM

Another user will try to implement it, I will not work on this one anymore.
see D3958 - Add an extra button for seeing the summary page when quitting a session (13/May/21).