diff --git a/HowwowKnyight - 1.5/GlobalSettings.cs b/HowwowKnyight - 1.5/GlobalSettings.cs index 23037e6..8052474 100644 --- a/HowwowKnyight - 1.5/GlobalSettings.cs +++ b/HowwowKnyight - 1.5/GlobalSettings.cs @@ -5,22 +5,55 @@ namespace HowwowKnyight.GlobalSettings { public class GlobalSettingsClass { - public List OwO = new List() - { - " uwu", - " owo", - " UwU", - " OwO", - " >w<", - " ^w^", - " QwQ", - " UwU", - " @w@", - " >.<", - " ÕwÕ", - "~", "~", "~", "~", "~" + public Dictionary UWUSimpleDict { get; set; } = + new() + { + { @"R", @"W" }, + { @"L", @"W" }, + { @"l", @"w" }, + { @"OU", @"UW" }, + { @"Ou", @"Uw" }, + { @"ou", @"uw" }, + { @"TH", @"D" }, + { @"Th", @"D" }, + { @"th", @"d" } + }; - }; + public Dictionary UWURegexDict { get; set; } = + new() + { + { @"N([AEIOU])", @"NY$1" }, + { @"N([aeiou])", @"Ny$1" }, + { @"n([aeiou])", @"ny$1" }, + { @"(?)", @"w" }, + { @"T[Hh]\b", @"F" }, + { @"th\b", @"f" }, + { @"T[Hh]([UI][^sS])", @"F$1" }, + { @"th([ui][^sS])", @"f$1" }, + { @"OVE\b", @"UV" }, + { @"Ove\b", @"Uv" }, + { @"ove\b", @"uv" } + }; + + public List UWUFaces { get; set; } = + new() + { + ">.>", "<.<", "UwU", + "OwO", "OWO", "UWU", + "uwu", "owo", ">w<", + "^w^", "QwQ", "@w@", + ">.<", "ÕwÕ", + }; + + public List Seperators { get; set; } = + new() + { + '-', + '.', + ' ' + }; + + public HowwowKnyight.OWOFlags Flags { get; set; } = HowwowKnyight.OWOFlags.All; } } //This does not work fully yet, needs to be fixed. I have no idea how sadly diff --git a/HowwowKnyight - 1.5/HowwowKnyight.cs b/HowwowKnyight - 1.5/HowwowKnyight.cs index a3316bd..2134177 100644 --- a/HowwowKnyight - 1.5/HowwowKnyight.cs +++ b/HowwowKnyight - 1.5/HowwowKnyight.cs @@ -1,47 +1,15 @@ -#region everything -#region usings +using HowwowKnyight.GlobalSettings; +using Modding; using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.IO; - -using Modding; -using MonoMod.RuntimeDetour; -using HowwowKnyight.GlobalSettings; - -using UnityEngine; -using UnityEngine.SceneManagement; - using System.Text.RegularExpressions; -using System.Security; using System.Collections; -#endregion - -#region System - -//[assembly: IgnoresAccessChecksTo("Assembly-CSharp")] -//[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] - -[module: UnverifiableCode] -namespace System.Runtime.CompilerServices -{ - - [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] - public class IgnoresAccessChecksToAttribute : Attribute - { - public IgnoresAccessChecksToAttribute(string assemblyName) - { - AssemblyName = assemblyName; - } - - public string AssemblyName { get; } - } -} - -#endregion - -#region HowwowKnyight +using UnityEngine; +using UnityEngine.SceneManagement; +using Random = UnityEngine.Random; namespace HowwowKnyight { @@ -55,107 +23,82 @@ Pwace yuww code on gifub text time ok? Dis wooks way bettew den what I owiginyaw public class HowwowKnyight : Mod, ITogglableMod, IGlobalSettings { - - - #region SettingStuff - - - - #region private - static string SpwitePath = ".wesuwwces.SpriteAtlasTexture-Title-2048x2048-fmt12.png"; - static string TitweTexturename = "SpriteAtlasTexture-Title-2048x2048-fmt12.png"; - static readonly string Author = "Henpemaz"; - static readonly string Contributor = "Ruttie"; - static Sprite titweSpwite; - static Sprite owiginawTitweSpwite; - static Texture owiginalgwimm; - private GameObject grimm; - private bool unloaded; - - - private bool enyabwed = false; - private Hook wanguageGetHook; - Assembly asm = Assembly.GetExecutingAssembly(); - - //int[] nums = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; //sry RedFrog - //Regex r = new Regex(@"\d", RegexOptions.IgnoreCase); //go SFG - #endregion - #region public - public static Coroutine ModifyTitweTextuweRuwtine { get; private set;} - public static GlobalSettingsClass settings { get; set; } = new GlobalSettingsClass(); + public static Coroutine? ModifyTitweTextuweRuwtine { get; private set; } + public static GlobalSettingsClass Settings { get; set; } = new GlobalSettingsClass(); public delegate string WanguageGetWef(ModHooks instance, string key, string tabwe); - public Dictionary images = new Dictionary(); - //public HowwowKnyight hk = new HowwowKnyight(); - public static HowwowKnyight Instance { get; private set; } + public Dictionary images = new(); + public static HowwowKnyight Instance { get; private set; } = null!; public bool update; - #endregion + + const string Author = "Henpemaz"; + const string Contributor = "Ruttie"; + string SpwitePath = ".wesuwwces.SpriteAtlasTexture-Title-2048x2048-fmt12.png"; + Sprite titweSpwite = null!; + Sprite? owiginawTitweSpwite; + Texture owiginalgwimm = null!; + GameObject GrimmGO { get; set; } = null!; + bool Unloaded; + bool enyabwed = false; + readonly OWOtils? Utils = new(); public void OnLoadGlobal(GlobalSettingsClass s) { - Modding.Logger.Log("loading globalsettings"); - settings = s; + Settings = s; + if (Utils == null) + { + Log($"{nameof(Utils)} should not be null."); + return; + } + Utils.Flags = Settings.Flags; + Utils.Seperators = Settings.Seperators; + Utils.UWUFaces = Settings.UWUFaces; + Utils.UWURegexDict = Settings.UWURegexDict; + Utils.UWUSimpleDict = Settings.UWUSimpleDict; } + public GlobalSettingsClass OnSaveGlobal() { - Modding.Logger.Log("saving globalsettings"); - return settings; + return Settings; } - #endregion - - - #region Base and version - - public HowwowKnyight() : base("HowwowKnyight") + public HowwowKnyight() : base("HowwowKnyight") { + Log("HowwowKnyight pre-init startup."); if (!enyabwed) { ModHooks.LanguageGetHook += WanguageGet; enyabwed = true; } - //ModHooks.LanguageGetHook += WanguageGet; } - public override string GetVersion() => "3.7.2 - 1.5.75"; - - #endregion - - - #region Init/override + public override string GetVersion() => + "4.1.0"; public override void Initialize(Dictionary> preloadedObjects) { Log("Inyitiawizing UwU"); - unloaded = false; + Unloaded = false; Instance = this; - #region Hooks + if (!enyabwed) { ModHooks.LanguageGetHook += WanguageGet; enyabwed = true; } + if (Utils?.Flags == OWOFlags.None) + LogWarn("Warning: Flags value is set to 0. This will result in the mod not changing any text. Set this value to 117 if this was a mistake."); + UnityEngine.SceneManagement.SceneManager.activeSceneChanged += SceneChanged; - #endregion + GrimmGO = preloadedObjects["GG_Grimm"][@"Grimm Scene/Grimm Boss"]; - #region DebugInterCaller try { - bool debug = false; - foreach (Assembly asm in AppDomain.CurrentDomain.GetAssemblies()) - { - string asmName = asm.GetName().Name; - if (asmName == "DebugMod") - { - debug = true; - break; - } - } - if (debug) + bool debug = ModHooks.GetMod("DebugMod", true) != null; + if (debug) { var go = GameObject.Find("DebugEasterEgg"); - Log("Debug Exists. >w<"); if (go != null) { try @@ -169,124 +112,80 @@ public override void Initialize(Dictionaryw<"); - Log("1.5.75 wewease"); + Debug.Log("HowwowKnyight, a mod mwade bwy: " + Author + ", and updated bwy: " + Contributor + ".\nEnjoy :3 ~Ruttie"); + Log("If yuw encuwntew any bug, (and wead dis), contact me, Ruttie#3005, on Discowd! >w<"); } - - - public override List<(string, string)> GetPreloadNames() - { - return new List<(string, string)> + public override List<(string, string)> GetPreloadNames() => + new() { ("GG_Grimm", @"Grimm Scene/Grimm Boss") }; - } - - #endregion - - #region DebugInter - - public void DebugInter() + void DebugInter() { Log("Debug is hewe, changing paths OwO"); - TitweTexturename = "SiwkNever2.png"; SpwitePath = ".wesuwwces.SiwkNever2.png"; - ModifyTitweTextuweRuwtine = GameManager.instance.StartCoroutine(HowwowKnyight.ModifyTitweSpwite()); + ModifyTitweTextuweRuwtine = GameManager.instance.StartCoroutine(ModifyTitweSpwite()); } - #endregion - - - #region TextureStuff - - private void Update() + void Update() { - if (unloaded == false) + if (Unloaded) + return; + while (owiginalgwimm == null) { - while (owiginalgwimm == null) + owiginalgwimm = GrimmGO.GetComponent().GetCurrentSpriteDef().material.mainTexture; + if (owiginalgwimm != null) { - owiginalgwimm = grimm.GetComponent().GetCurrentSpriteDef().material.mainTexture; - if (owiginalgwimm != null) - { - grimm.GetComponent().GetCurrentSpriteDef().material.mainTexture = HowwowKnyight.Instance.images["atlas0_213"]; - } + if (GrimmGO.GetComponent().GetCurrentSpriteDef().material.mainTexture == images["atlas0_213"]) + break; + GrimmGO.GetComponent().GetCurrentSpriteDef().material.mainTexture = images["atlas0_213"]; } } - else if (unloaded == true) - { - Modding.Logger.LogError("Update called while unloaded"); - } } private void SceneChanged(Scene awg0, Scene awg1) { - Log("SceneChanged"); - Log(awg1.name); if (awg1.name == "Menu_Title") - { - if (ModifyTitweTextuweRuwtine == null) - { - ModifyTitweTextuweRuwtine = GameManager.instance.StartCoroutine(HowwowKnyight.ModifyTitweSpwite()); - } - } + ModifyTitweTextuweRuwtine ??= GameManager.instance.StartCoroutine(ModifyTitweSpwite()); else if (ModifyTitweTextuweRuwtine != null) { GameManager.instance.StopCoroutine(ModifyTitweTextuweRuwtine); @@ -295,7 +194,6 @@ private void SceneChanged(Scene awg0, Scene awg1) if (awg1.name == "GG_Grimm") { - Log("Right scene found"); ModHooks.HeroUpdateHook += Update; update = true; } @@ -306,97 +204,68 @@ private void SceneChanged(Scene awg0, Scene awg1) } } - static IEnumerator ModifyTitweSpwite() + IEnumerator ModifyTitweSpwite() { - yield return null; - while (true) + while (owiginawTitweSpwite == null && !Unloaded) { - while (owiginawTitweSpwite == null) + owiginawTitweSpwite = GameObject.Find("LogoTitle")?.GetComponent()?.sprite; + if (owiginawTitweSpwite == null) + continue; + + var titweTextuwe = new Texture2D(1, 1); + using (var stweam = Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType().Namespace + SpwitePath)) { - owiginawTitweSpwite = GameObject.Find("LogoTitle").GetComponent().sprite; - if (owiginawTitweSpwite != null) - { - Texture2D titweTextuwe = new Texture2D(1, 1); - using (Stream stweam = Assembly.GetExecutingAssembly().GetManifestResourceStream(typeof(HowwowKnyight).Namespace + SpwitePath)) - { - byte[] buffew = new byte[stweam.Length]; - stweam.Read(buffew, 0, buffew.Length); - titweTextuwe.LoadImage(buffew, false); - titweTextuwe.name = TitweTexturename; - } - titweSpwite = Sprite.Create(titweTextuwe, new Rect(0, 0, titweTextuwe.width, titweTextuwe.height), new Vector2(0.5f, 0.5f), owiginawTitweSpwite.pixelsPerUnit, 0, SpriteMeshType.FullRect); - } - yield return null; + var buffew = new byte[stweam.Length]; + stweam.Read(buffew, 0, buffew.Length); + if (!titweTextuwe.LoadImage(buffew)) + throw new InvalidDataException("Failed to load image used for title text replacement."); } - GameObject.Find("LogoTitle").GetComponent().sprite = titweSpwite; - yield return null; + titweSpwite = Sprite.Create(titweTextuwe, new Rect(0, 0, titweTextuwe.width, titweTextuwe.height), new Vector2(0.5f, 0.5f), owiginawTitweSpwite.pixelsPerUnit, 0, SpriteMeshType.FullRect); + break; } + GameObject.Find("LogoTitle").GetComponent().sprite = titweSpwite; + ModifyTitweTextuweRuwtine = null; + yield break; } - #endregion + string WanguageGet(string key, string instance, string owig) + { + if (Unloaded) + return owig; + var FyremothHere = ModHooks.GetMod("Fyremoth", true) != null; - #region WanguageGet + if (key == "GRIMM_SUPER" && owig == "Troupe Master" && !FyremothHere) + return "OwO Mastew"; + if (owig == "Uumuu" && !FyremothHere) + return "Uuwuu"; - private string WanguageGet(string key, string instance, string owig) - { - bool FyremothHere = false; - foreach (Assembly asm in AppDomain.CurrentDomain.GetAssemblies()) - { - string asmName = asm.GetName().Name; - //Modding.Logger.Log(asmName); - if (asmName == "Fyremoth") - { - FyremothHere = true; - } - } - if (key == "GRIMM_SUPER" && owig == "Troupe Master" && FyremothHere == false) - { - owig = "OwO Mastew"; - return (owig); - } - if (owig == "Uumuu" && FyremothHere == false) - { - owig = "Uuwuu"; - return owig; - } - Regex r = new Regex(@"\d", RegexOptions.IgnoreCase); //I hope dis wowks SFG - MatchCollection matches = r.Matches(owig); + var matches = Regex.Matches(owig, @"\d", RegexOptions.IgnoreCase); if (matches.Count > 0) - { - return (owig); - } + return owig; else { try { - return UWUfyStwing(PwepwocessDiawoge(owig)); + return Utils?.OWOifyString(owig) ?? throw new ArgumentNullException(nameof(Utils)); } - catch + catch (Exception ex) { - Modding.Logger.Log("Something terrible has happened! Please contact me with this info!"); - return (owig); + Log("Failed to UwU-ify string. Info:" + + $"\nOrig: \'{owig}\'" + + $"\nInstance: \'{instance}\'" + + $"\nKey: \'{key}\'" + + $"\nException: {ex}"); + return owig; } } } - - #endregion - - - #region Unload - public void Unload() { - Log("Unwoad UwU"); + Log("Unwoading UwU"); try { - if (wanguageGetHook != null) - { - wanguageGetHook.Dispose(); - wanguageGetHook = null; - } - if (enyabwed) { ModHooks.LanguageGetHook -= WanguageGet; @@ -417,124 +286,269 @@ public void Unload() WestoweTitweTextuwe(); Log("Done unwoading UwU"); - unloaded = true; + Unloaded = true; } - catch + catch (Exception ex) { - Log("It seems wike unwoading has faiwed! Pwease wet me knyow! >w<"); + Log($"It seems wike unwoading has faiwed! >w<\n{ex}"); } } - static void WestoweTitweTextuwe() + void WestoweTitweTextuwe() { if (owiginawTitweSpwite == null) - { return; - } GameObject.Find("LogoTitle").GetComponent().sprite = owiginawTitweSpwite; } - static void WestoweGwimm() + void WestoweGwimm() { if (owiginalgwimm == null) - { return; - } - Instance.grimm.GetComponent().GetCurrentSpriteDef().material.mainTexture = owiginalgwimm; + Instance.GrimmGO.GetComponent().GetCurrentSpriteDef().material.mainTexture = owiginalgwimm; } - #endregion - + /// + /// An instance version of the normal , allowing more customization. + /// + class OWOtils : IDisposable, IEquatable + { + /// + /// Creates a new instance of the CustomOWOtils class using the specified flags. + /// + /// The flags to use. + public OWOtils(OWOFlags flags = OWOFlags.All) + { + Flags = flags; + } - #region OwO-ify + /// + /// Contains the replacements. + /// + public Dictionary UWUSimpleDict { get; set; } = new() + { + { @"R", @"W" }, + { @"L", @"W" }, + { @"l", @"w" }, + { @"OU", @"UW" }, + { @"Ou", @"Uw" }, + { @"ou", @"uw" }, + { @"TH", @"D" }, + { @"Th", @"D" }, + { @"th", @"d" } + }; - #region Dictionaries - private static readonly Dictionary uwu_simpwe = new Dictionary() - { - { @"R", @"W" }, - //{ @"r", @"w" }, - { @"L", @"W" }, - { @"l", @"w" }, - { @"OU", @"UW" }, - { @"Ou", @"Uw" }, - { @"ou", @"uw" }, - { @"TH", @"D" }, - { @"Th", @"D" }, - { @"th", @"d" }, - - }; - private static readonly Dictionary uwu_wegex = new Dictionary() - { - { @"N([AEIOU])", @"NY$1" }, - { @"N([aeiou])", @"Ny$1" }, - { @"n([aeiou])", @"ny$1" }, - { @"(?)", @"w" }, - { @"T[Hh]\b", @"F" }, - { @"th\b", @"f" }, - { @"T[Hh]([UI][^sS])", @"F$1" }, - { @"th([ui][^sS])", @"f$1" }, - { @"OVE\b", @"UV" }, - { @"Ove\b", @"Uv" }, - { @"ove\b", @"uv" }, - }; - #endregion - - public static string UWUfyStwing(string owig) - { + /// + /// Contains the replacements that require Regex to replace. + /// + public Dictionary UWURegexDict { get; set; } = new() + { + { @"N([AEIOU])", @"NY$1" }, + { @"N([aeiou])", @"Ny$1" }, + { @"n([aeiou])", @"ny$1" }, + { @"(?)", @"w" }, + { @"T[Hh]\b", @"F" }, + { @"th\b", @"f" }, + { @"T[Hh]([UI][^sS])", @"F$1" }, + { @"th([ui][^sS])", @"f$1" }, + { @"OVE\b", @"UV" }, + { @"Ove\b", @"Uv" }, + { @"ove\b", @"uv" } + }; - return uwu_simpwe.Aggregate(uwu_wegex.Aggregate(owig, (cuwwent, vawue) => Regex.Replace(cuwwent, vawue.Key, vawue.Value)), (cuwwent, vawue) => cuwwent.Replace(vawue.Key, vawue.Value)); - } + /// + /// Contains all faces. + /// + public List UWUFaces { get; set; } = new() + { + ">.>", "<.<", "UwU", + "OwO", "OWO", "UWU" + }; - static readonly char[] sepawatows = { '-', '.', ' ' }; + /// + /// Contains all default seperators. + /// + public List Seperators { get; set; } = new() + { + '-', + '.', + ' ' + }; - public static string PwepwocessDiawoge(string owig) - { - // Stuttew - int fiwstSepawatow = owig.IndexOfAny(sepawatows); - if (owig.StartsWith("Oh")) + /// + /// The flags of the current instance. + /// + public OWOFlags Flags { get; set; } + + /// + /// OWO-ify a string using the provided flags. + /// + /// The target string. + /// The modified string. + public string OWOifyString(string target) => + Flags == OWOFlags.None ? target : ProcessString(target: PreprocessString(target: target)); + + /// + /// Processes a string, this modifies the string using the UWUSimpleDict and UWURegexDict. + /// + /// The target string. + /// The modified string. + public string ProcessString(string target) { - owig = "Uh" + owig.Substring(2); + if (Flags.HasFlag(OWOFlags.UWURegex)) + target = UWURegexDict.Aggregate(target, (cuwwent, vawue) => Regex.Replace(cuwwent, vawue.Key, vawue.Value)); + if (Flags.HasFlag(OWOFlags.UWUStandard)) + target = UWUSimpleDict.Aggregate(target, (cuwwent, vawue) => cuwwent.Replace(vawue.Key, vawue.Value)); + return target; } - else if (owig.Length > 3 && (fiwstSepawatow < 0 || fiwstSepawatow > 5) && UnityEngine.Random.value < 0.25f) + + /// + /// Preprocesses a string, this adds stutters, standard replacements and faces. + /// + /// The target string. + /// The modified string. + public string PreprocessString(string target) { - Match fiwstPhoneticVowew = Regex.Match(owig, @"[aeiouyngAEIOUYNG]"); - Match fiwstAwfanum = Regex.Match(owig, @"\w"); - if (fiwstPhoneticVowew.Success && fiwstPhoneticVowew.Index < 5) + // Stuttew + if (Flags.HasFlag(OWOFlags.Stutter)) { - owig = owig.Substring(0, fiwstPhoneticVowew.Index + 1) + "-" + owig.Substring(fiwstAwfanum.Index); + int fiwstSepawatow = target.IndexOfAny(Seperators.ToArray()); + if (target.StartsWith("Oh")) + target = "Uh" + target.Substring(2); + else if (target.Length > 3 && (fiwstSepawatow < 0 || fiwstSepawatow > 5) && (Random.Range(0, 4) == 0 || Flags.HasFlag(OWOFlags.ForceStutter))) + { + var fiwstPhoneticVowew = Regex.Match(target, @"[aeiouyngAEIOUYNG]"); + var fiwstAwfanum = Regex.Match(target, @"\w"); + if (fiwstPhoneticVowew.Success && fiwstPhoneticVowew.Index < 5) + target = target.Substring(0, fiwstPhoneticVowew.Index + 1) + "-" + target.Substring(fiwstAwfanum.Index); + } } - } - // Standawd wepwacemens - bool hasFace = false; - owig = owig.Replace("what is that", "whats this"); - if (owig.IndexOf("What is that") != -1) - { - owig = owig.Replace("What is that", "OWO whats this"); - hasFace = true; + bool hasFace = false; + // Standawd wepwacemens + if (Flags.HasFlag(OWOFlags.StandardReplacements)) + { + target = target.Replace("what is that", "whats this"); + if (target.IndexOf("What is that") != -1) + { + target = target.Replace("What is that", "OWO whats this"); + hasFace = true; + } + target = target.Replace("Little", "Widdow") + .Replace("little", "widdow"); + + if (target.IndexOf("!") != -1) + { + target = Regex.Replace(target, @"!$", @"! >w<"); + hasFace = true; + } + } + + // Pwetty faces UwU + if (Flags.HasFlag(OWOFlags.Faces) && (target.EndsWith("?") || (!hasFace && Random.Range(0, 5) == 0) || Flags.HasFlag(OWOFlags.ForceFaces))) + { + target = target.TrimEnd(Seperators.ToArray()); + target += " " + UWUFaces[Random.Range(0, UWUFaces.Count)]; + } + return target; } - owig = owig.Replace("Little", "Widdow"); - owig = owig.Replace("little", "widdow"); - if (owig.IndexOf("!") != -1) + + /// + public void Dispose() { - owig = Regex.Replace(owig, @"(!+)", @"$1 >w<"); - hasFace = true; + GC.SuppressFinalize(this); + UWUSimpleDict.Clear(); + UWUSimpleDict = null!; + UWURegexDict.Clear(); + UWURegexDict = null!; + UWUFaces.Clear(); + UWUFaces = null!; + Seperators.Clear(); + Seperators = null!; } - // Pwetty faces UwU - if (owig.EndsWith("?") || (!hasFace && UnityEngine.Random.value < 0.2f)) + /// + public bool Equals(OWOtils? other) => + other?.Flags == Flags && + other.UWUFaces == UWUFaces && + other.Seperators == Seperators && + other.UWUSimpleDict == UWUSimpleDict && + other.UWURegexDict == UWURegexDict; + + /// + public override bool Equals(object obj) => + Equals(obj as OWOtils); + + /// + public override int GetHashCode() { - owig = owig.TrimEnd(sepawatows); - GlobalSettingsClass howwowKnyightSettings = new GlobalSettingsClass(); - owig += howwowKnyightSettings.OwO[UnityEngine.Random.Range(0, (howwowKnyightSettings.OwO.Count - 1))]; + unchecked + { + int hashCode = -381760713; + hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(UWUSimpleDict); + hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(UWURegexDict); + hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(UWUFaces); + hashCode = hashCode * -1521134295 + EqualityComparer>.Default.GetHashCode(Seperators); + hashCode = hashCode * -1521134295 + Flags.GetHashCode(); + return hashCode; + } } - return owig; - } - #endregion - } -} + /// + public static bool operator ==(OWOtils? left, OWOtils? right) => + left?.Equals(right) ?? right is null; -#endregion + /// + public static bool operator !=(OWOtils? left, OWOtils? right) => + !(left == right); + } -#endregion \ No newline at end of file + /// + /// Configures the OWOtils. The default setting is . + /// + [Flags] + public enum OWOFlags : byte + { + /// + /// Does not affect the string at all, not recommended. + /// + None = 0 << 0, + /// + /// Add faces. + /// + Faces = 1 << 0, + /// + /// Force the adding of faces. + /// + ForceFaces = Faces | 1 << 1, + /// + /// Add stutters (if applicable). + /// + Stutter = 1 << 2, + /// + /// Force the adding of stutters (if applicable). + /// + ForceStutter = Stutter | 1 << 3, + /// + /// Add the standard replacements. + /// + StandardReplacements = 1 << 4, + /// + /// Use the UWUStandardDict dictionary. + /// + UWUStandard = 1 << 5, + /// + /// Use the UWURegexDict dictionary. + /// + UWURegex = 1 << 6, + /// + /// Use all settings. + /// + All = Faces | Stutter | StandardReplacements | UWUStandard | UWURegex, + /// + /// Use all settings and use the force variant if possible. + /// + ForceAll = ForceFaces | ForceStutter | StandardReplacements | UWUStandard | UWURegex + } + } +} \ No newline at end of file diff --git a/HowwowKnyight - 1.5/HowwowKnyight.csproj b/HowwowKnyight - 1.5/HowwowKnyight.csproj index bea5e36..5169785 100644 --- a/HowwowKnyight - 1.5/HowwowKnyight.csproj +++ b/HowwowKnyight - 1.5/HowwowKnyight.csproj @@ -1,59 +1,25 @@  - - + + - Debug - AnyCPU {7357A011-FA73-43D0-A760-8CB5E2B2F1C1} Library - Properties HowwowKnyight HowwowKnyight - v4.7.2 - 512 - true - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - 8.0 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - 8.0 - false - - - true - - - bin\net35\ + net472 + latest + portable + enable + true - - - - - + + - - - + ..\..\1.5- api files\Assembly-CSharp.dll @@ -81,10 +47,10 @@ ..\..\1.5- api files\PlayMaker.dll - \..\..\..\1.5- api files\System.dll + \..\..\1.5- api files\System.dll - \..\..\..\1.5- api files\mscorlib.dll + \..\..\1.5- api files\mscorlib.dll ..\..\1.5- api files\UnityEngine.dll @@ -93,12 +59,7 @@ ..\..\1.5- api files\UnityEngine.CoreModule.dll - ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Hollow Knight\hollow_knight_Data\Managed\UnityEngine.ImageConversionModule.dll + ..\..\1.5- api files\UnityEngine.ImageConversionModule.dll - - - - - \ No newline at end of file diff --git a/HowwowKnyight - 1.5/Properties/AssemblyInfo.cs b/HowwowKnyight - 1.5/Properties/AssemblyInfo.cs deleted file mode 100644 index 8923b34..0000000 --- a/HowwowKnyight - 1.5/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("HowwowKnyight")] -[assembly: AssemblyDescription("Tuwns HowwowKnyight into UwU")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Henpemaz")] -[assembly: AssemblyProduct("HowwowKnyight")] -[assembly: AssemblyCopyright("Copyright © 2020")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("7357a011-fa73-43d0-a760-8cb5e2b2f1c1")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.1.0.0")] -[assembly: AssemblyFileVersion("1.1.0.0")] diff --git a/HowwowKnyight - 1.5/obj/Debug/HowwowKnyight.dll b/HowwowKnyight - 1.5/obj/Debug/HowwowKnyight.dll deleted file mode 100644 index 77927f5..0000000 Binary files a/HowwowKnyight - 1.5/obj/Debug/HowwowKnyight.dll and /dev/null differ diff --git a/HowwowKnyight - 1.5/obj/Debug/HowwowKnyight.pdb b/HowwowKnyight - 1.5/obj/Debug/HowwowKnyight.pdb deleted file mode 100644 index e77ca9f..0000000 Binary files a/HowwowKnyight - 1.5/obj/Debug/HowwowKnyight.pdb and /dev/null differ