Skip to content

Commit 83c36b4

Browse files
authored
Merge pull request #363 from Shivansps/add-tool-guide
Add dev tool guide
2 parents 945925d + 87e0497 commit 83c36b4

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

Knossos.NET/ViewModels/DeveloperModsViewModel.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,5 +365,23 @@ public void InstallLatestStable()
365365
}
366366
}
367367
}
368+
369+
internal async void OpenAddToolGuide()
370+
{
371+
try
372+
{
373+
var text = "If you want to add or update your tool to Knossos.NET tool section, you will need to make a PR in the tool repo: https://github.com/KnossosNET/Knet-Tool-Repo." +
374+
"\nEditing the 'knet_tools.json' to add or modify your tool. The download must be in a direct-download storage (like a Github release), no google drive support." +
375+
"\nIf you dont know how to do this, please create an 'issue' instead in that same repo, providing the tool data and download link." +
376+
"\nIf you press continue you will be taken to the repo.";
377+
var resp = await MessageBox.Show(MainWindow.instance, text, "Adding tools to Knossos.NET", MessageBox.MessageBoxButtons.ContinueCancel);
378+
if (resp == MessageBox.MessageBoxResult.Continue)
379+
KnUtils.OpenBrowserURL("https://github.com/KnossosNET/Knet-Tool-Repo");
380+
}
381+
catch(Exception ex)
382+
{
383+
Log.Add(Log.LogSeverity.Error, "DeveloperModsViewModel.OpenAddToolGuide", ex);
384+
}
385+
}
368386
}
369387
}

Knossos.NET/Views/DeveloperModsView.axaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@
4848
</TabItem>
4949

5050
<TabItem Header="Modding Tools">
51-
<v:DevToolManagerView Content="{Binding DevToolManager}"/>
51+
<Grid>
52+
<Button ToolTip.Tip="You want to add your tool to Knossos.NET tool section?" Command="{Binding OpenAddToolGuide}" Margin="0,-50,5,0" VerticalAlignment="Top" HorizontalAlignment="Right" ZIndex="1">How to add or update my tool?</Button>
53+
<v:DevToolManagerView Content="{Binding DevToolManager}"/>
54+
</Grid>
5255
</TabItem>
5356

5457
<TabItem Header="Nebula">

0 commit comments

Comments
 (0)