Jump to content

Mouse hover for additional information


Recommended Posts

@Stan`@Angen@Freagarach@maroder

Do you have a hint for me how hover actions are coded? Is this C++ or JS? Where would I find some (example) code? Thank you!

I ask because of patch D4252, where we agree that the additional explanatory text won't fit behind the "Enabled mods" text anymore, so that it would need to be a hover-over tooltip.

Edited by Ceres
Link to comment
Share on other sites

To give you some starting information:

The tooltips are defined in public/gui/common/setup.xml

and you can use them in the xml files, which define the layout of the mod page like this (i.e. tooltip_style):

<object type="button" style="MenuButton" tooltip_style="AwesomeToolTip"/>

 

  • Like 1
Link to comment
Share on other sites

5 hours ago, Ceres said:

Is this C++ or JS?

Neither you can do it all by editing the xml file you already found.

 

5 hours ago, Ceres said:

Where would I find some (example) code?

I guess: search your favorite tooltip in game and look how it is done there (hint: the mod up and mod down buttons on the right hand side of the modselection panel seem like a good candidate)

  • Like 1
Link to comment
Share on other sites

@bb_@Stan`

I would like to understand the meaning of this:

<object size="16 62% 100%-15 100%-84">

I'm on IRC (as Ceres). Is that the right place to ask or rather here in the forum?

PS:

@bb_ Thanks for your kind help over there! :) For other interested people:

left top position is (16, 62%):

  • object is 16 pixels to the right (absolute)
  • object is at 62% of the height (relative)

right bottom is (100%-15, 100%-84):

  • right hand side of object is 15 pixels from right of parent object
  • bottom of object is 84 pixels from bottom of the parent object

Note that sizes are relative to parent object's size.

Hopefully, I summarised this correctly. ;) I will play around with different numbers to better understand this.

Edited by Ceres
changed "top left" to "left top" and "bottom right" to "right bottom"
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...