mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-07-27 04:52:50 +00:00
rogueviz::ascending-descending:: rv_hook used
This commit is contained in:
parent
6ed4b564ef
commit
c9b59877eb
@ -4,10 +4,10 @@ namespace hr {
|
|||||||
|
|
||||||
namespace ply {
|
namespace ply {
|
||||||
|
|
||||||
bool in, animated;
|
|
||||||
|
|
||||||
using namespace rogueviz::objmodels;
|
using namespace rogueviz::objmodels;
|
||||||
|
|
||||||
|
bool animated;
|
||||||
|
|
||||||
hyperpoint A = point31(9.7, -38.1, 10.116);
|
hyperpoint A = point31(9.7, -38.1, 10.116);
|
||||||
hyperpoint B = point31(17.3, -38.1, 10.95);
|
hyperpoint B = point31(17.3, -38.1, 10.95);
|
||||||
hyperpoint C = point31(17.3, -46.1, 11.75);
|
hyperpoint C = point31(17.3, -46.1, 11.75);
|
||||||
@ -207,8 +207,6 @@ model staircase("rogueviz/nil/", "aco.obj", nilize);
|
|||||||
|
|
||||||
bool draw_ply() {
|
bool draw_ply() {
|
||||||
|
|
||||||
if(!in) return false;
|
|
||||||
|
|
||||||
if(nil) prepare_nilform();
|
if(nil) prepare_nilform();
|
||||||
|
|
||||||
staircase.render(ggmatrix(currentmap->gamestart()));
|
staircase.render(ggmatrix(currentmap->gamestart()));
|
||||||
@ -246,13 +244,14 @@ void show() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void o_key(o_funcs& v) {
|
void o_key(o_funcs& v) {
|
||||||
if(in) v.push_back(named_dialog("Ascending & Descending", show));
|
v.push_back(named_dialog("Ascending & Descending", show));
|
||||||
}
|
}
|
||||||
|
|
||||||
auto plyhook = addHook(hooks_frame, 100, draw_ply)
|
void enable() {
|
||||||
|
rogueviz::rv_hook(hooks_frame, 100, draw_ply);
|
||||||
+ addHook(anims::hooks_anim, 100, [] {
|
rogueviz::rv_hook(hooks_o_key, 80, o_key);
|
||||||
if(!in || !animated) return;
|
rogueviz::rv_hook(anims::hooks_anim, 100, [] {
|
||||||
|
if(!animated) return;
|
||||||
usecache = false;
|
usecache = false;
|
||||||
ld t = ticks * 1. / anims::period;
|
ld t = ticks * 1. / anims::period;
|
||||||
t = t - floor(t);
|
t = t - floor(t);
|
||||||
@ -266,30 +265,14 @@ auto plyhook = addHook(hooks_frame, 100, draw_ply)
|
|||||||
);
|
);
|
||||||
|
|
||||||
anims::moved();
|
anims::moved();
|
||||||
})
|
});
|
||||||
|
|
||||||
+ addHook(hooks_o_key, 80, o_key)
|
|
||||||
|
|
||||||
#if CAP_COMMANDLINE
|
|
||||||
+ addHook(hooks_args, 100, [] {
|
|
||||||
using namespace arg;
|
|
||||||
|
|
||||||
if(0) ;
|
|
||||||
else if(argis("-asd")) {
|
|
||||||
in = true;
|
|
||||||
}
|
}
|
||||||
else if(argis("-asd-prec")) {
|
|
||||||
shift(); prec = argi();
|
auto plyhook =
|
||||||
}
|
arg::add3("-asd", enable) +
|
||||||
else if(argis("-asd-anim")) {
|
addHook(hooks_configfile, 100, [] {
|
||||||
in = true;
|
param_b(animated, "ad_animated");
|
||||||
animated = true;
|
});
|
||||||
}
|
|
||||||
else return 1;
|
|
||||||
return 0;
|
|
||||||
})
|
|
||||||
#endif
|
|
||||||
;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,8 @@ namespace pentaroll {
|
|||||||
}
|
}
|
||||||
|
|
||||||
namespace ply {
|
namespace ply {
|
||||||
extern bool animated, in;
|
extern bool animated;
|
||||||
|
void enable();
|
||||||
extern rogueviz::objmodels::model staircase;
|
extern rogueviz::objmodels::model staircase;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -392,7 +393,7 @@ void ply_slide(tour::presmode mode, eGeometry geom, eModel md, bool anim) {
|
|||||||
if(mode == pmStart) {
|
if(mode == pmStart) {
|
||||||
set_geometry(geom);
|
set_geometry(geom);
|
||||||
start_game();
|
start_game();
|
||||||
tour::slide_backup(ply::in, true);
|
ply::enable();
|
||||||
tour::slide_backup(anims::period, 40000.);
|
tour::slide_backup(anims::period, 40000.);
|
||||||
tour::slide_backup(mapeditor::drawplayer, false);
|
tour::slide_backup(mapeditor::drawplayer, false);
|
||||||
tour::slide_backup(pconf.rotational_nil, 0.);
|
tour::slide_backup(pconf.rotational_nil, 0.);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user