TrenchBroom / TrenchBroom

Cross-Platform Level Editor
kristianduske.com/trenchbroom
GNU General Public License v3.0
1.88k stars 224 forks source link

FGD Tooltips not showing #2056

Closed JackViney96 closed 5 years ago

JackViney96 commented 6 years ago

System Information

TrenchBroom V2.0.0-final on Windows 10

Expected Behavior

According to @kduske, when you hover over an entity key when using a FGD, information specific to that key should be shown in a tooltip. On Windows 10 this tooltip is not shown.

Steps to Reproduce

https://streamable.com/zw3xk To reproduce this video on Windows 10:

  1. Use the ad_1_7p1_tb.fgd FGD provided with Arcane Dimensions 1.71, or similar
  2. Place an entity that has information defined for its keys, such as misc_model. Entity definition shown below: image
  3. Hover the mouse over a key on the entity. No matter how long the mouse is hovered for, and regardless of whether or not the key has been used on this entity or not, no tooltip showing the information from the FGD file will be displayed.

Suggestion

Currently, the editor displays the primary description for the entity below the entity inspector. I believe that it would be more useful to have this information displayed whenever the "classname" and "origin" fields are selected, and instead display key-specific information in this space when keys are selected. Tooltips slow down the user experience and can be frustrating when trying to repeatedly reference them.

ericwa commented 6 years ago

The tooltips work on macOS, so it seems like it's OS specific. Here, I had the mouse over "angle": screen shot 2018-02-20 at 9 13 59 pm

Upload of the ad1.7 patch 1 FGD:ad_1_7p1_tb.fgd.txt

Currently, the editor displays the primary description for the entity below the entity inspector. I believe that it would be more useful to have this information displayed whenever the "classname" and "origin" fields are selected, and instead display key-specific information in this space when keys are selected. Tooltips slow down the user experience and can be frustrating when trying to repeatedly reference them.

Agreed. That space used for smart editors, for keys that have them, but it could have the smart editor and documentation text vertically stacked.

JosiahJack commented 5 years ago

Would it be helpful to in addition to tooltip (or instead of if for some reason wx doesn't work for it on Win/Linux) display the corresponding tooltip text under the k|v list below the smart editor whenever a k|v pair is selected?

It would be immediately visible that way and more discoverable.

ericwa commented 5 years ago

I tried implementing this: the "smart editor" area is now a splitter, where the top half is a documentation box and the bottom half is the smart editor area. The current grid cell's short description is displayed and bold and the long description is displayed below it in non-bold: screenshot_20190217_213059

The only thing that looks a bit strange is, if you select an attribute with no smart editor, it displays the class documentation in the smart editor panel (same behaviour as TB has always had): screenshot_20190217_222129

ericwa commented 5 years ago

It's also a bit awkward with .def's like Rubicon2.def where there's no per-attribute documentation: screenshot_20190217_224232

I guess I could just collapse the upper pane (the attribute documentation) when there's nothing to display.

The other thing I want to mention is TB's original behaviour of only showing the Class documentation when there's no Smart Editor is not that great, because often you need to see the documentation to make sense of the smart editor choices. This is the case with spawnflags a lot of the time.

One idea for remedying this, that I haven't implemented yet, is to move the class description (EntityDefinition::description()) to the upper half of the split pane I added, below the attribute documentation (if it exists). This would let you read the .def documentation while the spawnflag panel is up. It'd look something like this:

Sunlight 2 dirt

1 enables dirtmapping (ambient occlusion) on sunlight2, -1 to disable. Default is to use the value of '_dirt'.

Class documentation

Worldspawn's description would go here. For the AD fgd it's just "World entity", def's would have more detail.

kduske commented 5 years ago

I guess I could just collapse the upper pane (the attribute documentation) when there's nothing to display.

Agreed.

The other thing I want to mention is TB's original behaviour of only showing the Class documentation when there's no Smart Editor is not that great, because often you need to see the documentation to make sense of the smart editor choices. This is the case with spawnflags a lot of the time.

Agreed as well.

One idea for remedying this, that I haven't implemented yet, is to move the class description (EntityDefinition::description()) to the upper half of the split pane I added, below the attribute documentation (if it exists). This would let you read the .def documentation while the spawnflag panel is up. It'd look something like this:

That looks like a useful compromise. In fact, I would do this always. So, below the attribute grid, show the smart editor if one is available and below that, show the combined documentation.

Or vice versa.