Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 "Implement Virtual Method" call "Super" in UE4

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
agaubatz Posted - Jul 04 2018 : 1:53:09 PM
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!
2   L A T E S T    R E P L I E S    (Newest First)
sean Posted - Dec 03 2018 : 6:48:02 PM
In build 2301, when implementing virtual methods from engine base classes marked with UCLASS, Super::MethodName is automatically added to generated implementation (case=116702).
feline Posted - Jul 04 2018 : 4:36:10 PM
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

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000