Unit hover text vs. icon hover text

Ninja2

Great Engineer
Joined
Nov 17, 2005
Messages
1,142
Location
Denmarkia
In my mod, when I give Interception promotions to my fighters and ground based interceptors, there's a strange difference in the display of the promotion. When I hover the mouse over the unit on the map (picture 1), I get the correct stats and promotions shown in the hover text. E.g. a 50% interception is shown, which is the unit's base interception stat of 40%, plus 10% from the Interception I promotion. However, if I hover the mouse over the unit's icon in the bottom of the interface (picture 2), I only see the base of 40% in the hover text. The promotion icon is visible, but the stat shown is just the 40%.

Where in the SDK code might I find the hover text for those icons, to see what is going on?
 

Attachments

  • aa1.jpg
    aa1.jpg
    225.3 KB · Views: 113
  • aa2.jpg
    aa2.jpg
    215.6 KB · Views: 124
I don't think this is what you are really looking for but it might help, so I thought I'd mention it. You can manually alter the screen help text in CvMainInterface.updateHelpStrings() by getting the current help string with CyInterface().getHelpString(), changing it, then using screen.setHelpTextString("YourHelpText").
 
Line 1060 of CvMainInterface.py sets up the hover type using this line:

Code:
screen.addUnitGraphicGFC( 
    "InterfaceUnitModel", 
    CyInterface().getHeadSelectedUnit().getUnitType(), 
    175, yResolution - 138, 123, 132, 
    WidgetTypes.WIDGET_UNIT_MODEL, 
    [B]CyInterface().getHeadSelectedUnit().getUnitType()[/B], -1,  
    -20, 30, 1, False )

As you can see, it looks only at the unit's type--not the specific unit. You could probably change this to use the actual unit with the correct widget type.
 
I'm not sure I understand. If you look at these two catapult screenies, the one on the left shows the hover from having the mouse on the plot. The other one shows the hover from the unit icon in the bottom of the screen. In both hover texts, you are able to see the specific unit, not just the unit type. There are in fact quite a few inconsistencies as to how stuff is shown in these two hover texts. Like the unit hover shows all the promotion bonuses in the same way it shows the base bonuses, but the icon hover shows 50% bonus to collateral (in gray text), but actually doesn't show the 10% against melee, that comes with Barrage II...

This is with BUG 3.6, I am not sure if you changed these hovers?
 

Attachments

  • cat1.jpg
    cat1.jpg
    262 KB · Views: 111
  • cat2.jpg
    cat2.jpg
    275.5 KB · Views: 124
Ah, I didn't look at the screenshots and didn't think you were using BUG. BUG has PLE which draws its own hover for the unit icons in the plot list. It uses the built-in hover text for the unit model in the bottom-left corner.

It would probably be possible to replace the hover for the unit model as well. Post a request in the Feature Request tracker on the SF.net site. I'm really busy at the moment, but I think it would be fairly simple to do.
 
Done! Thanks for the help.
 
Top Bottom