mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-06-19 14:54:07 +00:00
rogueviz:: intra-demos now use the new quickkey system
This commit is contained in:
parent
f5d4be5a8d
commit
8fcabb0fde
@ -452,80 +452,45 @@ void create_intra_sol() {
|
|||||||
|
|
||||||
map<int, cell*> starter;
|
map<int, cell*> starter;
|
||||||
|
|
||||||
bool vr_keys(int sym, int uni) {
|
void vrqm_ext() {
|
||||||
if(intra::in && !starter.count(intra::current)) starter[intra::current] = cwt.at;
|
if(intra::in && !starter.count(intra::current)) starter[intra::current] = cwt.at;
|
||||||
const Uint8 *keystate = SDL12_GetKeyState(NULL);
|
dialog::addItem("move to Euclidean", 'e');
|
||||||
#if CAP_SDL2
|
dialog::add_action([] {
|
||||||
if(keystate[SDL_SCANCODE_LALT] || keystate[SDL_SCANCODE_RALT])
|
println(hlog, "intra::current = ", intra::current);
|
||||||
#else
|
intra::switch_to(2);
|
||||||
if(keystate[SDLK_LALT] || keystate[SDLK_RALT])
|
if(starter.count(intra::current)) cwt.at = centerover = starter[intra::current];
|
||||||
#endif
|
fullcenter();
|
||||||
{
|
View = cspin90(0, 1);
|
||||||
if(sym == 'e' && intra::in) {
|
playermoved = false;
|
||||||
println(hlog, "intra::current = ", intra::current);
|
walking::handle();
|
||||||
intra::switch_to(2);
|
});
|
||||||
if(starter.count(intra::current)) cwt.at = centerover = starter[intra::current];
|
dialog::addItem("move to hyperbolic", 'h');
|
||||||
fullcenter();
|
dialog::add_action([] {
|
||||||
View = cspin90(0, 1);
|
intra::switch_to(0);
|
||||||
playermoved = false;
|
if(starter.count(intra::current)) cwt.at = centerover = starter[intra::current];
|
||||||
walking::handle();
|
fullcenter();
|
||||||
return true;
|
View = cspin90(0, 1);
|
||||||
}
|
playermoved = false;
|
||||||
if(sym == 'h' && intra::in) {
|
walking::handle();
|
||||||
intra::switch_to(0);
|
});
|
||||||
if(starter.count(intra::current)) cwt.at = centerover = starter[intra::current];
|
dialog::addItem("move to spherical", 's');
|
||||||
fullcenter();
|
dialog::add_action([] {
|
||||||
View = cspin90(0, 1);
|
intra::switch_to(6);
|
||||||
playermoved = false;
|
if(starter.count(intra::current)) cwt.at = centerover = starter[intra::current];
|
||||||
walking::handle();
|
fullcenter();
|
||||||
return true;
|
View = cspin90(0, 1);
|
||||||
}
|
playermoved = false;
|
||||||
if(sym == 's' && intra::in) {
|
walking::handle();
|
||||||
intra::switch_to(6);
|
});
|
||||||
if(starter.count(intra::current)) cwt.at = centerover = starter[intra::current];
|
dialog::addItem("move to Solv", 'y');
|
||||||
fullcenter();
|
dialog::add_action([] {
|
||||||
View = cspin90(0, 1);
|
intra::switch_to(3);
|
||||||
playermoved = false;
|
if(starter.count(intra::current)) cwt.at = centerover = starter[intra::current];
|
||||||
walking::handle();
|
fullcenter();
|
||||||
return true;
|
View = cspin90(0, 1);
|
||||||
}
|
playermoved = false;
|
||||||
if(sym == ',') {
|
walking::handle();
|
||||||
camera_speed *= 1.2;
|
});
|
||||||
println(hlog, "camera_speed set to ", camera_speed);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if(sym == '.') {
|
|
||||||
camera_speed /= 1.2;
|
|
||||||
println(hlog, "camera_speed set to ", camera_speed);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
#if CAP_VR
|
|
||||||
if(sym == 'a') {
|
|
||||||
vrhr::absolute_unit_in_meters *= 1.2;
|
|
||||||
walking::eye_level *= 1.2;
|
|
||||||
println(hlog, "vr absolute unit set to ", vrhr::absolute_unit_in_meters);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if(sym == 'z') {
|
|
||||||
vrhr::absolute_unit_in_meters /= 1.2;
|
|
||||||
walking::eye_level /= 1.2;
|
|
||||||
println(hlog, "vr absolute unit set to ", vrhr::absolute_unit_in_meters);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if(sym == 'w') {
|
|
||||||
walking::switch_walking();
|
|
||||||
println(hlog, "walking set to ", ONOFF(walking::on));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
#if CAP_VR
|
|
||||||
if(sym == 'x') {
|
|
||||||
vrhr::always_show_hud = false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// all generators will add to the current scene
|
// all generators will add to the current scene
|
||||||
@ -551,6 +516,7 @@ auto hooks =
|
|||||||
// generate Sol with floors to the current scene, runs autimatically
|
// generate Sol with floors to the current scene, runs autimatically
|
||||||
+ arg::add3("-intra-sol", create_intra_sol)
|
+ arg::add3("-intra-sol", create_intra_sol)
|
||||||
//+ arg::add3("-intra-more", create_intra_more);
|
//+ arg::add3("-intra-more", create_intra_more);
|
||||||
|
+ arg::add3("-fnkeys-portals", [] { rogueviz::rv_hook(vrhr::vr_quickmenu_extensions, 101, vrqm_ext); })
|
||||||
+ arg::add3("-intra-demo-floors", [] {
|
+ arg::add3("-intra-demo-floors", [] {
|
||||||
walking::colors_of_floors = {
|
walking::colors_of_floors = {
|
||||||
0xFFFF40, 0xD0D000,
|
0xFFFF40, 0xD0D000,
|
||||||
@ -582,7 +548,7 @@ auto hooks =
|
|||||||
slide_backup(vrhr::cscr, vrhr::eCompScreen::eyes);
|
slide_backup(vrhr::cscr, vrhr::eCompScreen::eyes);
|
||||||
)
|
)
|
||||||
starter.clear();
|
starter.clear();
|
||||||
rogueviz::rv_hook(hooks_handleKey, 101, vr_keys);
|
rogueviz::rv_hook(vrhr::vr_quickmenu_extensions, 101, vrqm_ext);
|
||||||
popScreenAll();
|
popScreenAll();
|
||||||
resetGL();
|
resetGL();
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user