This will use the unit's Direction field to show different wall connections.
The unit should be a building and have NumDirections = 16 and Flip = false.
The wall unit didn't count in GetNumOpponents. When it attacked, AI didn't fight back and no warnings are shown.
NOTE: need to modify triggers, so they won't count the wall units when calculating player's remaining units. Not needed for those games which don't use this feature.
Wall mapping:
Frame 0 - wall without connections.
Frame 1 - wall with north connection.
Frame 2 - wall with west connection.
Frame 3 - wall with north and west connections.
Frame 4 - wall with south connection.
Frame 5 - wall with south and north connections.
Frame 6 - wall with south and west connections.
Frame 7 - wall with south, north and west connections.
Frame 8 - wall with east connection.
Frame 9 - wall with east and north connections.
Frame 10 - wall with east and west connections.
Frame 11 - wall with east, north and west connections.
Frame 12 - wall with east and south connections.
Frame 13 - wall with east, south and north connections.
Frame 14 - wall with east, south and west connections.
Frame 15 - wall with all connections.
patch from Cybermind.
(Force[force].Reset() should be placed before the loop)
Remove the behavior of changing of force index (since it doesn't work befor and it is strange)
Some clean up.
If the user types something like "foo~!bar" in a TextField widget,
then display the tilde as is; the "~!" there does not mean that the
next character is a hot key. The user is not supposed to know about
any such syntax.
Implemented by having a parallel plain-text CFont that Lua code then
assigns to each TextField it creates. The plain-text CFont shares
textures with the markup CFont, so the memory cost is minimal.
(Originally, I was instead going to implement this by adding a syntax
parameter to gcn::Font::drawString and all related functions. That
however was the wrong choice because e.g. gcn::ImageFont::drawString
then had to take the parameter but had no idea what to do with it.)
Plain-text fonts can be used in all other widgets too, such as list
boxes or labels. This commit does not make any such widgets use them
though, and the choice of font does not currently affect how the
engine checks whether the widget has a hot key defined.
This was doing x += getWidth(text) after drawing each glyph,
but getWidth returns the width of the whole string, thus being
wrong if the string contains more than one glyph.
drawGlyph has already been documented as returning the width
of the single glyph, so use that instead.
This fix is not particularly important, because gcn::DefaultFont
is only a fallback for when the correct font has not been set.
Do not assume the Boolean value is at the top of the Lua stack,
although it currently always is because CSerializeLua::AppendLuaFields
does not support Boolean values as keys in the table.