OpenRA icon indicating copy to clipboard operation
OpenRA copied to clipboard

Tooltip Descriptions

Open MustaphaTR opened this issue 9 years ago • 10 comments

In Generals when hovered over, tech buildings show what they do too, after their name. IMO it would be cool for our mods too.

resim This is how they look on Generals (i guess it is a part of the name), but i think it would be better if we had a sepeare Description: field, that works similar to one in Production Menu, but for units in the field.

MustaphaTR avatar Nov 29 '17 14:11 MustaphaTR

We have an IProvideTooltipInfo interface that lets traits add extra info to a tooltip. It should be easy to make a new trait for this purpose.

pchote avatar Nov 29 '17 14:11 pchote

Is this issue still ongoing?

I have been following the project for certain time, and after diving into the code, I think this is a good issue to try to contribute a bit for the first time.

xecollons avatar Mar 01 '18 22:03 xecollons

Yes, feel free to work on this. If you have any further questions be sure to contact us here or on IRC (#openra). :)

abcdefg30 avatar Mar 02 '18 00:03 abcdefg30

In fact, I do have some questions, if you don't mind: -I had thought about two approaches to implement this. The one suggested in this thread, approach that I have already implemented and it's working fine, it's quite trivial using the IProvideTooltipInfo interface: openra_fieldtooltip Or adding the "FieldDescription" as a new property for the Tooltip class directly. I prefer the first approach since is less intrusive(and also I don't want to change any -more or less- basic class in my first commit), but the second can more intuitive("ok, I have a tooltip that have a Name and can have a FieldDescription), and could be useful when using the DisguiseTooltip. What do you think?

-Also, since I didn't play Generals, I don't know exactly which logic this tooltip have. Do enemies see this support tooltip? Do allies also see it? Because a "Capture this building" message, for example, doesn't have sense for the owner of the building or his allies. So, now my structure for this in a yaml is like: FieldDescriptionTooltip: -Description: Capture these barracks to KILL

And I'm thinking of changing it to something like: FieldDescriptionTooltip: -AllyDescription: You love the barracks -EnemyDescription: Capture these barracks to KILL

Being AllyDescription and EnemyDescription nullable, of course. Am I over-engineering? It's my first commit, so I want it to be OK 😋

xecollons avatar Mar 03 '18 12:03 xecollons

The tooltip descriptions were stance-unaware in Generals. The point of tooltip descs over there was to describe tech buildings, since those have no visible description otherwise. Adding such to Barracks/whatnot sounds weird to me - unless they are mission-specific objective hints.

GraionDilach avatar Mar 03 '18 13:03 GraionDilach

The barracks thing is just an example, a random building I chose just to try it.

Same as putting the FieldDescription to the barracks, you can use it to provide a description to any other building(or not). If you want to provide a fielddescription only in (certain) tech buildings, you can.

If you are implying that this shouldn't be generic for any type of unit or structure and should be specific for tech buildings, I can do that as well, that's no problem.

xecollons avatar Mar 03 '18 15:03 xecollons

What do you think?

Using the IProvideTooltipInfo interface as you already did seems fine.

Do enemies see this support tooltip? Do allies also see it?

Having AllyDescription and EnemyDescription fields sound good to me. They won't hurt and open possibilities for missions, as already remarked.

abcdefg30 avatar Mar 05 '18 20:03 abcdefg30

The problem would be with neutral stuff in that case tbh.

GraionDilach avatar Mar 06 '18 14:03 GraionDilach

A single description that is shown to everyone would be much simpler. I don't see any need to over-complicate this, especially when we don't have a use case for separating descriptions based on stance.

pchote avatar Mar 06 '18 15:03 pchote

I thought about adding this to RA now that TooltipDescription is available. I'm not quite sure what would go well with the zombie/ant granting biological lab. Perhaps; 'Capture to gain access to biological weapons!'

What I'd put with other buildings: Oil Derrick - Capture to receive steady trickle of funds Hospital - Provides gradual healing to infantry of owner Forward Command - Provides small construction radius to owner Communitcations Center - Capture to reveal a large area around this structure

Smittytron avatar Apr 09 '18 01:04 Smittytron