Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
fad8c9c
Fix small Misstake. Shame on me.
desperationfighter Apr 10, 2022
e4b53e5
Added internal Modlist Tab
desperationfighter Apr 10, 2022
8f20346
Change to alphabetical sorted Mod List
desperationfighter Apr 10, 2022
8d11859
integrated deactivated Mod list + improvments
desperationfighter Apr 11, 2022
8f2842b
reduce overhead + clearup appearance
desperationfighter Apr 11, 2022
c035e4a
Merge pull request #1 from desperationfighter/Dev-Desp
desperationfighter Apr 13, 2022
0e0c2ab
Coding consistency cleanup from previous PR
Metious Apr 14, 2022
a125c8d
Better game store checks
Metious Apr 14, 2022
b33e15d
Update QModManager/OptionsManager.cs
desperationfighter Apr 14, 2022
12e4503
Update QModManager/OptionsManager.cs
desperationfighter Apr 14, 2022
59cd0f6
First try of getting the enable disable Check box
desperationfighter Apr 14, 2022
4f0d5a4
First test to implement a List of chaning mods
desperationfighter Apr 17, 2022
c74fbc7
backup
desperationfighter Apr 17, 2022
96c55d8
Onchange Methode cleared up
desperationfighter Apr 17, 2022
1627b32
Adding Apply Function and false confirm prevention
desperationfighter Apr 17, 2022
9694aa0
start writing to disk
desperationfighter Apr 18, 2022
a33d1ef
Save to Mod.json first time working fine
desperationfighter Apr 18, 2022
a88324c
backup
desperationfighter Apr 18, 2022
9cd1e88
Rework Code + Deactivated Mods can now be changed too
desperationfighter Apr 18, 2022
32c377d
Update Pirate Check
desperationfighter Apr 19, 2022
e68a324
Merge pull request #2 from desperationfighter/Dev-Pirate
desperationfighter Apr 19, 2022
2332055
added cancel changes function
desperationfighter Apr 24, 2022
54a8500
code Cleanup
desperationfighter Apr 24, 2022
761d8b2
Merge pull request #3 from desperationfighter/Dev-ChangeModStatus
desperationfighter Apr 24, 2022
acba05c
Added QMM Option Entry to make Mod List Menu optional
desperationfighter Apr 25, 2022
6c767a7
Merge pull request #4 from desperationfighter/Dev-ShowModlistOptional
desperationfighter Apr 25, 2022
1c526f4
Fix for QMM Versionchecker parsing + Fix Gameversion Logger (#5)
desperationfighter May 7, 2022
642d684
Adding API for Mods to get current running QMM Version. (#6)
desperationfighter May 15, 2022
5214db2
Added detailed Error Catch for Folder Tree Logger (#7)
desperationfighter May 25, 2022
dc389ec
additional Error Catching + Mod.json Information on Filetree (#8)
desperationfighter Jun 16, 2022
374f0ec
returnfrom save game warning (#9)
desperationfighter Jun 16, 2022
41ff307
Error Catching for Date and Time Logging.
desperationfighter Jul 20, 2022
d5f7470
pass through Exception Message
desperationfighter Aug 15, 2022
15ebab5
Merge branch 'SubnauticaModding:Dev' into Dev
desperationfighter Sep 17, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 60 additions & 1 deletion QModManager/OptionsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,24 @@
using QModManager.Utility;
using System.Reflection;
using UnityEngine.Events;
using System.Collections.Generic;
using System.Linq;

internal static class OptionsManager
{
internal static int ModsTab;
internal static int ModListTab;

[HarmonyPatch(typeof(uGUI_OptionsPanel), nameof(uGUI_OptionsPanel.AddTabs))]
internal static class OptionsPatch
{
[HarmonyPostfix]
internal static void Postfix(uGUI_OptionsPanel __instance)
{
#region Mod Config
ModsTab = __instance.AddTab("Mods");
__instance.AddHeading(ModsTab, "QModManager");


MethodInfo AddToggleOption = null;
if(Patcher.CurrentlyRunningGame == QModGame.Subnautica)
{
Expand Down Expand Up @@ -60,7 +63,63 @@ internal static void Postfix(uGUI_OptionsPanel __instance)
AddToggleOption.Invoke(__instance, new object[] { ModsTab, "Enable debug logs", Config.EnableDebugLogs, new UnityAction<bool>(value => Config.EnableDebugLogs = value), null });
AddToggleOption.Invoke(__instance, new object[] { ModsTab, "Enable developer mode", Config.EnableDevMode, new UnityAction<bool>(value => Config.EnableDevMode = value), null });
}
#endregion Mod Config

#region Mod List
//Create new Tab in the Menu
ModListTab = __instance.AddTab("QMods List");

//Add QMM Informations
#if SUBNAUTICA_EXP || BELOWZERO_EXP
__instance.AddHeading(ModListTab, $"QModManager -Experimental- running version {Assembly.GetExecutingAssembly().GetName().Version.ToStringParsed()}");
#else
__instance.AddHeading(ModListTab, $"QModManager running version {Assembly.GetExecutingAssembly().GetName().Version.ToStringParsed()}");
#endif
//Add SML Informations
var modprio_sml = QModServices.Main.GetMod("SMLHelper");
if (modprio_sml != null)
{
__instance.AddHeading(ModListTab, $"{modprio_sml.DisplayName} {(modprio_sml.Enable ? $"v{modprio_sml.ParsedVersion}" : $"")} {(modprio_sml.IsLoaded ? "is activated" : "is deactivated")}");
}
else
{
__instance.AddHeading(ModListTab, $"SML Helper is not installed");
}

IEnumerable<IQMod> mods = QModServices.Main.GetAllMods().OrderBy(mod => mod.DisplayName);
List<IQMod> activeMods = new List<IQMod>();
List<IQMod> inactiveMods = new List<IQMod>();

foreach (var mod in mods)
{
if (mod.Enable)
{
activeMods.Add(mod);
}
else
{
inactiveMods.Add(mod);
}
}

__instance.AddHeading(ModListTab, $"- - Statistics - -");
__instance.AddHeading(ModListTab, $"{mods.Count()} Mods found");
__instance.AddHeading(ModListTab, $"{activeMods.Count} Mods enabled");
__instance.AddHeading(ModListTab, $"{inactiveMods.Count} Mods disabled");

__instance.AddHeading(ModListTab, $"- - List of currently running Mods - -");
foreach (var mod in activeMods)
{
__instance.AddHeading(ModListTab, $"{mod.DisplayName} v{mod.ParsedVersion.ToString()} from {mod.Author}");
}

__instance.AddHeading(ModListTab, $"- - List of Disabled Mods - -");

foreach (var mod in inactiveMods)
{
__instance.AddHeading(ModListTab, $"{mod.DisplayName} from {mod.Author}");
}
#endregion Mod List
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions QModManager/Patching/StoreDetector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ internal static string GetUsedGameStore()
}
else if (IsEpic(directory))
{
return "Eic Games";
return "Epic Games";
}
else if (IsMSStore(directory))
{
Expand Down Expand Up @@ -88,7 +88,7 @@ internal static bool NonValidStore(string folder)
{
if (File.Exists(Path.Combine(folder, file)))
{
return false;
return true;
}
}
return false;
Expand Down