Skip to content

More snippets #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions snippets/ue4cds.snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
<Title>ue4cds</Title>
<Author>github.com/narthur157</Author>
<Description>Unreal Engine CreateDefaultSubobject snippet</Description>
<HelpUrl>
</HelpUrl>
<Shortcut>ue4cds</Shortcut>
</Header>
<Snippet>
<Declarations>
<Literal Editable="true">
<ID>name</ID>
<ToolTip>Subobject name</ToolTip>
<Default>NewComp</Default>
<Function>
</Function>
</Literal>
<Literal Editable="true">
<ID>class</ID>
<ToolTip>Component class name</ToolTip>
<Default>Component</Default>
<Function>
</Function>
</Literal>
</Declarations>
<Code Language="cpp"><![CDATA[$name$ = CreateDefaultSubobject<$class$>(TEXT("$name$"));
$selected$ $end$]]></Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
48 changes: 48 additions & 0 deletions snippets/ue4consdebug.snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
<Title>ue4consdebug</Title>
<Author>github.com/narthur157</Author>
<Description>Unreal Engine console debugging option snippet</Description>
<HelpUrl>
</HelpUrl>
<Shortcut>ue4consdebug</Shortcut>
</Header>
<Snippet>
<Declarations>
<Literal Editable="true">
<ID>name</ID>
<ToolTip>Debug option name</ToolTip>
<Default>MyClass</Default>
<Function>
</Function>
</Literal>
<Literal Editable="true">
<ID>projName</ID>
<ToolTip>Project name</ToolTip>
<Default>MyProject</Default>
<Function>
</Function>
</Literal>
<Literal Editable="true">
<ID>description</ID>
<ToolTip>Describes what this debug option does</ToolTip>
<Default>description</Default>
<Function>
</Function>
</Literal>
</Declarations>
<Code Language="cpp"><![CDATA[static int32 Debug$name$ = 0;
FAutoConsoleVariableRef CVARDebug$name$(
TEXT("$projName$.$name$"),
Debug$name$,
TEXT("$description$"),
ECVF_Cheat);
$selected$ $end$]]></Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
9 changes: 7 additions & 2 deletions snippets/ue4log.snippet
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Literal Editable="true">
<ID>category</ID>
<ToolTip>Log category name</ToolTip>
<Default>MyProject</Default>
<Default>LogTemp</Default>
<Function>
</Function>
</Literal>
Expand All @@ -36,7 +36,12 @@
</Function>
</Literal>
</Declarations>
<Code Language="cpp"><![CDATA[UE_LOG($category$, $level$, TEXT("$text$"));
<Code Language="cpp"><![CDATA[void $class$::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);

DOREPLIFETIME($class$, $property$);
}
$selected$ $end$]]></Code>
</Snippet>
</CodeSnippet>
Expand Down
40 changes: 40 additions & 0 deletions snippets/ue4nabo.snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
<Title>ue4nabo</Title>
<Author>github.com/narthur157</Author>
<Description>Unreal Engine NotifyActorBeginOverlap snippet</Description>
<HelpUrl>
</HelpUrl>
<Shortcut>ue4nabo</Shortcut>
</Header>
<Snippet>
<Declarations>
<Literal Editable="true">
<ID>name</ID>
<ToolTip>Class name</ToolTip>
<Default>ClassName</Default>
<Function>
</Function>
</Literal>
<Literal Editable="true">
<ID>class</ID>
<ToolTip>Component class name</ToolTip>
<Default>Component</Default>
<Function>
</Function>
</Literal>
</Declarations>
<Code Language="cpp"><![CDATA[void $class$::NotifyActorBeginOverlap(AActor* OtherActor)
{
Super::NotifyActorBeginOverlap(OtherActor);

$selected$ $end$
}]]></Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
51 changes: 51 additions & 0 deletions snippets/ue4prop.snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
<Title>ue4prop</Title>
<Author>github.com/narthur157</Author>
<Description>Unreal Engine blueprint property snippet</Description>
<HelpUrl>
</HelpUrl>
<Shortcut>ue4prop</Shortcut>
</Header>
<Snippet>
<Declarations>
<Literal Editable="true">
<ID>category</ID>
<ToolTip>UI category name</ToolTip>
<Default>Components</Default>
<Function>
</Function>
</Literal>
<Literal Editable="true">
<ID>defaultsAttribute</ID>
<ToolTip>Defaults attribute</ToolTip>
<Default>VisibleAnywhere</Default>
<Function>
</Function>
</Literal>
<Literal Editable="true">
<ID>type</ID>
<ToolTip>Property type</ToolTip>
<Default>Type</Default>
<Function>
</Function>
</Literal>
<Literal Editable="true">
<ID>name</ID>
<ToolTip>Property name</ToolTip>
<Default>Name</Default>
<Function>
</Function>
</Literal>
</Declarations>
<Code Language="cpp"><![CDATA[UPROPERTY($defaultsAttribute$, Category="$category$")
$type$ $name$;
$selected$ $end$]]></Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
49 changes: 49 additions & 0 deletions snippets/ue4repl.snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
<Title>ue4repl</Title>
<Author>github.com/narthur157</Author>
<Description>Unreal Engine GetLifetimeReplicatedProps snippet</Description>
<HelpUrl>
</HelpUrl>
<Shortcut>ue4repl</Shortcut>
</Header>
<Snippet>
<Declarations>
<Literal Editable="true">
<ID>category</ID>
<ToolTip>Log category name</ToolTip>
<Default>LogTemp</Default>
<Function>
</Function>
</Literal>
<Literal Editable="true">
<ID>class</ID>
<ToolTip>The class currently being edited</ToolTip>
<Default>ClassName</Default>
<Function>
</Function>
</Literal>
<Literal Editable="true">
<ID>property</ID>
<ToolTip>Property to replicate</ToolTip>
<Default>Property</Default>
<Function>
</Function>
</Literal>
</Declarations>
<Code Language="cpp"><![CDATA[#include "Net/UnrealNetwork.h"
void $class$::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);

DOREPLIFETIME($class$, $property$);
}
$selected$ $end$]]></Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>