From 3f0dc27140502e141d297d00d885dd104b150508 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 6 May 2022 19:52:17 +0200 Subject: [PATCH] vr:: refactored vr_enable_button --- vr.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/vr.cpp b/vr.cpp index 53931f9c..32fb4817 100644 --- a/vr.cpp +++ b/vr.cpp @@ -1299,15 +1299,7 @@ EX void show_vr_demos() { dialog::display(); } -EX void show_vr_settings() { - cmode = sm::SIDE | sm::MAYDARK; - gamescreen(0); - dialog::init(XLAT("VR settings")); - - dialog::addItem(XLAT("VR demos"), 'D'); - dialog::add_action_push(show_vr_demos); - - +EX void vr_enable_button() { dialog::addBoolItem(XLAT("VR enabled"), enabled, 'o'); dialog::add_action([] { enabled = !enabled; @@ -1318,6 +1310,17 @@ EX void show_vr_settings() { dialog::addInfo(XLAT("error: ") + error_msg, 0xC00000); else dialog::addInfo(XLAT("VR initialized correctly"), 0x00C000); + } + +EX void show_vr_settings() { + cmode = sm::SIDE | sm::MAYDARK; + gamescreen(0); + dialog::init(XLAT("VR settings")); + + dialog::addItem(XLAT("VR demos"), 'D'); + dialog::add_action_push(show_vr_demos); + + vr_enable_button(); dialog::addBreak(100);