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
Add moving buttons for order parameters in functions #1159
Conversation
Almost good :) I've fixed this, I'll wait for Travis to compile this. You can actually see the error messages, if any, in the Travis page. For example: https://travis-ci.org/4ian/GDevelop/jobs/562664711 I've seen here there was the error message about the extra parameter. This being said, would be great to have this compiling on Windows 10, but I have little access to a Windows 10 machine these days. I might get a virtual machine for this. |
Alright this is passing now! This should work but a question though: if we change the order of the parameters, this won't update any existing action/condition/expression using this function. Should we worry about this? Or is it ok not to update anything? What do you think? |
The name of parameters still, i guess the action/condition/expression need name and not the index of parameter. So if just the name is require all should work without refresh action/condition/expression.
Or linux, i guess Windows10 in VM is heavy and we need windows key. |
No actions/conditions depends on the order of the parameters :/ (otherwise, what would happen if you rename the parameter), like when you declares an extension. |
I'm ok for merging this as it does not looks like a big problem, but I was thinking maybe we can actually add a warning using a |
Sorry I didn't see the post.
A program that asks the user to do something is a little funny ^^ |
This feature is at this stage since some updates. |
Basically yes we would need to add in As a starting point, it should be a bit like GDevelop/Core/GDCore/IDE/WholeProjectRefactorer.cpp Lines 337 to 354 in a6dab9a
which is implemented like this: GDevelop/Core/GDCore/IDE/WholeProjectRefactorer.cpp Lines 550 to 569 in a6dab9a
We would need a
(you can see the "Visit" indicates the Visitor pattern). Would be a few hours for me to do I think... but I've little time these days and want to finish https://trello.com/c/hjy2d6O2/383-performance-improvements-for-collisions-raycast-distance-tests-with-large-number-of-objects-or-very-large-levels and work on https://trello.com/c/cLzur8l0/386-add-support-for-declaring-new-effects-in-extensions as effects are important for games and to let contributors create new effects. |
Yes I also prefer to see the effects and optimization! Ok let's leave this aside, in any case it doesn't seem possible for me to do the C++ part. It's more than a few hours that I need just for try do to this. |
Finally took the time to add these functions :) So you now have Use them like For example:
will move the parameter at position 2 to position 3 (knowing that first position is 0) for the given function of the given behavior in the whole project. @Bouh do you want to give a try at this? In addition to move the parameter like you did, you now need to make two functions that looks like Let me know if you want to try this, otherwise I'll try to do it later. |
I will give a try tomorrow.
Le ven. 27 déc. 2019 à 22:44, Florian Rival <notifications@github.com> a
écrit :
… Finally took the time to add these functions :)
So you now have gd.WholeProjectRefactorer.moveEventsFunctionParameter and
gd.WholeProjectRefactorer.moveBehaviorEventsFunctionParameter.
Use them like gd.WholeProjectRefactorer.renameEventsFunction or
gd.WholeProjectRefactorer.renameBehaviorEventsFunction. Parameters are:
project, eventsFunctionsExtension, [eventsBasedBehavior for the Behavior
one], eventsFunction.getName() (the name of the function for which the
parameter is moved, and finally the oldIndex (a number) and the newIndex
(number too).
For example:
gd.WholeProjectRefactorer.renameBehaviorEventsFunction(
project,
eventsFunctionsExtension,
eventsBasedBehavior,
eventsFunction.getName(),
2,
3
);
will move the parameter at position 2 to position 3 (knowing that first
position is 0) for the given function of the given behavior in the whole
project.
@Bouh <https://github.com/Bouh> do you want to give a try at this? In
addition to move the parameter like you did, you now need to make two
functions that looks like _makeRenameFreeEventsFunction and
_makeRenameBehaviorEventsFunction (except that you call them
makeMoveXXXParameter, and you pass oldIndex/newIndex and call the proper
functions inside) in EventsFunctionsExtensionEditor. Then, pass these
functions to <EventsFunctionConfigurationEditor props and finally to
<EventsFunctionParametersEditor props.
You'll need to call the proper function
(_makeRenameFreeEventsFunction/_makeRenameBehaviorEventsFunction) according
to if a behavior is selected or not (see selectedEventsBasedBehavior).
Let me know if you want to try this, otherwise I'll try to do it later.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1159?email_source=notifications&email_token=AAMX4DTC2GXAFWEL64YFQJTQ2ZZMPA5CNFSM4IGGCUUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHXZXPY#issuecomment-569351103>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMX4DTH62QCJ4SGWC5EFBDQ2ZZMPANCNFSM4IGGCUUA>
.
|
Next on #1340 |
This should be closed now that it's continuing in another PR |
Right, closing this one! |
This is in link with this card on Trello
I've follow your instruction, i can't compile again the gd.js i got errors and it's bored to search how fix it.
Compile and install the environement for gd.js is a bit hard on Windows10, we have errors everywhere.