Tooltip Descriptions
In Generals when hovered over, tech buildings show what they do too, after their name. IMO it would be cool for our mods too.
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.
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.
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.
Yes, feel free to work on this. If you have any further questions be sure to contact us here or on IRC (#openra). :)
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:
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 😋
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.
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.
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.
The problem would be with neutral stuff in that case tbh.
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.
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