GUI tooltips

GUI tooltips

Postby StefanP.MUC » 03 Mar 2011, 09:50

CEGUI supports very easy tooltip integration:
{l Code}: {l Select All Code}
<Property Name="Tooltip" Value="Hooray a tooltip text" />

But to get it work, it seems that CEGUI needs to know how much time has passed. This is from the CEGUI forums:
System::injectTimePulse tells CEGUI how many seconds have passed. If you never call it, tooltips, animations and maybe other stuff won't work. Tell your coders to insert it and call it every frame with a delta.


I suppose one of the coders knows where to put this in the code. With this line the GUI would support showing tooltips. I think that's a nice feature to have for player freindlyness since it doesn't require much coding nor designing work. It seems we need it anyways if we want t have animated mouse cursors for example.
StefanP.MUC
 

Re: GUI tooltips

Postby svenskmand » 03 Mar 2011, 16:01

Nice :)

When I made the first GUI mock-up I wanted the gold and mana containers to be animated looking like an Hourglass where gold runs down when you earn it and out when you spend it, and mana flows through when you spend and obtain it. That is also why the counters where so big in the initial mock-up.
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: GUI tooltips

Postby andrewbuck » 03 Mar 2011, 22:50

I can add this in, it is just a one-line entry and I think I know where it should be entered. Are you building your game yourself, blablub, or are you using the prebuilt packages from sourceforge?

-Buck
andrewbuck
OD Moderator
 
Posts: 563
Joined: 20 Dec 2009, 01:42

Re: GUI tooltips

Postby andrewbuck » 04 Mar 2011, 06:52

I got the line added for the time injection. I will push it to git on sourceforge so you can use it. I did notice however that when I run the latest code checked out from git (using the media from SVN), the game starts properly, however the GUI overlay is not visible. When loading the game I get the following error (it seems to be complaining about line 146 of Media/gui/OpenDungeons.layout). I have included a bit before and after the error message for context.

-Buck

{l Code}: {l Select All Code}
Adding goal KillAllEnemies
Adding goal ProtectCreature   Creature name: King
Adding goal ClaimNTiles
Adding goal ClaimNTiles
Adding goal MineNGold
Adding goal MineNGold
Adding goal MineNGold
Adding goal ProtectDungeonTempleMesh: Loading SquareSelector.mesh.
Texture: Water4.png: Loading 1 faces(PF_A8R8G8B8,1024x1024x1) with 5 generated mipmaps from Image. Internal format is PF_A8R8G8B8,1024x1024x1.
Texture: _cegui_ogre_0: Loading 1 faces(PF_A8B8G8R8,256x256x1) with 0 generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x256x1.
Texture: _cegui_ogre_1: Loading 1 faces(PF_A8B8G8R8,256x256x1) with 0 generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x256x1.
Texture: _cegui_ogre_2: Loading 1 faces(PF_A8B8G8R8,256x256x1) with 0 generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x256x1.
CEGUI::GenericException in file CEGUIExpatParser.cpp(78) : ExpatParser::parseXMLFile - XML Parsing error 'mismatched tag' at line 146


ERROR:  Caught and ignored an exception in the loading of the CEGUI overlay, the game will continue to function albeit without the GUI overlay functionality.

Loading music...
Media/music//replacementmusic.ogg
Loaded music
*** Initializing OIS ***
*** FrameListener initialized ***
andrewbuck
OD Moderator
 
Posts: 563
Joined: 20 Dec 2009, 01:42

Re: GUI tooltips

Postby StefanP.MUC » 04 Mar 2011, 07:43

Thanks for the report, I accidentally deleted a closing tag to much while removing the old GUI. Just pushed a fixing commit to SVN.

I'm using the prebuilt packages, so I can't check my source code commits myself. I didn't get it to compile properly. I wanted to try yesterday again with eclipse, but it gave me only errors (The Eclipse evironment itself, not the Compiler or something). So for now I use TortoiseGit and Codeblock, this works pretty good. I'll try to see if I can get it to build with it later.

edit: I did set up a Ubuntu VM and compiled the game there, currently checking out the Media. Then I should be able to test it there.
StefanP.MUC
 

Re: GUI tooltips

Postby StefanP.MUC » 04 Mar 2011, 13:18

OK, in my Ubuntu VM I can now test the layout changes myself. Good thing: Everything works so far (even clicking :D ).
StefanP.MUC
 

Re: GUI tooltips

Postby StefanP.MUC » 04 Mar 2011, 13:29

OK, everything but the tooltips... These still don'T work, even with the incetionTimePulse

There's something on the CEGUI wiki about the source code part on this:
http://www.cegui.org.uk/wiki/index.php/ ... he_Tooltip
StefanP.MUC
 

Re: GUI tooltips

Postby StefanP.MUC » 04 Mar 2011, 14:14

Ah, there also needs to be a setDefaultTooltip() call. I currently test it on my Ubuntu VM, if it works I'll push it to the repo.

edit: Yay, it's working :) I already pushed it. Now we can have tooltips. This will save us a lot of "User manual writing", we can simply give a self-explaining tooltip. ;)
StefanP.MUC
 

Re: GUI tooltips

Postby andrewbuck » 04 Mar 2011, 15:08

Excellent work blablub. I am pretty impressed with how quickly you picked all this stuff up. Learning CEGUI/git/SVN and setting up a build environment on win/linux is no easy feat. I will try to check out the latest stuff and see how it works on my dev system here, although if it works in your vm I see no reason why it won't work for me.

-Buck
andrewbuck
OD Moderator
 
Posts: 563
Joined: 20 Dec 2009, 01:42

Re: GUI tooltips

Postby StefanP.MUC » 04 Mar 2011, 15:34

I'm not completly new to development. ;) I'd call me rather "professional" on Computers in general and on programming on Windows with C#. But OD is the first really big cross-platform project for me that I participate in, that's why I had some starting problems, but I'm getting used to all this stuff quickly. ;)
StefanP.MUC
 

Re: GUI tooltips

Postby andrewbuck » 04 Mar 2011, 16:00

That makes sense then. In any case, glad to have you aboard.

-Buck
andrewbuck
OD Moderator
 
Posts: 563
Joined: 20 Dec 2009, 01:42

Re: GUI tooltips

Postby svenskmand » 04 Mar 2011, 19:40

Yes welcome aboard :)
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Who is online

Users browsing this forum: No registered users and 0 guests

cron