Qt ynaq/yn#aq dialogs
When 'popup_dialog' is set, the Qt interface uses a popup window for yn_function() calls and the dialog has a list of buttons, one per potential choice. It has been handling "yn?" and "ynq?" questions differently from general request-one-char prompts, using buttons "Yes", "No, and "Cancel" instead of showing individual letters. This extends that to "ynaq" and "yn#aq" questions and labels 'q' reply as "Stop" instead of "Cancel" for those. Also, when player uses keyboard instead of mouse to answer, allow 'c' as well as 'q' for cancel ones, 's' as well as 'q' for stop ones. Prompt Buttons yn [Yes ][ No ] ynq [ Yes ][ No ][Cancel] ynaq [Yes ][ No ][All ][Stop] yn#aq [Yes ]Count:______[ No ][All ][Stop] rl [ Left ][Right ] //unchanged; included for completeness (For contrast, when something specifies "ny" as the acceptable choices, the buttons will just be [n][y]. Prompts for choosing from a list of inventory letters can't accidentally match these special cases as long as they're specified in alphabetical order.)
This commit is contained in:
@@ -19,8 +19,12 @@ private:
|
||||
bool allow_count;
|
||||
QLineEdit *le;
|
||||
|
||||
// abritrary size; might need to be more sophisicated someday
|
||||
char alt_answer[26 + 1], alt_result[26 + 1];
|
||||
|
||||
protected:
|
||||
virtual void keyPressEvent(QKeyEvent*);
|
||||
void AltChoice(char answer, char result);
|
||||
|
||||
private slots:
|
||||
void doneItem(int);
|
||||
|
||||
Reference in New Issue
Block a user