H. G. Muller wrote on Wed, Sep 14, 2016 01:17 PM UTC:
Indeed, that is a disadvantage of the way promotions are implemented: you have to select from the piece list. When used here as diagram the intended application was to show pseudo-legal piece moves, not play complete games, so promotion is really a bit outside the scope. When I use it for playing games on a turn-based server page, I display the piece list permanently next to the board, so that this way of chosing the promotion piece is not a problem. (And for Shogi variants, where the list can get very long, the choice is only yes/no, and can be made on the line above the board.) I guess it could also open a list of names to click on.
I noticed the diagram allows you to promote to opponent pieces! For some reason it does not allow promotion when moving from 8th to 9th rank after deferral. I should certainly fix that.
I guess you can do without P in the promoChoice, so that clicks on the Pawn will be ignored, as you can defer from promotion by clicking a piece that is not allowed on the 8th rank. That would avoid assignment of a default promotion piece when you choose Pawn on 10th rank.
Note that you have an M in the promoChoice string, presumably for Marshall, but that the piece name is defined as Chancellor, abbreviated by C. So the choice of Chancellor would be ignored.
PS: note I made a tiny change to the WeirdPromotion script, as when you chose a Pawn for black on the last rank you would get a WHITE Queen!
Indeed, that is a disadvantage of the way promotions are implemented: you have to select from the piece list. When used here as diagram the intended application was to show pseudo-legal piece moves, not play complete games, so promotion is really a bit outside the scope. When I use it for playing games on a turn-based server page, I display the piece list permanently next to the board, so that this way of chosing the promotion piece is not a problem. (And for Shogi variants, where the list can get very long, the choice is only yes/no, and can be made on the line above the board.) I guess it could also open a list of names to click on.
I noticed the diagram allows you to promote to opponent pieces! For some reason it does not allow promotion when moving from 8th to 9th rank after deferral. I should certainly fix that.
I guess you can do without P in the promoChoice, so that clicks on the Pawn will be ignored, as you can defer from promotion by clicking a piece that is not allowed on the 8th rank. That would avoid assignment of a default promotion piece when you choose Pawn on 10th rank.
Note that you have an M in the promoChoice string, presumably for Marshall, but that the piece name is defined as Chancellor, abbreviated by C. So the choice of Chancellor would be ignored.
PS: note I made a tiny change to the WeirdPromotion script, as when you chose a Pawn for black on the last rank you would get a WHITE Queen!