I working on an AH 1914 VASSAL module. In the original game, the back, hidden side, of the pieces showed “defensive lines” on the top and an arrow on the bottom. I want to use layers to show the decrease and increase in unit values as they take losses and reinforcement so I thought I’d use masking to show the hidden side of the counters. The pieces need to rotate to show which hex sides they are defending.
I got it to work fine for the side that does the masking, see “Allied View” below. But when I switch to the German player, the masking only works as desired as long as the top of the unit is pointed to the top. The rotated pieces don’t show the masked side, they show the display view. See “German View”.
Anyone know if I can keep the masked side when rotating and if so, how do I do it?
I read where I had to have the “Can Rotate” as the last trait and obviously after the “Mask” trait. I had alreay done that.
I just added the “Text Label” trait between the “Mask” and “Can Rotate”. If I actually add a text label, even just a space, everything works like I want. If I don’t actually have any text or spaces, it doesn’t work.
Thanks for the link to the module and the detailed description on how to generate the error.
The way you have specified your traits is correct.
It turns out to be a bug in the way ‘Can Rotate’ draws pieces when you change sides without restarting the game. You will find that if you save the game as allies, then close the game, then change your password, then load the saved game as germans, the pieces will display correctly.
Joel, I have created bug 2821853 for this and assigned it over to you. I’ve done some investigation and tried to fix, but couldn’t get it to work.
The problem appears to be in GamePieceOpImpl.isChanged(). It does not take into account that the current Player’s side may have changed, thus affecting how he views the piece. A GamePieceOpImpl is only used when the angle of rotation is not 0, thus explaining the initial symptom. I thought saving the side when the GamePieceOpImpl is created and checking this in isChanged() would fix the problem, but it seems to be something deeper in the Op caching.