| 610 | } |
| 611 | |
| 612 | void NetHackQtPlayerSelector::selectRace(int crow, int ccol, |
| 613 | int prow, int pcol) |
| 614 | { |
| 615 | int ra = race->currentRow(); |
| 616 | int ro = role->currentRow(); |
| 617 | if (ra == -1 || ro == -1) |
| 618 | return; |
| 619 | QTableWidgetItem *item = race->item(prow, 0); |
| 620 | if (item != NULL) |
| 621 | item->setSelected(false); |
| 622 | |
| 623 | #ifndef QT_CHOOSE_RACE_FIRST |
| 624 | selectRole(crow, ccol, prow, pcol); |
| 625 | #else |
| 626 | QTableWidgetItem *i = race->currentItem(); |
| 627 | QTableWidgetItem *valid = 0; |
| 628 | for (int j = 0; races[j].noun; ++j) { |
| 629 | if (!valid && (ro < 0 || validrace(ro, j))) { |
| 630 | valid = race->item(j, 0); |
| 631 | break; |
| 632 | } |
| 633 | } |
| 634 | if (!validrace(ro, race->currentRow())) |
| 635 | i = valid; |
| 636 | for (int j = 0; races[j].noun; ++j) { |
| 637 | item = race->item(j, 0); |
| 638 | item->setSelected(item == i); |
| 639 | /* used to call setFlags here, but setupOthers() -> selectGender() |
| 640 | (and selectAlignment()) -> populate_races() takes care of that */ |
| 641 | } |
| 642 | nhUse(crow); |
| 643 | nhUse(ccol); |
| 644 | nhUse(pcol); |
| 645 | #endif |
| 646 | |
| 647 | //flags.initrace = race->currentRow(); |
| 648 | setupOthers(); |
| 649 | } |
| 650 | |
| 651 | void NetHackQtPlayerSelector::setupOthers() |
| 652 | { |
nothing calls this directly
no test coverage detected