Opened 4 years ago

Closed 2 years ago

Last modified 2 years ago

#3699 closed enhancement (fixed)

[PATCH] Display tooltips for victory conditions

Reported by: fcxSanya Owned by: Vladislav Belov
Priority: Nice to Have Milestone: Alpha 22
Component: UI & Simulation Keywords: patch
Cc: Patch:

Description (last modified by elexis)

We have "Description" field for victory conditions (see for example conquest.json), but it's not being displayed on GUI: http://i.imgur.com/5GFw5Dd.png (there is only generic 'Select victory condition' tooltip at the botton of the screen). It would be convenient (especially for new players) to have description text displayed in a tooltip.


Another game setup dropdown which will benefit from tooltips is 'Map Type' (Skirmish/Random/Scenario) (see comments on Transifex: public-gui-other/61660925)


According to elexis: "that hover-event is probably easy to add in CList.cpp by calling ScriptEvent" (quote from #0ad-dev)

Attachments (3)

3899_tooltip.png (348.8 KB) - added by Vladislav Belov 3 years ago.
3699_tooltip.patch (3.7 KB) - added by Vladislav Belov 3 years ago.
Adds the victory condition and the map type tooltips
3699_tooltip.2.patch (3.7 KB) - added by Vladislav Belov 3 years ago.
Adds the victory condition and the map type tooltips

Download all attachments as: .zip

Change History (18)

comment:1 Changed 3 years ago by fcxSanya

Description: modified (diff)

comment:2 Changed 3 years ago by Vladislav Belov

Keywords: patch rfc added
Milestone: BacklogAlpha 22
Owner: set to Vladislav Belov
Status: newassigned
Summary: Display tooltips for victory conditions[PATCH] Display tooltips for victory conditions

comment:3 Changed 3 years ago by Vladislav Belov

Keywords: patch rfc added
Milestone: BacklogAlpha 22
Owner: set to Vladislav Belov
Status: newassigned
Summary: Display tooltips for victory conditions[PATCH] Display tooltips for victory conditions

Changed 3 years ago by Vladislav Belov

Attachment: 3899_tooltip.png added

comment:4 Changed 3 years ago by Vladislav Belov

http://trac.wildfiregames.com/raw-attachment/ticket/3699/3899_tooltip.png

Changed 3 years ago by Vladislav Belov

Attachment: 3699_tooltip.patch added

Adds the victory condition and the map type tooltips

comment:5 Changed 3 years ago by elexis

Keywords: gui tooltip removed
  • Strings:
    (23:15:02) scythetwirler_: random -> randomly
    (23:15:39) scythetwirler_: I'd say the main differentiating characteristic between skirmish and scenario is that skirmish has selectable civs while scenarios have locked civs.
    
  • The hover approach is more versatile than passing an array of strings, as the former can be used to do execute arbitrary code, for example set preview graphics when hovering over an item of a list (see IRC discussion 23:19 - 23:39).
  • The gamesetup filter could use this feature too, the dropdowns in the session seem self-explanatory.
  • Not tooo happy about seeing hovered_item being a setting when it should be read-only. Wouldn't it be better to pass the hovered item as an argument via ScriptEvent??

comment:6 in reply to:  5 ; Changed 3 years ago by Vladislav Belov

Replying to elexis:

  • Not tooo happy about seeing hovered_item being a setting when it should be read-only. Wouldn't it be better to pass the hovered item as an argument via ScriptEvent??

But then we won't be able to know current hovered item, i.e. when we need to reset/recreate something with tooltips.

comment:7 Changed 3 years ago by Vladislav Belov

Is ok: "A map without scenario.", "A randomly generated map.", "A map with scenario and locked civs."?

comment:8 Changed 3 years ago by Imarok

From @wiki:Manual_SettingUpAGame#a1.ChangeMatchType:

  • Skirmish: Play a map with predefined terrain with your choice of civilizations and players.
  • Scenario: Play a map with predefined terrain, units, civilizations, and players.
  • Random: Play a random map with your choice of map size, civilizations, and players.

So what about:

  • "A map with predefined terrain."
  • "A map with predefined terrain, civilizations and players."
  • "A randomly generated map."

comment:9 in reply to:  8 ; Changed 3 years ago by Vladislav Belov

Replying to Imarok:

  • "A map with predefined terrain."
  • "A map with predefined terrain, civilizations and players."
  • "A randomly generated map."

"Terrain" doesn't sound user-friendly, maybe then:

  • "A map with predefined landscape."
  • "A map with predefined landscape, civilizations and players."
  • "A randomly generated map."

comment:10 in reply to:  9 Changed 3 years ago by Imarok

Replying to vladislavbelov:

Replying to Imarok:

  • "A map with predefined terrain."
  • "A map with predefined terrain, civilizations and players."
  • "A randomly generated map."

"Terrain" doesn't sound user-friendly, maybe then:

  • "A map with predefined landscape."
  • "A map with predefined landscape, civilizations and players."
  • "A randomly generated map."

True ;)

comment:11 in reply to:  6 Changed 3 years ago by elexis

Replying to vladislavbelov:

But then we won't be able to know current hovered item, i.e. when we need to reset/recreate something with tooltips.

  • Yep, one wouldn't be able to access the hovered item outside of the scope of the event. Indeed less versatile and one would have to cache it if used outside of scope. Perhaps it would be possible to at least make that thing read-only by subscribing to GUIM_SETTINGS_UPDATED, but that would be a workaround as well. In that case we have to accept your code.
  • The // Nothing is <foo> as default. comments are not needed (nor newlines in between the SetSetting calls in the ctor)

Changed 3 years ago by Vladislav Belov

Attachment: 3699_tooltip.2.patch added

Adds the victory condition and the map type tooltips

comment:12 Changed 3 years ago by elexis

Milestone: Alpha 22Work In Progress

Moving to the new WIP milestone.

comment:13 Changed 3 years ago by elexis

There is also a translation comment requesting an explanation for the trigger filter. Why not just add it to the tooltip field?

comment:14 Changed 2 years ago by elexis

Resolution: fixed
Status: assignedclosed

In 19588:

Get the index of the hovered element in GUI lists and use it to display item-specific tooltips in the gamesetup for the victory condition, maptype and starting resources.

Differential Revision: https://code.wildfiregames.com/D316
Fixes #3699
Patch By: Vladislav

comment:15 Changed 2 years ago by elexis

Description: modified (diff)
Keywords: rfc removed
Milestone: Work In ProgressAlpha 22

Thanks for the patch!

Note: See TracTickets for help on using tickets.