internal static bool TryGetPreset(Type windowType, string presetName, out OverlayPreset preset)
        {
            var currentType = windowType;

            while (currentType != null)
            {
                if (loadedPresets.TryGetValue(currentType, out var p))
                {
                    if (p.TryGetValue(presetName, out preset))
                    {
                        return(true);
                    }
                }

                currentType = currentType.BaseType;
            }
            foreach (var i in windowType.GetInterfaces())
            {
                if (loadedPresets.TryGetValue(i, out var p))
                {
                    if (p.TryGetValue(presetName, out preset))
                    {
                        return(true);
                    }
                }
            }

            preset = null;
            return(false);
        }
 internal static void DeletePreset(OverlayPreset preset)
 {
     if (preset != null && preset.targetWindowType != null &&
         loadedPresets.TryGetValue(preset.targetWindowType, out var presets) &&
         presets.Remove(preset.name))
     {
         DestroyImmediate(preset);
         SaveAllPreferences();
     }
 }
        static void AddPreset(OverlayPreset preset)
        {
            if (!loadedPresets.TryGetValue(preset.targetWindowType, out var presets))
            {
                loadedPresets.Add(preset.targetWindowType, presets = new Dictionary <string, OverlayPreset>());
            }

            if (!presets.ContainsKey(preset.name))
            {
                presets.Add(preset.name, preset);
            }
            else
            {
                presets[preset.name] = preset;
            }
        }