Name: CatTextureEditor
Author: whocares8128
Version: 1.5.9

IMPORTANT:
A lot of effort has been made to make this program compatible with the various mods of Cat files already available.  It may very well change the file structure (often for the better) when making changes.  In general, it should improve the structure of the file, but just to be safe, MAKE A BACKUP OF YOUR FILES BEFORE MAKING ANY CHANGES!!!!


Requirements:
64-bit version of Windows
.NET Framework 4.0+


Changelog:
v1.5.9	
	Added broader recognition support for JPEG formats, including EXIF & SPIFF.
	Replacement image type is no longer influenced by the given extension, i.e. giving a PNG file a DDS extension will not prevent the program from correctly identifying it.

v1.5.8
	Initial Release


Description:
This tool was designed to view, extract, and replace textures stored in Cat files, for the game Senran Kagura: Estival Versus.  

Optionally, it can search for and replace text as defined in the configuration file, when a Cat file containing the search terms is loaded.  By default, the configuration setting is empty.  For instructions on how to define this setting see below.


Installation:
Simply extract the contents to a location of your choice, and run CatTextureEditor.exe.


Basic Operation:
Drag'n'drop a Cat file onto the left side.  When opened, you can browse the various images by changing the Index below the image.

You can also drag'n'drop DDS/PNG/JPEG/CAT files onto the right side for viewing, comparing, or replacing.

Note: The window size can be changed or maximized to see more details of the images.


Extraction:
With the desired Cat file texture displayed via the Index, click Export
OR
Simply click Export All.

Note: For each image extracted, a file will be created in the source folder with name of the source Cat file along with the Index and Name (if available).  
For example, "pl05_00_H.cat.2.skin00_EE.dds" would be created when exporting the DDS texture at Index 2, named "skin00_EE" from the Cat file "pl05_00_H.cat".


Replacing Textures:
With the desired Cat file texture for replacement displayed via the Index, and the Replace Image loaded on the right side, click Replace under the image to inject.  The file is then **immediately updated**, so be sure to make any desired backups before clicking.

Note: At this time, DDS, PNG, and JPEG are supported.


Custom Replacement of Text:
1) Copy "CatTextureEditor.exe.config" from the "(Optional)" folder within this archive to the same directory as the Cat Texture Editor program.

2) Add items within "string" elements, where each item is a pair of old text and new text separated by a "|" (vertical pipe).
For example, to replace "Kafuru" with "Baka", the setting would like the following:

            ...
            <setting name="TextToReplace" serializeAs="Xml">
                <value>
                    <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                        xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
                        <string>Kafuru|Baka</string>
                    </ArrayOfString>
                </value>
            </setting>
            ...	

You could also substitute "Kafuru" with "oJ" similarly:

                        ...
                        <string>Kafuru|oJ</string>
                        ...

Each item to be replaced must appear with its own "string" element.  You can define as many as you like.

Note: The order is important!  If "123|New Text" appeared before "ABC123|Some Other Text", then the latter would never find anything to replace, because all "123"s would already be "New Text".

3) Save changes.
Note: The configuration is encoded in UTF-8, so be sure you save the file in a format that can handle the characters present in the file.

4) Drag'n'drop the desired Cat file (likely within the "GameData\Binary" path of the game) onto the program.

Keep in mind that this will only change the text.  Any changes to graphical text will require further effort.  Also, any changes made in the configuration will only take effect the next time the program is launched.

Note: Be sure to *backup* the original file before confirming the changes.

5) Confirm the replacement.  The file is **immediately updated**.  Likely, you'll receive a message that the Cat file contains no textures.  This is normal and the changes are already saved.
