Drive Joints says where and why a drive stopped short (#1169)

Drive Joints says where and why a drive stopped short.
This commit is contained in:
Mateusz Sych authored and GitHub committed 2026-10-14 17:56:21 -04:00
1 parent 5744b1f327
commit 01b1b70586
12 files changed
+165 -9

No files matched your search

+16 -6
View File
@@ -3030,7 +3030,7 @@ fn sels(d: &Dialog, i: usize) -> &[Sel] {
d.inputs.get(i).map(|x| x.items.as_slice()).unwrap_or(&[])
}
fn run_dialog(app: &mut SolveApp, d: &Dialog) -> Result<(), String> {
pub(crate) fn run_dialog(app: &mut SolveApp, d: &Dialog) -> Result<(), String> {
let commands = apply_commands(app, d)?;
// The live preview may be computing these very commands: OK takes its result.
crate::preview::settle(app, &commands);
@@ -3039,12 +3039,22 @@ fn run_dialog(app: &mut SolveApp, d: &Dialog) -> Result<(), String> {
roll_marker(app, marker)?;
}
for (cmd, params) in commands {
if let Err(error) = app.run(&cmd, params) {
if let Some((id, _)) = d.editing {
let position = app.session.doc.feature_index(id);
let _ = roll_marker(app, position);
match app.run(&cmd, params) {
Ok(reply) => {
// A drive that stopped short says where, and why.
if cmd == "joint.drive"
&& let Some(why) = crate::dialogs_assembly::drive_stop(&app.session, &reply)
{
app.set_status(why, false);
}
}
Err(error) => {
if let Some((id, _)) = d.editing {
let position = app.session.doc.feature_index(id);
let _ = roll_marker(app, position);
}
return Err(error);
}
return Err(error);
}
}
Ok(())