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 |
From: Brett L. <wak...@gm...> - 2007-12-04 22:44:34
|
On Tue, 2007-12-04 at 22:04 +0100, Erik Vos wrote: > A summary of the changes: > > 1. The main goal was implementing bonus tokens, An important feature of several games. Good choice. :-) > Bonus tokens are not bound to stations (white circles). > To avoid conflicts with the current (imperfect) base token positioning, That's putting it mildly. ;-) > In the future we will need some algorithm to find empty spots > to lay such tokens (or perhaps predefine such spots in Tiles.xml). Yes. The token laying code needs a lot of love. Perhaps there is someone lurking on the list that would like to work on it? > 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. > We've restructerd the OR UI a few different times. I'm not certain there's going to be an easy way to structure so many inter-dependent parts. Perhaps we just need to better document how it works so that each time we come back to it, we don't have to RTFS over and over again to relearn it. > 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. Yeah, one of the bigger todo's that I've had on my list is to figure out why the OR UI doesn't automatically re-size itself when the window is resized. I suspect there's some single thing that's missing or mis-configured that is causing it to stay a static size. ---Brett. Ignorance must certainly be bliss or there wouldn't be so many people so resolutely pursuing it. |