Monthly Archives: April 2021

Some of these bits, some of those (b136)


Found and fixed an issue where GCA was not correctly tagging plugin controls found in the user’s plugins folder as controls.

Forgot to have GCA save/load the setting for gutter widths. Now it does.

Fixed the drawing code for character lists so that it no longer overrides the selected item color with the ‘touched’ color if ShowMeDirty is on.

Made some adjustments to the internal MiserOptionsBlock control to improve performance.

Added the EncumbranceMoveAdjustment() function to GCACharacter. This returns the current adjustment factor based on the current encumbrance level, as a math string. For example, at encumbrance level 1, Light, it returns “* 0.8”. These are currently fixed, but the plan is to allow them to be set by campaign settings or data files in the future. You can also request this text value from the character’s tagitem() function using any of these tags “encumbrancemovefactor”, “encmoveadj”, “encmovefactor”, or “encumbrancemoveadjustment”.

Many, many builds ago we added support for the drnotes() tag, to include non-mode-specific notes about the DR of an item, as is often used for split DR to explain how to use the second value. I did not implement support for displaying the DRNotes anywhere in the UI, and over time I simply forgot to go back and do that. I am doing that now.

The Protection box on unified has been updated to display DRNotes in its lists when appropriate. It has also been updated to resize its lists a little less jankily, and to support displaying info in the Info display for the currently selected protection item.

The Protection box has been updated to allow double-clicking a list item to launch Edit.

Broke out some of the stuff in Loadout calculations into separate routines to make maintenance easier.

Found an error in book file processing where a new body definition did not correctly replace an already loaded one with the same name.

I’ve made the Resync dialog rememeber its positioning, and changed the text slightly.

After GCA4 characters are loaded, GCA will now pop up Resync dialogs for those characters.

Added a new line to the Party tab explainer about the experimental and unfinished state of the tab.

Fixed a crash-bug in the character card designer for the Party tab.

The Edit dialog will now display location, DR, and DB values in an Armor block for traits with DR or DB.

* Loadouts and Armor

I believe I have the first experimental handling of complex split DR working. I implemented it based on the idea of the split DR looking like 7/19pi/19cu/5bu/5cor/3cr.

The new process within GCA will take that type of value for all applied armor and it will combine like protection types when armor stacks, and use untyped protection where no like-type protection is found.

I decided on this method as being the most direct, easiest to understand, and simplest to expand. GCA will happily type any text that follows a number in the DR splits, so you could add ‘cosmic ray’ protection or ‘ghost’ protection or whatever. (If I was to expand this to DB as well, you could have something like reflec armor that provides DB versus lasers but nothing else, for example.)

Right now, most split DR is simply listed as two untyped values. That’s not helpful to this process, so GCA will label the second of the two untyped values as ‘[note]’ and proceed from there as above. The user can edit the split to reflect the intended damage type and get the proper handling, or leave it since ‘[note]’ tells them it’s for the type mentioned in the armor’s DR note–but that may result in incorrect combinations of ‘[note]’ values if they weren’t meant to be the same type.

* Protection dialog

The armor and layer lists have been updated to display DRNotes when appropriate.

Added a note that is shown when stacking rules prevent the application of some values from Deflect or Fortify to location.

Added an explainer to the Armor & Shields tab to explain that you have to uncheck the Always auto-calculate box and also deselect all armor in the Apply Armor list in order to enter your own protection values, instead of having GCA calculate them.

I’ve added a checkbox to allow the protection image to be scaled to fit the display area.

I have updated the protection image display and refresh code. It should be smoother now.

I have updated the location boxes displayed on the protection image to something I think is much nicer. These boxes will also display little icons when there are issues with layers, or with Deflect or Fortify stacking.

* Sheets

Color Block Sheet updated to print DR Notes in the protection display.

I haven’t figured out a good way to update the Official sheet yet.

I adjusted the GetProtectionPaperDoll() function to include a line break before DB if DB is included in a box value.

More bits of plugins and other stuff (b135)


GCA should now be saving and loading the system color settings.

The System Colors dialog now supports importing colors from a prefs file.

