Posts: 1,031
Threads: 246
Joined: Jul 2022
07-15-2024, 10:48 PM
(This post was last modified: 07-15-2024, 10:50 PM by Davider.)
I want to quickly disable a script/class in the project folder without deleting it, making it as if it doesn't exist. This is similar to the effect produced by pressing Ctrl+D in QM. I think this is a great feature. When I press Ctrl+D, a red prohibition symbol appears on the project's icon. When I press Ctrl+D again, the prohibition symbol disappears, and the file is re-enabled.
This feature is really useful and applies to other item types in LA as well.
Posts: 12,072
Threads: 140
Joined: Dec 2002
Where it can be useful? Do you want to place triggers (hotkey etc) in separate scripts, and then quickly disable/enable the trigger?
Posts: 1,031
Threads: 246
Joined: Jul 2022
07-16-2024, 02:25 PM
(This post was last modified: 07-16-2024, 02:28 PM by Davider.)
Yes, In QM, disabling macros and triggers with Ctrl+D is indeed very convenient.
there is another scenario. For instance, in a project, I've defined a library file. I want to create its second version, so I intend to disable the first version. I don't want to delete it. If I don't disable it, some variables or functions in the two library files might conflict. Or is there a better way to handle this?
Posts: 12,072
Threads: 140
Joined: Dec 2002
I usually move the old file or its clone from the project folder to somewhere else.
@Project
- MainFile
- ClassFile
Garbage
- ClassFile
- ClassFile2
- ...
Posts: 1,031
Threads: 246
Joined: Jul 2022
07-19-2024, 05:07 AM
(This post was last modified: 07-19-2024, 05:19 AM by Davider.)
Sometimes I need to switch back and forth between two versions of class files.
Still, under QM, pressing Ctrl+D is convenient.
Is it complex to implement? Is it feasible? Looking forward to it.
Another minor question, just out of curiosity:
In LA, renaming an item's filename requires pressing F2. Would it be difficult to implement a double-click feature like in QM for this purpose?
Posts: 12,072
Threads: 140
Joined: Dec 2002
07-19-2024, 05:21 AM
(This post was last modified: 07-19-2024, 05:22 AM by Gintaras.)
Unlikely this feature will be added soon.
Posts: 12,072
Threads: 140
Joined: Dec 2002
Quote:Sometimes I need to switch back and forth between two versions of class files.
Sometimes for it I use #if.
Project main file:
/*/ define TEST_NEW_CODE; /*/
//To switch back and forth quickly, change TEST_NEW_CODE eg to _TEST_NEW_CODE and back; /*/
OldClassFile:
#if !TEST_NEW_CODE
code
#endif
NewClassFile:
#if TEST_NEW_CODE
code
#endif
Or both code versions can be in the same file:
#if TEST_NEW_CODE
new code
#else
old code
#endif
Posts: 1,031
Threads: 246
Joined: Jul 2022
07-19-2024, 08:47 AM
(This post was last modified: 07-19-2024, 08:48 AM by Davider.)
Thanks for the solution you provided.
I have an idea:
When I press Ctrl+D, the bottom right corner of the icon of the currently selected item in the LA project list will display a disabled symbol.
Additionally, a new entry will be added to the first line comment of the file, for example:
/*/ disabled; /*/