"Disabled Button" image mistakenly reported as an "Unused image"

I am modifying the latest version (2.0) of the “TP: Stalingrad” module. I added this new Global Key Command trait to the Main (“Stalingrad”) Map:

This trait adds a new “Refit” button to the Main Map Toolbar. That button can be disabled, and I defined an image (“RefitButtonDisabled.png”) for that button when disabled. The button appearance (both enabled and disabled) is working as expected.

However, when I run the “Remove Unused Images” utility from the Module Editor Toolbar, the “disabled button” image is included in the list of unused images:

This seems like a bug to me.

Note that the other 12 images which are listed as “unused” are also actually used by the module, but only via explicit file path references embedded within an HTML string for a Report Action trait. I can understand why the module might not spot those references and I don’t think it is worth “fixing” that issue. However, the “disabled button” image is directly referenced within the GKC trait, and I suspect the Vassal design intent is to detect this reference.

The (in development) test module can be found in my Dropbox here.

The newly added GKC in question (Description = “Perform Dawn refits”) was added under the “Toolbar buttons” folder of the “Stalingrad” Map Window. Interestingly, it seems that none of the fields defined in that GKC (only) can be found by the Editor “Find” (Ctrl+F) function; that may be a significant clue.

Jim Hunter.

Sorry, I forgot to mention that this behavior is seen using Vassal version 3.7.1. The module in question was created under 3.6.19, and I updated the vassal version during my development.

Jim Hunter.

I suggest you ignore this second issue (regarding the Editor’s Find feature). I am seeing it occur only intermittently, and have not yet determined the pattern to that behavior. I did however see it start working again after I unchecked the (newly added) Regular Expression box in the Search dialog, so that may be a factor. I will continue to look for a reproducible test case and report back.

Meanwhile, the original issue regarding the Unused Images is easily reproduced (and easily ignored - low priority).

Jim Hunter.

Thanks for the report Jim.

I’ve added an issue for the disable Icon appearing as an unused image issue. It appears to affect all toolbar buttons. We’ll get that fixed for 3.7.2.


This is long-standing and, as you say, expected. As a workaround, I stick those images into a dummy Layer trait in a Prototype; et voila, they become “known” to the editor. This also happens to be a useful way to load said image files into the module.

Nice workaround!

Hi Jim…

Does this extract from the Reference Manual shed any light for you (press Help from the Search box to see this in the editor):

The feature is aimed at a situation I was finding where I have a Property called “cName”. The standard search will also report BasicName. With, Regex search a more targeted search is possible; for example:
.*\bcName\b.* will find all references to the word “cName”.

The feature just passes the search string directly to a Java function for matching a Regex. This I presume is why, with no Regex operations in a string, the Regex search looks for exact matches only (typically throwing up Properties only).

In summary, the Regular Expression feature is for when you want a narrowed down search, presuming that it’s worth the effort of composing a Regex for it.

Perhaps a coding problem will emerge but at the moment I think at least some UI or documentation update would help. Some thoughts I have,

  1. A message advising when Regular Expression has been selected for a search and what that means.
  2. Add some more info on the search panel by the Regular Expression checkbox.
  3. Another example in the Help.
  4. Perhaps, when there are no regex operands in the search box, checking Regular Expression could produce a more useful, but intuitive, search than it does now.

Suggestions welcome and I’m interested in what further you may find.

@Jim_Hunter, a new release 12773-Unused-Icon-image is building now in Builds of vassalengine/vassal, could you give that a go and confirm it resolves the issue?


Hi Brent,

Yes, your Unused-Icon-Image build did fix the issue (the RefitButtonDisabled image icon no longer appears in the Unused Images list.

Thanks for the quick work!

Jim Hunter.

The fix is merged. It will appear in 3.7.2 when it’s released, probably in a few days.