During role/race/gender/alignment selection, when gender gets toggled replace the gender-specific role titles and their icons to reflect new gender value. And enable or disable Valkyrie choice depending upon the gender value, not just current race value. This ended up revising a lot of the NetHackQtPlayerSelector code, eliminating some redundancies and being more careful with the use of validrace()/validgend()/validalign(). That still isn't bulletproof. It also changes the two instances of buttonPressed that were drawing Qt6 warnings from connect() at run-time with buttonClicked. That works as intended with Qt5 and might eliminate those. The code to use female player character tiles looks correct to me but when I toggle gender, role titles change but their icons don't. I don't know what's going on here. Some ealier code always specifies MALE but that code isn't used according to various prints to stderr that I temporarily inserted.
60 lines
1.2 KiB
C++
60 lines
1.2 KiB
C++
// Copyright (c) Warwick Allison, 1999.
|
|
// Qt4 conversion copyright (c) Ray Chason, 2012-2014.
|
|
// NetHack may be freely redistributed. See license for details.
|
|
|
|
// qt_plsel.h -- player selector dialog
|
|
|
|
#ifndef QT4PLSEL_H
|
|
#define QT4PLSEL_H
|
|
|
|
namespace nethack_qt_ {
|
|
|
|
class NetHackQtKeyBuffer;
|
|
|
|
class NetHackQtPlayerSelector : private QDialog {
|
|
Q_OBJECT
|
|
public:
|
|
enum { R_None=-1, R_Quit=-2, R_Rand=-3 };
|
|
|
|
NetHackQtPlayerSelector(NetHackQtKeyBuffer&);
|
|
|
|
public slots:
|
|
void Quit();
|
|
void Random();
|
|
void Randomize();
|
|
void plnamePlayVsQuit();
|
|
|
|
void populate_roles();
|
|
void populate_races();
|
|
|
|
void selectName(const QString& n);
|
|
void selectRole(int current, int, int previous, int);
|
|
void selectRace(int current, int, int previous, int);
|
|
void setupOthers();
|
|
void selectGender(int);
|
|
void selectAlignment(int);
|
|
|
|
public:
|
|
bool Choose();
|
|
|
|
private:
|
|
QTableWidget* role;
|
|
QTableWidget* race;
|
|
QRadioButton **gender;
|
|
QRadioButton **alignment;
|
|
|
|
bool fully_specified_role;
|
|
int chosen_gend;
|
|
int chosen_align;
|
|
int cleric_role_row;
|
|
int human_race_row;
|
|
|
|
QPushButton *rand_btn;
|
|
QPushButton *play_btn;
|
|
QPushButton *quit_btn;
|
|
};
|
|
|
|
} // namespace nethack_qt_
|
|
|
|
#endif
|