Skip to content

Commit

Permalink
[Mod] Added moddb support for links
Browse files Browse the repository at this point in the history
  • Loading branch information
CadeEvs committed May 25, 2022
1 parent 3b09c15 commit 61a9f1b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion FrostyEditor/Windows/ModSettingsWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Frosty.Core.Mod;
using System.Collections.Generic;
using System;
using System.Linq;

namespace FrostyEditor.Windows
{
Expand Down Expand Up @@ -77,7 +78,9 @@ private void saveButton_Click(object sender, System.Windows.RoutedEventArgs e)
return;
}

if (modPageLinkTextBox.Text != "" && (!Uri.IsWellFormedUriString(modPageLinkTextBox.Text, UriKind.RelativeOrAbsolute) || !modPageLinkTextBox.Text.Contains("nexusmods.com")))
string[] approvedDomains = { "nexusmods.com", "moddb.com" };

if (modPageLinkTextBox.Text != "" && (!Uri.IsWellFormedUriString(modPageLinkTextBox.Text, UriKind.RelativeOrAbsolute) || !approvedDomains.Any(modPageLinkTextBox.Text.Contains)))
{
FrostyMessageBox.Show("Link needs to be valid", "Frosty Editor");
return;
Expand Down

0 comments on commit 61a9f1b

Please sign in to comment.