12/02/2009

Author:catatonic
Contents of 2020 Utility.zip:

Setup.exe
SR2020 Utility.msi
readme.txt


Description:

This Windows .NET application is designed to allow the user to view the Supreme Ruler 2020 DEFAULT.UNIT file as a sortable list.
Since this .CSV data file is quite large and is awkward to view with a plain text editor, or even with a spreadsheet program, this application was designed to allow the user to view each SR2020 unit in a standard "List View" dialog box.  

All columns of interest are displayed and each column is seperately sortable.  Columns can be moved horizontally.

Arrays of buttons allow filtering of the list by land, sea and air classes, sub-classes, facilities and "special topics".

A "Keep Selected" button allows the user to select target unit/rows and then delete all non-selected rows.  This allows "side-by-side" compairsons of units.  

The previous "SR2020 Browser" with the Technical Readout matrix is included.  Both dialogs are available from the main screen "View" menu-item.  

The DEFAULT.UNIT file can be selected from the "File/Open" menu-item.  The applicataion can be run from any folder.

All Unit records can be edited or deleted and new records can be created.  Not all fields of the Unit record are visible or editable.  

When you save an edited Unit to the main list, the list will be re-sorted by Unit ID.

Not all DEFAULT.UNIT database file record "fields" can be edited.  Only the Unit attributes that I consider to be important enough to change are editable.  Other fields are hidden from the user, but are still preserved for when the new version of the UNITS file is saved.

Unit data fields are strongly typed - you cannot enter a number for a boolean (true/false) value, a comma or a period into an integer (non-decimal), or a non-digit into a decimal (0.234) field.

