Skip to content

Commit

Permalink
Fixed player images
Browse files Browse the repository at this point in the history
  • Loading branch information
leventebajak committed May 14, 2024
1 parent 3198c9c commit 6c031c5
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 35 deletions.
16 changes: 8 additions & 8 deletions src/main/java/GameFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -294,22 +294,22 @@ public void actionPerformed(ActionEvent e) {
playerBackground.setBorderPainted(false);
playerBackground.setOpaque(false);
playerBackground.setBounds (37, 742, 470, 146);
playerBackground.setIcon(new ImageIcon("res/"+"bigbutton.png"));
playerBackground.setDisabledIcon(new ImageIcon("res/"+"bigbutton.png"));
playerBackground.setIcon(new ImageIcon("res/bigbutton.png"));
playerBackground.setDisabledIcon(new ImageIcon("res/bigbutton.png"));
fieldBackground.setEnabled(false);
fieldBackground.setContentAreaFilled(false);
fieldBackground.setBorderPainted(false);
fieldBackground.setOpaque(false);
fieldBackground.setBounds (572, 742, 470, 146);
fieldBackground.setIcon(new ImageIcon("res/"+"bigbutton.png"));
fieldBackground.setDisabledIcon(new ImageIcon("res/"+"bigbutton.png"));
fieldBackground.setIcon(new ImageIcon("res/bigbutton.png"));
fieldBackground.setDisabledIcon(new ImageIcon("res/bigbutton.png"));
pointBackground.setEnabled(false);
pointBackground.setContentAreaFilled(false);
pointBackground.setBorderPainted(false);
pointBackground.setOpaque(false);
pointBackground.setBounds (998, 742, 470, 146);
pointBackground.setIcon(new ImageIcon("res/"+"middlebutton.png"));
pointBackground.setDisabledIcon(new ImageIcon("res/"+"middlebutton.png"));
pointBackground.setIcon(new ImageIcon("res/middlebutton.png"));
pointBackground.setDisabledIcon(new ImageIcon("res/middlebutton.png"));
}

public void SetButtonStyle(JButton button, ImageIcon img, ImageIcon disabledimg, int angle ){
Expand Down Expand Up @@ -337,8 +337,8 @@ public void DrawPlayer(Player player){
DrawFieldIcon(i, player.GetField());
}

playericon.setIcon(new ImageIcon(player.GetPictureName()));
playericon.setDisabledIcon(new ImageIcon(player.GetPictureName()));
playericon.setIcon(new ImageIcon("res/"+player.GetPictureName()));
playericon.setDisabledIcon(new ImageIcon("res/"+player.GetPictureName()));
}

