Hidden scripts

Features wanted...
Post Reply
jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Hidden scripts

Post by jacky »

So as it is now we can hide scripts in script files of course, simply by giving them no caption and a label starting with an underscore. I'd like it very much if we could drop the "no caption" part and only make it that if the label starts with an underscore it's hidden, caption or not.

The benefit being that one could have a somewhat big menu on a script file, but only the main items would be shown when loaded, and to load the full menu (or any hidden items) one would have to use command load specifying the items. Would be a much better solution than our current way, which is loading the file loads the entire thing, and to only get the main/most used commands one needs to specify it on the loading command (as so use one, e.g. not possible with Scripting|Load Script File... or Load Selected Script File.
Proud XYplorer Fanatic

admin
Site Admin
Posts: 66307
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Hidden scripts

Post by admin »

Yo, makes total sense. Done.

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Re: Hidden scripts

Post by jacky »

admin wrote:Yo, makes total sense. Done.
Thanks a lot! :D

Little bug there : separators are ignored if they don't come after a visible menu :

Code: Select all

"you see this"
  msg "hi";
"secret : _hidden"
  msg "you don't see this one";
-
"Cancel"
No separator is shown on that one :?
Proud XYplorer Fanatic

admin
Site Admin
Posts: 66307
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Hidden scripts

Post by admin »

jacky wrote:
admin wrote:Yo, makes total sense. Done.
Thanks a lot! :D

Little bug there : separators are ignored if they don't come after a visible menu :

Code: Select all

"you see this"
  msg "hi";
"secret : _hidden"
  msg "you don't see this one";
-
"Cancel"
No separator is shown on that one :?
Oh yes! Fixed.

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Re: Hidden scripts

Post by jacky »

Another thing that'd be nice, on that matter :
we have ::load *; to show "visible" items (of current script file), and we can do ::load *, "label1;-;_label2;label3"; to specify which one we wants, so what would be really nice would be to add support for * as label so ::load *, *; would show all (visible+hidden) items!
Proud XYplorer Fanatic

admin
Site Admin
Posts: 66307
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Hidden scripts

Post by admin »

jacky wrote:Another thing that'd be nice, on that matter :
we have ::load *; to show "visible" items (of current script file), and we can do ::load *, "label1;-;_label2;label3"; to specify which one we wants, so what would be really nice would be to add support for * as label so ::load *, *; would show all (visible+hidden) items!
Goody, done. 8)

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Re: Hidden scripts

Post by jacky »

admin wrote:
jacky wrote:Another thing that'd be nice, on that matter :
we have ::load *; to show "visible" items (of current script file), and we can do ::load *, "label1;-;_label2;label3"; to specify which one we wants, so what would be really nice would be to add support for * as label so ::load *, *; would show all (visible+hidden) items!
Goody, done. 8)
Yep, except that this will now show all scripts, and I wish it would only show items, i.e. those with a caption. Meaning that hidden/internal scripts (i.e. no caption and a label starting with underscore) would remain hidden, because they are usually not meant to be shown/called manually.

Code: Select all

"Smthg : foo"
  msg "foo";
"- : _sep"
"Hidden : _bar"
  sub confirm("Are you sure?") ? "_doIt" : "nothing";
"_doIt"
  msg "bar";
-
"Full menu..."
  load *,*;
"Cancel : nothing"
In that example, script _doIt should not be shown by load *,* because while _sep and _bar are hidden items, _doIt is an hidden/internal script, and isn't meant to ever be manually triggered (or else we'd give it a caption).
Proud XYplorer Fanatic

admin
Site Admin
Posts: 66307
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Hidden scripts

Post by admin »

jacky wrote:
admin wrote:
jacky wrote:Another thing that'd be nice, on that matter :
we have ::load *; to show "visible" items (of current script file), and we can do ::load *, "label1;-;_label2;label3"; to specify which one we wants, so what would be really nice would be to add support for * as label so ::load *, *; would show all (visible+hidden) items!
Goody, done. 8)
Yep, except that this will now show all scripts, and I wish it would only show items, i.e. those with a caption. Meaning that hidden/internal scripts (i.e. no caption and a label starting with underscore) would remain hidden, because they are usually not meant to be shown/called manually.

Code: Select all

"Smthg : foo"
  msg "foo";
"- : _sep"
"Hidden : _bar"
  sub confirm("Are you sure?") ? "_doIt" : "nothing";
"_doIt"
  msg "bar";
-
"Full menu..."
  load *,*;
"Cancel : nothing"
In that example, script _doIt should not be shown by load *,* because while _sep and _bar are hidden items, _doIt is an hidden/internal script, and isn't meant to ever be manually triggered (or else we'd give it a caption).
Yep, makes sense.

Post Reply