Commit 7e4d505c authored by 刘家荣's avatar 刘家荣 💬
Browse files

Merge remote-tracking branch 'origin/itr2-front'

parents ac9a5a39 28dd9154
Loading
Loading
Loading
Loading

res/BGM icon.png

0 → 100644
+5.54 KiB
Loading image diff...

res/BGP icon.png

0 → 100644
+8.27 KiB
Loading image diff...

res/CBP 2.0.png

0 → 100644
+2.13 MiB
Loading image diff...
+10 −7
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ public class ChessGameFrame extends JFrame {
        addExitButton();
        addLoadButton();
        addBGMButton();
        addBGPButton();
        addWithdrawButton();
        addSendButton();

@@ -166,11 +167,12 @@ public class ChessGameFrame extends JFrame {
        });
    }
    private void addBGMButton() {
        JButton button = new JButton("bgm");
        Image img = new ImageIcon("res\\BGM icon.png").getImage().getScaledInstance(30,30,Image.SCALE_SMOOTH);
        ImageIcon icon = new ImageIcon(img);
        JButton button = new JButton(icon);
        button.setLocation(550,200);
        button.setSize(40, 30);
        button.setFont(new Font("Rockwell", Font.BOLD, 10));
//        button.setBackground(Color.green);
        button.setVisible(true); //  whether visible
        add(button);

@@ -185,13 +187,16 @@ public class ChessGameFrame extends JFrame {
        });
    }
    private void addBGPButton() {
        JButton button = new JButton("BGP");
        Image img = new ImageIcon("res\\BGP icon.png").getImage().getScaledInstance(30,30,Image.SCALE_SMOOTH);
        ImageIcon icon = new ImageIcon(img);
        JButton button = new JButton(icon);
        button.setLocation(550, 240);
        button.setSize(40, 30);
        button.setFont(new Font("Rockwell", Font.BOLD, 10));
        button.setVisible(true);
        add(button);

        // TODO 完成
        button.addActionListener(e -> {

        });
@@ -213,7 +218,6 @@ public class ChessGameFrame extends JFrame {

        });
    }

    public void addSendButton() {
        JButton button = new JButton("Send");
        button.setLocation(550,790);
@@ -242,7 +246,6 @@ public class ChessGameFrame extends JFrame {
        score.setBackground(Color.black);
        score.setVisible(true);

        // todo instance is null
        int[] getScore = Game.instance.getScoreboard();
        score.setText(String.valueOf(getScore[chessType]));
        add(score);
@@ -293,7 +296,7 @@ public class ChessGameFrame extends JFrame {
        roomListArea.setFont(new Font("Rockwell",Font.BOLD,10));
        roomListArea.setBackground(Color.WHITE);
        // todo 后端可 print 但 user 不能编辑
//        playerListArea.setEnabled(false);
        playerListArea.setEditable(false);
        add(roomListArea);
    }

@@ -313,7 +316,7 @@ public class ChessGameFrame extends JFrame {
        messageArea.setBackground(Color.green);
//        jScrollPane.setLocation(445,718);
        // todo 后端可 print 但 user 不能编辑
//        messageArea.setEnabled(false);
        messageArea.setEditable(false);
        messageArea.setLocation(445,625);
//        add(jScrollPane);
        add(messageArea);
+1 −1
Original line number Diff line number Diff line
package view;

public enum Theme {
    DEFAULT("img"), STYLE_2("img"), STYLE_3("img");
    DEFAULT("res\\CBP 1.0.png"), STYLE_2("res\\CBP 2.0.png"), STYLE_3("img");
    public final String imgDir;
    
    Theme(String imgDir) {