forked from 1b-agent/opencadstudio-upstream
feat(select): Previous / Last keywords at Select objects prompts
Standard selection keywords, available typed or as prompt buttons in every gathering command (#426): P / PREVIOUS re-selects the set the last finishing command worked on (now captured before the working set is dropped), and L / LAST selects the most recently created object of the current space (highest handle among its selectable wires). Handled centrally in the step router, so the command line, the option buttons and the automation feeder share one implementation; deleted objects and locked layers are filtered out. Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
1 parent
d6b1307a0e
commit
84620852fe
4 files changed
+104
-1
No files matched your search
@@ -11,7 +11,7 @@
|
||||
use acadrust::Handle;
|
||||
use glam::DVec3;
|
||||
|
||||
use crate::command::{CadCommand, CmdResult};
|
||||
use crate::command::{CadCommand, CmdOption, CmdResult};
|
||||
use crate::scene::model::wire_model::WireModel;
|
||||
|
||||
pub struct SelectObjectsCommand {
|
||||
@@ -68,6 +68,18 @@ impl CadCommand for SelectObjectsCommand {
|
||||
true
|
||||
}
|
||||
|
||||
// Clickable selection keywords (#426): Previous re-selects the set the
|
||||
// last command worked on, Last the most recently created object. The
|
||||
// keywords are consumed centrally in `try_selection_keyword`, so they
|
||||
// also work typed — these buttons just surface them.
|
||||
fn options(&self) -> Vec<CmdOption> {
|
||||
if self.commit_on_enter {
|
||||
vec![CmdOption::new("Previous", "P"), CmdOption::new("Last", "L")]
|
||||
} else {
|
||||
Vec::new()
|
||||
}
|
||||
}
|
||||
|
||||
fn on_selection_complete(&mut self, handles: Vec<Handle>) -> CmdResult {
|
||||
if self.commit_on_enter {
|
||||
// Keep gathering: remember the running set and update the prompt.
|
||||
|
||||
Reference in new issue
Block a user