Charcters such as double quotes (") and commas are data file seperators and are generally prohibited when editing unit data.
These rules are now automatically enforced since the program now filters out inappropriate user key-strokes during editing sessions.
 

Load/Display performance slows with the more units that are selected.

The program is designed for use with SR2020-GC only.  Other versions might work - no guarantees.
The program reads the installed DEFAULT.UNIT, DEFAULT.TTRX, Local_text.TTR, and local variables.ini files.
The program reads the "Language Files" and "Install Folder" entrys from your SR2020 registry entry.
The program writes no files except when saving changes.
The program will not change any of your SR2020 files except for DEFAULT.UNIT.
The program reads from the Windows Registry but does not write to it.


FUTURE PLANS:

1. Add a custom TR window for Missiles to the Browser, just like the in the game.


INSTALLATION:

This application requires the light-weight ".NET Framework 3.5 Client Profile" package, which will be automatically 
downloaded to your computer via the Web.  This takes less than a minute.

You can install the Utility app into any folder when prompted from the Installer.


1. Download "SR2020 Utility.zip".  

2. Un-zip the three installation files into any folder.

3. Run "setup.exe" with Administrator's Privledges.

4. Setup will ask for permission to download the ".NET Framework 3.5 Client Profile".

5. Allow the download.  This will happen quickly, especially if this is a re-installation.

6. Acknowledge the successful Framework installation.  This screen may be obscured by the next one.

7. The SR2020 Utility installation process will begin immediately.

8. Follow the prompts and allow the app to install into the target folder. If you have SR2020 installed on another drive then you will get a chance to change the drive letter.

A shortcut icon will be placed onto your desktop. Use it to start the Utility.

If the installation refuses to install then you may not have permissions for the target folder.  Try the following :

A. Login as Administrator and change the file permissions for the folder.

or 

B. Re-install into another folder that you have permission to write to and then move the "SR2020 Utility.exe" and "Readme.txt" files
   manually to the target folder.


Operation

WARNING - Back up your DEFAULT.UNIT file before attempting to edit it!  If you do not use the "Save As" feature then your current DEFAULT.UNIT file will be over-written.

This this application is compatable with Windows 7, Vista and XP.

The editing function of this application operates on the DEFAULT.UNIT file located in your "Superme Ruler 2020/Maps/Data" folder.  If you do not have administrative permission to edit files in this folder then this program will throw error prompts and program exceptions.
It you have problems saving your edited work then try copying the target .UNIT file into another folder where you have permissions and then re-start the program.  Otherwise, try running the program as an administer.

To delete a Unit record select the record in the maian list and press the "Delete" key.
Once you confirm the deletion, the UNITs file will be re-written immediately.  Pending edits will 
be saved as well.


To edit a Unit record:

1. Select the Unit from the main List View.
2. Double-click the unit or press the "Edit" button.
3. A second list view of the single unit will appear in two columns - a label column on the left and a unit data column on the right.
4. Two buttons are displayed below the edit matrix - "Save" and "Cancel".
5. To edit a value double-click on the value's row in the edit matrix.
6. The value will appear in an edit box, or a special prompt will appear.
7. Edit the value in the edit box.
8. Press "Return".
9. The edited value will be reflected in the list.
10. To finish editing press the "Save" button. This saves the edited data to the list, not to the DEFAULT.UNIT file.
11. To complete saving your work switch from the List Viewer dialog to the main window.
12. From the "File" menu select either "Save" or "Save As" and write your changes to the current .UNIT file.

To add a new unit:

1. Follow the steps above for editing.
2. To the bottom right there is a "Next Usable ID" box.  This displays the next un-used Unit ID for the class of the unit that you have chosen to edit.
3. Before saving the new unit assign it a unique Unit ID or class ID.
4. Press the "Save" button.
5. The new Unit will be placed into the main list viewer and the viewer will re-sort the units automatically.
6. You must manually save your work from the File menu on the main window.

If you attempt to change a unit's ID number you will be prompted with the option to use the "Next Usable ID" that is displayed in the box.

If you attempt to change the class of the Unit you will be prompted with the option to automatically provide a new compatable Unit ID as well.

The "Next Usable ID" box lists the next unused ID for the unit's class.  The search for the first unused Unit ID begins at the first valid Unit for that class, i.e. for Infantry the seach begins at unit ID "1".  
For Recon units it begins at "1000".  Unit IDs that have been used but not saved are skipped in the search.

Duplicate Unit names are permitted.

Once you have saved an edit to the main list, any attempt to re-sort the list will cause the user to be prompted to either save the change, discrad it or abort the sort.

If you attempt to close the list viewer or the main program before saving your work then you will be prompted to save it.
The Save file options are only active while the list viewer is displayed, and then only if you have changed some Unit data.

Software Changes:

Version 1.0.0.9 12/02/2009
1. Fixed bug where edits could not be saved if main listing was displaying "All".
2. Stopped Viewer from remaining on top, preventing access to the "Save" menu on the main window.
3. Allowed background events to proceed during long file writes.

Version 1.0.0.8 12/02/2009
1. Added warning when UNIT file is already opened in another editor.
2. Smoothed out initial display of Viewer window.
3. Disabled main list while editing to prohibit multiple editing sessions.
4. Improved main window hot keys.
5. Added check for blank records.

Version 1.0.0.7 11/30/2009
1. Fixed problem with next unused unit ID selection.
2. Fixed bug with return key in edit box.
3. Added record deletion feature.

Version 1.0.0.6 11/29/2009
1. Fixed problem with Missile filters.
2. Improved Facilities filters.
3. Added tabbing and hotkeys.
4. Added 12 new editable Facilities fields.
5. Restored icon to shortcut.

Version 1.0.0.5 11/26/2009
New Features:

1. Re-sizing of Browser or Viewer stretches the listbox or list view for a larger display.
2. Enabled editing of a unit by double-clicking it in the main list view.
3. Automated editing of Unit IDs - next available ID is provided automatically.
4. Automated editing of class IDs - an appropriate new Unit ID is provided automatically.
5. Implemented tool-tips for all buttons and for the more mysterious filter buttons.
6. Automatic file-saving is offered via a prompt when re-sorting, closing the viewer or the application.
7. "Next Unused ID" (Unit ID) now skips Unit IDs that are used for edits but are not yet saved to the DEFAULT.UNIT file.
8. The edit box now appears above the value being edited, rather than at the top of the edit list.
9. User entries are now filtered and validated when editing Units - no numbers for boolean values, no commas for numbers, etc.

Bug fixes:
1. Fixed test-to-boolean conversion function.
2. Fixed invalid index exception when selecting "Edit" without a Unit selected.
3. Fixed problem where edited units saved to the main list were not marked as having been changed.
4.  
2. 
Version 1.0.0.4 11/24/2009
1. Added Unit editing.
2. Added "Edit" button.
3. Added "Save" and "Save As" file menu items.
4. Added a disappearing edit panel.
5. Speeded up loading of the list view control.

Version 1.0.0.3 11/21/2009
1. Added new "Keep Selected" button. Allows selective column deletion.
2. Changed Publish prerequsite from "3.5 SP1" to "3.5 SP1 Client Profile".
3. Eliminated flicker from list view when loading.

Version 1.0.0.2 11/21/2009
1. Beefed-up error handling for when files are missing.
2. Corrected setting in the setup/Installer - changed launch condition from .NET 4.0 to 3.5.

Version 1.0.0.1 11/21/2009
1. Manually changed all ".NET 4.0" references to 3.0.

Release Notes:
Version 1.0.0.0 11/20/2009
1. Still calls for .NET version 4.0.



Release Notes (Browser only)
version 1.0.0.5  11/25/2009
1. The browser can now be re-sized.  Doing so will stretch the Units listbox to occupy available screen space.
2. The Technical readout has been over-hauled to deal with changes in screen resolution.
3. Fixed problem where "Missiles" button was listed in the "Air" units group box.
4. Fixed broken "Missile" searches.


version 1.0.0.4
No Changes.

version 1.0.0.3  11/21/2009
1. Application is more object-oriented and is better structured.
2. Tested with different DEFAUlT.UNIT files to deal with un-expected idiosyncracies.
3. App is relocatable.
4. Contains file selector for DEFAULT.UNIT file.

version 1.0.0.2
No changes.

version 1.0.0.1 10/15/2009
1. Fixed problem where un-expected numeric format in .CSV file caused program exception.
2. Cleaned up graphics.
3. Added title to technical readout.
4. Replaced file-handling so that the entire .CSV file is no longer resident in memory.
5. Added accessors to class objects.
6. Strengthened error checking.
7. Modified to accept eccentricly formated DEFAULT.UNIT files.
8. Modified file opening to shared mode.

version 1.0.0.0  10/20/2009
1. Tool-tips are not localized - they are all in English.  Unit and tech names are translated into your installed language.
2. Tool-tips are keyed to the text data, not to the icons.
3. Compiled to use .NET Framework version 3.5 SP1 Client Profile.
4. Only tested under Windows 7 without extra .NET Frameworks installed.
5. Missiles use the standard TR large window, not the smaller missile one.




DISCLAIMER:

Install and run this program at your own risk.

This program is provided as is without any guarantees or warranty. 
Although the author has attempted to find and correct any bugs in the free software programs, the author is not responsible for any damage or losses of any kind caused by the use or misuse of the programs. 
The author is under no obligation to provide support, service, corrections, or upgrades to the free software programs. 
