Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a tooltip showing the price of a room tile/trap when hovering its icon #89

Closed
akien-mga opened this issue Aug 20, 2014 · 9 comments · Fixed by #136
Closed

Add a tooltip showing the price of a room tile/trap when hovering its icon #89

akien-mga opened this issue Aug 20, 2014 · 9 comments · Fixed by #136
Assignees
Milestone

Comments

@akien-mga
Copy link
Member

As the topic says. For now it's by trial and error that you know whether you can place a room tile.

@hwoarangmy
Copy link
Contributor

Yes, we could add in the text showing the room name the total price of the room.

@akien-mga
Copy link
Member Author

Yes, we could add in the text showing the room name the total price of the room.

Ah indeed it could be done like that too. Or both :-)

@Bertram25
Copy link
Contributor

IMHO, both.

When selecting the room, its price should be indicated next to the name.
When in the process of adding a room (mouse dragging), the total price should be shown.
Later, we'll probably want to color the stuff depending on whether it's possible.

@Bertram25
Copy link
Contributor

0.4.9 or later? (Might be trickier than it sounds... or not.)

@hwoarangmy
Copy link
Contributor

doesn't sound that tricky. If it reveals to be, we could just forget for now :)

@Bertram25
Copy link
Contributor

Doc for default CEGUI tooltip implementation:
http://cegui.org.uk/wiki/Tooltips
http://static.cegui.org.uk/docs/0.8.4/classCEGUI_1_1Tooltip.html

I'll deal with improving the skin once we have it in-game.

@Bertram25
Copy link
Contributor

As discussed with @hwoarangmy , the CEGUI button icon tooltip part is moved to 'Later' for now.
As he said, all the necessary code is here to show cegui system tooltips, yet they won't show for an unknown reason. This will have to be investigated.
And if we can't display them that way, we will have to add a custom text overlay and use it as tooltip.

@Bertram25
Copy link
Contributor

Reopening as the hover tooltip part isn't done yet.

@Bertram25 Bertram25 reopened this Sep 25, 2014
@Bertram25
Copy link
Contributor

Note to self or anyone, for later use when fixing this:
I've looked at that by pure fanciness:
First problem I have seen is that in Gui.cpp, we're using:

CEGUI::System::getSingleton().getDefaultGUIContext().setDefaultTooltipObject(new CEGUI::Tooltip("OD","Tooltip"));

Which creates a memleak and isn't the preferred way to do that. We should instead use AFAIK:

CEGUI::System::getSingleton().getDefaultGUIContext().setDefaultTooltipType((CEGUI::utf8*)"OD/Tooltip");

As it will handle the tooltip internally, and log if there is an error when creating a valid tooltip object.

Secondly, in ODFrameListener, the injectTimePulse() method should also be called on the default gui context. This line is missing next to the existing one:

CEGUI::System::getSingleton().getDefaultGUIContext().injectTimePulse(evt.timeSinceLastFrame);

This may or may not fix the problem but at least can't hurt.

@hwoarangmy hwoarangmy self-assigned this Nov 21, 2014
@Bertram25 Bertram25 modified the milestones: 0.4.9, Later Nov 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants