Monthly Archives: September 2015

Some bits are more complicated than they look


* Updater

The first draft of the update checker should now be working. It can check for updates to the program and to data files. GCA will do initial processing, but will then shut down and run the GCA5Updater.exe app with elevated permissions to actually do the data updates. GCA5Updater will also run any setup program downloads. Once finished, the updater will re-launch GCA.

Added stuff to Options to support the update checker.

Added a menu option to the Help menu to check for updates regardless of the update checker settings.

* Bug stomping

Fixed a bug related to not removing items correctly from OrderBy lists in the SortedTraitCollection. I believe this will fix the serious parent/child issue that was being encountered.

* Other stuff

Added a few more error traps and validity checks in various places.

Internal plugin reference adjusted slightly to store running versions.

Another teeny little bit


Fixed some drag-n-drop drawing/updating issues resulting from support for multi-line trait items in Unified and Classic views. This only affected drawing indicators and such, not the functionality itself.

Added the initial infrastructure for possible auto-update-checking in the future.

Added some more checks to AddChild/RemoveChild to be much more verbose any time anything unusual happens after loading, in a continuing attempt to track down weirdness.

Teeny tiny little bit


There is a bug somewhere causing parents to sometimes lose track of some of their children. I have not been able to determine how or where this happens. To address it for the time being, I’ve written a pair of routines that will hopefully reconnect children with parents when one has forgotten the other.

When drawing shown but normally hidden traits in the Unified View or Classic View trait lists, the text is now drawn with some transparency, which has the effect of ‘graying them out’ regardless of the actual color they’re drawn in. The options related to adjusting the transparency level are in the Display box in Program Options.

Even more bits of cleanup


Compact View has been renamed Unified View.

* Bug fixes

Added a trap for an instance where mismatched parens might crash GCA more ugly than usual.

Added a bit of code so that hopefully otherwise untrapped exceptions can still send related data to the log and to the file.

Adjusted the in-column editor in the Classic View Attributes list to allow entry of a decimal point. GCA will generally round that off once entry is done, unless the value actually supports decimals.

Adjusted the calculation order of skills/spells to apply modifiers, and then to include any child point costs. This is consistent with the calculation order of other traits, and avoids total included child costs being unintentionally affected by any modifiers applied to the parent skill.

Library modifiers being read from book files were losing the group they were meant to be a part of if the group was assigned passively by the group heading rather than by a group() tag. This has been fixed. The FastLoad version number has been updated to force a reload-from-source for all libraries to address this issue, but that won’t fix character data that may have carried through this issue (GCA does put Read Validation Error warning in the log when loading a character file that has missing XML data, so you should see a message about the Modifier element if that’s the case; it just won’t be a very helpful message beyond that).

Fixed a couple minor issues in the trait lists in Unified View that resulted from a couple routines not having been updated when support for symbols was added.

* Advanced Edit

Changed the edit control for grid cells to a standard text box.

Changed the context menu option for Paste Modifiers to use the CTRL+SHIFT+V key combo. This will allow CTRL+V to once again work as intended within the text editor for pasting normal values. If whole tags have been copied, using CTRL+V will still work to paste them into the whole grid, as that handler still exists, so long as you’re not inside a cell editor at the time (because that will paste the tag info into the editor, instead).

* Other features

Added support to run GCA in ‘portable’ mode. Run GCA with the /p command line option and GCA will use the folder it’s launched from as the base folder for program data, app data, and as the root folder under which it will create the /GURPS Character Assistant 5/ folder tree for all the user data. (GCA will set the window title to include “(Portable Mode)” when this mode is being used.)

When the Verbose Book Processing option is on, GCA will now print the line number where a warning was encountered during processing of traits and modifiers. This line number is printed in blue just after the warning in the log. That should speed up locating such things in the data files. Note: be aware that for items that cross multiple lines, the line number will always be the last line of the set, not necessarily the exact line of that set with the issue.

* ColorBlockSheet

Weapons are now included normally in the equipment list. Not including them was an oversight from recycled code.

Adjusted how the protection block shades body part headers and the colors it uses for text.

Adjusted the protection block’s armor/shield listings text to use the Equipment color settings like the rest of the block.

Tiny bit of cleanup


* Bug fixes

A previous fix that addressed the issue of equipment items not raising notification that they’d changed, and therefore not triggering recalcs, surfaced a bug that it had hidden. Certain items that didn’t have their own base values, such as equipment parent items, could now trigger an endless recalc loop. This should now be fixed.

* ColorBlockSheet

Obliquely noted in b63, but this was updated in b63 to support the character’s selected trait grouping options.

Fixed a bug.

* OfficialCharacterSheet

Now has a couple of options (Yes by default) which will attempt to reduce overflowing of the weapon tables by allocating  available free space from one table to the other.

Added an option to print the Protection paper doll on page two, bumping the Equipment listing to the overflow pages (No by default).

Added support for trait grouping.

Fixed a bug.

Scrub them bits


* Export

As with print plugins for character sheets, GCA now offers default/current character settings for export sheets. These options follow the existing ones for the character sheets in Options, and work the same way.

There is now an Export button on the toolbar, between the Close button and the Print button. I found it less confusing to put it before the Print/Preview buttons, rather than after them. The Export button works like the Print/Preview buttons, with a drop-down portion to provide access to any alternative sheets that may have been set, and the primary button launching the primary export sheet selection.

GCA will save/load/track all these new options.

* Misc fixes and clean-up

Restored ability to type in the Description & Notes dialog without accidentally closing the dialog by pressing Enter. You’ll need to activate the OK button in another way, such as ALT+O, the mouse, or tabbing to the button.

GCA will now save/load the character settings for the trait list grouping options in the character file.

GCA will now recalculate the character when leaving the Loadouts window.

Added the StorePortraitsInCharacterFiles option. When True (default setting) it saves character portrait image data encoded as Base64 within the character file. The option for this in Options is currently in the Experimental Features block on the Program Options tab.

Fixed a bug that prevented Equipment items from correctly reporting that they’d changed when various things that change them were applied or adjusted. This prevented related items and $ cost totals from being correctly and automatically recalced.

Fixed a bug in displaying grouped traits using a tag matching a specific tag value.

* Other features

GCA now loads an internal copy of the character’s portrait, which is kept in the PortraitImage property. If the character has the image file saved to the character file, that image will be loaded from the saved data in the file. If the character does not have the saved data in the file, the image should be the one set by having loaded the file reference, instead. (That is, the file reference is loaded and the image set if possible, and then the saved data is loaded to overwrite the reference-created data.) This way, the image is available, even if the referenced file is not. This does mean that if you change the original reference file, you’ll need to re-load it in the Portrait dialog to re-set the internal image data, whereas the old behavior would always be loading the current version of the source file, if found.

GCA now supports retrieving the campaign’s base TL through the character’s TagItem property, which means you can now use char::basetl or char::campaigntl to get the TL for the overall campaign, rather than only for the character.

Created the GroupedTraitListBuilder class, which should simplify allowing sheets to support the trait list grouping options by doing the work of breaking a trait list into grouped sub-lists (as specified by the character’s options) for the sheet author. The author can then take the generated lists and output them as the user would like to see them. Example usage in the ColorBlockSheet plugin.

* SheetOptionsManager

Added functions for retrieving typed Values for specific options.

Some generic functions:

Public Function ValueBoolean(Index As String) As Boolean
Public Function ValueInt(Index As String) As Integer
Public Function ValueULong(Index As String) As ULong
Public Function ValueDouble(Index As String) As Double
Public Function ValueString(Index As String) As String
Public Function ValueBooleanArray(Index As String) As Boolean()

And by optType:

Public Function ValueColor(Index As String) As Color
Public Function ValueFont(Index As String) As Font
Public Function ValueList(Index As String) As String
Public Function ValueListArray(Index As String) As Boolean()
Public Function ValueListOrdered(Index As String) As String
Public Function ValueListFlag(Index As String) As ULong
Public Function ValueListNumber(Index As String) As Integer
Public Function ValueText(Index As String) As String
Public Function ValueVar(Index As String) As String
Public Function ValueTrueFalse(Index As String) As Boolean
Public Function ValueYesNo(Index As String) As Boolean

* GCA5.xsd

Added some nodes to allow for saving export sheets and trait list grouping options.