diff --git a/App.AdventureMaker.Core/Forms/AddResourceWindow.cs b/App.AdventureMaker.Core/Forms/AddResourceWindow.cs index 40f8069..358ff50 100644 --- a/App.AdventureMaker.Core/Forms/AddResourceWindow.cs +++ b/App.AdventureMaker.Core/Forms/AddResourceWindow.cs @@ -13,12 +13,14 @@ public class AddResourceWindow : Dialog { private readonly IEditor editor; - private readonly EnumDropDown dropDown; + private readonly EnumRadioButtonList dropDown; public AddResourceWindow(IEditor editor) { this.editor = editor; + Title = "Add new resource"; + Size = MinimumSize = new Size(400, 250); Resizable = false; @@ -32,7 +34,11 @@ public AddResourceWindow(IEditor editor) new StackLayoutItem(new GroupBox() { Text = "Select a resource type to add", - Content = (dropDown = new EnumDropDown()) + Content = (dropDown = new EnumRadioButtonList() + { + Orientation = Orientation.Vertical, + Spacing = new Size(8, 8) + }) }, true), new StackLayoutItem(new StackLayout() { diff --git a/App.AdventureMaker.Core/Global/ResourceImporter.cs b/App.AdventureMaker.Core/Global/ResourceImporter.cs index e029cd7..24cc5b4 100644 --- a/App.AdventureMaker.Core/Global/ResourceImporter.cs +++ b/App.AdventureMaker.Core/Global/ResourceImporter.cs @@ -4,6 +4,7 @@ using Distance.AdventureMaker.Common.Models; using System; using System.IO; +using System.Text; public static class ResourceImporter { @@ -49,10 +50,21 @@ public static DirectoryInfo GetPath(DirectoryInfo projectPath, FileInfo file, st public static string GenerateDirectoryName(string path) { - string guid = Guid.NewGuid().ToString("D"); - string date = DateTime.Now.Ticks.ToString(); + //string guid = Guid.NewGuid().ToString("D"); + //string date = DateTime.Now.Ticks.ToString(); string root = !string.IsNullOrWhiteSpace(path) ? $"{path}/" : ""; - return $"{root}imported/{guid}_{date}"; + //return $"{root}imported/{guid}_{date}"; + + Random random = new Random((int)(DateTime.Now.Ticks % int.MaxValue)); + + StringBuilder sb = new StringBuilder(); + + while (sb.Length < 4) + { + sb.Append(random.Next(10)); + } + + return $"{root}imported/{sb}"; } } \ No newline at end of file