mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-08-03 12:23:56 +00:00
nilrider:: planning:: insert command now lets to drag to set vel
This commit is contained in:
parent
a5313d24c4
commit
523e000664
@ -269,14 +269,20 @@ bool level::handle_planning(int sym, int uni) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
case 'i': {
|
case 'i': {
|
||||||
if(uni == '-') {
|
if(uni == '-' && !holdmouse) {
|
||||||
planpoint pt(C0, C0);
|
planpoint pt(C0, C0);
|
||||||
pt.at = get_spline(closest_t);
|
pt.at = get_spline(closest_t);
|
||||||
pt.vel = (get_spline(closest_t + 1e-3) - pt.at) / 1e-3;
|
pt.vel = hpxy(0, 0);
|
||||||
plan.insert(plan.begin() + int(ceil(closest_t)), pt);
|
plan.insert(plan.begin() + int(ceil(closest_t)), pt);
|
||||||
|
move_id = int(ceil(closest_t));
|
||||||
|
holdmouse = true;
|
||||||
clean_history_to(int(closest_t));
|
clean_history_to(int(closest_t));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else if(uni == '-' && holdmouse) {
|
||||||
|
plan[move_id].vel = mousept - plan[move_id].at;
|
||||||
|
clean_history_to(move_id - 1);
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user