I want to use CEGUI as much as possible in my game so I don't end up using all kinds of extra font rasterizers and everything. Right now I got a silly problem with the tooltips. They show up allright, and it looks fine.
Except, I want to display them in the game window. Now, the default behavior for a tooltip is NOT to show up more than once if the mouse stays over the same button/picture/whatever. Unfortunately, this also applies to the root window.
right now, to have the tooltip appear twice, I first need to move the mouse out of my game window, to a different window (a toolbar), and move back.
I've tried (and failed):
- resetTimer();
- Changing target window to NULL, and back
- Changing the window tooltiptext to "" when there is NO unit under the mouse cursor.
Like this:
Code: Select all
..for..
//Only update when necassary
if (wdw->getTooltipText() != tmp)
wdw->setTooltipText(tmp);
//We had a hit!
bHit = true;
.. loop ..
//no hit? remove text:
if (bHit == false)
{
//If the tooltip text string is not empty, do that right now and reset timer.
//if (wdw->getTooltipText() != "")
// {
// wdw->setTooltipText("");
Tooltip* pbar = static_cast<Tooltip*>(winMgr.getWindow("Tooltip"));
pbar->resetTimer();
// pbar->setTargetWindow(NULL);
// pbar->setTargetWindow(wdw);
// }
}
Unfortunately, all my attempts have failed at the moment. Ofcourse I can use a statictext object. Ofcourse I can creat my own Tooltip object in CEGUI. But I rather not, since everytime I update to the new versions, I miht have to sort things out again.
Anyone have an interesting 'hack' to fix my problem?