Add support log, improve bone name display, fix incognify issues
This commit is contained in:
@@ -45,4 +45,12 @@
|
|||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<!--<PropertyGroup Condition="'$(Configuration)'=='Debug'">
|
||||||
|
<DefineConstants>INCOGNIFY_STRINGS</DefineConstants>
|
||||||
|
</PropertyGroup>-->
|
||||||
|
|
||||||
|
<PropertyGroup Condition="'$(Configuration)'=='Release'">
|
||||||
|
<DefineConstants>INCOGNIFY_STRINGS</DefineConstants>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -137,7 +137,8 @@ public static class ServiceManagerBuilder
|
|||||||
.AddSingleton<SaveService>()
|
.AddSingleton<SaveService>()
|
||||||
.AddSingleton<FilenameService>()
|
.AddSingleton<FilenameService>()
|
||||||
.AddSingleton<BackupService>()
|
.AddSingleton<BackupService>()
|
||||||
.AddSingleton<FrameworkManager>();
|
.AddSingleton<FrameworkManager>()
|
||||||
|
.AddSingleton<SupportLogBuilderService>();
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
|
|||||||
134
CustomizePlus/Core/Services/SupportLogBuilderService.cs
Normal file
134
CustomizePlus/Core/Services/SupportLogBuilderService.cs
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
using CustomizePlus.Armatures.Services;
|
||||||
|
using CustomizePlus.Configuration.Data;
|
||||||
|
using CustomizePlus.Core.Data;
|
||||||
|
using CustomizePlus.Core.Extensions;
|
||||||
|
using CustomizePlus.Profiles;
|
||||||
|
using CustomizePlus.Templates;
|
||||||
|
using Dalamud.Plugin;
|
||||||
|
using OtterGui.Services;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CustomizePlus.Core.Services;
|
||||||
|
|
||||||
|
//Based on Penumbra's support log
|
||||||
|
public class SupportLogBuilderService
|
||||||
|
{
|
||||||
|
private readonly PluginConfiguration _configuration;
|
||||||
|
private readonly TemplateManager _templateManager;
|
||||||
|
private readonly ProfileManager _profileManager;
|
||||||
|
private readonly ArmatureManager _armatureManager;
|
||||||
|
private readonly DalamudPluginInterface _dalamudPluginInterface;
|
||||||
|
|
||||||
|
public SupportLogBuilderService(
|
||||||
|
PluginConfiguration configuration,
|
||||||
|
TemplateManager templateManager,
|
||||||
|
ProfileManager profileManager,
|
||||||
|
ArmatureManager armatureManager,
|
||||||
|
DalamudPluginInterface dalamudPluginInterface)
|
||||||
|
{
|
||||||
|
_configuration = configuration;
|
||||||
|
_templateManager = templateManager;
|
||||||
|
_profileManager = profileManager;
|
||||||
|
_armatureManager = armatureManager;
|
||||||
|
_dalamudPluginInterface = dalamudPluginInterface;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string BuildSupportLog()
|
||||||
|
{
|
||||||
|
var sb = new StringBuilder(10240);
|
||||||
|
sb.AppendLine("**Settings**");
|
||||||
|
sb.Append($"> **`Plugin Version: `** {Plugin.Version}\n");
|
||||||
|
sb.Append($"> **`Commit Hash: `** {ThisAssembly.Git.Commit}+{ThisAssembly.Git.Sha}\n");
|
||||||
|
sb.Append($"> **`Root editing: `** {_configuration.EditorConfiguration.RootPositionEditingEnabled}\n");
|
||||||
|
sb.AppendLine("**Settings -> Editor Settings**");
|
||||||
|
sb.Append($"> **`Limit to my creatures (editor): `** {_configuration.EditorConfiguration.LimitLookupToOwnedObjects}\n");
|
||||||
|
sb.Append($"> **`Preview character (editor): `** {_configuration.EditorConfiguration.PreviewCharacterName?.Incognify() ?? "Not set"}\n");
|
||||||
|
sb.AppendLine("**Settings -> Profile application**");
|
||||||
|
sb.Append($"> **`Character window: `** {_configuration.ProfileApplicationSettings.ApplyInCharacterWindow}\n");
|
||||||
|
sb.Append($"> **`Try On: `** {_configuration.ProfileApplicationSettings.ApplyInTryOn}\n");
|
||||||
|
sb.Append($"> **`Cards: `** {_configuration.ProfileApplicationSettings.ApplyInCards}\n");
|
||||||
|
sb.Append($"> **`Inspect: `** {_configuration.ProfileApplicationSettings.ApplyInInspect}\n");
|
||||||
|
sb.Append($"> **`Lobby: `** {_configuration.ProfileApplicationSettings.ApplyInLobby}\n");
|
||||||
|
sb.AppendLine("**Relevant plugins**");
|
||||||
|
GatherRelevantPlugins(sb);
|
||||||
|
sb.AppendLine("**Templates**");
|
||||||
|
sb.Append($"> **`Count: `** {_templateManager.Templates.Count}\n");
|
||||||
|
foreach (var template in _templateManager.Templates)
|
||||||
|
{
|
||||||
|
sb.Append($"> > **`{template.ToString(),-29}`**\n");
|
||||||
|
}
|
||||||
|
sb.AppendLine("**Profiles**");
|
||||||
|
sb.Append($"> **`Count: `** {_profileManager.Profiles.Count}\n");
|
||||||
|
foreach (var profile in _profileManager.Profiles)
|
||||||
|
{
|
||||||
|
sb.Append($"> > =====\n");
|
||||||
|
sb.Append($"> > **`{profile.ToString(),-29}`*\n");
|
||||||
|
sb.Append($"> > **`Name: {profile.Name.Text.Incognify()}`**\n");
|
||||||
|
sb.Append($"> > **`Type: {profile.ProfileType}`**\n");
|
||||||
|
sb.Append($"> > **`Character name: {profile.CharacterName.Text.Incognify()}`**\n");
|
||||||
|
sb.Append($"> > **`Limit to my creatures: {profile.LimitLookupToOwnedObjects}`**\n");
|
||||||
|
sb.Append($"> > **`Templates:`**\n");
|
||||||
|
sb.Append($"> > > **`Count: {profile.Templates.Count}`**\n");
|
||||||
|
foreach (var template in profile.Templates)
|
||||||
|
{
|
||||||
|
sb.Append($"> > > **`{template.ToString()}`**\n");
|
||||||
|
}
|
||||||
|
sb.Append($"> > **`Armatures:`**\n");
|
||||||
|
sb.Append($"> > > **`Count: {profile.Armatures.Count}`**\n");
|
||||||
|
foreach (var armature in profile.Armatures)
|
||||||
|
{
|
||||||
|
sb.Append($"> > > **`{armature.ToString()}`**\n");
|
||||||
|
}
|
||||||
|
sb.Append($"> > =====\n");
|
||||||
|
}
|
||||||
|
sb.AppendLine("**Armatures**");
|
||||||
|
sb.Append($"> **`Count: `** {_armatureManager.Armatures.Count}\n");
|
||||||
|
foreach (var kvPair in _armatureManager.Armatures)
|
||||||
|
{
|
||||||
|
var identifier = kvPair.Key;
|
||||||
|
var armature = kvPair.Value;
|
||||||
|
sb.Append($"> > =====\n");
|
||||||
|
sb.Append($"> > **`{armature.ToString(),-29}`**\n");
|
||||||
|
sb.Append($"> > **`Actor: {armature.ActorIdentifier.Incognito(null) ?? "None"}`**\n");
|
||||||
|
sb.Append($"> > **`Built: {armature.IsBuilt}`**\n");
|
||||||
|
sb.Append($"> > **`Visible: {armature.IsVisible}`**\n");
|
||||||
|
sb.Append($"> > **`Pending rebind: {armature.IsPendingProfileRebind}`**\n");
|
||||||
|
sb.Append($"> > **`Last seen: {armature.LastSeen}`**\n");
|
||||||
|
sb.Append($"> > **`Profile: {armature.Profile?.ToString() ?? "None"}`**\n");
|
||||||
|
sb.Append($"> > **`Main Root Bone/Total Bones/Partial Skeleton Count: {armature.MainRootBone}/{armature.TotalBoneCount}/{armature.PartialSkeletonCount}`**\n");
|
||||||
|
sb.Append($"> > **`Bone template bindings:`**\n");
|
||||||
|
foreach (var bindingKvPair in armature.BoneTemplateBinding)
|
||||||
|
{
|
||||||
|
sb.Append($"> > > **`{BoneData.GetBoneDisplayName(bindingKvPair.Key)} ({bindingKvPair.Key}) -> {bindingKvPair.Value.ToString()}`**\n");
|
||||||
|
}
|
||||||
|
sb.Append($"> > =====\n");
|
||||||
|
}
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void GatherRelevantPlugins(StringBuilder sb)
|
||||||
|
{
|
||||||
|
ReadOnlySpan<string> relevantPlugins =
|
||||||
|
[
|
||||||
|
"MareSynchronos", "Ktisis", "Brio", "DynamicBridge"
|
||||||
|
];
|
||||||
|
var plugins = _dalamudPluginInterface.InstalledPlugins
|
||||||
|
.GroupBy(p => p.InternalName)
|
||||||
|
.ToDictionary(g => g.Key, g =>
|
||||||
|
{
|
||||||
|
var item = g.OrderByDescending(p => p.IsLoaded).ThenByDescending(p => p.Version).First();
|
||||||
|
return (item.IsLoaded, item.Version, item.Name);
|
||||||
|
});
|
||||||
|
foreach (var plugin in relevantPlugins)
|
||||||
|
{
|
||||||
|
if (plugins.TryGetValue(plugin, out var data))
|
||||||
|
sb.Append($"> **`{data.Name + ':',-29}`** {data.Version}{(data.IsLoaded ? string.Empty : " (Disabled)")}\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -38,6 +38,10 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<!--<PackageReference Include="DalamudPackager" Version="2.1.12" />-->
|
<!--<PackageReference Include="DalamudPackager" Version="2.1.12" />-->
|
||||||
|
<PackageReference Include="GitInfo" Version="3.3.5">
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
|
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
|
||||||
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
|
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
|||||||
@@ -9,13 +9,25 @@ using CustomizePlus.Configuration.Services.Temporary;
|
|||||||
using OtterGui.Services;
|
using OtterGui.Services;
|
||||||
using CustomizePlus.Api;
|
using CustomizePlus.Api;
|
||||||
using ECommons;
|
using ECommons;
|
||||||
|
using ECommons.Commands;
|
||||||
|
using ECommons.Configuration;
|
||||||
|
using OtterGui;
|
||||||
|
using System.IO;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Linq;
|
||||||
|
using CustomizePlus.Configuration.Data;
|
||||||
|
using CustomizePlus.Core.Extensions;
|
||||||
|
using CustomizePlus.Templates;
|
||||||
|
using CustomizePlus.Profiles;
|
||||||
|
using CustomizePlus.Armatures.Services;
|
||||||
|
|
||||||
namespace CustomizePlus;
|
namespace CustomizePlus;
|
||||||
|
|
||||||
public sealed class Plugin : IDalamudPlugin
|
public sealed class Plugin : IDalamudPlugin
|
||||||
{
|
{
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
public static readonly string Version = $"{Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? string.Empty} [DEBUG]";
|
public static readonly string Version = $"{ThisAssembly.Git.Commit}+{ThisAssembly.Git.Sha} [DEBUG]";
|
||||||
#else
|
#else
|
||||||
public static readonly string Version = Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? string.Empty;
|
public static readonly string Version = Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? string.Empty;
|
||||||
#endif
|
#endif
|
||||||
@@ -40,7 +52,7 @@ public sealed class Plugin : IDalamudPlugin
|
|||||||
_services.GetService<CPlusWindowSystem>();
|
_services.GetService<CPlusWindowSystem>();
|
||||||
_services.GetService<CommandService>();
|
_services.GetService<CommandService>();
|
||||||
|
|
||||||
Logger.Information($"Customize+ v{Version} [FantasiaPlus] started");
|
Logger.Information($"Customize+ v{Version} ({ThisAssembly.Git.Commit}+{ThisAssembly.Git.Sha}) [FantasiaPlus] started");
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ using CustomizePlus.GameData.Services;
|
|||||||
using CustomizePlus.Core.Extensions;
|
using CustomizePlus.Core.Extensions;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using CustomizePlus.Game.Services;
|
using CustomizePlus.Game.Services;
|
||||||
|
using CustomizePlus.Core.Data;
|
||||||
|
|
||||||
namespace CustomizePlus.UI.Windows.MainWindow.Tabs.Debug;
|
namespace CustomizePlus.UI.Windows.MainWindow.Tabs.Debug;
|
||||||
|
|
||||||
@@ -187,7 +188,7 @@ public class StateMonitoringTab
|
|||||||
#if !INCOGNIFY_STRINGS
|
#if !INCOGNIFY_STRINGS
|
||||||
ImGui.Text($"{kvPair.Key}: p: {kvPair.Value.Translation} | r: {kvPair.Value.Rotation} | s: {kvPair.Value.Scaling}");
|
ImGui.Text($"{kvPair.Key}: p: {kvPair.Value.Translation} | r: {kvPair.Value.Rotation} | s: {kvPair.Value.Scaling}");
|
||||||
#else
|
#else
|
||||||
ImGui.Text($"{kvPair.Key}: p: {(kvPair.Value.Translation.IsApproximately(Vector3.Zero) ? "Approx. not changed" : "Changed")} | r: {(kvPair.Value.Rotation.IsApproximately(Vector3.Zero) ? "Approx. not changed" : "Changed")} | s: {(kvPair.Value.Scaling.IsApproximately(Vector3.One) ? "Not changed" : "Changed")}");
|
ImGui.Text($"{BoneData.GetBoneDisplayName(kvPair.Key)} ({kvPair.Key}): p: {(kvPair.Value.Translation.IsApproximately(Vector3.Zero) ? "Approx. not changed" : "Changed")} | r: {(kvPair.Value.Rotation.IsApproximately(Vector3.Zero) ? "Approx. not changed" : "Changed")} | s: {(kvPair.Value.Scaling.IsApproximately(Vector3.One) ? "Not changed" : "Changed")}");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -215,7 +216,7 @@ public class StateMonitoringTab
|
|||||||
ImGui.Text($"Bone template bindings:");
|
ImGui.Text($"Bone template bindings:");
|
||||||
foreach (var kvPair in armature.BoneTemplateBinding)
|
foreach (var kvPair in armature.BoneTemplateBinding)
|
||||||
{
|
{
|
||||||
ImGui.Text($"{kvPair.Key} -> {kvPair.Value.Name.Text.Incognify()} ({kvPair.Value.UniqueId})");
|
ImGui.Text($"{BoneData.GetBoneDisplayName(kvPair.Key)} ({kvPair.Key}) -> {kvPair.Value.Name.Text.Incognify()} ({kvPair.Value.UniqueId})");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ public class SettingsTab
|
|||||||
private readonly TemplateEditorManager _templateEditorManager;
|
private readonly TemplateEditorManager _templateEditorManager;
|
||||||
private readonly CPlusChangeLog _changeLog;
|
private readonly CPlusChangeLog _changeLog;
|
||||||
private readonly MessageService _messageService;
|
private readonly MessageService _messageService;
|
||||||
|
private readonly SupportLogBuilderService _supportLogBuilderService;
|
||||||
|
|
||||||
public SettingsTab(
|
public SettingsTab(
|
||||||
PluginConfiguration configuration,
|
PluginConfiguration configuration,
|
||||||
@@ -35,7 +36,8 @@ public class SettingsTab
|
|||||||
HookingService hookingService,
|
HookingService hookingService,
|
||||||
TemplateEditorManager templateEditorManager,
|
TemplateEditorManager templateEditorManager,
|
||||||
CPlusChangeLog changeLog,
|
CPlusChangeLog changeLog,
|
||||||
MessageService messageService)
|
MessageService messageService,
|
||||||
|
SupportLogBuilderService supportLogBuilderService)
|
||||||
{
|
{
|
||||||
_configuration = configuration;
|
_configuration = configuration;
|
||||||
_armatureManager = armatureManager;
|
_armatureManager = armatureManager;
|
||||||
@@ -43,6 +45,7 @@ public class SettingsTab
|
|||||||
_templateEditorManager = templateEditorManager;
|
_templateEditorManager = templateEditorManager;
|
||||||
_changeLog = changeLog;
|
_changeLog = changeLog;
|
||||||
_messageService = messageService;
|
_messageService = messageService;
|
||||||
|
_supportLogBuilderService = supportLogBuilderService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Draw()
|
public void Draw()
|
||||||
@@ -53,6 +56,7 @@ public class SettingsTab
|
|||||||
|
|
||||||
DrawGeneralSettings();
|
DrawGeneralSettings();
|
||||||
|
|
||||||
|
ImGui.NewLine();
|
||||||
ImGui.NewLine();
|
ImGui.NewLine();
|
||||||
ImGui.NewLine();
|
ImGui.NewLine();
|
||||||
|
|
||||||
@@ -299,7 +303,7 @@ public class SettingsTab
|
|||||||
#region Support Area
|
#region Support Area
|
||||||
private void DrawSupportButtons()
|
private void DrawSupportButtons()
|
||||||
{
|
{
|
||||||
var width = ImGui.CalcTextSize("Join Discord for Support").X + ImGui.GetStyle().FramePadding.X * 2;
|
var width = ImGui.CalcTextSize("Copy Support Info to Clipboard").X + ImGui.GetStyle().FramePadding.X * 2;
|
||||||
var xPos = ImGui.GetWindowWidth() - width;
|
var xPos = ImGui.GetWindowWidth() - width;
|
||||||
// Respect the scroll bar width.
|
// Respect the scroll bar width.
|
||||||
if (ImGui.GetScrollMaxY() > 0)
|
if (ImGui.GetScrollMaxY() > 0)
|
||||||
@@ -311,6 +315,14 @@ public class SettingsTab
|
|||||||
ImGui.SetCursorPos(new Vector2(xPos, 1 * ImGui.GetFrameHeightWithSpacing()));
|
ImGui.SetCursorPos(new Vector2(xPos, 1 * ImGui.GetFrameHeightWithSpacing()));
|
||||||
if (ImGui.Button("Show update history", new Vector2(width, 0)))
|
if (ImGui.Button("Show update history", new Vector2(width, 0)))
|
||||||
_changeLog.Changelog.ForceOpen = true;
|
_changeLog.Changelog.ForceOpen = true;
|
||||||
|
|
||||||
|
ImGui.SetCursorPos(new Vector2(xPos, 2 * ImGui.GetFrameHeightWithSpacing()));
|
||||||
|
if (!ImGui.Button("Copy Support Info to Clipboard"))
|
||||||
|
return;
|
||||||
|
|
||||||
|
var text = _supportLogBuilderService.BuildSupportLog();
|
||||||
|
ImGui.SetClipboardText(text);
|
||||||
|
_messageService.NotificationMessage($"Copied Support Info to Clipboard.", NotificationType.Success, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Draw a button to open the official discord server. </summary>
|
/// <summary> Draw a button to open the official discord server. </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user