Page MenuHomeWildfire Games

Options page to display per-value tooltips
ClosedPublic

Authored by elexis on Jan 17 2020, 5:14 AM.

Details

Summary

Sometimes (as in D2546) the different choices for a dropdown in the options page are not obvious to the player.
This patch aims to solve that by displaying a tooltip for every of the option choices.

Test Plan

There are different ways this can be achieved. Some choices include:

  • Displaying all per-item tooltips below the option tooltip when hovering the option.
  • Displaying or not displaying the option tooltip when hovering an item.

Notice the 500ms tooltip delay is changed to 0ms, so that the user is immediately aware of the choices, and thus reading the tooltips even prior to the labels. (Once starting to read the labels, its easy to not pay attention to the tooltip, not expecting it to differ.)

and 'Make sure that it works.'

Notice / confirm that messages.json extracts the strings already.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

elexis created this revision.Jan 17 2020, 5:14 AM
elexis edited the test plan for this revision. (Show Details)Jan 17 2020, 5:14 AM

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/1067/display/redirect

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/163/display/redirect

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 119| 119| 			sprintf(
| 120| 120| 				option.min !== undefined && option.max !== undefined ?
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122|    |-				option.min !== undefined && option.max === undefined ?
|    | 122|+					option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 120| 120| 				option.min !== undefined && option.max !== undefined ?
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123|    |-					translateWithContext("option number", "Min: %(min)s") :
|    | 123|+						translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 121| 121| 					translateWithContext("option number", "Min: %(min)s, Max: %(max)s") :
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124|    |-				option.min === undefined && option.max !== undefined ?
|    | 124|+						option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
| 127| 127| 				{
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 122| 122| 				option.min !== undefined && option.max === undefined ?
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125|    |-					translateWithContext("option number", "Max: %(max)s") :
|    | 125|+							translateWithContext("option number", "Max: %(max)s") :
| 126| 126| 					"",
| 127| 127| 				{
| 128| 128| 					"min": option.min,
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/options/options.js
| 123| 123| 					translateWithContext("option number", "Min: %(min)s") :
| 124| 124| 				option.min === undefined && option.max !== undefined ?
| 125| 125| 					translateWithContext("option number", "Max: %(max)s") :
| 126|    |-					"",
|    | 126|+							"",
| 127| 127| 				{
| 128| 128| 					"min": option.min,
| 129| 129| 					"max": option.max

binaries/data/mods/public/gui/options/options.js
| 239| »   »   »   let·value·=·optionType.guiToValue(control);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'value' is already declared in the upper scope.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1585/display/redirect

vladislavbelov accepted this revision.Jan 18 2020, 9:16 PM
vladislavbelov added a subscriber: vladislavbelov.

Looks ok for me.

This revision is now accepted and ready to land.Jan 18 2020, 9:16 PM

(The patch was not tested, see IRC)

binaries/data/mods/public/gui/options/options.json
62 ↗(On Diff #11060)

Shouldnt be added to late observers, but the gamesetup assign option!

This revision was automatically updated to reflect the committed changes.
Owners added a subscriber: Restricted Owners Package.Jan 18 2020, 9:40 PM