Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* Fix TeamRatingPanel

* Review TeamRatingPanel

* release_notes.md
  • Loading branch information
wsbrenk authored Oct 20, 2024
1 parent 2cd15b6 commit fe2a158
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/main/java/core/prediction/TeamRatingPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.io.Serial;
import java.util.ArrayList;
import java.util.List;



class TeamRatingPanel extends JPanel implements ItemListener {
private static final long serialVersionUID = -6238120571629957579L;
@Serial
private static final long serialVersionUID = -6238120571629957579L;
//~ Instance fields ----------------------------------------------------------------------------
private final GridBagConstraints m_clConstraints;
private List<RatingItem> levels;
Expand Down Expand Up @@ -78,12 +80,12 @@ class TeamRatingPanel extends JPanel implements ItemListener {
tactIndex = 6;
}

values[row][0].setSelectedIndex(tactIndex);
values[row][0].setSelectedIndex(Math.max(0, Math.min(tactIndex, tactics.size()-1)));
values[row][0].addItemListener(this);
taktikpanel.add(values[row][0]);

values[row][1] = new JComboBox(levels.toArray());
values[row][1].setSelectedIndex(Math.min(team.getTacticLevel(), 19)); // limit tactic strength to divine
values[row][1].setSelectedIndex(Math.max(0,Math.min(team.getTacticLevel(), levels.size()-1)));
values[row][1].addItemListener(this);

if (team.getTacticType() == IMatchDetails.TAKTIK_NORMAL) {
Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@

* Calculation of the tsi sub by approximating the tsi formula (#235)

### Team Analyzer
* Fix illegal argument exception in team rating panel (#2155)
*
### Player Analysis

* Fix error in rating compare table (#2153)

### Rating
Expand Down

0 comments on commit fe2a158

Please sign in to comment.