mirror of
https://github.com/baketnk/frame-yap.git
synced 2026-10-06 10:00:05 +02:00
Consolidate VR UI with Inconsolata neon styling and mount settings
This commit is contained in:
1 parent
417f81cb09
commit
1ba0f26e0e
19 files changed
+1179
-245
No files matched your search
+23
-8
@@ -15,12 +15,15 @@ namespace {
|
||||
void help() {
|
||||
std::cout << "FrameYap — standalone Steam Frame voice typing POC\n"
|
||||
"Usage: frameyap [--help | --version]\n"
|
||||
" --run --assets DIR --font FILE --worker FILE --model DIR\n"
|
||||
" [--python FILE] [--threads 2|4] [--socket gamescope-0] [--head]\n"
|
||||
" --run --assets DIR [--font FILE] --worker FILE --model DIR\n"
|
||||
" [--python FILE] [--threads 2|4] [--socket gamescope-0] [--mount MODE]\n"
|
||||
" --register MANIFEST [--autostart] | --unregister MANIFEST\n"
|
||||
" --check-input [--socket gamescope-0] (discovery only, no typing)\n"
|
||||
" --check-overlay --assets DIR --font FILE [--head] (5s, no mic/input)\n"
|
||||
" --check-controls --assets DIR --font FILE [--head] (30s, gestures only)\n\n"
|
||||
" --check-overlay --assets DIR [--font FILE] [--mount MODE] (5s, no mic/input)\n"
|
||||
" --check-controls --assets DIR [--font FILE] [--mount MODE] (30s, gestures only)\n\n"
|
||||
"Mount: world (first-launch default), left-wrist, right-wrist, head.\n"
|
||||
"Settings save the mount; --mount overrides it for this launch. --head is an alias.\n"
|
||||
"Font defaults to bundled Inconsolata in the assets directory.\n"
|
||||
"Right grip: double-tap, hold second squeeze to speak, release to review.\n"
|
||||
"Left grip: double-tap for explicit Enter. Bindings are remappable.\n"
|
||||
"Review first: Insert approves current focus; never automatic Enter.\n"
|
||||
@@ -49,12 +52,16 @@ int main(int argc, char** argv) {
|
||||
options.socket = socket && *socket ? socket : "gamescope-0";
|
||||
for (int i = 2; i < argc; ++i) {
|
||||
std::string_view arg = argv[i];
|
||||
if (arg == "--head" && mode != "--check-input") { options.hand = false; continue; }
|
||||
if (arg == "--head" && mode != "--check-input") { options.mount = frameyap::Mount::Head; continue; }
|
||||
if (i + 1 == argc) throw std::runtime_error("Missing option value");
|
||||
std::string value = argv[++i];
|
||||
if (arg == "--socket" && mode != "--check-overlay") options.socket = value;
|
||||
else if (arg == "--assets" && mode != "--check-input") options.assets = value;
|
||||
else if (arg == "--font" && mode != "--check-input") options.font = value;
|
||||
else if (arg == "--mount" && mode != "--check-input") {
|
||||
options.mount = frameyap::parse_mount(value);
|
||||
if (!options.mount) throw std::runtime_error("Mount must be world, left-wrist, right-wrist or head");
|
||||
}
|
||||
else if (arg == "--worker" && mode == "--run") options.worker = value;
|
||||
else if (arg == "--python" && mode == "--run") options.python = value;
|
||||
else if (arg == "--model" && mode == "--run") options.model = value;
|
||||
@@ -66,10 +73,10 @@ int main(int argc, char** argv) {
|
||||
frameyap::TextInput input(options.socket);
|
||||
std::cout << "Gamescope IME v2 ready; no input delivered.\n"; return 0;
|
||||
}
|
||||
if (options.assets.empty() || options.font.empty()) throw std::runtime_error("--assets and --font required");
|
||||
if (options.assets.empty()) throw std::runtime_error("--assets required");
|
||||
if (mode == "--check-overlay" || mode == "--check-controls") {
|
||||
frameyap::InstanceLock lock;
|
||||
frameyap::Overlay overlay(options.assets, options.font, options.hand);
|
||||
frameyap::Overlay overlay(options.assets, options.font, options.mount);
|
||||
overlay.draw({"FrameYap five-second visual check", "No audio captured. No text or Enter delivered.", "Controls inactive during this check.", false, false});
|
||||
for (vr::TrackedDeviceIndex_t i = 0; i < vr::k_unMaxTrackedDeviceCount; ++i) {
|
||||
if (vr::VRSystem()->GetTrackedDeviceClass(i) != vr::TrackedDeviceClass_Controller) continue;
|
||||
@@ -95,7 +102,15 @@ int main(int argc, char** argv) {
|
||||
if (next != status) { status = next; std::cout << status << std::endl; }
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||
}
|
||||
} else std::this_thread::sleep_for(std::chrono::seconds(5));
|
||||
} else {
|
||||
const auto end = std::chrono::steady_clock::now() + std::chrono::seconds(5);
|
||||
while (std::chrono::steady_clock::now() < end) {
|
||||
for (auto action : overlay.poll()) if (action == frameyap::UiAction::Quit) return 0;
|
||||
overlay.draw({"FrameYap five-second visual check", "No audio captured. No text or Enter delivered.",
|
||||
"Actions are diagnostic only during this check.", false, false});
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||
}
|
||||
}
|
||||
std::cout << "Overlay APIs accepted panel; physical visibility requires human confirmation.\n"; return 0;
|
||||
}
|
||||
if (options.worker.empty() || options.model.empty()) throw std::runtime_error("--worker and --model required");
|
||||
|
||||
Reference in new issue
Block a user