MCPcopy Create free account
hub / github.com/NetHack/NetHack / NetHackQtPlayerSelector

Method NetHackQtPlayerSelector

outdated/win/Qt3/qt3_win.cpp:1003–1187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1001};
1002
1003NetHackQtPlayerSelector::NetHackQtPlayerSelector(NetHackQtKeyBuffer& ks) :
1004 QDialog(qApp->mainWidget(),"plsel",TRUE),
1005 keysource(ks),
1006 fully_specified_role(TRUE)
1007{
1008 /*
1009 0 1 2
1010 + Name ------------------------------------+
1011 0 | |
1012 + ---- ------------------------------------+
1013 + Role ---+ + Race ---+ + Gender ------+
1014 | | | | | * Male |
1015 1 | | | | | * Female |
1016 | | | | +--------------+
1017 | | | |
1018 | | | | + Alignment ---+
1019 2 | | | | | * Male |
1020 | | | | | * Female |
1021 | | | | +--------------+
1022 3 | | | | ...stretch...
1023 | | | |
1024 4 | | | | [ Play ]
1025 5 | | | | [ Quit ]
1026 +---------+ +---------+
1027 */
1028
1029 int marg=4;
1030 QGridLayout *l = new QGridLayout(this,6,3,marg,marg);
1031
1032 QButtonGroup* namebox = new QButtonGroup(1,Horizontal,"Name",this);
1033 QLineEdit* name = new QLineEdit(namebox);
1034 name->setMaxLength(sizeof(svp.plname)-1);
1035 if ( strncmp(svp.plname,"player",6) && strncmp(svp.plname,"games",5) )
1036 name->setText(svp.plname);
1037 connect(name, SIGNAL(textChanged(const QString&)),
1038 this, SLOT(selectName(const QString&)) );
1039 name->setFocus();
1040 QButtonGroup* genderbox = new QButtonGroup("Sex",this);
1041 QButtonGroup* alignbox = new QButtonGroup("Alignment",this);
1042 QVBoxLayout* vbgb = new QVBoxLayout(genderbox,3,1);
1043 vbgb->setAutoAdd(TRUE);
1044 vbgb->addSpacing(fontMetrics().height()*3/4);
1045 QVBoxLayout* vbab = new QVBoxLayout(alignbox,3,1);
1046 vbab->setAutoAdd(TRUE);
1047 vbab->addSpacing(fontMetrics().height());
1048 QLabel* logo = new QLabel(nh_attribution, this);
1049
1050 l->addMultiCellWidget( namebox, 0,0,0,2 );
1051#ifdef QT_CHOOSE_RACE_FIRST
1052 race = new NhPSListView(this);
1053 role = new NhPSListView(this);
1054 l->addMultiCellWidget( race, 1,5,0,0 );
1055 l->addMultiCellWidget( role, 1,5,1,1 );
1056#else
1057 role = new NhPSListView(this);
1058 race = new NhPSListView(this);
1059 l->addMultiCellWidget( role, 1,5,0,0 );
1060 l->addMultiCellWidget( race, 1,5,1,1 );

Callers

nothing calls this directly

Calls 7

rn2Function · 0.85
validraceFunction · 0.85
validgendFunction · 0.85
validalignFunction · 0.85
mainWidgetMethod · 0.80
selectedItemNumberMethod · 0.80
heightMethod · 0.45

Tested by

no test coverage detected