The System Colors dialog now supports exporting colors to a prefs file. To export, you must provide a profile name so that the color scheme can be imported in the future using that name. Supports exporting to an existing prefs file without overwriting the other contents of the file, but will warn if you might overwrite system colors with the same name.

Updated the Plugins dialog to support control plugins. Enabling or disabling Unified boxes should take effect once the dialog is closed.

Updated some of the code related to disabling and managing disabled plugins to be able to better handle controls and built-in plugins.

Adjusted the setup for the Sheet Options dialog so that it will no longer accidentally include control plugins in the sheets list, as those are not intended to be included (both because controls don’t support profiles and because controls are instantiated as possibly multiple other objects with the plugin itself being more of a template).

Added more xml doc headers to various procedures in various places.

Added more explicit type conversions in more places and removed more obsolete code blocks.

Adjusted the Simple Options dialog (the one used for run-specific options for Export Sheets) to allow for it to serve as the Options dialog for the control plugins.

Updated the IUnifiedViewBox interface.

Control plugins can now raise the ShowOptions event to tell GCA to call up the Options dialog with the options sheet for that control. Once the user has interacted with the dialog and closed it, GCA will call SetOptions so that the plugin can apply any changes. Note that these plugins are welcome to manage setting of the options themselves through their own UI, and simply use the sheet options that GCA implements to persist those options between sessions. GCA will save control plugin options when it shuts down, and it loads them when it instantiates controls during startup. (These options are saved in SheetOptions.prefs, while the simple settings that GCA manages for its own use, such as visibility on the form or column spanning, are saved in gca5.prefs.)

Updated the attack modes boxes to allow setting some options through GCA’s plugin control options dialog.

Updated the sample Attack Modes Box – External plugin to allow setting some options through GCA’s plugin control options dialog.

Updated the trait list boxes to once again support turning on/off shading of alternate lines.

The Gives Builder in Simple Edit should now only appear when Show All Fields is turned on.

The Where It’s Kept section for equipment should now appear higher up the form on Simple Edit.

Moved the code for saving and loading settings for the various objects that handle user-settings into the objects themselves, where it should have been all along, instead of in GCA’s main code.

The color settings saved to prefs files has been altered slightly, so that the saved color within the brackets, if not a named one, will now use my preferred “&FF00FF” hex color format instead of the previous “Color [A=255, R=255, G=240, B=255]” format.

* Trait Lists

Added a couple lines of code to allow formatting the display of weights and dollar costs for equipment items in the equipment trait lists. I don’t yet have support for it in the UI anywhere, but in the gca5.prefs file, the entries look like this:

FormatWeights = False
WeightFormat = ##,##0.00
FormatDollarCosts = False
DollarCostFormat = ##,##0.00

Change the False to True and GCA will use the format entries for the displayed values in the equipment lists. The Format values use the .Net Format() codes (as per Microsoft.VisualBasic.Strings.Format). The defaults shown here display two decimal places for each and always show at least one digit to the left of the decimal point.

* Color Block Sheet

Updated description to refer to Unified view rather than Compact view.

Bits or bytes of plugins or colors (b134)


NOTE: The placement of the new System Colors toolbar button on the 1st toolbar will mess up your toolbar placements if you have them running linear as I do. I’m sorry about that.

NOTE: Your Unified boxes will be in a different order because they’re created in an entirely different way. Once you adjust the order using the new Unified View Layout dialog, they should keep that order.

The floater window should no longer get focus briefly when it appears, which should prevent unnecessary refreshes of the main window.

Adjusted the way the General Info box handled typing (in Unified and on the Attributes tab of Classic), because it was tedious to enter text into the Name or Player boxes. Changes should now perpetuate throughout the interface only after you’ve left one of those boxes.

Fixed some interaction issues between boxes and GCA that were disconnecting selected traits in boxes from what GCA thought the selected traits were.

Updated the IUnifiedViewBox interface.

All of the boxes in Unified view are now created from plugins. All of the plugins used right now are currently built into GCA. Support for externally compiled control plugins is available, and I have created an externally compilable version of the Attack Modes Box as an example. It is just a class-name-altered version of the one I’m using internally, which was built starting from a user control. This allows it to serve as both an example of a control plugin for Unified View and a control plugin based on a Visual Studio generated user control.

