feat(stats): add v1 immersion stats dashboard (#19)

This commit is contained in:
2026-03-20 02:43:28 -07:00
committed by GitHub
parent 42abdd1268
commit 6749ff843c
555 changed files with 46356 additions and 2553 deletions

View File

@@ -257,7 +257,9 @@ try {
add_search_path(search_paths, utils.join_path(home, ".local", "bin", "SubMiner.AppImage"))
add_search_path(search_paths, "/opt/SubMiner/SubMiner.AppImage")
add_search_path(search_paths, "/usr/local/bin/SubMiner")
add_search_path(search_paths, "/usr/local/bin/subminer")
add_search_path(search_paths, "/usr/bin/SubMiner")
add_search_path(search_paths, "/usr/bin/subminer")
end
for _, path in ipairs(search_paths) do

View File

@@ -44,6 +44,9 @@ function M.create(ctx)
mp.register_script_message(hover.HOVER_MESSAGE_NAME_LEGACY, function(payload_json)
hover.handle_hover_message(payload_json)
end)
mp.register_script_message("subminer-stats-toggle", function()
mp.osd_message("Stats: press ` (backtick) in overlay", 3)
end)
end
return {

View File

@@ -372,12 +372,9 @@ function M.create(ctx)
end)
end
launch_overlay_with_retry(1)
if texthooker_enabled then
ensure_texthooker_running(function()
launch_overlay_with_retry(1)
end)
else
launch_overlay_with_retry(1)
ensure_texthooker_running(function() end)
end
end
@@ -481,31 +478,33 @@ function M.create(ctx)
state.texthooker_running = false
disarm_auto_play_ready_gate()
ensure_texthooker_running(function()
local start_args = build_command_args("start")
subminer_log("info", "process", "Starting overlay: " .. table.concat(start_args, " "))
local start_args = build_command_args("start")
subminer_log("info", "process", "Starting overlay: " .. table.concat(start_args, " "))
state.overlay_running = true
mp.command_native_async({
name = "subprocess",
args = start_args,
playback_only = false,
capture_stdout = true,
capture_stderr = true,
}, function(success, result, error)
if not success or (result and result.status ~= 0) then
state.overlay_running = false
subminer_log(
"error",
"process",
"Overlay start failed: " .. (error or (result and result.stderr) or "unknown error")
)
show_osd("Restart failed")
else
show_osd("Restarted successfully")
end
end)
state.overlay_running = true
mp.command_native_async({
name = "subprocess",
args = start_args,
playback_only = false,
capture_stdout = true,
capture_stderr = true,
}, function(success, result, error)
if not success or (result and result.status ~= 0) then
state.overlay_running = false
subminer_log(
"error",
"process",
"Overlay start failed: " .. (error or (result and result.stderr) or "unknown error")
)
show_osd("Restart failed")
else
show_osd("Restarted successfully")
end
end)
if opts.texthooker_enabled then
ensure_texthooker_running(function() end)
end
end)
end

View File

@@ -32,6 +32,7 @@ function M.create(ctx)
"Open options",
"Restart overlay",
"Check status",
"Stats",
}
local actions = {
@@ -53,6 +54,9 @@ function M.create(ctx)
function()
process.check_status()
end,
function()
mp.commandv("script-message", "subminer-stats-toggle")
end,
}
input.select({