ensuring hidden directories are included.

This commit is contained in:
Josh Ashton
2022-11-30 15:09:20 -07:00
parent 01c5417146
commit b66cbec2e7
111 changed files with 174 additions and 530 deletions
+48 -5
View File
@@ -1,13 +1,20 @@
package src;
import javax.swing.*;
import java.awt.*;
public class BasicPanel extends JPanel implements AppTheme {
import static src.AppConstants.*;
import static src.ImageManager.*;
public class BasicPanel extends JPanel {
private DefaultButton[] optionButtons;
private String[] options;
private ImageInfoPanel infoPanel;
private InfoPanel infoPanel;
private int choiceIndex;
private String panelTitle;
private ImageManager images;
private int currentPanel;
public BasicPanel(JPanel navPanel, String[] options, String[] descriptions, String panelTitle) {
@@ -24,8 +31,13 @@ public class BasicPanel extends JPanel implements AppTheme {
};
this.infoPanel = new ImageInfoPanel(options, descriptions, basicBounds, Integer.parseInt(Character.toString(panelTitle.charAt(5))));
infoPanel.updateInfo(0); // Default start with 0th element.
images = new ImageManager();
infoPanel = new InfoPanel(options, descriptions, basicBounds, images);
currentPanel = Integer.parseInt(Character.toString(panelTitle.charAt(5)));
infoPanel.updateInfo(0, getNextPortrait(0));
choiceIndex = 0;
@@ -35,6 +47,28 @@ public class BasicPanel extends JPanel implements AppTheme {
}
private JLabel getNextPortrait(int index) {
JLabel nextPortrait;
if(currentPanel == 1) {
nextPortrait = images.getRacePortrait(index);
} else if(currentPanel == 2) {
nextPortrait = images.getClassPortrait(index);
} else {
nextPortrait = null;
}
return nextPortrait;
}
private void panelSetup() {
setBackground(lightBrown);
@@ -108,7 +142,16 @@ public class BasicPanel extends JPanel implements AppTheme {
optionButtons[newIndex].select();
choiceIndex = newIndex;
infoPanel.updateInfo(choiceIndex);
if(currentPanel == 1 || currentPanel == 2) {
infoPanel.updateInfo(choiceIndex, getNextPortrait(choiceIndex));
} else {
infoPanel.updateInfo(choiceIndex);
}
}