Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 "Implement Virtual Method" call "Super" in UE4
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

agaubatz
New Member

USA
2 Posts

Posted - Jul 04 2018 :  1:53:09 PM  Show Profile  Reply with Quote
I've really appreciated all the UE4 specific features that have been added to Visual Assist lately. They've made my life a lot easier! And it's impressive given how non-standard and macro-magicy UE4's C++ is.

Obviously, I'm about to ask for more...

I use the "Implement Virtual Method" refactor all the time, but when I do, I almost always want to call "Super::MyFunctionName(Param1, Param2...)" and have to type it out. Could there be a setting or something that would include that base class call in the generated code?

It's easy to forget to call Super, and there are a lot of subtle bugs that can happen in UE4 projects if you do. For instance, forgetting to call "Super::BeginPlay()" can result in particle systems randomly not playing.

Thanks!

feline
Whole Tomato Software

United Kingdom
19022 Posts

Posted - Jul 04 2018 :  4:36:10 PM  Show Profile  Reply with Quote
To make calling the super function easier and quicker, you can add your own VA Snippet, with the body:

Super::$MethodName$($MethodArgs$);

or, to make it easier, simply open the VA Snippet editor, and paste in the following code from the clipboard:

<VA_Snippet>
<Language>C++</Language>
<Title>Call super class</Title>
<Shortcut>super</Shortcut>
<Description />
<Code>Super::$MethodName$($MethodArgs$);</Code>
</VA_Snippet>


which will insert the snippet for you, along with its shortcut, "super" in this example.

You cannot currently tell VA to add this automatically as part of the refactoring command, since the symbol context does not exist until the code has been generated, but this is something we are aware of, and are looking to improve at some point:

case=9863

zen is the art of being at one with the two'ness
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Dec 03 2018 :  6:48:02 PM  Show Profile  Reply with Quote
In build 2301, when implementing virtual methods from engine base classes marked with UCLASS, Super::MethodName is automatically added to generated implementation (case=116702).
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000