/**
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/MainMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,23 @@ public void actionPerformed(ActionEvent e) {
}
});

background.setIcon(new ImageIcon("res/"+"1.png"));
background.setDisabledIcon(new ImageIcon("res/"+"1.png"));
background.setIcon(new ImageIcon("res/1.png"));
background.setDisabledIcon(new ImageIcon("res/1.png"));
background.setEnabled(false);
background.setOpaque(false);
background.setContentAreaFilled(false);
background.setBorderPainted(false);
background.setFocusable(false);
start.setIcon(new ImageIcon("res/"+"startgame.png"));
start.setDisabledIcon(new ImageIcon("res/"+"startgame.png"));
start.setIcon(new ImageIcon("res/startgame.png"));
start.setDisabledIcon(new ImageIcon("res/startgame.png"));
start.setOpaque(false);
start.setContentAreaFilled(false);
settings.setIcon(new ImageIcon("res/"+"settings.png"));
settings.setDisabledIcon(new ImageIcon("res/"+"settings.png"));
settings.setIcon(new ImageIcon("res/settings.png"));
settings.setDisabledIcon(new ImageIcon("res/settings.png"));
settings.setOpaque(false);
settings.setContentAreaFilled(false);
exit.setIcon(new ImageIcon("res/"+"exit.png"));
exit.setDisabledIcon(new ImageIcon("res/"+"exit.png"));
exit.setIcon(new ImageIcon("res/exit.png"));
exit.setDisabledIcon(new ImageIcon("res/exit.png"));
exit.setOpaque(false);
exit.setContentAreaFilled(false);
background.setBounds (0, 0, 512, 512);
Expand All @@ -112,7 +112,7 @@ public void actionPerformed(ActionEvent e) {

Font font=new Font("Consolas", Font.BOLD, 60);
try {
font = Font.createFont(Font.TRUETYPE_FONT, new File("res/"+"Desert.ttf"));
font = Font.createFont(Font.TRUETYPE_FONT, new File("res/Desert.ttf"));
} catch (FontFormatException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); }
font = font.deriveFont(Font.BOLD,45);

Expand Down
36 changes: 18 additions & 18 deletions src/main/java/SettingsFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,22 +106,22 @@ private void initComponents(){
f2.setEnabled (false);
f3.setEnabled (false);
f4.setEnabled (false);
s1.setIcon(new ImageIcon("res/"+"saboteur1.png"));
s1.setDisabledIcon(new ImageIcon("res/"+"saboteur1.png"));
s2.setIcon(new ImageIcon("res/"+"saboteur2.png"));
s2.setDisabledIcon(new ImageIcon("res/"+"saboteur2.png"));
s3.setIcon(new ImageIcon("res/"+"saboteur3.png"));
s3.setDisabledIcon(new ImageIcon("res/"+"saboteur3.png"));
s4.setIcon(new ImageIcon("res/"+"saboteur4.png"));
s4.setDisabledIcon(new ImageIcon("res/"+"saboteur4.png"));
f1.setIcon(new ImageIcon("res/"+"fixer1.png"));
f1.setDisabledIcon(new ImageIcon("res/"+"fixer1.png"));
f2.setIcon(new ImageIcon("res/"+"fixer2.png"));
f2.setDisabledIcon(new ImageIcon("res/"+"fixer2.png"));
f3.setIcon(new ImageIcon("res/"+"fixer3.png"));
f3.setDisabledIcon(new ImageIcon("res/"+"fixer3.png"));
f4.setIcon(new ImageIcon("res/"+"fixer4.png"));
f4.setDisabledIcon(new ImageIcon("res/"+"fixer4.png"));
s1.setIcon(new ImageIcon("res/saboteur1.png"));
s1.setDisabledIcon(new ImageIcon("res/saboteur1.png"));
s2.setIcon(new ImageIcon("res/saboteur2.png"));
s2.setDisabledIcon(new ImageIcon("res/saboteur2.png"));
s3.setIcon(new ImageIcon("res/saboteur3.png"));
s3.setDisabledIcon(new ImageIcon("res/saboteur3.png"));
s4.setIcon(new ImageIcon("res/saboteur4.png"));
s4.setDisabledIcon(new ImageIcon("res/saboteur4.png"));
f1.setIcon(new ImageIcon("res/fixer1.png"));
f1.setDisabledIcon(new ImageIcon("res/fixer1.png"));
f2.setIcon(new ImageIcon("res/fixer2.png"));
f2.setDisabledIcon(new ImageIcon("res/fixer2.png"));
f3.setIcon(new ImageIcon("res/fixer3.png"));
f3.setDisabledIcon(new ImageIcon("res/fixer3.png"));
f4.setIcon(new ImageIcon("res/fixer4.png"));
f4.setDisabledIcon(new ImageIcon("res/fixer4.png"));

jp.setPreferredSize (new Dimension (930, 647));
jp.setLayout (null);
Expand Down Expand Up @@ -223,8 +223,8 @@ public void actionPerformed(ActionEvent e) {
getContentPane().add(jp);
buttonsDisabler();

background.setIcon(new ImageIcon("res/"+"2.png"));
background.setDisabledIcon(new ImageIcon("res/"+"2.png"));
background.setIcon(new ImageIcon("res/2.png"));
background.setDisabledIcon(new ImageIcon("res/2.png"));
background.setEnabled(false);
background.setOpaque(false);
background.setContentAreaFilled(false);
Expand Down

0 comments on commit 6c031c5

Please sign in to comment.