From: Erik V. <eri...@xs...> - 2012-03-19 10:15:50
|
Ah, I had overlooked that use case. Thanks for spotting that! My construct was intended to allow different pictures to be defined per hex (in addition to per tile), but of course this only applies to preprinted tiles. Indeed these should always have a negative number. Different pictures for layable tiles cannot be defined per hex, so the detour via MapHex is not needed at all. For clarity, I would prefer to use the tileID sign, rather than the pictureId sign to make his distinction (which I did in my first commit). But I later realised that we should then make tile.getPictureId() return the tileID if no picture is defined, and that change could have more impact, so I have reverted that idea my second commit. I’m now back on exactly your code (but with some added comments). I may come back to this aspect later on. Erik. From: Dr. Martin Brumm [mailto:dr....@t-...] Sent: Sunday, March 18, 2012 4:29 PM To: 'Erik Vos'; 'Rails Development' Subject: AW: Fix for MapHex Display Problem Hi Erik, the bug emerged as you placed any tile on a preprinted Hex with a negative ID. (So in principle any native preprinted Tile). In that case the Select Mechanismn for upgrading a tile printed the right tiles for upgrade (id and everything) on the left selection panel but showed the hex.graphic of the preprinted MapHex. You couldn’t see anything besides the original MapHex gaphic on the Map nor on the Selectionpanel on the left side. I tested it with 1830 and 1880 from the current master repository. My Fix assumes that all preprinted tiles have negative ID and all upgrade Tiles have an ID >0. So far that assumption is true as far as I could see. Regards, Martin Von: Erik Vos [mailto:eri...@xs...] Gesendet: Sonntag, 18. März 2012 16:23 An: Dr....@t-...; 'Rails Development' Betreff: RE: Fix for MapHex Display Problem Martin, What exactly was the problem that you encountered? Do you have a saved file that shows it? Your change isn’t incorrect, but IMO it should be superfluous, as hex.getPictureID() should already handle all valid cases (although in a different way). If you really saw a problem, there must be another underlying bug. I’m assuming that the tile/pic configurations are correct (all preprinted ones negative, all laid ones positive). This may need further checking, though. Erik. From: Dr....@t-... [mailto:Dr....@t-...] Sent: Sunday, March 18, 2012 10:05 AM To: Rails Development; Erik Vos Subject: Fix for MapHex Display Problem Hi, please find enclosed the patch for the small problem created with the introduction of tilebased pictureIDs. Autor: Martin Brumm <Dr....@t-...> 2012-03-18 10:01:39 Eintragender: Martin Brumm <Dr....@t-...> 2012-03-18 10:01:39 Eltern: a384f297999ccc2de0d66a1c9d836b37d6e45dd8 (Fixed the startprice but didnt remove the pop up for IG/BCR) Zweig: master Folgt auf: v1.5.0 Vorgänger von: Fixed new pictureID Display. Tiles with a positive Picture ID have preference over hex.PictureIDs. ---------------------- rails/ui/swing/hexmap/GUITile.java ---------------------- index f7162f9..5ccf092 100644 @@ -53,7 +53,12 @@ public class GUITile { this.hex = (MapHex)guiHex.getModel(); TileManager tileManager = guiHex.getHexMap().orUIManager.getTileManager(); tile = tileManager.getTile(tileId); - picId = hex.getPictureId(); + + if (tile.getPictureId() >0 ) { + picId= tile.getPictureId(); + } else { + picId = hex.getPictureId(); + } if (hex.getTileOrientation() == TileOrientation.EW) { baseRotation = 0.5 * DEG60; |