Route VR mode through app preferences

This commit is contained in:
2026-06-04 14:22:39 +02:00
parent f8243566c4
commit 884a6d4940
8 changed files with 79 additions and 23 deletions

View File

@@ -1159,18 +1159,13 @@ void App::init_menu_tools()
vr_btn->find<NodeCheckBox>("tools-vr-check")->on_value_changed = [this, main](Node* target, bool checked)
{
if (checked)
{
if (!vr_start())
{
auto cb = static_cast<NodeCheckBox*>(target);
cb->set_value(false);
message_box("VR Failed", "Couldn't start Virtual Reality mode");
}
}
else
{
vr_stop();
const auto status = pp::panopainter::execute_legacy_vr_mode_preference(
*this,
checked);
if (!status.ok()) {
auto cb = static_cast<NodeCheckBox*>(target);
cb->set_value(false);
message_box("VR Failed", "Couldn't start Virtual Reality mode");
}
};
}