From: Erik V. <eri...@hc...> - 2007-12-04 22:20:02
|
I have just committed a bunch of changes and a few new classes. A summary of the changes: 1. The main goal was implementing bonus tokens, in particular the 18AL +$10 Coalfield bonus token that can be laid by a company owning the S&NA private. Laying bonus tokens proceeds similarly as laying normal (base) tokens, as outlined in the next points. 2. In the token laying step the S&NA owning company now has a choice between two tokens that can be laid (in fact both can be laid, as the bonus token is extra). So we need a selection mechanism. I have implemented this similar to tile laying: after a hex is selected, the tokens that can be laid on that hex (if any) are displayed in the upgrade panel. If only one token can be laid, it is highlighted (light orange, as used in the stock round). If there is a choice, none is highlighted initially, and the player must select one. 3. Bonus tokens can be laid at any time during the OR. For that purpose, I have now added a "Special" menu to the OR window (we already have such a Special menu in the stock round for e.g. the M&H/NYC swap). If a special action can be performed, such as laying a bonus token, the Special menu is enabled and highlighted. Bonus tokens are not bound to stations (white circles). To avoid conflicts with the current (imperfect) base token positioning, bonus tokens are laid near the upper left corner of a tile (a second one would be laid near the lower right corner). In the future we will need some algorithm to find empty spots to lay such tokens (or perhaps predefine such spots in Tiles.xml). 4. To get this all working was pretty much a nightmare, not the least because of the complex and non-transparent structure of the OR UI code. To make a start improving this, I have added a new class ORUIManager, and moved most of the logic and state awareness into this class. The Window and Panel classes are now mainly concerned with UI updates and action catching, as they should (ORWindow, however, remains the main entry point, for consistency with other round type UIs). This restructuring work is far from complete, but I think everything now at least works. 5. One small fix related to the missing token names on the map. These were actually displayed, but in the wrong position: in the upper left corner of the map! This is now OK. However, the tokens are small and so the text is hardly readable. Final comment: Although I have not changed the Saved file structure and version number, it appeared that some saved files can not be reloaded because of a bug in saving token lay actions. Erik Vos |