raduprv / Eternal-Lands

http://www.eternal-lands.com
Other
158 stars 57 forks source link

Add tooltips in map editor toolbox buttons #101

Closed brunoramoslu closed 3 years ago

brunoramoslu commented 3 years ago

I was wondering if we could add tooltips to the map editor buttons, something like this.

I could try to rework the code a bit to prevent duplicating the "positions" of of the buttons if needed.

feeltheburn commented 3 years ago

Tooltips are quite annoying once you know the tools, and there aren't many to learn here.

If added, there needs to be an option to not show them. (Simplest method being a variable set in the mapedit.ini file.)

gvissers commented 3 years ago

As Burn seems to be the only one actually using the map editor, I'd take his comments into account :smile:

Also, since you're cleaning up code, you might want to address a pet peeve of mine: you could take the opportunity to remove the hard-coded pixel boundaries and replace them by dynamic values in an array (which needs to be initialized at startup). This would help in adding UI scaling to the map editor (the buttons are really small on my system). Either that, or at least replace them by appropriately named #define constants. Then use the same values in the click handler.

brunoramoslu commented 3 years ago

I will clean up the code a bit and add an option to enable/disable tooltips.

I'm also thinking about addind the 't' key to control tooltip being shown or not.

I think setting the tool tip to activate by default should be ok, if you can later disable it.

feeltheburn commented 3 years ago

That sounds fine, as long as there's a way to deactivate, by variable or by click. ;)

brunoramoslu commented 3 years ago

I have done a couple of changes to improve the pull request:

Any feedback would be welcome :slightly_smiling_face:

gvissers commented 3 years ago

I think this works well enough, so I have merged it. One suggestion for further a possible improvement: try adding a semi-transparent background behind the tooltips, so that they're easier to read.

I'll take a stab at scaling the buttons.