[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XBoard-devel] GTK version, promotion popup

From: h.g. muller
Subject: [XBoard-devel] GTK version, promotion popup
Date: Fri, 04 Sep 2009 10:20:10 +0200

At 23:49 3-9-2009 -0700, Arun Persaud wrote:
The GTK version also still crashes, for example when promoting a pawn, since the promotion-window is not been ported to GTK and the old X-code will now create a crash...

Getting rid of the promotion popup altogether is on my to-do list,
so perhaps you should not bother porting the old dialog. One of
the very annoying things about the XBoard promotion popup is
that it is shown even for moves that are already known to be illegal.
Try for instance to play e2d8 from the opening setup. When legality
testing is on, it first shows te promotion popup to make you select
a piece, and no matter what you choose, the move is then rejected
as illegal later. In WinBoard I fixed this, but not yet in XBoard.
Especially in Shogi, where moving any piece type in or out of a rather
deep promotion zone could cause a promotion, this behavior was very
annoying. (For normal Chess you are of course not very likely to draw
Pawns to the last rank by accident.)

But what is even more annoying is that the promotion popup is not
variant-proof. Not all of the 22 piece types can appear in the promotion
menu, although it is patched a little to work in the most common variants
(e.g. in giveaway you can promote to King, and in Gothic to Archbishop
and Chancelor, while in Shogi you can select Yes/No.)

Another problem is that currently internationalization is broken in the
promotion popup: It uses the first letter of the name on the button as
a piece indicator (except for Knight), so if yo change the button labels,
you would get invalid choices unless you would also adapt the
pieceToChar table to the language. (Which is in general undesirable,
as it would preclude you from reading international PGN.)

In Superchess (-variant super) and Great Shatranj you can only promote
to a captured piece, and for this purpose I let these games display holdings
(although they are not drop games) to show what is captured. in WinBoard
I already implemented promotion in these games without a popup,
by having the user click the piece in the holding he wants to promote to,
in order to finish the move. (Until then the piece is shown as Pawn on
the promotion square. It would of course be still nicer if the Pawn kept
flashing there until you make the choice; I think that XBoard can flash

I would like to switch to that method also for games where the promotion
choice is fixed (i.e. not dependent on what is captured, so no holdings
are shown). To this end I would want to show a "pseudo-popup", i.e. just
change the background color of a rectangular area in the board to black,
and temporarily remove the pieces that are on those squares in the current
position, and replace them by all the pieces you can promote to in the
current variant. (If there is more than one, that is; in Shatranj where you
always promote to "Queen" promotion would be automatic.)

This would make the promotion procedure completely pictorial,
and would thus also get rid of any lanuage issues. It would need
a bit smart code, though, to decide how to best format the available
choices into a rectangular area, and where to position it on the board.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]