1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-01-22 23:17:04 +00:00

move_to function

This commit is contained in:
Zeno Rogue 2021-08-23 15:56:45 +02:00
parent 711ae44605
commit e5aa10df83

View File

@ -159,6 +159,17 @@ void irradiate() {
cleanup_protomap();
}
void move_to(cellwalker cw) {
cwt = cw;
centerover = cwt.at;
View = Id;
}
void move_to(twalker dw) {
auto m = dynamic_cast<hrmap_testproto*> (currentmap);
move_to(cellwalker(m->clone(dw.at)->c7, dw.spin, dw.mirrored));
}
void debug_menu() {
cmode = sm::SIDE | sm::MAYDARK;
gamescreen(0);
@ -216,10 +227,8 @@ void debug_menu() {
dialog::init();
for(auto dw: debuglist) {
dialog::addItem("go to " + index_pointer(dw.at), 'a');
dialog::add_action([dw,m] {
cwt = cellwalker(m->clone(dw.at)->c7, dw.spin, dw.mirrored);
centerover = cwt.at;
View = Id;
dialog::add_action([dw] {
move_to(dw);
});
}
dialog::display();