Opened 8 years ago

Closed 7 years ago

Last modified 7 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 7 years ago.
3699_tooltip.patch (3.7 KB ) - added by Vladislav Belov 7 years ago.
Adds the victory condition and the map type tooltips
3699_tooltip.2.patch (3.7 KB ) - added by Vladislav Belov 7 years ago.
Adds the victory condition and the map type tooltips

Download all attachments as: .zip

Change History (18)

comment:1 by fcxSanya, 8 years ago

Description: modified (diff)

comment:2 by Vladislav Belov, 7 years ago

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 by Vladislav Belov, 7 years ago

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

by Vladislav Belov, 7 years ago

Attachment: 3899_tooltip.png added

comment:4 by Vladislav Belov, 7 years ago

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

by Vladislav Belov, 7 years ago

Attachment: 3699_tooltip.patch added

Adds the victory condition and the map type tooltips

comment:5 by elexis, 7 years ago

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?

in reply to:  5 ; comment:6 by Vladislav Belov, 7 years ago

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 by Vladislav Belov, 7 years ago

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

comment:8 by Imarok, 7 years ago

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."

in reply to:  8 ; comment:9 by Vladislav Belov, 7 years ago

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."

in reply to:  9 comment:10 by Imarok, 7 years ago

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 ;)

in reply to:  6 comment:11 by elexis, 7 years ago

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)

by Vladislav Belov, 7 years ago

Attachment: 3699_tooltip.2.patch added

Adds the victory condition and the map type tooltips

comment:12 by elexis, 7 years ago

Milestone: Alpha 22Work In Progress

Moving to the new WIP milestone.

comment:13 by elexis, 7 years ago

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

comment:14 by elexis, 7 years ago

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 by elexis, 7 years ago

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

Thanks for the patch!

Note: See TracTickets for help on using tickets.