Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

File Browser Save/Load UI

Discussion in 'Assets and Asset Store' started by petrucio, Oct 8, 2012.

  1. petrucio

    petrucio

    Joined:
    Aug 30, 2011
    Posts:
    126
    Last edited: Nov 3, 2012
  2. petrucio

    petrucio

    Joined:
    Aug 30, 2011
    Posts:
    126
    Planned Updates:
    - Multiple selection
    - Mobile / touch support
     
  3. Psyche_RTS

    Psyche_RTS

    Joined:
    Oct 8, 2012
    Posts:
    26
    Hi Petrucio!

    We just bought your plugin, and the load function doesn't seem to work well.
    Is there something special to do before loading a saved scene?

    By the way, good work for your addon.

    Thanks.

    Ced.
     
  4. petrucio

    petrucio

    Joined:
    Aug 30, 2011
    Posts:
    126
    Hi Psyche_RTS, thanks for buying our File Browser! Sorry it took me this long to respond, I only saw your post now.

    The Save and Load modes only handle the screenshots automatically - the actual saving and loading must be done by you, using the file names returned by the File Browser. There are some good packages in the asset store to help with that.
     
  5. petrucio

    petrucio

    Joined:
    Aug 30, 2011
    Posts:
    126
    I did end up finding a bug in the Load mode that made it return the name of the screenshot file instead of the data file.

    I'll get it fixed in an update next week.
     
  6. koushik.s

    koushik.s

    Joined:
    Dec 10, 2012
    Posts:
    6
    will it work for mobiles? if yes i'm ready to buy this plug in...
     
  7. petrucio

    petrucio

    Joined:
    Aug 30, 2011
    Posts:
    126
    @koushik.s:

    Right now it doesn't work on touch-based devices. I plan on adding that to a later version, but I don't have time to do that in the near future - sorry.
     
  8. jeroenhmg

    jeroenhmg

    Joined:
    Sep 15, 2010
    Posts:
    3
    Recently bought this and am generally happy - but I have one question: what to do to get the "Drives" to work? On MacOS and Windows this causes an error: "Unable to access drive %%ROOT%%".
    I have modified some other (minor and unrelated) code in FileBrowser.cs.

    Ok, I have managed to get this working on Windows by modifying (adding) some code into the FileBrowser.cs code.
    Now to get the Mac side working... Let me know if I can publish the code change here for others.
     
    Last edited: Jan 28, 2013
  9. petrucio

    petrucio

    Joined:
    Aug 30, 2011
    Posts:
    126
    Thanks for buying, jeroenhmg. I'll take a look into the %%ROOT%% issue tomorrow and will get back to you then.
     
  10. jeroenhmg

    jeroenhmg

    Joined:
    Sep 15, 2010
    Posts:
    3
    Thanks Petrucio, let me know if you want to have a look at my changes (which fixed the issue for Windows)
     
  11. petrucio

    petrucio

    Joined:
    Aug 30, 2011
    Posts:
    126
    Sure, you can publish them here - thanks.

    I'm not sure I'll be able to get my hands on a Mac tomorrow - how soon do you need it fixed for MacOS?
     
  12. jeroenhmg

    jeroenhmg

    Joined:
    Sep 15, 2010
    Posts:
    3
    MacOS not urgent -> client will be running exe on Windows machines.

    My change for getting it to work on Windows: in the function SwitchDirectory() replace:

    Code (csharp):
    1.  
    2.         this.currentDirectory  = Path.GetFullPath(this.newDirectory);
    3.  
    with:

    Code (csharp):
    1.  
    2.         if (this.newDirectory == "%%ROOT%%") {
    3.             this.currentDirectory = this.newDirectory;
    4.         }
    5.         else {
    6.             this.currentDirectory = Path.GetFullPath(this.newDirectory);
    7.         }
    8.  
    In addition to solve a weird screen corruption (error box related) that was happening when "Drives" was selected I also changed the following in OnGUI() (approximately on line 817):

    Code (csharp):
    1.             string text = this.userError;
    2.             string filename = Path.Combine(this.currentDirectory, this.files[this.selectedFile]);
    3.  
    to:

    Code (csharp):
    1.             string text = this.userError;
    2.             string filename;
    3.             if(this.selectedFile > -1) {
    4.                 filename = Path.Combine(this.currentDirectory, this.files[this.selectedFile]);
    5.             }
    6.             else {
    7.                 filename = this.currentDirectory;
    8.             }
    9.  
    Thanks for the quick replies by the way, much appreciated.
     
  13. petrucio

    petrucio

    Joined:
    Aug 30, 2011
    Posts:
    126
    Thanks for the fixes, much appreciated! :)
     
  14. Hexagon-Neuron

    Hexagon-Neuron

    Joined:
    Oct 1, 2010
    Posts:
    305
    Hi Petrucio,

    Will you be applying the above fixes to the next release? I noticed that the package has not been updated for 7 weeks or so. Just concerned about support before I buy :)

    Thanks

    Paul
     
  15. petrucio

    petrucio

    Joined:
    Aug 30, 2011
    Posts:
    126
    I'm on super crunch mode for the GDC since I'm the producer and only programmer at my studio, so:

    1. You should be worried about support because I don't have much time for it right now.

    2. You shouldn't be worried about support because I use the FileBrowser EXTENSIVELLY in my project, and so I have a deep interest to fix any issues.

    I didn't update the package yet because:
    a. It's mostly stable, other then the above bug
    b. I haven't got the time to test it under a Mac.

    If you buy it and regret it, you'll get your money back, even if I have to PayPal you myself.

    Thanks!

    PS: I'll see if I can find the time to update it this week.
     
  16. Hexagon-Neuron

    Hexagon-Neuron

    Joined:
    Oct 1, 2010
    Posts:
    305
    Hi Petrico,

    Thanks for replying, and I know how it is ;)

    I may well give it a go this weekend.
     
  17. petrucio

    petrucio

    Joined:
    Aug 30, 2011
    Posts:
    126
    Update is live on the Asset Store.

    The biggest change is thumbnail caching of the image previews, which will load directories with large images significantly faster after the second time. And some bug fixes and minor improvements.
     
  18. Hexagon-Neuron

    Hexagon-Neuron

    Joined:
    Oct 1, 2010
    Posts:
    305
    Great news. Thanks Petrucio!
     
  19. paraself

    paraself

    Joined:
    Jun 30, 2012
    Posts:
    139
    Hi Petrucio, just purchased. But how do I make the window draggable. It's pretty a essential feature when building an in-game editor, cos users are supposed to bring up the other gui windows at the same time. ;)
     
  20. petrucio

    petrucio

    Joined:
    Aug 30, 2011
    Posts:
    126
    Hello paraself, thanks for buying!

    Since it uses Unity native GUI, and Unity's GUI isn't drag-friendly, it currently does not support dragging. Sorry about that.

    I use it a lot and I have never really felt the need for it - but you can request a refund if this is a deal breaker for you.
     
  21. paraself

    paraself

    Joined:
    Jun 30, 2012
    Posts:
    139
    Hi it's fine I'll just stick to it since I found that I can resize the window. ;-) But do you consider porting it to NGUI ;)
     
  22. petrucio

    petrucio

    Joined:
    Aug 30, 2011
    Posts:
    126
    Thanks! Yeah, I intend to port it to NGUI someday, since I also use it a lot and it would look better and be more extensible with NGUI.

    But I do not have an estimate on when that'll happen - could take many months, so don't count on it.
     
  23. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,028
    Hi,
    Will the mobile version be available soon?
    I really need a texture file browser with save/load for mobile and was wondering if this could do it?

    ty!
     
  24. petrucio

    petrucio

    Joined:
    Aug 30, 2011
    Posts:
    126
    Sorry sonicviz, I'm way to busy, and since I don't need the File Browser on my current project, I think it's unlikelly that I'll get around to porting it to mobiles anytime this year.
     
  25. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,028
    No Sale! ty!

    fyi should you should make that clear in the Asset Store description as you imply mobile support will be *coming soon*, rather than *not soon at all*. Glad I asked!
     
    Last edited: Jun 22, 2013
  26. petrucio

    petrucio

    Joined:
    Aug 30, 2011
    Posts:
    126
    Just bumping this up to let any subscribers know that an update is available.

    It's a minor update, mainly to enable users to tweak UI variables and see the changes take effect every frame. It really makes life easier to set your styles up properly.
     
  27. gulanxiu

    gulanxiu

    Joined:
    Mar 4, 2014
    Posts:
    12
    Hello, petrucio, my English is not good, please forgive me.
    I really like your tools. It is really great.
    In my project is running well, and I very much hope that watched it updated.
    I now have a problem, my project is the wallpaper display, customers need real-time switching wallpaper in preview. Now double-click on the map and select the wallpaper. Tool interface closed. Re-open interface to find wallpaper textures.
    When can double-click on the map to allow the selection tool interface do not close. So you can see the effect of switching the map until satisfied. Then close the screen.
    I hope I can understand that, and look forward to your reply. Thank you very much! $fileBrowser.jpg
     
  28. petrucio

    petrucio

    Joined:
    Aug 30, 2011
    Posts:
    126
    I'm sorry gulanxiu, but I'm really not understanding what you are trying to say here. I've tried really hard, and I've slowly read what you've written 3 times.

    What's your native language? If it's latin or anglosaxon in origin, I'll have an easier time to understand it. Just write in your native language regarless, and I'll see what google translate comes up with.
     
  29. gulanxiu

    gulanxiu

    Joined:
    Mar 4, 2014
    Posts:
    12
    I'm sorry petrucio
    I am a Chinese,I mean, when you double-click the mouse to select a map, GUI interface do not quit
     
  30. petrucio

    petrucio

    Joined:
    Aug 30, 2011
    Posts:
    126
    I thought that was what you meant, and I tried it here, and it quits just fine on double-clicks. Sorry I'm not being able to help you,
     
  31. gulanxiu

    gulanxiu

    Joined:
    Mar 4, 2014
    Posts:
    12
    It does not matter,thank you very much:)
     
  32. gulanxiu

    gulanxiu

    Joined:
    Mar 4, 2014
    Posts:
    12
    hello,I want it not quits on double-clicks, $fileBrowser2.jpg :D
     
  33. petrucio

    petrucio

    Joined:
    Aug 30, 2011
    Posts:
    126
    Oh, NOT close on double-clicks! Ok, that's pretty easy!

    Just add a return before any code on the FileDoubleClickCallback method, on FileBrowser.cs, line 1095:

    Code (csharp):
    1.  
    2.     private void FileDoubleClickCallback(int i) {
    3.         return; // <<-- Add this here
    4.         // ...
    5.     }
    6.  
     
  34. gulanxiu

    gulanxiu

    Joined:
    Mar 4, 2014
    Posts:
    12
    Hello, problem solving, but the map can not be switched.
    Version: File Browser SaveLoad UI v1.1.1.13
    //===========================================================================
    private void FileDoubleClickCallback(int i) {
    this.soundPreviewer.Disable();
    this.StopAllCoroutines();
    this.StartCoroutine(this.FileSelected());
    }
     
  35. petrucio

    petrucio

    Joined:
    Aug 30, 2011
    Posts:
    126
    Ok, I think I've finally figured out what you want!

    Try changing the double-click method to this:

    Code (csharp):
    1.     //===========================================================================
    2.     private void FileDoubleClickCallback(int i) {
    3.         this.soundPreviewer.Disable();
    4.         this.StopAllCoroutines();
    5.         this.StartCoroutine(this.FileSelected());
    6.        
    7.         // Double-click not closing hack
    8.         this.ShowBrowser(this.title, this.callback);
    9.     }
     
  36. gulanxiu

    gulanxiu

    Joined:
    Mar 4, 2014
    Posts:
    12
    Wow, it was successful
    Very, very grateful
    I wish you success in work:D
     
  37. petrucio

    petrucio

    Joined:
    Aug 30, 2011
    Posts:
    126
    Thanks!
     
  38. javdog

    javdog

    Joined:
    Dec 29, 2013
    Posts:
    7
    petrucio, I need my users to be able to do 2 simple things. So please let me know if your file browser is the one I can turn to.
    1. I need to be able to easily assign your browser to open when my user clicks on a 3D text I have setup as a menu item.
    2. When my user finds and selects the media file they want, I need that path string to be sent to the next scene.

    can I get this done with your offering?
     
    Last edited: Jun 18, 2014
  39. petrucio

    petrucio

    Joined:
    Aug 30, 2011
    Posts:
    126
    Sure javdog, it can easily do what you are requesting of it.

    I expect you to have basic scripting skills in order to use it, but I'll help you out where I can if you have any trouble with it.

    Thanks.
     
  40. KnuckleCracker

    KnuckleCracker

    Joined:
    Dec 27, 2011
    Posts:
    63
    Is there a way (other than code changes) to turn off the preview? I just want a straight up file load/save dialog without large icons for files or a lot of horizontal space reserved for a preview.
     
  41. petrucio

    petrucio

    Joined:
    Aug 30, 2011
    Posts:
    126
    Not currently no. You could add a showPreview variable to the inspector to toggle it and change the UI code, but I don't have time to do that this year.

    The smaller icons for the files is easy to setup just changing the inspector values.
     
  42. RealAspireGames

    RealAspireGames

    Joined:
    Dec 24, 2013
    Posts:
    263
    Hello!
    How do I load things other than pictures like actual games.
     
  43. petrucio

    petrucio

    Joined:
    Aug 30, 2011
    Posts:
    126
  44. zhouyadong1983

    zhouyadong1983

    Joined:
    May 27, 2014
    Posts:
    1
    i am an user in china.
    can not preview and load the image,when the image‘s name include chinese character






     
  45. GameJob2017

    GameJob2017

    Joined:
    Mar 1, 2017
    Posts:
    16
    Hello Petrucio,

    I am very interested in buying your Unity Asset . :)

    It appears you have not been active on this forum for about 2 years, and you did not list an email support for this asset on the asset store. So, I am not sure if this asset has been deprecated and is no longer supported by you ?

    For now, I would like to have some questions:

    (1) Can you please confirm if this asset work for iOS and Android ?

    (2) Would you please upgrade this asset to support Unity 5 ?

    When I try to buy this asset, Unity warns me that this asset was designed for Unity 4 and may not be compatible with Unity 5. Therefore, I have not bought your asset yet.

    (3) Does your asset work with MP3 files and PNG and JPG files ?

    (4) Can your asset actually play some MP3 file (as preview) as you specify in the description section ? That would be awesome. :)

    (5) I need to allow users to load MP3 files for iOS and Android. Do you happen to know the paths to the root music directories for those 2 platforms ?
    Also, do I need to modify some config files to allow your asset to access those music directories on the mobile devices for those 2 platforms ?

    (6) Similarly, I need to allow users to load pictures or photos from the standard Gallery or Photo apps (for iOS and Android). Do you happen to know the root directories to show the list of the pictures and photo on those platforms ?

    Also, do I need to modify some config files to allow your asset to access those photo directories (inside Gallery app) on the mobile devices for those 2 platforms ?

    Thank you very much.
     
    Last edited: Jul 26, 2017
  46. petrucio

    petrucio

    Joined:
    Aug 30, 2011
    Posts:
    126
    1. Just tested it on Android, and it doesn't work out of the box. Unfortunately I don't have time to debug why not.

    2. It works fine using Unity's auto-conversion out of the box.

    3. Yes

    4. Unfortunately it doesn't preview mp3 files, due to licensing shenanigans. It previews .wav and .ogg files.

    5. Don't know. In theory all you would need to do is know what these folders are and set it as the starting folder when showing the browser.

    6. Same as 5.
     
  47. max_aigneraigner

    max_aigneraigner

    Joined:
    May 9, 2017
    Posts:
    9
    Hi petrucio,

    Is this file Browser system working with VR goggles such as the Oculus rift or HTC Vive?
    (would be really great if it did!)

    yours
    Max Aigner
     
  48. petrucio

    petrucio

    Joined:
    Aug 30, 2011
    Posts:
    126
    Sorry, no, it doesn't support VR, and I have to immediate plans or time to do it.
     
  49. max_aigneraigner

    max_aigneraigner

    Joined:
    May 9, 2017
    Posts:
    9
    hm ok
    well but actually I got it to work.. VRTK supports some UI pointers, where you can controll standard Unity UI.
    :)
    thanks for the nice Plugin
    yours
    Max Aigner
     
  50. kdragos

    kdragos

    Joined:
    Jun 25, 2016
    Posts:
    13
    Just wondering if this works with the newer versions of Unity. I'm assuming so since others here have posted recently about it. I want to be sure before I invest the money to buy it.