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

Export to SQF function do not allow for easy copying of large missions #789

Open
tova-cup opened this issue Jan 4, 2025 · 2 comments
Open
Labels
enhancement Improves an existing feature

Comments

@tova-cup
Copy link

tova-cup commented Jan 4, 2025

Is your enhancement related to a problem?
Currently, the export to SQF module allow to display the content of a mission into a SQF copy than can be run at a later time to restore the mission.

However, in its current state, the dialogue does not come with a "select all" nor "copy" button.

While it is not impactful if a mission contains only a couple of objects, it makes the use of the SQF code near impossible if the mission is large (hundreds of objects, units with custom loadouts, etc.) as the player will not be able to select the whole SQF code.

Solution you'd like:
Add either a "select all" or a "copy" button to the export SQF module's dialogue.

Alternatives you've considered:
As a "least effort" solution, automatically copy to clipboard the SQF code displayed with a tactical use of the copyToClipboard command.

Approach is not feasible as copyToClipboard only works on server.
See comment.

Additional context:
Please note that the following shortcuts do not work in the dialogue and do not allow to select all : Ctrl + A, Ctrl + Shift + End.

@tova-cup tova-cup added the enhancement Improves an existing feature label Jan 4, 2025
@mharis001
Copy link
Member

We do try to use the copyToClipboard command when it's available.

// Allow using button to copy text when copyToClipboard command is available
private _ctrlCopy = _display displayCtrl IDC_EXPORT_COPY;
if (isServer) then {
_ctrlCopy ctrlAddEventHandler ["ButtonClick", {
params ["_ctrlCopy"];
private _display = ctrlParent _ctrlCopy;
private _ctrlEdit = _display displayCtrl IDC_EXPORT_EDIT;
copyToClipboard ctrlText _ctrlEdit;
}];
} else {
_ctrlCopy ctrlShow false;
};

We would need to create an extension to solve this for situations where the command is not available.

@tova-cup
Copy link
Author

tova-cup commented Jan 5, 2025

My bad, I forgot about the fact that copyToClipboard only works on server. So I guess this approach is a bit of a dead end indeed.

I am not familiar enough with dialogs to evaluate the feasibility of a "select all button", but I think it might be the easiest (only?) way to make the export module "feature complete".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improves an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants