Enable existing wc_popup_dialog option. Use it in yn_function() instead using a mystery value which apparently used to live in Qt Settings but isn't there anymore so couldn't be turned on or off. Also replaces conditional USE_POPUPS which isn't defined anywhere either so presumably came from CFLAGS and only supported "yn?", "ynq?", and "rl?" with hardcoded Qt popups rather than using NetHackQtYnDialog. Doing that revealed that the popup dialog for ynaq was in pretty bad shape. It's functional but still needs a lot of work, beyond the limited Qt/C++ capability I possess. The KeyPress issue which accepts <shift> as input, thereby preventing <shift>+<character> from being typed during ynaq prompting, is particularly nasty. Append the ynaq dialog's response to the message line containing the corresponding prompt similar to what's now done for regular yn_function(). Add getlin() prompt+response to the message window.
43 lines
775 B
C++
43 lines
775 B
C++
// Copyright (c) Warwick Allison, 1999.
|
|
// Qt4 conversion copyright (c) Ray Chason, 2012-2014.
|
|
// NetHack may be freely redistributed. See license for details.
|
|
|
|
// qt_key.h -- a key buffer
|
|
|
|
#ifndef QT4KEY_H
|
|
#define QT4KEY_H
|
|
|
|
namespace nethack_qt_ {
|
|
|
|
class NetHackQtKeyBuffer {
|
|
public:
|
|
NetHackQtKeyBuffer();
|
|
|
|
bool Empty() const;
|
|
bool Full() const;
|
|
|
|
void Put(int k, int ascii, uint state);
|
|
void Put(char a);
|
|
void Put(const char* str);
|
|
int GetKey();
|
|
int GetAscii();
|
|
Qt::KeyboardModifiers GetState();
|
|
|
|
int TopKey() const;
|
|
int TopAscii() const;
|
|
Qt::KeyboardModifiers TopState() const;
|
|
|
|
void Drain();
|
|
|
|
private:
|
|
enum { maxkey=64 };
|
|
int key[maxkey];
|
|
int ascii[maxkey];
|
|
Qt::KeyboardModifiers state[maxkey];
|
|
int in,out;
|
|
};
|
|
|
|
} // namespace nethack_qt_
|
|
|
|
#endif
|