Generalize UI: general status by default, diagnostics behind Debug details
Rework the spike-era debug readouts into general-purpose status, with the verbose diagnostics gated behind the menu bar's "Debug details" switch: - Controllers (was "Phase 0 spike"): always shows slot/source + live buttons; the raw stick/trigger numbers are debug-only. - Injection hook status: general view is attached + focus spoof + a single "Game reading controller: N polls/s" summary; the per-slot poll table, focus-API counts, and input-path detection are debug-only. - Audio: general view adds a "Buffered: N ms" health/latency proxy (AudioMirror now tracks buffered audio in both render paths) and keeps the render-stream count; the per-stream table is debug-only. Default overlay is now clean general status; flip Debug details for the full diagnostics. Completes the "generalize the UI" roadmap task. All tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -29,7 +29,7 @@ const char* format_tag_name(std::uint32_t tag)
|
||||
|
||||
} // namespace
|
||||
|
||||
void AudioPanel::draw_ui(const HookStatusView& status)
|
||||
void AudioPanel::draw_ui(const HookStatusView& status, bool debug_details)
|
||||
{
|
||||
const bool have_target = target_ != nullptr && IsWindow(target_);
|
||||
DWORD pid = 0;
|
||||
@@ -76,6 +76,7 @@ void AudioPanel::draw_ui(const HookStatusView& status)
|
||||
ImGui::SameLine();
|
||||
ImGui::TextColored(hooked ? ImVec4(0.4f, 1.0f, 0.4f, 1.0f) : ImVec4(1.0f, 0.8f, 0.3f, 1.0f), "%s",
|
||||
mirror_.source_name());
|
||||
ImGui::Text("Buffered: %u ms", mirror_.buffered_ms());
|
||||
}
|
||||
const std::string mirror_status = mirror_.status();
|
||||
if (!mirror_status.empty())
|
||||
@@ -90,10 +91,10 @@ void AudioPanel::draw_ui(const HookStatusView& status)
|
||||
ImGui::TextDisabled("Game audio also plays locally (echo). Inject the hook to remove it.");
|
||||
}
|
||||
|
||||
// --- Render-stream debug view -----------------------------------------
|
||||
// --- Render-stream view -----------------------------------------------
|
||||
// The hook counts every render stream the game creates, even with mirroring
|
||||
// off. v1 captures only the first ("primary"); this makes multi-stream games
|
||||
// obvious so we know if/when that needs revisiting.
|
||||
// off. v1 captures only the first ("primary"); the count makes a multi-stream
|
||||
// game obvious, and the per-stream table (debug details) shows why.
|
||||
ImGui::Separator();
|
||||
ImGui::Text("Render streams: %u", status.audio_streams_seen);
|
||||
if (status.audio_streams_seen > kMaxAudioStreams)
|
||||
@@ -102,6 +103,12 @@ void AudioPanel::draw_ui(const HookStatusView& status)
|
||||
ImGui::TextDisabled("(showing first %u)", kMaxAudioStreams);
|
||||
}
|
||||
|
||||
if (!debug_details)
|
||||
{
|
||||
ImGui::End();
|
||||
return; // the per-stream table below is diagnostic detail
|
||||
}
|
||||
|
||||
const std::uint32_t rows = std::min<std::uint32_t>(status.audio_streams_seen, kMaxAudioStreams);
|
||||
if (rows > 0 &&
|
||||
ImGui::BeginTable("audio_streams", 5, ImGuiTableFlags_Borders | ImGuiTableFlags_SizingFixedFit))
|
||||
|
||||
Reference in New Issue
Block a user