917 int color_done, color_notdone; |
917 int color_done, color_notdone; |
918 |
918 |
919 // Draw standard stuff |
919 // Draw standard stuff |
920 DrawWindowWidgets(w); |
920 DrawWindowWidgets(w); |
921 |
921 |
|
922 /* Check if the currently selected player is still active. */ |
|
923 if (_performance_rating_detail_player == INVALID_PLAYER || !GetPlayer(_performance_rating_detail_player)->is_active) { |
|
924 if (_performance_rating_detail_player != INVALID_PLAYER) { |
|
925 /* Raise and disable the widget for the previous selection. */ |
|
926 RaiseWindowWidget(w, _performance_rating_detail_player + 13); |
|
927 DisableWindowWidget(w, _performance_rating_detail_player + 13); |
|
928 SetWindowDirty(w); |
|
929 |
|
930 _performance_rating_detail_player = INVALID_PLAYER; |
|
931 } |
|
932 |
|
933 for (i = PLAYER_FIRST; i < MAX_PLAYERS; i++) { |
|
934 if (GetPlayer(i)->is_active) { |
|
935 /* Lower the widget corresponding to this player. */ |
|
936 LowerWindowWidget(w, i + 13); |
|
937 SetWindowDirty(w); |
|
938 |
|
939 _performance_rating_detail_player = i; |
|
940 break; |
|
941 } |
|
942 } |
|
943 } |
|
944 |
|
945 /* If there are no active players, don't display anything else. */ |
|
946 if (_performance_rating_detail_player == INVALID_PLAYER) break; |
|
947 |
922 // Paint the player icons |
948 // Paint the player icons |
923 for (i = 0; i < MAX_PLAYERS; i++) { |
949 for (i = 0; i < MAX_PLAYERS; i++) { |
924 if (!GetPlayer(i)->is_active) { |
950 if (!GetPlayer(i)->is_active) { |
925 // Check if we have the player as an active player |
951 // Check if we have the player as an active player |
926 if (!IsWindowWidgetDisabled(w, i + 13)) { |
952 if (!IsWindowWidgetDisabled(w, i + 13)) { |
927 // Bah, player gone :( |
953 // Bah, player gone :( |
928 DisableWindowWidget(w, i + 13); |
954 DisableWindowWidget(w, i + 13); |
929 // Is this player selected? If so, select first player (always save? :s) |
955 |
930 if (IsWindowWidgetLowered(w, i + 13)) { |
|
931 RaiseWindowWidget(w, i + 13); |
|
932 LowerWindowWidget(w, 13); |
|
933 _performance_rating_detail_player = 0; |
|
934 } |
|
935 // We need a repaint |
956 // We need a repaint |
936 SetWindowDirty(w); |
957 SetWindowDirty(w); |
937 } |
958 } |
938 continue; |
959 continue; |
939 } |
960 } |
940 |
961 |
941 // Check if we have the player marked as inactive |
962 // Check if we have the player marked as inactive |
942 if (IsWindowWidgetDisabled(w, i + 13)) { |
963 if (IsWindowWidgetDisabled(w, i + 13)) { |
943 // New player! Yippie :p |
964 // New player! Yippie :p |