Actions in functions

Q&A about the latest versions
Post Reply
MSchneiter
Posts: 38
Joined: Thu May 10, 2018 5:06 pm

Hi gurus,

I very often need to repeat a succession of same actions in few skin elements, and therefore have to copy and paste the list of actions from one element to the other. Wondering about the possibility to define functions to record these same actions...

For example, I'm hiding/moving a navigation map on the left, outside the screen boundaries, instead of just making it not visible (I prefer to have movement). I'm also using a variable, SHOWNAVIG, if order to know in which state I am at any time (map hidden or not hidden).
So I have these 2 actions:
Pano2vr_actions.JPG
Pano2vr_actions.JPG (23.6 KiB) Viewed 1512 times
However, I have several other elements which trigger to hide or show the map (move it back into the screen boundaries), and it would be good if I could define a function with these 2 actions, then only call the function in subsequent elements. Also, if I need to change someting in the actions, that would enable to only change it in the function, instead of looking around where I have pasted these 2 action lines...

Any plan for such feature? (unless it already exist?)
User avatar
Hopki
Gnome
Posts: 13015
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

HI,
Just checking, you only need to highlight the actions in an element.
Then in the tree select all the elements that need them and then use the keyboard shortcut to past, control + v (PC) or command + v (Mac).
This will paste the copied actions to all of the selected elements in one hit.
So to this end I don't think we need to do anything else, unless this does not help, if so please let me know with a few more details.
Regards,
Hopki
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
MSchneiter
Posts: 38
Joined: Thu May 10, 2018 5:06 pm

Hi Hopki,

Thanks for your reply, yes I do understand the copy/paste possibilities for actions (this is good!)

My worry is that I would like to avoid this copy/paste of the same 2 action lines (shown in my initial post) in multiple object, and instead to have the ability to paste these 2 lines in a kind of function, and resuse the function in several objects.

Let's say that I can have these 2 actions stored under a function called HIDE_PLAN, I could then stick HIDE_PLAN() in all objects that participate to hide the plan/map. This avoid duplication of code.
If at any stage I need to change the code for hiding the plan, I just have to change it in the function, instead of having to change it in all object where these 2 lines might have been copied...

Let me know if I'm not clear
Tx
Post Reply