[ModBuddy Extension] Vanilla Asset Browser

CommanderZ

Warlord
Joined
Nov 24, 2007
Messages
182
Location
Prague, Czech. Rep.
About Vanilla Asset Browser

This simple extension allows you to browse vanilla assets hierarchy without leaving ModBuddy. Text files will be opened directly in ModBuddy, images, sounds and other files will be opened in their associated programs.

Advanced usage

Opening files in external editor
Simply hold SHIFT while opening and file from the Vanilla Assets :)
You can change the editor in <ModBuddy folder>/MatejZabsky/ExternalEditorPath.txt

Advanced search modes
  • Prefix search - add one space character before search query (has no effect on file content search).
  • Regular expression search - if you use any other character than letters, ".", "_" and " ", the search query will be interpreted as PCRE regular expression (for both file name and file content searches).

Installation

1) Download the attached archive and extract it
2) Register ModBuddy as Visual Studio Isolated Shell
3) Open the "vsix" file found in the archive
4) Visual Studio Extension Installer pops up - click Install
5) Once the installation is complete, close the window
6) Restart ModBuddy (if it was running)
7) Go to View->Other Windows->Vanilla Assets
8) Find the CivilizationV.exe with the dialog box that pops up
9) You should now see a floating window with root asset directories. Dock it somewhere and you are done :)

Upgrading to newer version

1) Download the attached archive and extract it
2) Open the "vsix" file found in the archive
3) Visual Studio Extension Installer pops up - click Install
4) Once the installation is complete, close the window
5) Restart ModBuddy (if it was running)

Version History

1.7 (17.10.2010)
- fixed the VA window not opening (reported by VRBones)

1.6 (13.10.2010)
- fixed the VA window being confused with Solution Explorer (reported by JeBuS27)

1.5 (12.10.2010)
- added option to open files in external editor

1.4 (7.10.2010)
- added prefix and regex search options

1.3 (5.10.2010)
- instant search by file contents
- search text box is now more responsive (no lag)

1.3 (5.10.2010)
- instant search by file contents
- search text box is now more responsive (no lag)

1.2 (5.10.2010)
- fixed bug where the tree would be populated more than once after the window is closed and reopened (reported by damocles88)

1.1 (4.10.2010)
- instant search by file name
- configuration file is now saved into correct directory
- removed unnecessary message boxes
- generally more polished

1.0 (3.10.2010)
- first version

Planned Features

- cache file content index onto hard drive so it doesn't have too be rebuild every time ModBuddy loads

Screenshot

attachment.php


Source code

I will post C# source code upon request.
 

Attachments

Very nice, thanks a bunch for this. Saves digging around in files or database managers to find what I need.

but I have found one bug...

For some reason the vanilla assets window is showing the same folders about 5 times. So I get one list of folders starting with Automation and ending with UI, but then another 4 or 5 more lists that immediately follow, all going from Automation to UI. It's a minor bug that doesn't affect how useful the tool is, but thought you might like to know :)
 
Very nice, thanks a bunch for this. Saves digging around in files or database managers to find what I need.

but I have found one bug...

For some reason the vanilla assets window is showing the same folders about 5 times. So I get one list of folders starting with Automation and ending with UI, but then another 4 or 5 more lists that immediately follow, all going from Automation to UI. It's a minor bug that doesn't affect how useful the tool is, but thought you might like to know :)

Could you please post a screenshot, I can't replicate this bug.

EDIT: Never mind, just found what causes it, will fix it ASAP.
 
Wow, this looks like a fantastic utility tool. Great work!

ps you should get the mods to move this to the proper sub forum so more people can find it ;)
 
yea that would be it. Its not a big deal though, great job once again.
 
Wow, CommanderZ, you're putting out great ModBuddy extensions, thanks a lot!

A question: using the vanilla assets browser is it possible to accidentally alter their original value? Or are they browsed strictly read-only?
 
Wow, CommanderZ, you're putting out great ModBuddy extensions, thanks a lot!

A question: using the vanilla assets browser is it possible to accidentally alter their original value? Or are they browsed strictly read-only?

