Logo Platform
logo amplifiers simplified

TooltipOverride not working

Reply
Copied to clipboard!
7 years ago
Jun 20, 2018, 10:30:41 PM

When using Modifier, TooltipOverride works fine.


When using BinaryModifier, it's not showing up.


However, this might be related to the use of a new Property within the SiumlationDescriptor referenced by the BinaryModifier.


I've created a GuiElement for the new Property, but it only seems to work if the Property was added to SimulationDescriptors[Empire] and SimulationDescriptors[ColonizedStarSystem] (so far) and not when the Property is apart of something like a system improvement descriptor.


So the question is how to get tooltips to look correct when using a new Property?

0Send private message
7 years ago
Jun 21, 2018, 7:44:38 AM

Hey Tychonoir,


Tooltips are a bit tricky and even devs have a hard time making them work, oops.

The BinaryModifier's effects are displayed only if at least one of the two operands (Left or Right) is a number or a property defined in the SimulationDescriptor (aka local) (if the tooltip shows the effect of a descriptor which isn't applied yet, for example on an improvement in the list of constructions, it will use the DefaultValue).

If one operand is a non-local property the tooltip will be "+X per Y on Z".

If both operands are non-local property the tooltip will likely not show up.


Can you copy your descriptors here so I can examine them?

Updated 7 years ago.
0Send private message
7 years ago
Jun 22, 2018, 7:00:30 AM

So I set up a series of test items to check various permentations of useage... and every single one worked. Hmmm.


What I think is happening on the original ones that don't work, is the local property is set to 0. This property may later be increased, however I think if the BinaryModifier evaluates to 0, the tooltip is suppressed regardless of override.

Since an unbuilt structure must evaluate to 0, therein lies the problem.

I think I found a workaround, though.

I'm instead setting the basevalue to 1, and then adding a Modifier to subtract 1 from the value, making the "normal" value 0 again. This seems to trick it into displaying the tooltip.

0Send private message
?

Click here to login

Reply
Comment

Characters : 0
No results
0Send private message