From 6c031c56913f9143401a6e2543a67e19216a4b22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levente=20Baj=C3=A1k?= Date: Tue, 14 May 2024 19:01:08 +0200 Subject: [PATCH] Fixed player images --- src/main/java/GameFrame.java | 16 +++++++------- src/main/java/MainMenu.java | 18 ++++++++-------- src/main/java/SettingsFrame.java | 36 ++++++++++++++++---------------- 3 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/main/java/GameFrame.java b/src/main/java/GameFrame.java index 1893740..8b2246b 100644 --- a/src/main/java/GameFrame.java +++ b/src/main/java/GameFrame.java @@ -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 ){ @@ -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())); } /** diff --git a/src/main/java/MainMenu.java b/src/main/java/MainMenu.java index f0a808e..75582c2 100644 --- a/src/main/java/MainMenu.java +++ b/src/main/java/MainMenu.java @@ -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); @@ -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); diff --git a/src/main/java/SettingsFrame.java b/src/main/java/SettingsFrame.java index 4913d61..1f494fc 100644 --- a/src/main/java/SettingsFrame.java +++ b/src/main/java/SettingsFrame.java @@ -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); @@ -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);