Skip to content

Commit

Permalink
Update AgentDebug.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Caraxi committed Oct 8, 2023
1 parent 93bf308 commit aa53d09
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Debugging/AgentDebug.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public unsafe class AgentDebug : DebugHelper {
private Type selectedAgentType;
private string agentSearch = string.Empty;


private bool starting = true;

public class AgentEventHandlerHook : IDisposable {
public AgentId AgentId { get; }
Expand Down Expand Up @@ -130,6 +130,17 @@ public override void Draw() {

}


if (starting) {
try {
var selectedAgent = DebugManager.GetSavedValue($"{nameof(AgentDebug)}:{nameof(selectAgent)}", string.Empty);
Enum.TryParse(selectedAgent, false, out selectAgent);
} catch {
//
}
starting = false;
}



if (ImGui.BeginTabBar("agenDebugTabs")) {
Expand Down Expand Up @@ -181,6 +192,7 @@ public override void Draw() {
if (ImGui.Selectable($"{agent.id}", selectAgent == agent.id)) {
selectAgent = agent.id;
selectedAgentType = null;
DebugManager.SetSavedValue($"{nameof(AgentDebug)}:{nameof(selectAgent)}", $"{agent.id}");
}

var size = ImGui.CalcTextSize($"{agent}").X + ImGui.GetStyle().FramePadding.X * 2 + ImGui.GetStyle().ScrollbarSize * 2;
Expand Down

0 comments on commit aa53d09

Please sign in to comment.