protected void DrawStates() { if (stateMachine.AssertDrawable()) { ImGui.TextColored(Color.green, $"Active state: {(stateMachine.Value.ActiveState == null ? "NONE" : stateMachine.Value.ActiveState.ToString())}"); ImGui.TextColored(Color.cyan, $"-> Incoming state: {(stateMachine.Value.IncomingState == null ? "NONE" : stateMachine.Value.IncomingState.ToString())}"); ImGui.Separator(); } if (!states.AssertDrawable()) { states.SetOwner(stateMachine.Value); return; } if (ImGui.CollapsingHeader("States:")) { using (new ScopeIndent()) { foreach (var state in states.Value) { ImGui.Text($"- {state.methodInfo.Name}"); } } } }
protected void DrawConnections() { if (!connections.AssertDrawable()) { connections.SetOwner(stateMachine.Value); return; } if (ImGui.CollapsingHeader("Connections:")) { using (new ScopeIndent()) { foreach (var connectionPair in connections.Value) { ImGui.Text($"- {connectionPair.Key.Name}"); using (new ScopeIndent()) { foreach (var pair in connectionPair.Value) { ImGui.Text($"-> {pair.Key.ToString()} > {pair.Value.Name}"); } } } } } }
public static bool DrawHeader(this DebugField field, string text) { if (!field.AssertDrawable()) { return(false); } return(ImGui.CollapsingHeader(text)); }
protected override void OnDraw(DebugMenuContext context) { if (!servants.AssertDrawable()) { return; } foreach (var commandServant in servants.Value) { var text = $"[{(commandServant.IsAlive ? "ON" : "OFF")}] ({commandServant.GetType().Name}) {commandServant.Name}"; if (commandServant.IsAlive) { ImGui.Text(text); } else { ImGui.TextDisabled(text); } } }
protected override void OnDraw(DebugMenuContext context) { if (contentAccessRequests.AssertDrawable()) { if (ImGui.CollapsingHeader("Content access requests")) { using (new ScopeIndent()) { foreach (var accessRequest in contentAccessRequests.Value) { ImGui.Text($"{accessRequest.CommandId.KeyDebugDisplay}: {accessRequest.Emitter.Owner.Name}"); } } } } if (hierarchicalTree.AssertDrawable()) { hierarchicalTree.Value.Draw(); } ImGui.Separator(); }
private void DrawReceivers(DebugMenuContext context) { if (!receivers.AssertDrawable()) { return; } for (var k = 0; k < receivers.Value.Keys.Count; k++) { var key = Key(k); var cmdName = idToTypes.ContainsKey(key & CommandId.MASK_TYPE) ? idToTypes[key & CommandId.MASK_TYPE].Name : Const.UNDEFINED; var commandId = (CommandId)key; if (ImGui.CollapsingHeader($"{commandId.KeyDebugDisplay}: {cmdName}")) { ImGui.Indent(); { var count = GetReceiverCount(key); if (count > 0) { for (var c = 0; c < count; c++) { var noticeReceiver = GetReceiver(key, c); ImGui.Text($"Owner: {noticeReceiver.Owner.Name}"); } } else { ImGui.Text(Const.EMPTY); } } ImGui.Unindent(); } } }