All of the places that use Unified boxes, such as dialogs and Party boxes, now use the plugin versions. The old versions have been removed.

I do NOT yet have a UI for user adjusting of SheetOptions for the new control plugins. GCA will get, process, and set the options, but they’ll currently always be the defaults as provided by the plugin, because of this lack of UI. I’ll get to that soon. For now, certain things that GCA tracks itself for each plugin, such as column span, visibility, and display order, are the only things saved, due to being external to the plugins themselves.

I have changed how GCA tracks and stores color information for boxes and traits and such. GCA now tracks these settings functionally and various features can grab the color set that they want from the system. This is different from before, where color settings were created based on the boxes that might need to have colors set by GCA. Now, GCA has a fixed set of color profiles available, and the controls access the ones that they want.

Everything in GCA should now work with the new color system. It’s entirely possible I hooked some things up to the wrong colors, however, so if you see something that looks weird, please let me know.

I have corrected some drawing issues in some of the Unified boxes where spacing was wrong or where colors were the default system colors instead of GCA’s internal colors.

The Classic Attributes tab should now properly clear the center column info when there is no character loaded.

I adjusted various bits of code to adapt to how plugin versions of Unified boxes work. This involved some new procedures and some consolidation of others, mostly in frmMain.

As a result of the work on the new plugins, combined with the new color system, the Colors & Layout dialog has been removed, as has the button that called it up on the third toolbar.

I have hooked up a new System Colors dialog from a new button on the first toolbar.

I have added a new dialog for setting the layout preferences for the Unified view. This is effectively the replacement for the rest of the Colors & Layout dialog.

Added a new button dropdown-menu to the front of the Unified View toolbar. From that, you can set the flow direction of the boxes, or call up the new Unified View Layout dialog to set various available options for Unified.

Removed a bunch of unused or outdated code related to boxes, plugins, miscellaneous UI stuff, and the failed experimental attempt at unloadable plugins.

Fixed some display issues in the Options dialog, and in the main toolbars.

Renamed some classes, but I don’t think any of those were user-facing, so shouldn’t affect anything in the object model that plugin writers need.

Added the GetResourceImage() function, which returns a Bitmap, to enable plugins to more easily use image resources included with GCA.

Adjusted the Attack Modes boxes a bit to not needlessly rebuild themselves as often.

Changed the Attack Modes boxes to use the Other Traits color scheme, since I realized that attack modes aren’t really equipment-specific.

* Select() and SelectX()

The changes made last build accidentally disabled the ability to specify both an ‘atleast’ and an ‘upto’ value for pointswanted() and itemswanted(), so that has been fixed.

* Plugins

Huge breaking change!

There are conflicts in the way I had done the IBasicPlugin Interface and using a plugin that is also a Control. This is particularly annoying with Name.

So, the ReadOnly Properties Name, Description, and Version have all been changed to Functions of PluginName, PluginDescription, and PluginVersion that return strings.

Public Function PluginName() As String Implements GCA5.Interfaces.IPrinterSheet.PluginName
Public Function PluginDescription() As String Implements GCA5.Interfaces.IPrinterSheet.PluginDescription
Public Function PluginVersion() As String Implements GCA5.Interfaces.IPrinterSheet.PluginVersion

Please update your plugins to reflect this change or GCA will not load them.

If you are using Visual Studio to create your plugins, you’ll want to remove and then re-add your References to GCA5.Interfaces and GCA5Engine. (And if you have a printer sheet, and you haven’t done that for some time, it wouldn’t hurt to do C1.C1.Report.4 also.)

I’ve updated the included sheets for this.

I’ve also restored SimpleTextExport to a standard export plugin, instead of the experimental remote plugin for which support is now removed.

I’ve adjusted the code in ColorBlockSheet and OfficialCharacterSheet to handle upgrading settings a bit differently. Also, because nothing on that front has changed in a long time, I removed most of the code in that block, leaving just a shell for future use.

I’ve also adjusted ColorBlockSheet to use the new GetResourceImage() function, so it no longer needs to include the Resources image folder. (This did require updating compile.xml to add a reference to GCA5.exe and the header of the code sheet to Imports GCA5, if you also have a sheet you want to update.)