1
0
Fork 0
forked from aly/qstbak

muffin v7.5.12

This commit is contained in:
alydev 2026-08-19 13:19:57 +10:00
parent 3102923ce2
commit 911ed68baa
65 changed files with 2356 additions and 1539 deletions

View file

@ -1,6 +1,5 @@
using System.Collections.Generic;
using System.Collections.Immutable;
using System.IO;
using System.Linq;
using System.Numerics;
using Dalamud.Bindings.ImGui;
@ -15,12 +14,9 @@ internal sealed class DebugConfigComponent : ConfigComponent
{
private readonly Dictionary<string, bool> _featurePausingOpenState = new Dictionary<string, bool>();
private readonly string? _cacheDirectory;
public DebugConfigComponent(IDalamudPluginInterface pluginInterface, Configuration configuration)
: base(pluginInterface, configuration)
{
_cacheDirectory = pluginInterface.ConfigDirectory.FullName;
}
public override void DrawTab()
@ -61,45 +57,8 @@ internal sealed class DebugConfigComponent : ConfigComponent
}
UiThemeUtils.EndCard(item4, item5, item6);
UiThemeUtils.SectionSpacing();
UiThemeUtils.SectionHeader("Data Cache");
var (contentStartPos, availableWidth, drawList) = UiThemeUtils.BeginCard();
UiThemeUtils.WrappedText("NPC position and zone boundary caches are rebuilt automatically after game patches. Use this button to force a rebuild on next load.");
bool flag = _cacheDirectory != null && (File.Exists(Path.Combine(_cacheDirectory, "npc-position-cache.bin")) || File.Exists(Path.Combine(_cacheDirectory, "zone-boundary-cache.bin")));
long num = 0L;
if (_cacheDirectory != null)
{
num += FileSize(Path.Combine(_cacheDirectory, "npc-position-cache.bin"));
num += FileSize(Path.Combine(_cacheDirectory, "zone-boundary-cache.bin"));
}
using (ImRaii.Disabled(!flag))
{
if (ImGui.Button("Clear LGB Caches") && _cacheDirectory != null)
{
TryDelete(Path.Combine(_cacheDirectory, "npc-position-cache.bin"));
TryDelete(Path.Combine(_cacheDirectory, "zone-boundary-cache.bin"));
}
if (flag && ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
{
ImU8String tooltip = new ImU8String(20, 1);
tooltip.AppendLiteral("Current cache size: ");
tooltip.AppendFormatted(FormatBytes(num));
ImGui.SetTooltip(tooltip);
}
}
if (!flag)
{
ImGui.SameLine();
ImGui.TextDisabled("(no cache files present)");
}
else
{
ImGui.SameLine();
ImGui.TextDisabled("Takes effect on next plugin load.");
}
UiThemeUtils.EndCard(contentStartPos, availableWidth, drawList);
UiThemeUtils.SectionSpacing();
UiThemeUtils.SectionHeader("Danger Zone");
var (contentStartPos2, availableWidth2, drawList2) = UiThemeUtils.BeginCard();
var (contentStartPos, availableWidth, drawList) = UiThemeUtils.BeginCard();
UiThemeUtils.WrappedTextColored(UiThemeUtils.StatusLocked, "Enabling any option below may cause unexpected behavior. Use at your own risk.");
bool value4 = base.Configuration.Advanced.DisablePartyWatchdog;
if (UiThemeUtils.WrappedCheckbox("Disable Party Watchdog", ref value4, "The Party Watchdog stops Questionable when entering certain zones with other party members, or when entering unsupported content. Disabling this allows Questionable to continue working while in a party, but may cause unexpected behavior in group content."))
@ -109,7 +68,7 @@ internal sealed class DebugConfigComponent : ConfigComponent
}
DrawFeaturePausingSection("Pandora's Box Feature Pausing", PandorasBoxIpc.ConflictingFeatures, "Auto Active Time Maneuver", "Only applies when Auto-Solve QTE is enabled.", base.Configuration.Advanced.PandoraFeatureExclusions);
DrawFeaturePausingSection("Bundle of Tweaks Feature Pausing", AutomatonIpc.ConflictingTweaks, "AutoSnipeQuests", "Only applies when AutoSnipe is enabled.", base.Configuration.Advanced.AutomatonTweakExclusions);
UiThemeUtils.EndCard(contentStartPos2, availableWidth2, drawList2);
UiThemeUtils.EndCard(contentStartPos, availableWidth, drawList);
}
private void DrawFeaturePausingSection(string header, ImmutableHashSet<string> features, string conditionalFeature, string conditionalHelpText, HashSet<string> exclusions)
@ -164,51 +123,4 @@ internal sealed class DebugConfigComponent : ConfigComponent
}
}
}
private static void TryDelete(string path)
{
try
{
File.Delete(path);
}
catch
{
}
}
private static long FileSize(string path)
{
try
{
FileInfo fileInfo = new FileInfo(path);
long result;
if (fileInfo != null && fileInfo.Exists)
{
long length = fileInfo.Length;
result = length;
}
else
{
result = 0L;
}
return result;
}
catch
{
return 0L;
}
}
private static string FormatBytes(long bytes)
{
if (bytes < 1048576)
{
if (bytes >= 1024)
{
return $"{(double)bytes / 1024.0:F1} KB";
}
return $"{bytes} B";
}
return $"{(double)bytes / 1048576.0:F1} MB";
}
}