Useful Snippets for UE4 using VAX

Setting up snippets for UE4 and VAX.

Nov. 16, 2020, 1 p.m.

These require Visual Assist, but you might be able to set this up using the default stuff with Visual Studio.

 

  1. Extensions -> VAssistX -> Code Generation and Refactoring -> Edit Refactoring Snippets...
  2. Type: By Title then click thebutton.
  3. Add the following options. Repeat the process for each of these.

    Title: UFUNCTION Callable Macro
    Shortcut: ufcall
    UFUNCTION(BlueprintCallable, Category = "$PROJECT_NAME$|$ClassName$")
    
    Title: UFUNCTION Const Callable Macro
    Shortcut: ufcon
    UFUNCTION(BlueprintCallable, BlueprintPure=false, Category = "$PROJECT_NAME$|$ClassName$")
    
    Title: UFUNCTION Get Macro
    Shortcut: ufget
    UFUNCTION(BlueprintPure, Category = "$PROJECT_NAME$|$ClassName$")
    
    Title: UPROPERTY BlueprintAssignable Macro
    Shortcut: upass
    UPROPERTY(BlueprintAssignable, Category = "$PROJECT_NAME$|$ClassName$", meta = (DisplayName = "$SymbolName$"))
    
    Title: UPROPERTY BlueprintReadOnly Macro
    Shortcut: upread
    UPROPERTY(BlueprintReadOnly, Category = "$PROJECT_NAME$|$ClassName$", meta = (DisplayName = "$SymbolName$"))
    
    Title: UPROPERTY EditAnywhere Macro
    Shortcut: upedit
    UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "$PROJECT_NAME$|$ClassName$", meta = (DisplayName = "$SymbolName$"))
    
    Title: UPROPERTY EditDefaultsOnly Macro
    Shortcut: updef
    UPROPERTY(EditDefaultsOnly, Category = "$PROJECT_NAME$|$ClassName$", meta = (DisplayName = "$SymbolName$"))
    
    Title: UPROPERTY Replicated Macro
    Shortcut: uprep
    UPROPERTY(Replicated)
    
    Title: UENUM Macro
    Shortcut: uenum
    UENUM(BlueprintType)
    enum class E$SymbolName$ : uint8
    {
        None     UMETA(DisplayName = "None"),
    };
    
    Title: USTRUCT Macro
    Shortcut: ustruct
    USTRUCT(BlueprintType)
    struct F$SymbolName$
    {
        GENERATED_BODY()
    
        F$SymbolName$() {}
    }
  4. To use these you just type the shortcut in the editor and it should popup.

 

until next time