Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to update label/text of a macro prompt dialog #2113

Closed
3b opened this issue Jan 11, 2025 · 2 comments
Closed

Add option to update label/text of a macro prompt dialog #2113

3b opened this issue Jan 11, 2025 · 2 comments
Labels
💡 Type: FR Requests a new feature

Comments

@3b
Copy link

3b commented Jan 11, 2025

Requested feature:

Add action:prompt_update_text and action:prompt_update_label or similar, that could be called between action:prompt_show and action:prompt_end to change state of currently displayed dialog.

Solves the following problem:

While writing macros that involve making incremental changes to state (like moving toolhead) or waiting for a while, it would be nice to be able to update the text of the dialog to show things like current position or remaining time without completely recreating the entire menu every time. Also allows factoring out the macros better, so the part doing the update doesn't need to know about the entire macro.

Additional information:

prompt_update_text would probably need some way to indicate which text to update if prompt_text was called multiple times, either just passing an index or adding some way to name the prompt_text.

@3b 3b added the 💡 Type: FR Requests a new feature label Jan 11, 2025
@3b
Copy link
Author

3b commented Jan 11, 2025

Possibly would be more reasonable to just recreate the dialog for every update if #2114 and #2115 were fixed, though would still allow for more flexibility in factoring the macros into pieces.

@meteyou
Copy link
Member

meteyou commented Jan 11, 2025

A command like this would not work, because it just render all commands between prompt_begin and prompt_show. So it would not read your command "update". It would also make it a lot of slower for rendering, because mainsail have to check every time the complete history, instead of the small part between "begin" and "show". so it have more negative values instead of positive possibilities.

so pls just rerender your new dialog with the new text.

@meteyou meteyou closed this as not planned Won't fix, can't repro, duplicate, stale Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💡 Type: FR Requests a new feature
Projects
None yet
Development

No branches or pull requests

2 participants