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

Added character entity support #6

Merged
merged 11 commits into from May 4, 2017
Merged

Conversation

nihal111
Copy link
Member

@nihal111 nihal111 commented May 3, 2017

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:
screenshot from 2017-05-03 22-51-44
screenshot from 2017-05-03 23-37-33

@nihal111 nihal111 requested a review from Josharias May 4, 2017 07:25
@nihal111
Copy link
Member Author

nihal111 commented May 4, 2017

@Josharias Can you please review this?

Copy link

@jzacharias-associa jzacharias-associa left a 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();

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.

Copy link
Member Author

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);

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)

Copy link
Member Author

@nihal111 nihal111 May 4, 2017

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.

@nihal111
Copy link
Member Author

nihal111 commented May 4, 2017

Of course the block tooltip still works. 😄
3

Added screenshots in readme and bumped version.
Merging now. Thanks for the review @jzacharias-associa @Josharias

@nihal111 nihal111 merged commit 3718c97 into Terasology:master May 4, 2017
@nihal111 nihal111 removed this from Month 1 in GSOC 2017 - Exploration World May 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants