diff --git a/CustomAudioHub/Config.cs b/CustomAudioHub/Config.cs deleted file mode 100644 index 8152e68..0000000 --- a/CustomAudioHub/Config.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace CustomAudioHub; - -public sealed class Config -{ - public bool Debug { get; set; } - public string AudioFilePath { get; set; } -} \ No newline at end of file diff --git a/CustomAudioHub/CustomAudioHub.csproj b/CustomAudioHub/CustomAudioHub.csproj index d4e5365..dc647d0 100644 --- a/CustomAudioHub/CustomAudioHub.csproj +++ b/CustomAudioHub/CustomAudioHub.csproj @@ -18,7 +18,7 @@ enable pdbonly true - 0.0.1 + 0.0.2 git https://github.com/KadavasKingdom/CustomAudioHub https://github.com/KadavasKingdom/CustomAudioHub @@ -29,24 +29,8 @@ - - - - - - - - - - - - - - - - diff --git a/CustomAudioHub/Hub.cs b/CustomAudioHub/Hub.cs new file mode 100644 index 0000000..bb3188f --- /dev/null +++ b/CustomAudioHub/Hub.cs @@ -0,0 +1,15 @@ +using LabApi.Loader.Features.Paths; + +namespace CustomAudioHub; + +public static class Hub +{ + public static readonly DirectoryInfo AudioHubDir = PathManager.Configs.CreateSubdirectory("global").CreateSubdirectory("AudioHub"); + /// + /// Combines the file name with the file path, your file name doesn't need to contain .ogg, if it doesn't it'll be added for you. + /// + public static string MakeFilePath(string audioName = "ExampleAudio", string audioType = ".ogg") + { + return Path.Combine(AudioHubDir.FullName, audioName.Contains(audioType) ? audioName : $"{audioName}{audioType}"); + } +} diff --git a/CustomAudioHub/Main.cs b/CustomAudioHub/Main.cs deleted file mode 100644 index fcdc47a..0000000 --- a/CustomAudioHub/Main.cs +++ /dev/null @@ -1,46 +0,0 @@ -using LabApi.Loader.Features.Plugins; -using LabApi.Loader.Features.Plugins.Enums; -using System; -using System.IO; - -namespace CustomAudioHub; - -public class Main : Plugin -{ - public static Main Instance { get; private set; } - #region Plugin Info - public override string Author => "Kadava"; - public override string Name => "CustomAudioHub"; - public override Version Version => new Version(0, 1); - public override string Description => "Main directory for custom audio storage."; - public override Version RequiredApiVersion => LabApi.Features.LabApiProperties.CurrentVersion; - public override LoadPriority Priority => LoadPriority.High; - #endregion - public override void Enable() - { - Instance = this; - } - public override void Disable() - { - Instance = null; - } - /// - /// Combines the file name with the file path, your file name doesn't need to contain .ogg, if it doesn't it'll be added for you. - /// - public static string MakeFilePath(string audioName = "ExampleAudio") - { - if (Main.Instance == null) - return string.Empty; - return Path.Combine(Main.Instance.Config.AudioFilePath, audioName.Contains(".ogg") ? audioName : $"{audioName}.ogg"); - } - - /// - /// Combines the file name with the file path, your file name doesn't need to contain .ogg, if it doesn't it'll be added for you. Does exactly the same as MakeFilePath - /// - public static string GetFilePath(string audioName = "ExampleAudio") - { - if (Main.Instance == null) - return string.Empty; - return Path.Combine(Main.Instance.Config.AudioFilePath, audioName.Contains(".ogg") ? audioName : $"{audioName}.ogg"); - } -} \ No newline at end of file