mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-27 06:27:17 +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;
|
||||
|
||||
bool vr_keys(int sym, int uni) {
|
||||
void vrqm_ext() {
|
||||
if(intra::in && !starter.count(intra::current)) starter[intra::current] = cwt.at;
|
||||
const Uint8 *keystate = SDL12_GetKeyState(NULL);
|
||||
#if CAP_SDL2
|
||||
if(keystate[SDL_SCANCODE_LALT] || keystate[SDL_SCANCODE_RALT])
|
||||
#else
|
||||
if(keystate[SDLK_LALT] || keystate[SDLK_RALT])
|
||||
#endif
|
||||
{
|
||||
if(sym == 'e' && intra::in) {
|
||||
println(hlog, "intra::current = ", intra::current);
|
||||
intra::switch_to(2);
|
||||
if(starter.count(intra::current)) cwt.at = centerover = starter[intra::current];
|
||||
fullcenter();
|
||||
View = cspin90(0, 1);
|
||||
playermoved = false;
|
||||
walking::handle();
|
||||
return true;
|
||||
}
|
||||
if(sym == 'h' && intra::in) {
|
||||
intra::switch_to(0);
|
||||
if(starter.count(intra::current)) cwt.at = centerover = starter[intra::current];
|
||||
fullcenter();
|
||||
View = cspin90(0, 1);
|
||||
playermoved = false;
|
||||
walking::handle();
|
||||
return true;
|
||||
}
|
||||
if(sym == 's' && intra::in) {
|
||||
intra::switch_to(6);
|
||||
if(starter.count(intra::current)) cwt.at = centerover = starter[intra::current];
|
||||
fullcenter();
|
||||
View = cspin90(0, 1);
|
||||
playermoved = false;
|
||||
walking::handle();
|
||||
return true;
|
||||
}
|
||||
if(sym == ',') {
|
||||
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;
|
||||
dialog::addItem("move to Euclidean", 'e');
|
||||
dialog::add_action([] {
|
||||
println(hlog, "intra::current = ", intra::current);
|
||||
intra::switch_to(2);
|
||||
if(starter.count(intra::current)) cwt.at = centerover = starter[intra::current];
|
||||
fullcenter();
|
||||
View = cspin90(0, 1);
|
||||
playermoved = false;
|
||||
walking::handle();
|
||||
});
|
||||
dialog::addItem("move to hyperbolic", 'h');
|
||||
dialog::add_action([] {
|
||||
intra::switch_to(0);
|
||||
if(starter.count(intra::current)) cwt.at = centerover = starter[intra::current];
|
||||
fullcenter();
|
||||
View = cspin90(0, 1);
|
||||
playermoved = false;
|
||||
walking::handle();
|
||||
});
|
||||
dialog::addItem("move to spherical", 's');
|
||||
dialog::add_action([] {
|
||||
intra::switch_to(6);
|
||||
if(starter.count(intra::current)) cwt.at = centerover = starter[intra::current];
|
||||
fullcenter();
|
||||
View = cspin90(0, 1);
|
||||
playermoved = false;
|
||||
walking::handle();
|
||||
});
|
||||
dialog::addItem("move to Solv", 'y');
|
||||
dialog::add_action([] {
|
||||
intra::switch_to(3);
|
||||
if(starter.count(intra::current)) cwt.at = centerover = starter[intra::current];
|
||||
fullcenter();
|
||||
View = cspin90(0, 1);
|
||||
playermoved = false;
|
||||
walking::handle();
|
||||
});
|
||||
}
|
||||
|
||||
// all generators will add to the current scene
|
||||
@ -551,6 +516,7 @@ auto hooks =
|
||||
// generate Sol with floors to the current scene, runs autimatically
|
||||
+ arg::add3("-intra-sol", create_intra_sol)
|
||||
//+ 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", [] {
|
||||
walking::colors_of_floors = {
|
||||
0xFFFF40, 0xD0D000,
|
||||
@ -582,7 +548,7 @@ auto hooks =
|
||||
slide_backup(vrhr::cscr, vrhr::eCompScreen::eyes);
|
||||
)
|
||||
starter.clear();
|
||||
rogueviz::rv_hook(hooks_handleKey, 101, vr_keys);
|
||||
rogueviz::rv_hook(vrhr::vr_quickmenu_extensions, 101, vrqm_ext);
|
||||
popScreenAll();
|
||||
resetGL();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user