The files are opened as normal files (writable). To be honest, I have no idea how to tell the Visual Studio to open ordinary writable file in read-only mode.

I could can mark the file read-only (using the file system flag) and then open it, but it might break Steam updater (though that is not very likely, most file-manipulation functions in most languages don't pay very much attention the the flag). If the file is read-only, the file is opened in some sort of semi-writable mode - you can type into it, but a lock icon is shown near file name and a warning box pops up while saving the file (allowing you to overwrite the file).

And thanks all for the positive replies!
 
My concern is unknowingly hitting a key while browsing an Asset file. That's why I have made a copy of the Assets folder (which I keep in ModBuddy's project root folder). Would it be possible to point the extension to that location instead?
 
when I run the vsix it says it haven't found a registered application, after I ran the .reg file and changed the .pkgdef file.

Hmm, weird. Are you sure you have the ModBuddy correctly installed? Try to do the two steps again (verify you did them correctly). Also, check whether the extension is not already installed (Go to Tools->Extension manager->All).

The installation instructions worked for me and for other people too, so I don't know what else could be wrong.

My concern is unknowingly hitting a key while browsing an Asset file. That's why I have made a copy of the Assets folder (which I keep in ModBuddy's project root folder). Would it be possible to point the extension to that location instead?

Check "<ModBuddy directory>/MatejZabsky/ExecutablePath.txt". You can change the value to anything you want and the extension will try to load the directory. The only "genuineness" check is during the first startup (when you are asked for the CiV executable).
 
Hmm, weird. Are you sure you have the ModBuddy correctly installed? Try to do the two steps again (verify you did them correctly). Also, check whether the extension is not already installed (Go to Tools->Extension manager->All).

The installation instructions worked for me and for other people too, so I don't know what else could be wrong.



Check "<ModBuddy directory>/MatejZabsky/ExecutablePath.txt". You can change the value to anything you want and the extension will try to load the directory. The only "genuineness" check is during the first startup (when you are asked for the CiV executable).

ok, running the ModBuddy exe directly from the folder (that is, not from Steam) made it work somehow :confused:

thanks :goodjob:
 
ok, running the ModBuddy exe directly from the folder (that is, not from Steam) made it work somehow

thanks

It is more likely you did something to fix the issue before you tried to run the ModBuddy directly ;) I usually run ModBuddy through the launcher and it works fine.
 
Update time! The search by file contents is now in. It is not really "instant" (it takes a few moments for the results to pop up), but it is still much faster than using Windows Search :)

The fast search has its price though: the ModBuddy now takes a ten or so more seconds to load (all the text Assets are being preloaded into memory).

1.3 (5.10.2010)
- instant search by file contents
- search text box is now more responsive (no lag)

See the first post for download and a screenshot.
 
Do you mean like Windows Grep? That will be the most useful tool ever :)

I was wondering: I actually have a copy of the root Tutorials folder (or something) inside my Assets copy, will it get indexed as well?
 
Do you mean like Windows Grep? That will be the most useful tool ever :)

Could you please explain what you mean?

The content search does simple string matching only (no wildcards or other stuff). I of course could use regexp matching instead, but that would slow down the search. Maybe...string matching would be used if there are no special chars (only letters) in the search query and regexp otherwise :)

Sounds like an idea, but I'm not sure it would be that useful. I am certainly not fluent enough with regexps to use them in my everyday practice.

I was wondering: I actually have a copy of the root Tutorials folder (or something) inside my Assets copy, will it get indexed as well?

Yes, any files you put into the Assets will be included in the tree and also in file name searches. The file content index however contains SQL, XML and LUA files only. I could add a few more extensions if you wish, the purpose of this is to prevent DDS and MP3 files from being indexed (only cca 800 of the 5000 files in the asset directory aree text files, the rest are mostly MP3s and DDSs...making like 99% of total Asset size).
 
Hey there, thanks for this extension, very nice. Quick question (and I hope I'm not just being stupid) but how do I use the search in Vanilla Assets? Nevermind :)
 
Back
Top Bottom