From f63d06b648018166b3bfd3365bd5941b1524244e Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 17 Nov 2024 17:01:44 +0100 Subject: [PATCH] vr:: better quickkeys for model viewing --- vr.cpp | 46 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/vr.cpp b/vr.cpp index 2cb70bb9..c98cf1b3 100644 --- a/vr.cpp +++ b/vr.cpp @@ -1658,18 +1658,40 @@ auto hookvr = addHook(vr_quickmenu_extensions, 100, [] { dialog::add_action([] { camera_speed /= 1.2; println(hlog, "camera_speed = ", camera_speed); }); #if CAP_VR if(vr::active()) { - dialog::addSelItem(XLAT("increase absolute unit"), 'a', fts(vrhr::absolute_unit_in_meters)); - dialog::add_action([] { - vrhr::absolute_unit_in_meters *= 1.2; - walking::eye_level *= 1.2; - println(hlog, "vr absolute unit set to ", vrhr::absolute_unit_in_meters); - }); - dialog::addSelItem(XLAT("increase absolute unit"), 'z', fts(vrhr::absolute_unit_in_meters)); - dialog::add_action([] { - vrhr::absolute_unit_in_meters /= 1.2; - walking::eye_level /= 1.2; - println(hlog, "vr absolute unit set to ", vrhr::absolute_unit_in_meters); - }); + if(in_perspective()) { + dialog::addSelItem(XLAT("increase absolute unit"), 'a', fts(vrhr::absolute_unit_in_meters)); + dialog::add_action([] { + vrhr::absolute_unit_in_meters *= 1.2; + walking::eye_level *= 1.2; + println(hlog, "vr absolute unit set to ", vrhr::absolute_unit_in_meters); + }); + dialog::addSelItem(XLAT("decrease absolute unit"), 'z', fts(vrhr::absolute_unit_in_meters)); + dialog::add_action([] { + vrhr::absolute_unit_in_meters /= 1.2; + walking::eye_level /= 1.2; + println(hlog, "vr absolute unit set to ", vrhr::absolute_unit_in_meters); + }); + } + else { + dialog::addSelItem(XLAT("increase model size"), 'a', fts(pconf.vr_scale_factor)); + dialog::add_action([] { + pconf.vr_scale_factor *= 1.2; + println(hlog, "vr scale factor set to ", pconf.vr_scale_factor); + }); + dialog::addSelItem(XLAT("decrease model size"), 'z', fts(pconf.vr_scale_factor)); + dialog::add_action([] { + pconf.vr_scale_factor *= 1.2; + println(hlog, "vr scale factor set to ", pconf.vr_scale_factor); + }); + dialog::addBoolItem(XLAT("increase Z-shift"), 'c', fts(pconf.vr_zshift)); + dialog::add_action([] { + pconf.vr_zshift += 0.5; + }); + dialog::addBoolItem(XLAT("decrease Z-shift"), 'd', fts(pconf.vr_zshift)); + dialog::add_action([] { + pconf.vr_zshift -= 0.5; + }); + } dialog::addBoolItem(XLAT("always show HUD"), 'x', always_show_hud); dialog::add_action([] { always_show_hud = !always_show_hud;