player made up his mind - get final selection here */
| 709 | |
| 710 | /* player made up his mind - get final selection here */ |
| 711 | int |
| 712 | plselFinalSelection(HWND hWnd, int *selection) |
| 713 | { |
| 714 | int ind; |
| 715 | |
| 716 | /* get current selections */ |
| 717 | if (SendDlgItemMessage(hWnd, IDC_PLSEL_ROLE_RANDOM, BM_GETCHECK, 0, 0) |
| 718 | == BST_CHECKED) { |
| 719 | flags.initrole = ROLE_RANDOM; |
| 720 | } else { |
| 721 | ind = |
| 722 | SendDlgItemMessage(hWnd, IDC_PLSEL_ROLE_LIST, CB_GETCURSEL, 0, 0); |
| 723 | flags.initrole = (ind == LB_ERR) |
| 724 | ? ROLE_RANDOM |
| 725 | : SendDlgItemMessage(hWnd, IDC_PLSEL_ROLE_LIST, |
| 726 | CB_GETITEMDATA, ind, 0); |
| 727 | } |
| 728 | |
| 729 | if (SendDlgItemMessage(hWnd, IDC_PLSEL_RACE_RANDOM, BM_GETCHECK, 0, 0) |
| 730 | == BST_CHECKED) { |
| 731 | flags.initrace = ROLE_RANDOM; |
| 732 | } else { |
| 733 | ind = |
| 734 | SendDlgItemMessage(hWnd, IDC_PLSEL_RACE_LIST, CB_GETCURSEL, 0, 0); |
| 735 | flags.initrace = (ind == LB_ERR) |
| 736 | ? ROLE_RANDOM |
| 737 | : SendDlgItemMessage(hWnd, IDC_PLSEL_RACE_LIST, |
| 738 | CB_GETITEMDATA, ind, 0); |
| 739 | } |
| 740 | |
| 741 | if (SendDlgItemMessage(hWnd, IDC_PLSEL_GENDER_RANDOM, BM_GETCHECK, 0, 0) |
| 742 | == BST_CHECKED) { |
| 743 | flags.initgend = ROLE_RANDOM; |
| 744 | } else { |
| 745 | ind = SendDlgItemMessage(hWnd, IDC_PLSEL_GENDER_LIST, CB_GETCURSEL, 0, |
| 746 | 0); |
| 747 | flags.initgend = (ind == LB_ERR) |
| 748 | ? ROLE_RANDOM |
| 749 | : SendDlgItemMessage(hWnd, IDC_PLSEL_GENDER_LIST, |
| 750 | CB_GETITEMDATA, ind, 0); |
| 751 | } |
| 752 | |
| 753 | if (SendDlgItemMessage(hWnd, IDC_PLSEL_ALIGN_RANDOM, BM_GETCHECK, 0, 0) |
| 754 | == BST_CHECKED) { |
| 755 | flags.initalign = ROLE_RANDOM; |
| 756 | } else { |
| 757 | ind = SendDlgItemMessage(hWnd, IDC_PLSEL_ALIGN_LIST, CB_GETCURSEL, 0, |
| 758 | 0); |
| 759 | flags.initalign = (ind == LB_ERR) |
| 760 | ? ROLE_RANDOM |
| 761 | : SendDlgItemMessage(hWnd, IDC_PLSEL_ALIGN_LIST, |
| 762 | CB_GETITEMDATA, ind, 0); |
| 763 | } |
| 764 | |
| 765 | /* check the role */ |
| 766 | if (flags.initrole == ROLE_RANDOM) { |
| 767 | flags.initrole = pick_role(flags.initrace, flags.initgend, |
| 768 | flags.initalign, PICK_RANDOM); |
no test coverage detected