add debug button to copy character data

This commit is contained in:
rootdarkarchon
2023-01-14 20:41:50 +01:00
parent 89eb6b448e
commit aaf11043fe
4 changed files with 24 additions and 3 deletions

View File

@@ -12,6 +12,7 @@ using MareSynchronos.API;
using MareSynchronos.Utils;
using MareSynchronos.WebAPI.Utils;
using Dalamud.Utility;
using Newtonsoft.Json;
namespace MareSynchronos.UI;
@@ -22,6 +23,8 @@ public class SettingsUi : Window, IDisposable
private readonly WindowSystem _windowSystem;
private readonly ApiController _apiController;
private readonly UiShared _uiShared;
public CharacterCacheDto LastCreatedCharacterData { private get; set; }
public event SwitchUi? SwitchToIntroUi;
private bool _overwriteExistingLabels = false;
private bool? _notesSuccessfullyApplied = null;
@@ -542,6 +545,19 @@ public class SettingsUi : Window, IDisposable
{
_uiShared.DrawServiceSelection(() => { });
}
if (UiShared.IconTextButton(FontAwesomeIcon.Copy, "[DEBUG] Copy Last created Character Data to clipboard"))
{
if (LastCreatedCharacterData != null)
{
ImGui.SetClipboardText(JsonConvert.SerializeObject(LastCreatedCharacterData, Formatting.Indented));
}
else
{
ImGui.SetClipboardText("ERROR: No created character data, cannot copy.");
}
}
UiShared.AttachToolTip("Use this when reporting mods being rejected from the server.");
}
private void DrawBlockedTransfers()