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
Added character entity support #6
Conversation
@Josharias Can you please review this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also had troubles with the box. I am glad you found out why the autosizing was not working correctly. I didnt dive far enough into the root cause.
If you dont mind just doing a quick verification that the block tooltips still work before merging, that would be great.
One more thing, could you bump the minor version of the module to 1.1 to mark the addition of this functionality?
One last thing, those screenshots are gold. I would be quite happy if you added them to the readme as well.
@@ -111,8 +122,7 @@ public String get() { | |||
@Override | |||
public List<TooltipLine> get() { | |||
if (cameraTargetSystem.isTargetAvailable()) { | |||
EntityRef targetEntity = blockEntityRegistry.getEntityAt(cameraTargetSystem.getTargetBlockPosition()); | |||
|
|||
EntityRef targetEntity = cameraTargetSystem.getTarget(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works ok for blocks too, right? If so, I wonder why I chose to use the block entity registry... Good job finding a more generic solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it works for blocks too. 🙂
if (!cameraTargetSystem.isBlock()) { | ||
EntityRef targetEntity = cameraTargetSystem.getTarget(); | ||
GetTooltipIconEvent getTooltipIconEvent = new GetTooltipIconEvent(); | ||
targetEntity.send(getTooltipIconEvent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a much better pattern than the hardcoding I did for block entities. I suppose the natural evolution would use a GetTooltipMeshEvent
to get the mesh for blocks (not now, just thoughts for the future)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes probably can have that in the future.
FYI, these events are defined in the WorldlyTooltip module at present. The module needs to be added as an optional dependency (new feature- MovingBlocks/Terasology#2767) for these events to be handled.
Of course the block tooltip still works. 😄 Added screenshots in readme and bumped version. |
Linked with Terasology/WildAnimals#9 and MovingBlocks/Terasology#2929
This adds Worldly Tooltip integration for character entities, specifically WildAnimals.
Tried adding a box around the ui, which doesn't seem to resize to
"use-content-height"
. Encountered some bugs with NUI and NUIEditor and reported them as engine issues. Will possibly fix the UI later in a follow up PR.Looks like this: