-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathRimworldDLLParameter.cs
More file actions
34 lines (28 loc) · 1.11 KB
/
RimworldDLLParameter.cs
File metadata and controls
34 lines (28 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System.Collections.Generic;
using System.IO;
using JetBrains.Application;
using JetBrains.Rider.Backend.Features.ProjectModel.ProjectTemplates.DotNetExtensions;
using JetBrains.Rider.Model;
using Microsoft.TemplateEngine.Abstractions;
namespace ReSharperPlugin.RimworldDev.TemplateParameters;
public class RimworldDLLParameter : DotNetTemplateParameter
{
public RimworldDLLParameter() : base("RimworldDLL", "Rimworld DLL", "Path to Assembly-CSharp.dll")
{
}
public override RdProjectTemplateOption CreateContent(ITemplateInfo templateInfo, ITemplateParameter templateParameter,
Dictionary<string, object> context)
{
var detectedPath = ScopeHelper.FindRimworldDll(Directory.GetCurrentDirectory())?.FullPath;
return new RdProjectTemplateTextOption(detectedPath ?? "", "string", Name, PresentableName, Tooltip, "");
}
}
[ShellComponent]
public class RimworldDLLParameterProvider : IDotNetTemplateParameterProvider
{
public int Priority => 50;
public IReadOnlyCollection<DotNetTemplateParameter> Get()
{
return new[] { new RimworldDLLParameter() };
}
}