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

[Don't Merge, IP] UI Animation System (Required for Terasology/Breathing#4 and #1639) #2271 #2273

Closed
wants to merge 14 commits into from

Conversation

viveret
Copy link
Contributor

@viveret viveret commented Apr 3, 2016

UI Animation System (Required for Terasology/Breathing#4 and #1639), full-fills discussion at #2271

@GooeyHub
Copy link
Member

GooeyHub commented Apr 3, 2016

Can one of the admins please verify this patch?

@Cervator
Copy link
Member

Cervator commented Apr 3, 2016

Neat :-)

@GooeyHub: ok to test

@viveret: should there be so many inner classes/interfaces or should they be in their own files? I see one or two occasionally. I actually have little to no clue on the involved best practices, it just stuck out.

Might also be good to add in an example, possible via a PR to a module able to use it :-)

@msteiger & @rzats: ping!

@Cervator Cervator added the Topic: UI/UX Requests, Issues and Changes related to screens, artwork, sound and overall user experience label Apr 3, 2016
@viveret
Copy link
Contributor Author

viveret commented Apr 3, 2016

@Cervator They will be definitely moved to their own files as this one grows. It is easier to have all the basic code in one file for faster editing. The implementations of all the methods will warrant a good amount of files.

@GooeyHub
Copy link
Member

GooeyHub commented Apr 3, 2016

Refer to this link for build results (access rights to CI server needed):
http://jenkins.terasology.org/job/TerasologyPRs/559/
Hooray Jenkins reported success with all tests good!

@@ -0,0 +1,151 @@
/*
* Copyright 2014 MovingBlocks
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this would ever happen in a newly created file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copy/pasted the licensing code from another file. Should it be not included?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, just change the year to 2016. If you've created this file from IntelliJ, a license header with the current year would be autogenerated,

@viveret
Copy link
Contributor Author

viveret commented Apr 3, 2016

I'm also wondering how someone would hook the update method of the animation somewhere it would be called automatically.

EDIT: Nevermind, found it!

private int myRepeatCount;

private enum AnimState {
STOPPED, RUNNING
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may also add a PAUSED state here to will resume the animation rather than restart it - although that's purely an optional feature request

@viveret
Copy link
Contributor Author

viveret commented Apr 3, 2016

@rzats I've made a lot of changes you should check out

@GooeyHub
Copy link
Member

GooeyHub commented Apr 3, 2016

Refer to this link for build results (access rights to CI server needed):
http://jenkins.terasology.org/job/TerasologyPRs/560/
Hooray Jenkins reported success with all tests good!

return v * (end - start) + start;
}

public void setStart(float val) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be v for consistency, I suppose - same with setEnd().
Alternatively, just set them all to value.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it should probably be "value" in both cases, as abbreviations make code less readable even though this case is trivial.

@rzats
Copy link
Member

rzats commented Apr 3, 2016

@viveret: this seems to be almost perfect in terms of checkstyling now 👍

Don't have much to say about functionality yet.

@viveret
Copy link
Contributor Author

viveret commented Apr 3, 2016

@rzats Awesome! I'll see if I can make transitions for menus or buttons.

@viveret
Copy link
Contributor Author

viveret commented Apr 3, 2016

@emanuele3d Do you know how I can inject a class that implements UpdateSubscriberSystem into the engine?

@viveret
Copy link
Contributor Author

viveret commented Apr 3, 2016

@Cervator @emanuele3d @rzats have any idea how I can hook animations into the engine?

@Cervator
Copy link
Member

Cervator commented Apr 3, 2016

@viveret simple example at https://github.com/Terasology/Spawning/blob/master/src/main/java/org/terasology/spawning/SpawnerSystem.java#L58 :-)

Since these are UI animations I suspect they could live in a System registered for client side only.

@GooeyHub
Copy link
Member

GooeyHub commented Apr 3, 2016

Refer to this link for build results (access rights to CI server needed):
http://jenkins.terasology.org/job/TerasologyPRs/561/
Hooray Jenkins reported success with all tests good!

@Josharias
Copy link
Contributor

Viveret, and then after using @RegisterSystem, use @share on the class so that other systems can have the animation system injected and used. Like this...https://github.com/MovingBlocks/Terasology/blob/develop/modules/Core/src/main/java/org/terasology/logic/inventory/InventoryClientSystem.java

@GooeyHub
Copy link
Member

GooeyHub commented Apr 4, 2016

Refer to this link for build results (access rights to CI server needed):
http://jenkins.terasology.org/job/TerasologyPRs/562/
Uh oh, something went wrong with the build. Need to check on that

@Cervator
Copy link
Member

Cervator commented Apr 7, 2016

Nice example! Works well, fun to see :D

Looks like you got some good technical feedback too. I just like seeing new stuff!

@rzats
Copy link
Member

rzats commented Apr 7, 2016

Made a note on a medium-priority API issue - otherwise this looks great!

@viveret
Copy link
Contributor Author

viveret commented Apr 7, 2016

@rzats I couldn't find your comments! D:

@rzats
Copy link
Member

rzats commented Apr 7, 2016

@viveret: these were created as a reply to an earlier line note - sorry if that's not very noticeable. Link

@GooeyHub
Copy link
Member

GooeyHub commented Apr 7, 2016

Refer to this link for build results (access rights to CI server needed):
http://jenkins.terasology.org/job/TerasologyPRs/573/
Hooray Jenkins reported success with all tests good!

@Cervator
Copy link
Member

Cervator commented Apr 7, 2016

I added the potential todos from the hidden comment to the initial post :-)

The link may not go to the right place at first as it seemingly relies on first loading then expanding the obsolete line comment

I see a new commit in any case so maybe they're already done :D

I think another comment got hidden when another commit updated something: https://github.com/MovingBlocks/Terasology/pull/2273/files/a36cac9381b063b4265d4c675f6eea2e0e565245#r58928885 - was @msteiger suggesting to finish the PR with minimal functionality then add more later

@viveret
Copy link
Contributor Author

viveret commented Apr 7, 2016

@Cervator I think @msteiger meant that, but I'd want to keep some essential functionality to show how the API is used.

@GooeyHub
Copy link
Member

GooeyHub commented Apr 8, 2016

Refer to this link for build results (access rights to CI server needed):
http://jenkins.terasology.org/job/TerasologyPRs/576/
Hooray Jenkins reported success with all tests good!

@msteiger
Copy link
Member

msteiger commented Apr 8, 2016

Thanks - I will try to review this over the weekend.

Another interesting candidate for animation could be Hermite interpolation (see TeraMath.fadeHermite):
https://www.wolframalpha.com/input/?i=t+*+t+*+(3+-+2+*+t)+from+0+to+1

@viveret
Copy link
Contributor Author

viveret commented Apr 16, 2016

@msteiger have you had a chance to look over it yet?

@msteiger
Copy link
Member

Yes, I'm looking into it currently. I'd like to edit a few things and send a PR to you when I'm done. I think that this might be easier than commenting and asking for changes. It might still take a few more days, though.

@viveret
Copy link
Contributor Author

viveret commented Apr 16, 2016

Sounds perfect.

@msteiger
Copy link
Member

Can you please resolve the merge conflicts? I will put my changes on top then.

@viveret
Copy link
Contributor Author

viveret commented Apr 17, 2016

Sure, I'll work on that now! @msteiger done!

@GooeyHub
Copy link
Member

Refer to this link for build results (access rights to CI server needed):
http://jenkins.terasology.org/job/TerasologyPRs/605/
Hooray Jenkins reported success with all tests good!

@GooeyHub
Copy link
Member

Refer to this link for build results (access rights to CI server needed):
http://jenkins.terasology.org/job/TerasologyPRs/606/
Hooray Jenkins reported success with all tests good!

@Cervator
Copy link
Member

@msteiger ping :-) Did the work elsewhere and couple PRs help get us to where we can move forward with this one? Do we need to merge #2302 first or rework anything here?

@msteiger
Copy link
Member

Thanks for the reminder. I'm working on it at the moment over at msteiger#27. Should be ready in a few days.

@viveret
Copy link
Contributor Author

viveret commented Apr 23, 2016

@msteiger So was my initial code before the refactor good or worthwhile?

@msteiger
Copy link
Member

msteiger commented May 8, 2016

Closing this in favor of #2306, which contains all commits of this PR. Thank you, @viveret!

@msteiger msteiger closed this May 8, 2016
@Cervator
Copy link
Member

Cervator commented May 8, 2016

Chances are it would auto-close as merged anyway when the other PR is completed, unless the commits had been rebased too much or something :-)

Yay animation in any case!

@Cervator Cervator added this to the v1.0.1 milestone May 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Topic: UI/UX Requests, Issues and Changes related to screens, artwork, sound and overall user experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants