Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Tools => Topic started by: FreeSpaceFreak on April 05, 2013, 04:11:05 pm

Title: RELEASE: wxVPView (aka Completely Useless VP Viewer)
Post by: FreeSpaceFreak on April 05, 2013, 04:11:05 pm
In order to make my modpack cleaner tool (http://www.hard-light.net/forums/index.php?topic=79943.0) more useful, it's gonna need VP support. So I wrote a little VP viewing tool to get the hang of it. Also because I was annoyed with the Java dependency of Maja Express, which currently seems to be the only cross-platform VP tool around.

What does it do?

What doesn't it do?

So indeed, it's actually completely useless :P Still though, in case you're interested, here's the latest version (v1.0):

Source code (9 KB) (https://docs.google.com/file/d/0B3TmWgAp1WMnQ2JFM3RUYnNlOXM/edit?usp=sharing) @ Google Drive; hit File->Download to get the ZIP.

Older versions (source & binaries) are available at Google Code (https://code.google.com/p/freespace-open-modpack-cleaner/downloads/list).

Compiling
Linux (and possibly OSX):
Code: [Select]
-- Found wxWidgets: TRUE 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/downwash/Code/wxvpview/release

Windows:
The code was written for wxWidgets 2.8.12; be advised that this version may not be fully compatible with your setup (http://wiki.wxwidgets.org/Microsoft_Visual_C%2B%2B_Guide).
Because of the above, I'm not actually testing it on Windows myself - but if you encounter any issues, please let me know.

Screenshots

If your platform is not in the list yet, you're welcome to take a screenshot :)

Ubuntu:
(http://i.imgur.com/ym27wiZ.png)

Mint MATE:
(http://i.imgur.com/KE06r2Q.png)

Lubuntu:
(http://i.imgur.com/s120Y0P.png)

Windows 7:
(http://i.imgur.com/qCc2B5s.png)

Windows XP:
(http://i.imgur.com/IM4RImj.png)

OSX:
(http://i.imgur.com/2ZW7A0r.png)
Title: Re: RELEASE: wxVPView (aka Completely Useless VP Viewer)
Post by: niffiwan on April 05, 2013, 09:45:20 pm
Huzzah for cross platform tools  :D :yes:

Compiles and works fine on my Mint 13 PC.  And it isn't useless, it does almost everything that I use Maja Express for... so... how hard is it to add the option to extract an entire directory?  :nervous:
Title: Re: RELEASE: wxVPView (aka Completely Useless VP Viewer)
Post by: FreeSpaceFreak on April 07, 2013, 03:06:20 pm
Not too hard, luckily :) I updated the OP with version 0.2 - now exports directories too, and doesn't even crash anymore when it fails to open a VP!

Notes on directory exporting:
Title: Re: RELEASE: wxVPView (aka Completely Useless VP Viewer)
Post by: niffiwan on April 07, 2013, 04:53:10 pm
Thanks - I'll try the new version in a few days or so.  Just one question in the meantime, what happens when you try to extract a directory with another directory inside it?  e.g. from your screenshot, if you double clicked on "players" what would happen?  Do you get all the files in the target dir, or are the sub-dirs kept as is?  I guess what I'm trying to say is that I feel that not creating the top level dir prior to extracting is a bit counter intuitive :)
Title: Re: RELEASE: wxVPView (aka Completely Useless VP Viewer)
Post by: Mongoose on April 07, 2013, 07:10:51 pm
If someone's nice enough to plop out a Windows exe, I'd love to take a look at this.
Title: Re: RELEASE: wxVPView (aka Completely Useless VP Viewer)
Post by: FreeSpaceFreak on April 08, 2013, 02:51:38 am
Thanks - I'll try the new version in a few days or so.  Just one question in the meantime, what happens when you try to extract a directory with another directory inside it?  e.g. from your screenshot, if you double clicked on "players" what would happen?  Do you get all the files in the target dir, or are the sub-dirs kept as is?  I guess what I'm trying to say is that I feel that not creating the top level dir prior to extracting is a bit counter intuitive :)
Subdirectories will be created inside the directory selected for export, along with all their contents. I guess it is indeed kind of inconsistent behaviour... I'll change it for the next version.
Title: Re: RELEASE: wxVPView (aka Completely Useless VP Viewer)
Post by: Kopachris on April 08, 2013, 03:24:18 am
I'll take a look at the code when I get home from work.  I could use some C/C++ experience, and I'd love to work on adding the ability to create VPs.

EDIT: Couldn't help myself.  Looking at the code while at work.
Title: Re: RELEASE: wxVPView (aka Completely Useless VP Viewer)
Post by: niffiwan on April 08, 2013, 03:36:06 am
Subdirectories will be created inside the directory selected for export, along with all their contents. I guess it is indeed kind of inconsistent behaviour... I'll change it for the next version.

Thanks :D

And, here's a Linux Mint 13 MATE shot for your gallery :)

edit: screenshot is now in OP

Title: Re: RELEASE: wxVPView (aka Completely Useless VP Viewer)
Post by: Spicious on April 08, 2013, 07:13:33 am
Enjoy (https://googledrive.com/host/0B_qLK7VGhoIyazFGMUV1aHlURHc/wxvpview.7z)!

A few notes:
Title: Re: RELEASE: wxVPView (aka Completely Useless VP Viewer)
Post by: FreeSpaceFreak on April 08, 2013, 12:59:37 pm
I'll take a look at the code when I get home from work.  I could use some C/C++ experience, and I'd love to work on adding the ability to create VPs.
That would be a very nice feature indeed :)

And, here's a Linux Mint 13 MATE shot for your gallery :)
Added to OP - thanks!

Enjoy (https://googledrive.com/host/0B_qLK7VGhoIyazFGMUV1aHlURHc/wxvpview.7z)!

A few notes:
  • Don't mix tabs and spaces
  • wxLC_SORT_DESCENDING breaks things on Windows
  • Why are you #defining _UNICODE?
  • strcasecmp is non-standard
  • Use iter1-> instead of (*iter1).
  • Extracting when double-clicking in the tree view is annoying
You, sir, are awesome :yes: I'll make sure to get these fixed for the next release. I'd been wondering if the double-click-to-export was a good idea - I'm thinking I'll change it to a right-click menu option for the next release. It would have the added benefit of being able to select multiple files from the list and batch-exporting them.
Title: Re: RELEASE: wxVPView (aka Completely Useless VP Viewer)
Post by: FreeSpaceFreak on April 09, 2013, 11:46:39 am
Alright, I updated the OP with version 0.3 (the source, that is). Enjoy!

Changes:
- Exporting is now done with a right-click menu
- Batch-exporting files is now also possible (select multiple files, right-click, export)
- Added a progress dialog box during export, you can now also cancel an ongoing export (note that already exported files will not be deleted)
- Improved Windows compilability
Title: Re: RELEASE: wxVPView (aka Completely Useless VP Viewer)
Post by: Spicious on April 24, 2013, 05:52:17 am
I've built 0.3 on Windows: https://googledrive.com/host/0B_qLK7VGhoIyazFGMUV1aHlURHc/wxvpview.7z
Project files for VS2008: https://googledrive.com/host/0B_qLK7VGhoIyazFGMUV1aHlURHc/wxvpview-project.7z
Title: Re: RELEASE: wxVPView (aka Completely Useless VP Viewer)
Post by: FreeSpaceFreak on April 24, 2013, 03:09:18 pm
Awesome, many thanks! I've mirrored them on the Modpack Cleaner download page (http://code.google.com/p/freespace-open-modpack-cleaner/downloads/list).

Since nobody seems to be running into issues, and work has picked up again for me, looks like version 0.3 will be the last release for a while. So you can all start using it now, you won't need to update any time soon :D
Title: Re: RELEASE: wxVPView (aka Completely Useless VP Viewer)
Post by: niffiwan on April 30, 2013, 05:16:41 am
I realise that you're probably busy at the moment, but I found a minor issue.  When you extract a folder to a location that has a folder with the same name, a "can't create folder" error is logged.  The contents of the VP-folder are extracted to the existing folder OK, so the error seems redundant in this care.  I haven't checked extracting duplicate files onto each other, an error would be expected in this case.

As an example, I was extracting the "data/missions" folder from every mod I have into a single location (/tmp) so I can find which missions are using a given sexp.
Title: Re: RELEASE: wxVPView (aka Completely Useless VP Viewer)
Post by: FreeSpaceFreak on April 30, 2013, 09:18:04 am
Hmm, right, I can see that happening... I've put it on the to-do list. For laterTM :nervous:
Title: Re: RELEASE: wxVPView (aka Completely Useless VP Viewer)
Post by: FreeSpaceFreak on June 28, 2013, 05:21:58 am
Bumpish! Version 1.0 has been released, now with niffiwan's bug fixed and an Export menu for extra intuitivity. Source is available in the first post.
Title: Re: RELEASE: wxVPView (aka Completely Useless VP Viewer)
Post by: Echelon9 on June 29, 2013, 03:12:29 am
Is there a compiled version for Mac anywhere around?
Title: Re: RELEASE: wxVPView (aka Completely Useless VP Viewer)
Post by: jg18 on June 29, 2013, 03:57:36 am
A few thoughts after trying to get it to compile with Xcode 3:

- For future releases, could you put the files in a folder and then zip the folder?

- MyFrame::OnContext() being overloaded caused problems because of the resulting ambiguity in MyFrame's event table. Try changing the function names to, say, OnTreeContext() and OnListContext().

- I can build a Unix executable easily enough, so I can see a GUI, but I can't use it. It'll require a working .app bundle, which'll require some changes to the CMakeLists.txt file. I'll try to look into it this weekend.
Title: Re: RELEASE: wxVPView (aka Completely Useless VP Viewer)
Post by: jg18 on June 30, 2013, 10:32:52 am
Here you go (http://www.mediafire.com/?rodzl0ulgkzau4z).

Screenshot:

(http://i.imgur.com/2ZW7A0r.png)
Title: Re: RELEASE: wxVPView (aka Completely Useless VP Viewer)
Post by: FreeSpaceFreak on June 30, 2013, 12:01:41 pm
Awesome, thanks a lot!