Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Tools => Topic started 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?
- Displays VP contents in the familiar layout of the vintage VPView32 (http://www.hard-light.net/wiki/index.php/Vpview32)
- Extract files & directories by right-click; batch exporting files is also possible.
- Probably the most lightweight, hence fastest VP viewer around
- But most importantly, written in wxWidgets for complete cross-platform compatibility: Windows, Linux and OSX
What doesn't it do?
- File previews. Nope, sorry, you're out of luck there. This is supposed to be a lightweight tool; if you want to look at a file, you'll have to extract it.
- VP editing/creation. Similar to VPView32, wxVPView treats VPs as read-only. If you want to edit VPs on non-Windows, try Maja Express (http://www.hard-light.net/wiki/index.php/Maja_Express).
- Sort the file list by column header. Sorting is nontrivial in wxWidgets 2.8, I decided it's not worth the effort. I may revisit this decision when (if ever) wxWidgets 3.0 comes out.
- Elaborate error checking. If you encounter any issues during normal use, please report them here.
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):
- Install CMake, GCC and wxWidgets 2.8.12 - all required packages are in the Ubuntu repos, and most other large distros should have them available as well.
- Unzip the source to a folder of your choosing, create a new directory to store the build files (I usually mkdir build inside the source folder)
- From the build folder, run cmake .. (replace .. by the path to the source files if needed) If you did everything right, the output should end with:
-- Found wxWidgets: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /home/downwash/Code/wxvpview/release
- Now, still inside the build folder, run make. The wxVPView binary will be created. That's it!
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)
-
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:
-
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:
- Double-clicking a directory in the tree will recursively extract its contents to a place of your choosing - the directory itself will not be recreated.
- Exporting big directories may take a while, during which the tool will go unresponsive. A progress bar is planned for version 0.3.
- Existing files & folders will be overwritten without warning.
-
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 :)
-
If someone's nice enough to plop out a Windows exe, I'd love to take a look at this.
-
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.
-
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.
-
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
-
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
-
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.
-
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
-
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
-
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
-
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.
-
Hmm, right, I can see that happening... I've put it on the to-do list. For laterTM :nervous:
-
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.
-
Is there a compiled version for Mac anywhere around?
-
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.
-
Here you go (http://www.mediafire.com/?rodzl0ulgkzau4z).
Screenshot:
(http://i.imgur.com/2ZW7A0r.png)
-
Awesome, thanks a lot!