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

Method setupOthers

win/Qt/qt_plsel.cpp:651–687  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

649}
650
651void NetHackQtPlayerSelector::setupOthers()
652{
653 int ro = role->currentRow();
654 int ra = race->currentRow();
655 int valid=-1;
656 int c=0;
657 int j;
658 for (j=0; j<ROLE_GENDERS; j++) {
659 bool v = validgend(ro,ra,j);
660 if ( gender[j]->isChecked() )
661 c = j;
662 gender[j]->setEnabled(v);
663 if ( valid<0 && v ) valid = j;
664 }
665 if ( !validgend(ro,ra,c) )
666 c = valid;
667 int k;
668 for (k=0; k<ROLE_GENDERS; k++) {
669 gender[k]->setChecked(c==k);
670 }
671 selectGender(c);
672
673 valid=-1;
674 for (j=0; j<ROLE_ALIGNS; j++) {
675 bool v = validalign(ro,ra,j);
676 if ( alignment[j]->isChecked() )
677 c = j;
678 alignment[j]->setEnabled(v);
679 if ( valid<0 && v ) valid = j;
680 }
681 if ( !validalign(ro,ra,c) )
682 c = valid;
683 for (k=0; k<ROLE_ALIGNS; k++) {
684 alignment[k]->setChecked(c==k);
685 }
686 selectAlignment(c);
687}
688
689void NetHackQtPlayerSelector::selectGender(int i)
690{

Callers

nothing calls this directly

Calls 2

validgendFunction · 0.85
validalignFunction · 0.85

Tested by

no test coverage detected