Previous topicNext topic

GLSLShader 'Select A File' : Add *.txt filter & lastpath

Suggestions for new features for Magic.
Post Reply
Terry Payman
Posts: 711
Joined: Sun Sep 14, 2014 8:15 am
Location: UK
Contact:

GLSLShader 'Select A File' : Add *.txt filter & lastpath

Post by Terry Payman »

GLSLShader 'Select A File' dialog box:

1) Default filter of "*.txt" in addition to the present "*.*"
Particularly helpful when picking shader files from amongst other types of file, eg when browsing in a "Collected Assets" folder.

2) Remember "lastpath" for the selected file.
It's a hassle having to repeatedly enter a path that differs from the (install?) default. Copy/paste of a module that "knows" the path is an inelegant workaround.

Filter and lastpath work very nicely for the Open Project (.magic) dialog. :D
Don't you just hate inconsistency? ;)
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: GLSLShader 'Select A File' : Add *.txt filter & lastpath

Post by Magic »

Of course! Thanks for that. :)
Sadler
Posts: 1142
Joined: Sat Aug 02, 2014 7:10 pm
Location: London, UK

Re: GLSLShader 'Select A File' : Add *.txt filter & lastpath

Post by Sadler »

All my gl shader files have a .glsl extension!
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: GLSLShader 'Select A File' : Add *.txt filter & lastpath

Post by Magic »

No problem, I'll add that extension too. :)
Terry Payman
Posts: 711
Joined: Sun Sep 14, 2014 8:15 am
Location: UK
Contact:

Re: GLSLShader 'Select A File' : Add *.txt filter & lastpath

Post by Terry Payman »

If the default filter is "*.*" no-one will have extra clicks unless they want/need to filter. Would be fine by me.
Otherwise perhaps add a configuration option for an arbitary default filter or a "LastFilter" memory.
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: GLSLShader 'Select A File' : Add *.txt filter & lastpath

Post by Magic »

2) Remember "lastpath" for the selected file.
It's a hassle having to repeatedly enter a path that differs from the (install?) default. Copy/paste of a module that "knows" the path is an inelegant workaround.
Hmm. I definitely see how this is an issue. I'm trying to think of a way around it, but the problem is that if a file is already being used in a module, the chooser path is always the path of the file.

For the GLSLShader module, it's important that the default file be loaded when the module is created.

Any thoughts on how to improve this?
Terry Payman
Posts: 711
Joined: Sun Sep 14, 2014 8:15 am
Location: UK
Contact:

Re: GLSLShader 'Select A File' : Add *.txt filter & lastpath

Post by Terry Payman »

Is it sufficient to look at whether the chooser/path has been triggered by the MouseUp event on the GLSLShader's file box?

- or perhaps just "push" a path to the default file when the module is created by Add>Special>GLSLShader, and "pop" back to the user's lastpath afterwards?
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: GLSLShader 'Select A File' : Add *.txt filter & lastpath

Post by Magic »

If "file.ext" is the module's current file, no matter what module it is, it will be the default selection when the file chooser is opened.

The behavior you're looking for would be what happens if no file is selected when the module is created. That's how it works for Video, Image, Model, etc. So I guess I could add an option somewhere to not load files in any modules by default?

EDIT: I tried that and it worked perfectly. So it'll be in the next version :)
Terry Payman
Posts: 711
Joined: Sun Sep 14, 2014 8:15 am
Location: UK
Contact:

Re: GLSLShader 'Select A File' : Add *.txt filter & lastpath

Post by Terry Payman »

:D Sounds perfect, if I have understood correctly. I look forward to trying it!
Many thanks Eric! :D
Post Reply