diff --git a/Artemis.Plugins.sln b/Artemis.Plugins.FNF.sln similarity index 100% rename from Artemis.Plugins.sln rename to Artemis.Plugins.FNF.sln diff --git a/Artemis.Plugins.Module.FNF/DataModels/FnfSongData.cs b/Artemis.Plugins.Module.FNF/DataModels/FnfSongData.cs index 6d2d999..127e02e 100644 --- a/Artemis.Plugins.Module.FNF/DataModels/FnfSongData.cs +++ b/Artemis.Plugins.Module.FNF/DataModels/FnfSongData.cs @@ -1,37 +1,80 @@ using Artemis.Core; using Artemis.Core.Modules; -using SkiaSharp; namespace Artemis.Plugins.Module.FNF.DataModels { public class FNFSongData { + [DataModelProperty (Name = "Song name", Description = "The name of the currently playing song")] + public string SongName { get; set; } = "fresh"; + [DataModelProperty (Name = "Difficulty name", Description = "The currently selected difficulty")] + public string Difficulty { get; set; } = "normal"; + + [DataModelProperty (Name = "Opponent name", Description = "The name of the current opponent character")] + public string DadName { get; set; } = "dad"; + [DataModelProperty (Name = "Boyfriend name", Description = "The name of the current player character")] + public string BfName { get; set; } = "bf"; + [DataModelProperty (Name = "Girlfriend name", Description = "The name of the current girlfriend character")] + public string GfName { get; set; } = "gf"; + [DataModelProperty (Name = "Stage name", Description = "The name of the current song's stage")] public string StageName { get; set; } = "stage"; [DataModelProperty (Name = "Is pixel stage", Description = "Whether the stage is a pixel stage or not")] public bool IsPixelStage { get; set; } = false; - [DataModelProperty (Name = "Beat number", Description = "The current beat of the song.")] - public int BeatNumber { get; set; } - [DataModelProperty (Name = "Measure number", Description = "The current measure of the song (assuming it is 4/4 time).")] + [DataModelProperty (Name = "Beat number", Description = "The current beat of the song")] + public int BeatNumber { get; set; } = 0; + [DataModelProperty (Name = "Measure number", Description = "The current measure of the song (assuming it is 4/4 time)")] public int MeasureNumber => BeatNumber / 4; + [DataModelProperty (Name = "Song progress", Description = "The percentage of the song that has passed")] + public float SongProgress { get; set; } = 0; [DataModelProperty (Name = "Player health", Description = "How much health boyfriend has")] - public float BoyfriendHealth { get; set; } + public float BoyfriendHealth { get; set; } = 1; [DataModelProperty (Name = "Current combo", Description = "How big your current combo is")] - public int CurrentCombo { get; set; } + public int CurrentCombo { get; set; } = 0; [DataModelProperty (Name = "Rating", Description = "Your rating percentage")] - public float RatingPercentage { get; set; } + public float RatingPercentage { get; set; } = 75; + [DataModelProperty (Name = "Combo type", Description = "The type of combo you're currently in")] + public string ComboType { get; set; } = "Clear"; [DataModelProperty (Name = "Full combo", Description = "Whether you are currently in a full combo")] - public bool FullCombo { get; set; } + public bool FullCombo { get; set; } = false; + // public bool FullCombo { get => ComboType == "FC" || ComboType == "GFC" || ComboType == "SFC" || ComboType == "MFC"; } + // public bool FullCombo { get => ComboType == ComboType.FullCombo || ComboType == ComboType.GoodFullCombo || ComboType == ComboType.MasterFullCombo; } - - [DataModelProperty (Name = "On beat")] + [DataModelProperty (Name = "On beat", Description = "Called every beat")] public DataModelEvent OnBeat { get; } = new DataModelEvent (); - [DataModelProperty (Name = "On measure")] + [DataModelProperty (Name = "On measure", Description = "Called every measure")] public DataModelEvent OnMeasure { get; } = new DataModelEvent (); - [DataModelProperty (Name = "On combo broken")] + + [DataModelProperty (Name = "On note hit", Description = "Called when a note is hit")] + public DataModelEvent OnNoteHit { get; } = new DataModelEvent (); + [DataModelProperty (Name = "On note miss", Description = "Called when a note is missed")] + public DataModelEvent OnNoteMiss { get; } = new DataModelEvent (); + [DataModelProperty (Name = "On combo broken", Description = "Called when a combo is broken")] public DataModelEvent OnComboBroken { get; } = new DataModelEvent (); } + public class NoteHitEventArgs : DataModelEventArgs { + public int NoteDirection { get; set; } + public string NoteType { get; set; } + public string NoteHitAccuracy { get; set; } + + public NoteHitEventArgs (int noteDirection, string noteType, string noteHitAccuracy) { + NoteDirection = noteDirection; + NoteType = noteType; + NoteHitAccuracy = noteHitAccuracy; + } + } + + public class NoteMissEventArgs : DataModelEventArgs { + public int NoteDirection { get; set; } + public string NoteType { get; set; } + + public NoteMissEventArgs (int noteDirection, string noteType) { + NoteDirection = noteDirection; + NoteType = noteType; + } + } + public class ComboBreakEventArgs : DataModelEventArgs { public int BrokenComboValue { get; set; } public bool WasFullCombo { get; set; } @@ -41,4 +84,19 @@ public ComboBreakEventArgs (int brokenComboValue, bool wasFullCombo) { WasFullCombo = wasFullCombo; } } + + /*public enum NoteHitAccuracy { + Sick, + Good, + Bad, + Shit + }*/ + + /*public enum ComboType { + MasterFullCombo, + GoodFullCombo, + FullCombo, + SingleDigitComboBreak, + Clear + }*/ } diff --git a/Artemis.Plugins.Module.FNF/FnfControlsBrushProvider.cs b/Artemis.Plugins.Module.FNF/FnfControlsBrushProvider.cs index 0ad0db2..6110503 100644 --- a/Artemis.Plugins.Module.FNF/FnfControlsBrushProvider.cs +++ b/Artemis.Plugins.Module.FNF/FnfControlsBrushProvider.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; namespace Artemis.Plugins.Module.FNF { - [PluginFeature (Name = "FNF Controls Layer", Icon = "Music")] + [PluginFeature (Name = "FNF Controls Layer", Icon = "Controller")] class FnfControlsBrushProvider : LayerBrushProvider { private readonly IWebServerService webServerService; diff --git a/Artemis.Plugins.Module.FNF/FnfModule.cs b/Artemis.Plugins.Module.FNF/FnfModule.cs index cccb379..4fd119b 100644 --- a/Artemis.Plugins.Module.FNF/FnfModule.cs +++ b/Artemis.Plugins.Module.FNF/FnfModule.cs @@ -23,6 +23,13 @@ public override void Enable () { }); webServerService.AddStringEndPoint (this, "SetModName", h => DataModel.GameState.ModName = h); + webServerService.AddStringEndPoint (this, "SetSongName", h => DataModel.SongData.SongName = h); + webServerService.AddStringEndPoint (this, "SetDifficlutyName", h => DataModel.SongData.Difficulty = h); + + webServerService.AddStringEndPoint (this, "SetDadName", h => DataModel.SongData.DadName = h); + webServerService.AddStringEndPoint (this, "SetBfName", h => DataModel.SongData.BfName = h); + webServerService.AddStringEndPoint (this, "SetGfName", h => DataModel.SongData.GfName = h); + webServerService.AddStringEndPoint (this, "SetStageName", h => DataModel.SongData.StageName = h); webServerService.AddStringEndPoint (this, "SetIsPixelStage", h => DataModel.SongData.IsPixelStage = bool.Parse (h)); @@ -36,20 +43,29 @@ public override void Enable () { DataModel.SongData.BeatNumber = val; }); + webServerService.AddStringEndPoint (this, "SetSongProgress", h => DataModel.SongData.SongProgress = float.Parse (h)); webServerService.AddStringEndPoint (this, "SetHealth", h => DataModel.SongData.BoyfriendHealth = float.Parse (h)); webServerService.AddStringEndPoint (this, "SetRating", h => DataModel.SongData.RatingPercentage = float.Parse (h)); webServerService.AddStringEndPoint (this, "SetCombo", h => DataModel.SongData.CurrentCombo = int.Parse (h)); webServerService.AddStringEndPoint (this, "StartSong", h => { + DataModel.SongData.ComboType = "SFC"; DataModel.SongData.FullCombo = true; DataModel.SongData.CurrentCombo = 0; DataModel.GameState.OnSongStarted.Trigger (); // DataModel.GameState.OnSongStarted.Trigger (new SongStartedEventArguments ()); }); + webServerService.AddJsonEndPoint (this, "NoteHit", h => DataModel.SongData.OnNoteHit.Trigger (h)); + webServerService.AddJsonEndPoint (this, "NoteMiss", h => DataModel.SongData.OnNoteMiss.Trigger (h)); webServerService.AddStringEndPoint (this, "BreakCombo", h => { DataModel.SongData.OnComboBroken.Trigger (new ComboBreakEventArgs (DataModel.SongData.CurrentCombo, DataModel.SongData.FullCombo)); + if (DataModel.SongData.FullCombo) DataModel.SongData.ComboType = "SDCB"; DataModel.SongData.FullCombo = false; DataModel.SongData.CurrentCombo = 0; }); + webServerService.AddStringEndPoint (this, "SetComboType", h => { + DataModel.SongData.ComboType = h; + // DataModel.SongData.ComboType = Enum.Parse (h); + }); webServerService.AddStringEndPoint (this, "SetDadHex", h => DataModel.Colors.DadHealthColor = SKColor.Parse (h)); webServerService.AddStringEndPoint (this, "SetBFHex", h => DataModel.Colors.BfHealthColor = SKColor.Parse (h)); diff --git a/Artemis.Plugins.Module.FNF/FnfProfileManagerModule.cs b/Artemis.Plugins.Module.FNF/FnfProfileManagerModule.cs index 4551e91..23ae7fa 100644 --- a/Artemis.Plugins.Module.FNF/FnfProfileManagerModule.cs +++ b/Artemis.Plugins.Module.FNF/FnfProfileManagerModule.cs @@ -7,7 +7,7 @@ using Newtonsoft.Json; namespace Artemis.Plugins.Module.FNF { - [PluginFeature (Name = "FNF Profile Manager", Icon = "Music")] + [PluginFeature (Name = "FNF Profile Manager", Icon = "PersonAdd")] public class FnfProfileManagerModule : PluginFeature { private readonly IWebServerService webServerService; private readonly IProfileService profileService; diff --git a/Artemis.Plugins.Module.FNF/plugin.json b/Artemis.Plugins.Module.FNF/plugin.json index 07f4816..b8cb856 100644 --- a/Artemis.Plugins.Module.FNF/plugin.json +++ b/Artemis.Plugins.Module.FNF/plugin.json @@ -3,8 +3,9 @@ "Name": "Friday Night Funkin' Integration", "Description": "pretty lights for beep boop game", "Author": "skedgyedgy", - "Website": null, + "Website": "https://gamebanana.com/mods/347063", "Repository": "https://github.com/skedgyedgy/Artemis.Plugins.FNF", - "Version": "1.2.1", - "Main": "Artemis.Plugins.Module.FNF.dll" + "Version": "1.3", + "Main": "Artemis.Plugins.Module.FNF.dll", + "Icon": "Music" } \ No newline at end of file