Skip to content

Commit

Permalink
remove dead Overlay code
Browse files Browse the repository at this point in the history
  • Loading branch information
marzent committed Mar 29, 2023
1 parent e87f054 commit 4631161
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 1,035 deletions.
105 changes: 0 additions & 105 deletions OverlayPlugin.Core/ConfigEventArgs.cs

This file was deleted.

16 changes: 0 additions & 16 deletions OverlayPlugin.Core/EventSources/BuiltinEventConfig.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using Newtonsoft.Json.Linq;
using RainbowMage.OverlayPlugin.Overlays;
using System;
using System.Collections.Generic;
using System.Linq;

namespace RainbowMage.OverlayPlugin.EventSources
{
Expand Down Expand Up @@ -182,20 +180,6 @@ public static BuiltinEventConfig LoadConfig(IPluginConfig config)
if (obj.TryGetValue("OverlayData", out value))
{
result.OverlayData = value.ToObject<Dictionary<string, JToken>>();

// Remove data for overlays that no longer exist.
var overlayUuiDs = config.Overlays.OfType<MiniParseOverlayConfig>()
.Select(overlay => (overlay).Uuid.ToString()).ToList();

var obsoleteKeys = (result.OverlayData.Keys.Where(key => key.StartsWith("overlay#") && key.Length >= 44)
.Select(key => new { key, uuid = key.Substring(8, 36) })
.Where(@t => !overlayUuiDs.Contains(@t.uuid))
.Select(@t => @t.key)).ToList();

foreach (var key in obsoleteKeys)
{
result.OverlayData.Remove(key);
}
}

if (obj.TryGetValue("LogLines", out value))
Expand Down
Loading

0 comments on commit 4631161

Please sign in to comment.