Skip to content

Instantly share code, notes, and snippets.

@Wampa842
Created June 10, 2021 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Wampa842/4944730bee4f874162ae806b03a61036 to your computer and use it in GitHub Desktop.
Save Wampa842/4944730bee4f874162ae806b03a61036 to your computer and use it in GitHub Desktop.
A collection of Visual Studio snippets for mod development for My Summer Car using MSC Loader Pro.
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>mcl</Title>
<Shortcut>mcl</Shortcut>
<Description>Inserts ModConsole.Log(), or wraps selected code inside the method.</Description>
<Author>Wampa842</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
<SnippetType>SurroundsWith</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal Editable="false">
<ID>ModConsole</ID>
<Function>SimpleTypeName(global::MSCLoader.ModConsole)</Function>
</Literal>
</Declarations>
<Code Language="csharp">
<![CDATA[$ModConsole$.Log($selected$$end$);]]>
</Code>
</Snippet>
</CodeSnippet>
<CodeSnippet Format="1.0.0">
<Header>
<Title>mclw</Title>
<Shortcut>mclw</Shortcut>
<Description>Inserts ModConsole.LogWarning(), or wraps selected code inside the method.</Description>
<Author>Wampa842</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
<SnippetType>SurroundsWith</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal Editable="false">
<ID>ModConsole</ID>
<Function>SimpleTypeName(global::MSCLoader.ModConsole)</Function>
</Literal>
</Declarations>
<Code Language="csharp">
<![CDATA[$ModConsole$.LogWarning($selected$$end$);]]>
</Code>
</Snippet>
</CodeSnippet>
<CodeSnippet Format="1.0.0">
<Header>
<Title>mcle</Title>
<Shortcut>mcle</Shortcut>
<Description>Inserts ModConsole.LogError(), or wraps selected code inside the method.</Description>
<Author>Wampa842</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
<SnippetType>SurroundsWith</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal Editable="false">
<ID>ModConsole</ID>
<Function>SimpleTypeName(global::MSCLoader.ModConsole)</Function>
</Literal>
</Declarations>
<Code Language="csharp">
<![CDATA[$ModConsole$.LogError($selected$$end$);]]>
</Code>
</Snippet>
</CodeSnippet>
<CodeSnippet Format="1.0.0">
<Header>
<Title>mclx</Title>
<Shortcut>mclx</Shortcut>
<Description>A try-catch block where the caught exception is passed to ModConsole.LogError().</Description>
<Author>Wampa842</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
<SnippetType>SurroundsWith</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal Editable="false">
<ID>ModConsole</ID>
<Function>SimpleTypeName(global::MSCLoader.ModConsole)</Function>
</Literal>
<Literal>
<ID>exception</ID>
<ToolTip>Exception type</ToolTip>
<Function>SimpleTypeName(global::System.Exception)</Function>
</Literal>
</Declarations>
<Code Language="csharp">
<![CDATA[try
{$selected$$end$
}
catch ($exception$ ex)
{
$ModConsole$.LogError(ex.ToString());
}]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment