Refactored the stupid thing to be a little less stupid, I hope you're happy tobey
This commit is contained in:
parent
28b044d2d7
commit
2b1b787c7f
1 changed files with 14 additions and 22 deletions
|
|
@ -66,7 +66,7 @@ namespace SMSModLogOutputAnalyzer
|
||||||
embedBuilder.WithAuthor(Context.User);
|
embedBuilder.WithAuthor(Context.User);
|
||||||
embedBuilder.WithFooter(Program.Footer);
|
embedBuilder.WithFooter(Program.Footer);
|
||||||
|
|
||||||
Dictionary<string, List<Tuple<bool?, string, string>>> values = new();
|
Dictionary<string, List<string>> values = new();
|
||||||
var lines = FindLines(textLines,
|
var lines = FindLines(textLines,
|
||||||
"[Message:MelonLoader] Game Version: ",
|
"[Message:MelonLoader] Game Version: ",
|
||||||
"[Message:MelonLoader] Unity Version: ",
|
"[Message:MelonLoader] Unity Version: ",
|
||||||
|
|
@ -78,15 +78,15 @@ namespace SMSModLogOutputAnalyzer
|
||||||
|
|
||||||
Log("Initial analysis complete.");
|
Log("Initial analysis complete.");
|
||||||
|
|
||||||
values[":page_facing_up: Game Version"] = new List<Tuple<bool?, string, string>> { new(null, "", lines["[Message:MelonLoader] Game Version: "][0].Item1) };
|
values[":page_facing_up: Game Version"] = new List<string> { lines["[Message:MelonLoader] Game Version: "][0].Item1 };
|
||||||
values[":diamond_shape_with_a_dot_inside: Unity Version"] = new List<Tuple<bool?, string, string>> { new(null, "", lines["[Message:MelonLoader] Unity Version: "][0].Item1) };
|
values[":diamond_shape_with_a_dot_inside: Unity Version"] = new List<string> { lines["[Message:MelonLoader] Unity Version: "][0].Item1 };
|
||||||
values[":tools: BepInEx Version"] = new List<Tuple<bool?, string, string>> { new(null, "", lines["[Message: BepInEx] BepInEx "][0].Item1.Split(" - ")[0]) };
|
values[":tools: BepInEx Version"] = new List<string> { lines["[Message: BepInEx] BepInEx "][0].Item1.Split(" - ")[0] };
|
||||||
|
|
||||||
List<Tuple<bool?, string, string>> part = new();
|
List<string> part = new();
|
||||||
foreach (var mod in lines["[Info : BepInEx] Loading ["])
|
foreach (var mod in lines["[Info : BepInEx] Loading ["])
|
||||||
{
|
{
|
||||||
var match = Regex.Match(mod.Item1, "(.+) ((\\d+\\.)+\\d+)\\]");
|
var match = Regex.Match(mod.Item1, "(.+) ((\\d+\\.)+\\d+)\\]");
|
||||||
part.Add(new(null, "", "**" + match.Groups[1] + "** " + match.Groups[2]));
|
part.Add("**" + match.Groups[1] + "** " + match.Groups[2]);
|
||||||
}
|
}
|
||||||
values[":tools: Loaded BepInEx Mods"] = part;
|
values[":tools: Loaded BepInEx Mods"] = part;
|
||||||
part = new();
|
part = new();
|
||||||
|
|
@ -95,12 +95,12 @@ namespace SMSModLogOutputAnalyzer
|
||||||
{
|
{
|
||||||
string line = textLines[mod.Item2 - 1];
|
string line = textLines[mod.Item2 - 1];
|
||||||
var match = Regex.Match(line, "\\[.+\\] (.+) v((\\d+\\.)+\\d+).+");
|
var match = Regex.Match(line, "\\[.+\\] (.+) v((\\d+\\.)+\\d+).+");
|
||||||
part.Add(new(null, "", "**" + match.Groups[1] + "** " + match.Groups[2]));
|
part.Add("**" + match.Groups[1] + "** " + match.Groups[2]);
|
||||||
}
|
}
|
||||||
values[":melon: Loaded MelonLoader Mods"] = part;
|
values[":melon: Loaded MelonLoader Mods"] = part;
|
||||||
part = new();
|
part = new();
|
||||||
|
|
||||||
if (lines["[Info : Unity Log] System.EntryPointNotFoundException: SteamAPI_SteamInput_v001"].Count > 0) part.Add(new(false, "", "Steam Entry Point not found"));
|
if (lines["[Info : Unity Log] System.EntryPointNotFoundException: SteamAPI_SteamInput_v001"].Count > 0) part.Add(":x: Steam Entry Point not found");
|
||||||
|
|
||||||
values[":loudspeaker: Common Errors"] = part;
|
values[":loudspeaker: Common Errors"] = part;
|
||||||
part = new();
|
part = new();
|
||||||
|
|
@ -108,7 +108,7 @@ namespace SMSModLogOutputAnalyzer
|
||||||
List<string> filetree = new();
|
List<string> filetree = new();
|
||||||
Dictionary<int, string> depths = new();
|
Dictionary<int, string> depths = new();
|
||||||
|
|
||||||
values[":file_folder: Install Directory"] = new List<Tuple<bool?, string, string>> { new(null, "", lines["[Message: File Tree] "][0].Item1) };
|
values[":file_folder: Install Directory"] = new List<string> { lines["[Message: File Tree] "][0].Item1 };
|
||||||
|
|
||||||
foreach (var lineTuple in lines["[Message: File Tree] "])
|
foreach (var lineTuple in lines["[Message: File Tree] "])
|
||||||
{
|
{
|
||||||
|
|
@ -137,11 +137,11 @@ namespace SMSModLogOutputAnalyzer
|
||||||
var mod = bepinexmod.Substring(16);
|
var mod = bepinexmod.Substring(16);
|
||||||
if (KnownMelonLoaderMods.Contains(mod.Split('\\').Last().Trim()))
|
if (KnownMelonLoaderMods.Contains(mod.Split('\\').Last().Trim()))
|
||||||
{
|
{
|
||||||
part.Add(new(false, "Known MelonLoader Mod", mod));
|
part.Add(":x: " + mod + " (Known MelonLoader Mod)");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
part.Add(new(null, "", mod));
|
part.Add(mod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
values[":file_folder: DLL Files in BepInEx/plugins"] = part;
|
values[":file_folder: DLL Files in BepInEx/plugins"] = part;
|
||||||
|
|
@ -152,11 +152,11 @@ namespace SMSModLogOutputAnalyzer
|
||||||
var mod = melonmod.Substring(14);
|
var mod = melonmod.Substring(14);
|
||||||
if (KnownBepInExMods.Contains(mod.Split('\\').Last().Trim()))
|
if (KnownBepInExMods.Contains(mod.Split('\\').Last().Trim()))
|
||||||
{
|
{
|
||||||
part.Add(new(false, "Known BepInEx Mod", mod));
|
part.Add(":x: " + mod + " (Known BepInEx Mod)");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
part.Add(new(null, "", mod));
|
part.Add(mod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
values[":file_folder: DLL Files in MLLoader\\Mods"] = part;
|
values[":file_folder: DLL Files in MLLoader\\Mods"] = part;
|
||||||
|
|
@ -170,15 +170,7 @@ namespace SMSModLogOutputAnalyzer
|
||||||
{
|
{
|
||||||
IsInline = false,
|
IsInline = false,
|
||||||
Name = x.Key,
|
Name = x.Key,
|
||||||
Value = string.Join("\n", x.Value.Select(y =>
|
Value = string.Join("\n", x.Value)
|
||||||
{
|
|
||||||
string value = "";
|
|
||||||
if (y.Item1.HasValue) value = "❌";
|
|
||||||
if (y.Item1.HasValue && y.Item1.Value) value = "✅";
|
|
||||||
value += " " + y.Item3;
|
|
||||||
if (!string.IsNullOrEmpty(y.Item2)) value += " (" + y.Item2 + ")";
|
|
||||||
return value;
|
|
||||||
}))
|
|
||||||
});
|
});
|
||||||
|
|
||||||
foreach (var field in fields) Log(field.Name + ", " + field.Value);
|
foreach (var field in fields) Log(field.Name + ", " + field.Value);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue