Author |
Topic |
|
Amimoller
Junior Member
Denmark
12 Posts |
Posted - Dec 18 2020 : 03:41:11 AM
|
One of the things that seem to take way too many steps when working with UE4 is adding new files. Right now the easiest way seem to be to use file explorer, go to the folder where you want the new file and copy paste then rename an existing one. Then add it to the project in visual studio. (It is also added to perforce automatically)
It would be really neat if VA could add an option when you right click a folder to create .h/.cpp file in that folder and add it to source control. If there was also a choice between adding just the bare minimum code for either actor / actorcomponent / uobject. That would be extra nice :)
Maybe there is alredy a better way to do it, but if not, this would be a really nice addition for UE developers.
Cheers! |
|
feline
Whole Tomato Software
United Kingdom
18951 Posts |
Posted - Dec 18 2020 : 05:35:31 AM
|
VA does have a Create File command, and you can use VA Snippets to specify the default initial file content for both header and cpp files:
https://support.wholetomato.com/default.asp?W288
Since the command is triggered from within the IDE, we take the directory of the current file to be the target directory in which to create the new file.
Since the files are automatically added to the project, IDE source control integration should take care of adding the files to Perforce.
You can then use other VA Snippets to add extra, more custom, standard blocks of code to the new files, depending on what you are doing with the files.
https://support.wholetomato.com/default.asp?W171 |
zen is the art of being at one with the two'ness |
|
|
Amimoller
Junior Member
Denmark
12 Posts |
Posted - Jan 23 2021 : 06:29:46 AM
|
So I tried out this solution. Its true i can select all the code of the class in the headerfile and select move to new file. Then i go to the source file and select all the implemention and move to new file.
But it places the files in the root of the project instead of the filter that matches the folder. So i still have to manually generate the project files and reload the project.
Its still a small improvement, but it would be much better if it followed UE4 filter/folder conventions. A+ if you could just right click a class and select extract to new file and it would suggest the right filename :) |
|
|
feline
Whole Tomato Software
United Kingdom
18951 Posts |
Posted - Jan 23 2021 : 07:28:58 AM
|
What are the rules for the filter in Solution Explorer for unreal engine projects? This isn't something I have looked at before, but looking at a simple game solution shows a mixture of C# and C++ files in the same project, which is not a "standard" Visual Studio structure. |
zen is the art of being at one with the two'ness |
|
|
Amimoller
Junior Member
Denmark
12 Posts |
Posted - Jan 25 2021 : 03:44:28 AM
|
As far as i know the filter structure matches the folder structure 1:1 and is kept that way since the solution is auto generated. So there isnt really and option of moving stuff around. I think the c# files are only used during the build process and mostly used to define dependencies across projects. Hence they are only? placed in the root of the solution / projects structure. |
|
|
feline
Whole Tomato Software
United Kingdom
18951 Posts |
Posted - Jan 25 2021 : 12:15:17 PM
|
We are considering the ability to move a class to a new file, so having the new file named so its name matches the class name just makes sense. I have added this point to the feature request:
case=31484
Assuming the directory structure in Solution Explorer matches up with the directory structure on the hard drive then placing the new file into the right filter / directory makes sense, I have put in a feature request for this:
case=144344 |
zen is the art of being at one with the two'ness |
|
|
Amimoller
Junior Member
Denmark
12 Posts |
Posted - Jan 25 2021 : 2:30:36 PM
|
Cool! That is going to both save time and prevent files being bloated with multiple classes since its so annoying to add a new file. Cheers! |
|
|
HGsofts
Starting Member
1 Posts |
Posted - Jun 17 2022 : 6:42:21 PM
|
I need a "Create File" for UE4 like a InteliJ. Please update. |
|
|
feline
Whole Tomato Software
United Kingdom
18951 Posts |
Posted - Jun 20 2022 : 06:55:56 AM
|
Have you tried using VA's Create File feature?
https://docs.wholetomato.com/default.asp?W288
Is there something more that you need to do? If so, can you give me some idea of what it is that you are looking for here? I haven't used InteliJ, so I don't know how it compares. |
zen is the art of being at one with the two'ness |
|
|
|
Topic |
|