├── LICENSE ├── README.md ├── package.json ├── unreal-class-actor.sublime-snippet ├── unreal-class-component.sublime-snippet ├── unreal-class-interface.sublime-snippet ├── unreal-class-object.sublime-snippet ├── unreal-class-statics.sublime-snippet ├── unreal-function-constructor.sublime-snippet ├── unreal-function-interface.sublime-snippet ├── unreal-function-replicated.sublime-snippet ├── unreal-function-static.sublime-snippet ├── unreal-function.sublime-snippet ├── unreal-log-cpp.sublime-snippet ├── unreal-log-fatal.sublime-snippet ├── unreal-log-header.sublime-snippet ├── unreal-log-line.sublime-snippet ├── unreal-macro-export.sublime-snippet ├── unreal-module-build.sublime-snippet ├── unreal-module-cpp-primary.sublime-snippet ├── unreal-module-cpp.sublime-snippet ├── unreal-module-header.sublime-snippet ├── unreal-module-target.sublime-snippet ├── unreal-property-component.sublime-snippet ├── unreal-property-editable.sublime-snippet ├── unreal-property-visible.sublime-snippet └── unreal-uproject.sublime-snippet /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2020, Alex Forsythe 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Unreal Snippets 2 | 3 | A collection of Sublime Text 3 snippets for writing Unreal Engine 4 game code. 4 | 5 | Some of these snippets assume that your project's source modules follow the convention of splitting source files into _Public_ and _Private_ subdirectories. 6 | 7 | ### Available Snippets 8 | 9 | **Project (.uproject)** 10 | 11 | - **uuproj** - Boilerplate .uproject file (e.g. `Project.uproject`) 12 | 13 | **Module (C#)** 14 | 15 | - **umt** - Define a project-level target rules file (e.g. `Source/Project.Target.cs`) 16 | - **umb** - Define a module-level build rules files (e.g. `Source/ProjectCore/ProjectCore.Build.cs`) 17 | - **umh** - Declare a module in its public header file (e.g. `Source/ProjectCore/Public/ProjectCore.h`) 18 | - **umc** - Define a module in its private cpp file (e.g. `Source/ProjectCore/Private/ProjectCore.cpp`) 19 | - **umcp** - Define the _primary_ game module implementation (one per project) 20 | 21 | **Logging (C++)** 22 | 23 | - **ulh** - Declare a module-level log category in a module-private header (e.g. `Source/ProjectCore/Private/Log.h`) 24 | - **ulc** - Define a module-level log category in a cpp file (e.g. `Source/ProjectCore/Private/Log.cpp`) 25 | - **ull** - Write a single UE_LOG line using the module-level log category 26 | - **ulf** - Write a single UE_LOG line at Fatal severity 27 | 28 | **Classes (C++)** 29 | 30 | - **uco** - Declare a UObject subclass 31 | - **ucc** - Declare a UActorComponent subclass 32 | - **uca** - Declare an AActor subclass 33 | - **ucs** - Declare a UBlueprintFunctionLibrary subclass (i.e. a "statics" class) 34 | - **uci** - Declare a UInterface subclass with associated native interface 35 | 36 | **Macros (C++)** 37 | 38 | - **ume** - Insert an export macro in a type definition 39 | 40 | **Properties (C++)** 41 | 42 | - **upc** - Declare a component UPROPERTY (Visible/ReadOnly in "Components" category) 43 | - **upe** - Declare an editable UPROPERTY (Editable/ReadWrite in "" category) 44 | - **upv** - Declare a visible UPROPERTY (Visible/ReadOnly in "" category) 45 | 46 | **Functions (C++)** 47 | 48 | - **uff** - Declare a BlueprintCallable member function 49 | - **ufs** - Declare a BlueprintCallable static function with a WorldContextObject parameter 50 | - **ufi** - Declare a pure virtual function in a native interface class 51 | - **ufc** - Declare a constructor that accepts a const FObjectInitializer reference (in a class header) 52 | - **ufr** - Define the implementation of GetLifetimeReplicatedProps (in an actor source file) 53 | 54 | ### Creating a Project 55 | 56 | Example setup steps for creating a new Unreal C++ project from scratch: 57 | 58 | - Create a root Unreal project directory: replace `Project` with your project name 59 | - Add `Project.uproj`, run `uuproj`, populate with primary module name (e.g. `ProjectCore`) 60 | - Add a `Source` directory 61 | - Within that directory, add `Project.Target.cs`, run `umt`, enter primary module name 62 | - Add `ProjectEditor.Target.cs` the same way, set _Type_ to `TargetType.Editor` 63 | - If desired, add `ProjectServer.Target.cs`, set _Type_ to `TargetType.Server` 64 | - Add a subdirectory for the primary module, e.g. `ProjectCore` 65 | - Within that directory, add `ProjectCore.Build.cs`, run `umb` 66 | - Add two subdirectories, `Public` and `Private` 67 | - Within Public, add `ProjectCore.h`, run `umh` 68 | - Within Private, add `ProjectCore.cpp`, run `umcp` 69 | - Within Private, add `Log.h`, run `ulh` 70 | - Within Private, add `Log.cpp`, run `ulc` 71 | 72 | At this point, you should be able to build your project and open it with the version of UE4Editor that you've built against. 73 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sublime-unreal-snippets", 3 | "version": "1.0.2", 4 | "description": "Snippets for writing Unreal Engine game code", 5 | "repository": { 6 | "type": "git", 7 | "url": "https://github.com/awforsythe/sublime-unreal-snippets.git" 8 | }, 9 | "keywords": [ 10 | "sublime", 11 | "text", 12 | "snippets", 13 | "unreal", 14 | "ue4", 15 | "c++" 16 | ], 17 | "author": "Alex Forsythe ", 18 | "license": "MIT", 19 | "bugs": { 20 | "url": "https://github.com/awforsythe/sublime-unreal-snippets/issues" 21 | }, 22 | "homepage": "https://github.com/awforsythe/sublime-unreal-snippets" 23 | } 24 | -------------------------------------------------------------------------------- /unreal-class-actor.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 20 | uca 21 | source.c++ 22 | 23 | -------------------------------------------------------------------------------- /unreal-class-component.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 20 | ucc 21 | source.c++ 22 | 23 | -------------------------------------------------------------------------------- /unreal-class-interface.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 25 | uci 26 | source.c++ 27 | 28 | -------------------------------------------------------------------------------- /unreal-class-object.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 20 | uco 21 | source.c++ 22 | 23 | -------------------------------------------------------------------------------- /unreal-class-statics.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 20 | ucs 21 | source.c++ 22 | 23 | -------------------------------------------------------------------------------- /unreal-function-constructor.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | ufc 6 | source.c++ 7 | 8 | -------------------------------------------------------------------------------- /unreal-function-interface.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | ufi 6 | source.c++ 7 | 8 | -------------------------------------------------------------------------------- /unreal-function-replicated.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | & OutLifetimeProps) const 4 | { 5 | Super::GetLifetimeReplicatedProps(OutLifetimeProps); 6 | 7 | DOREPLIFETIME(A${TM_FILENAME/([^\.]+)\..*/$1/}, ${1:SomeProperty}); 8 | } 9 | 10 | ]]> 11 | ufr 12 | source.c++ 13 | 14 | -------------------------------------------------------------------------------- /unreal-function-static.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 6 | ufs 7 | source.c++ 8 | 9 | -------------------------------------------------------------------------------- /unreal-function.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 6 | uff 7 | source.c++ 8 | 9 | -------------------------------------------------------------------------------- /unreal-log-cpp.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 8 | ulc 9 | source.c++ 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /unreal-log-fatal.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | ulf 6 | source.c++ 7 | 8 | -------------------------------------------------------------------------------- /unreal-log-header.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 10 | ulh 11 | source.c++ 12 | 13 | -------------------------------------------------------------------------------- /unreal-log-line.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | ull 6 | source.c++ 7 | 8 | -------------------------------------------------------------------------------- /unreal-macro-export.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | ume 6 | source.c++ 7 | 8 | -------------------------------------------------------------------------------- /unreal-module-build.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 18 | umb 19 | source.cs 20 | 21 | -------------------------------------------------------------------------------- /unreal-module-cpp-primary.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 21 | umcp 22 | source.c++ 23 | 24 | -------------------------------------------------------------------------------- /unreal-module-cpp.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 21 | umc 22 | source.c++ 23 | 24 | -------------------------------------------------------------------------------- /unreal-module-header.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | ("${TM_FILENAME/([^\.]+)\..*/$1/}"); 14 | } 15 | 16 | static inline bool IsAvailable() 17 | { 18 | return FModuleManager::Get().IsModuleLoaded("${TM_FILENAME/([^\.]+)\..*/$1/}"); 19 | } 20 | 21 | virtual void StartupModule() override; 22 | virtual void ShutdownModule() override; 23 | }; 24 | 25 | ]]> 26 | umh 27 | source.c++ 28 | 29 | -------------------------------------------------------------------------------- /unreal-module-target.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 16 | umt 17 | source.cs 18 | 19 | -------------------------------------------------------------------------------- /unreal-property-component.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 6 | upc 7 | source.c++ 8 | 9 | -------------------------------------------------------------------------------- /unreal-property-editable.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 6 | upe 7 | source.c++ 8 | 9 | -------------------------------------------------------------------------------- /unreal-property-visible.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 6 | upv 7 | source.c++ 8 | 9 | -------------------------------------------------------------------------------- /unreal-uproject.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 18 | uuproj 19 | 20 | --------------------------------------------------------------------------------