mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-15 04:17:43 +01:00
Merge remote-tracking branch 'lmcintyre/master' into viewport
This commit is contained in:
commit
fd9b145756
12 changed files with 657 additions and 25 deletions
|
|
@ -42,6 +42,8 @@ namespace Dalamud.Interface
|
|||
|
||||
private UIDebug UIDebug = null;
|
||||
|
||||
private uint copyButtonIndex = 0;
|
||||
|
||||
public DalamudDataWindow(Dalamud dalamud) {
|
||||
this.dalamud = dalamud;
|
||||
|
||||
|
|
@ -57,6 +59,7 @@ namespace Dalamud.Interface
|
|||
}
|
||||
|
||||
public bool Draw() {
|
||||
this.copyButtonIndex = 0;
|
||||
ImGui.SetNextWindowSize(new Vector2(500, 500), ImGuiCond.FirstUseEver);
|
||||
|
||||
var isOpen = true;
|
||||
|
|
@ -101,7 +104,7 @@ namespace Dalamud.Interface
|
|||
}
|
||||
ImGui.Text($"Result: {this.sigResult.ToInt64():X}");
|
||||
ImGui.SameLine();
|
||||
if (ImGui.Button("C")) {
|
||||
if (ImGui.Button($"C{this.copyButtonIndex++}")) {
|
||||
ImGui.SetClipboardText(this.sigResult.ToInt64().ToString("x"));
|
||||
}
|
||||
|
||||
|
|
@ -112,7 +115,7 @@ namespace Dalamud.Interface
|
|||
$" {valueTuple.Item1} - 0x{valueTuple.Item2.ToInt64():x}");
|
||||
ImGui.SameLine();
|
||||
|
||||
if (ImGui.Button("C")) {
|
||||
if (ImGui.Button($"C##copyAddress{copyButtonIndex++}")) {
|
||||
ImGui.SetClipboardText(valueTuple.Item2.ToInt64().ToString("x"));
|
||||
}
|
||||
}
|
||||
|
|
@ -442,7 +445,7 @@ namespace Dalamud.Interface
|
|||
|
||||
ImGui.TextUnformatted(actorString);
|
||||
ImGui.SameLine();
|
||||
if (ImGui.Button("C")) {
|
||||
if (ImGui.Button($"C##{this.copyButtonIndex++}")) {
|
||||
ImGui.SetClipboardText(actor.Address.ToInt64().ToString("X"));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,9 @@ namespace Dalamud.Interface
|
|||
|
||||
public DalamudInterface(Dalamud dalamud) {
|
||||
this.dalamud = dalamud;
|
||||
if (dalamud.Configuration.LogOpenAtStartup) {
|
||||
OpenLog();
|
||||
}
|
||||
}
|
||||
|
||||
private bool isImguiDrawDemoWindow = false;
|
||||
|
|
@ -97,7 +100,7 @@ namespace Dalamud.Interface
|
|||
ImGui.Separator();
|
||||
if (ImGui.MenuItem("Open Log window"))
|
||||
{
|
||||
this.logWindow = new DalamudLogWindow(this.dalamud.CommandManager);
|
||||
this.logWindow = new DalamudLogWindow(this.dalamud.CommandManager, this.dalamud.Configuration);
|
||||
this.isImguiDrawLogWindow = true;
|
||||
}
|
||||
if (ImGui.BeginMenu("Set log level..."))
|
||||
|
|
@ -223,7 +226,7 @@ namespace Dalamud.Interface
|
|||
{
|
||||
if (ImGui.MenuItem("From Fallbacks"))
|
||||
{
|
||||
Loc.SetupWithFallbacks();
|
||||
this.dalamud.LocalizationManager.SetupWithFallbacks();
|
||||
}
|
||||
|
||||
if (ImGui.MenuItem("From UICulture"))
|
||||
|
|
@ -336,7 +339,7 @@ namespace Dalamud.Interface
|
|||
}
|
||||
|
||||
public void OpenLog() {
|
||||
this.logWindow = new DalamudLogWindow(this.dalamud.CommandManager);
|
||||
this.logWindow = new DalamudLogWindow(this.dalamud.CommandManager, this.dalamud.Configuration);
|
||||
this.isImguiDrawLogWindow = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,15 +13,20 @@ namespace Dalamud.Interface
|
|||
{
|
||||
class DalamudLogWindow : IDisposable {
|
||||
private readonly CommandManager commandManager;
|
||||
private bool autoScroll = true;
|
||||
private readonly DalamudConfiguration configuration;
|
||||
private bool autoScroll;
|
||||
private bool openAtStartup;
|
||||
private readonly List<(string line, Vector4 color)> logText = new List<(string line, Vector4 color)>();
|
||||
|
||||
private readonly object renderLock = new object();
|
||||
|
||||
private string commandText = string.Empty;
|
||||
|
||||
public DalamudLogWindow(CommandManager commandManager) {
|
||||
public DalamudLogWindow(CommandManager commandManager, DalamudConfiguration configuration) {
|
||||
this.commandManager = commandManager;
|
||||
this.configuration = configuration;
|
||||
this.autoScroll = configuration.LogAutoScroll;
|
||||
this.openAtStartup = configuration.LogOpenAtStartup;
|
||||
SerilogEventSink.Instance.OnLogLine += Serilog_OnLogLine;
|
||||
}
|
||||
|
||||
|
|
@ -71,7 +76,14 @@ namespace Dalamud.Interface
|
|||
// Options menu
|
||||
if (ImGui.BeginPopup("Options"))
|
||||
{
|
||||
ImGui.Checkbox("Auto-scroll", ref this.autoScroll);
|
||||
if (ImGui.Checkbox("Auto-scroll", ref this.autoScroll)) {
|
||||
this.configuration.LogAutoScroll = this.autoScroll;
|
||||
this.configuration.Save();
|
||||
};
|
||||
if (ImGui.Checkbox("Open at startup", ref this.openAtStartup)) {
|
||||
this.configuration.LogOpenAtStartup = this.openAtStartup;
|
||||
this.configuration.Save();
|
||||
};
|
||||
ImGui.EndPopup();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue