Monthly Archives: March 2016

Store bits, get bits, edit bits

b78

* Various

Set the Duplicate Card dialog to fixed borders.

Session files should no longer be getting inserted into the most-recently-used list.

Updated FastLoad structure to support inclusion of #Store values.

* Store and Get

Finished something started way back in b57: support for #Store and #Get().

#Store is a data file directive that allows storing text as a named block for use elsewhere in the Library, such as ‘#store warning=Don’t Do That!’. These are basically global variables on the Library level, rather than at the trait level, and in concept are similar to Lists, but store only a single item of text, rather than a group of related text items.

#Get allows you to retrieve #Store values.

Like with #Choice or other such directives, these are for use in building other library features, such as SelectX dialogs, or #Choice dialogs. You can use these to insert what will be character features, such as storing a formula that’s inserted into a trait, but remember that #Get is only processed when a trait is added to the character.

The #Store template looks like this:

#store VarName=text

The VarName should be simple, but if necessary (when it includes an = sign) it can be enclosed in quotes or braces.

The text bit can be whatever text you want, so long as it conforms to GCA’s data file rules (one line, or put together from multiple lines using line continuation). Don’t enclose text in quotes or braces unless you want them whereever the text is going to be inserted. Includes support for ~P (that’s a tilde followed by a capital P) for inserting a carriage return/line feed into the text, which is converted during #get() retrieval.

Be conscious of where the text is going to go; don’t include things like unbalanced parens or other characters that might result in the destination no longer being correctly parseable after the value is inserted.

Whitespace at the front or end of either part is trimmed.

The #Get() template looks like this:

#get(VarName)

And simply replaces the entirety of the #get() command with the retrieved value.

A couple examples:

[ADS]
<_TESTING>
#Store TestData=This is a Test
Example 1 (#GET(TESTDATA)), 5/10

#Store DialogTitle=Test Dialog
#Store DialogText = Hello!~PThis is a dialog to demonstrate the #Store and #Get commands.~PTry it!
#Store DialogList = Item 1 Chosen, Item 2 Chosen, Item 3 Chosen
Example 2 (%choice%), 5/10, x(#ChoiceList(list(#get(dialoglist)),Title(#get(dialogtitle)),Text(#get(dialogtext)) ))

In Example 1, the name extension becomes ‘This is a Test’ when added to the character.

In Example 2, a Choice dialog pops up when added to a character, and the dialog is populated with the #Store values.

* Simple Edit

Rebuilt Simple Edit’s display features, to correct a bug, and to allow for more easily expanding it with additional features in the future.

Added support for additional full-cost ‘active slots’ in Alternative Abilities, so that you pay full cost for X slots, and pay 1/5 cost for the rest of the Alternative Abilities in the group. This now has UI in Simple Edit and is supported with the altabilityslots() tag.

All the multi-line text boxes in Simple Edit should now support CTRL+A to select all the text.

Extending the Party a bit

b77

Reverted the previous ‘fix’ for the trickle-thru setup, because it allowed for endless loops to occur in certain circumstances. Addressed the particular concern elsewise.

Altered some log messages a tad.

* Party Stuff

Updated .gca5party files to support additional Party View data tacked to the end.

When saving a Party to a .gca5party file, GCA now includes the Party View information.

GCA now saves the currently loaded characters in a ‘session’ as a Party file, rather than as a list of character files. This allows for correctly restoring sessions with their Party information.

Character cards in Party View can now be sent to the front or back of the stack using the Gear menu, or to the back of the stack by clicking the Done button.

When duplicating a character card, the Duplicate Card dialog now appears, allowing you to set various options for the duplication process.

Bits of conditional fencing

b76

* Various

Trying out copies of the TL/Speed/Dodge/damage blocks from Classic Attributes on the General Information box in Unified.

Changed output of Windows version in the startup log.

If GCA finds gca5.prefs in its home folder, it will run in “portable” mode.

Added UI for changing User Folders (aka the various Bins) to Options.

Added an option to Options to allow/disallow auto-setting of Tablet mode when GCA starts up.

Added an option to the main window’s View menu to force Tablet Mode on or off. If on, auto-setting on startup is ignored.

Fixed a bug in the code that sets up trickle-thru calculations.

Updated the error messages related to plugins.

* Fencing Weapon

Added support for a fencingweapon() tag. (Maybe it should be lightweapon() instead?) The value for this tag, for current testing purposes, should be ‘char::enclevel’ such as fencingweapon(char::enclevel) because that will force GCA to create an association between the character and the trait, to ensure it’s recalculated when GCA’s encumbrance level changes. The given value of the tag is not used.

When this tag exists, and the character’s encumbrance level is above 0, GCA will create a charfencingpenalty(-X) tag, and add an item to the bonus list for encumbrance level affecting fencing weapon attacks and parries.

GCA will then use the charfencingpenalty() value to reduce the charskillscore() for the weapon. It then adds that value *back* before calculating the charparryscore() based on charskillscore(), and then reduces charparryscore() by that amount.

Net result: charskillscore() is reduced by EncLevel for the attack tables, and charparryscore() is reduced by EncLevel for the attack tables, and charparryscore() is not affected by ‘double dipping’ the encumbrance penalty.

* Conditional Select()

Added support for the new conditional() tag in the Select() structure. The conditional(), if it exists, must evaluate to True (a non-zero result) in order for the Select() to be processed.

	triggers(_
		select(_
			text("Select with Conditional. You'll never see this one."),
			conditional(@sametext("alpha", "bravo")),
			itemswanted(atleast 1),
			list(_
				DI:Alcoholism, 
				DI:Stubbornness, 
				DI:Workaholic_
				)_
			)_
		)

In this example, @sametext(“alpha”, “bravo”) evaluates to 0, so it would not be shown. Conditional() is, obviously, math enabled, so it supports the full Solver functionality to determine if the conditional() applies.

A bit of a grab bag

b75

* Bug Fixes

In some peculiar circumstances, certain updates of the lists in the Classic View were throwing exceptions. I have rearranged the order of operations in the code a little bit to address this issue.

When Print Previewing a sheet, the flag telling the sheet whether or not it was in Sheet View should now be set correctly.

* Other

Added a Traits dialog. This is currently available from any trait list box in Unified view via the gear icon drop-down menu.

Changed the way some things worked in the Classic trait lists, so that they could be re-used in the Traits dialog.

Added support for a new PermanentButton ActionType in Sheet View, which allows for creating buttons on the character sheet that remain active and usable at all times.

* Data Files

Updated to include Eric’s current update batch.

* ColorBlockSheet

Updated to make use of the new PermanentButton ActionType. This now puts buttons into the Header to call up the Traits dialog for the specified type of trait.

* Plug-ins

I have updated the third-party controls. This breaks sheet plug-ins, which will have to be re-compiled against the new versions. All included plug-ins have been updated.

From past experience, updating the third-party controls can also lead to strange behavior in GCA if some things are a little incompatible. This might affect the tab controls, the grids in Advanced Edit and maybe a couple other things.

It appears the updated controls also have more dependencies on other libraries from the vendor, which has increased the installation size some.