Commit 76f9b52a authored by YuFan Jia's avatar YuFan Jia 💤
Browse files

feat(remind): add

parent 710fe631
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -65,9 +65,6 @@ public class GameCore {
            this.currentPlayer = ChessPiece.BLACK;
        }
        ChessGameUI.thisStatus.setCurrentPlayer(currentPlayer);
        // todo:complete status panel
        // statusPanel.setPlayerText(currentPlayer.name());
        // statusPanel.setScoreText(blackScore, whiteScore);
    }

    public void zoom(int outerWidth, int outHeight) {// 缩放
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ public class BasicBackground {
			backFrame.setTitle("Othello");
			backFrame.setName("backFrame");
			Container basicContentPane = backFrame.getContentPane();
			basicContentPane.setPreferredSize(new Dimension(700, 500));
			basicContentPane.setPreferredSize(new Dimension(500, 300));
			backFrame.pack();
			backFrame.setLocationRelativeTo(null);
		}
+10 −4
Original line number Diff line number Diff line
@@ -50,8 +50,11 @@ public class ChessGameUI extends JPanel {
	}

	private void restartButtonActionPerformed() {// restart按钮触发事件
		OpinionPanel tem = new OpinionPanel("Are you sure to restart the game?", "Waing", JOptionPane.OK_CANCEL_OPTION);
		if (tem.clickYes()) {
			thisGameCore.restart();
		}
	}

	private void undoButtonActionPerformed() {// undo按钮触发事件
		thisGameCore.undo();
@@ -68,10 +71,13 @@ public class ChessGameUI extends JPanel {
	}

	private void menuBUttonActionPerformed() {
		JOptionPane.showConfirmDialog(null, "Are you sure to exit to menu?", "Waring", 2);
		OpinionPanel tem = new OpinionPanel("Are you sure to exit to the menu?", "Warning",
				JOptionPane.OK_CANCEL_OPTION);
		if (tem.clickYes()) {
			BasicBackground.backFrame.remove(BasicBackground.thisChessGameUI);
			BasicBackground.changePanel(BasicBackground.thisStartMenuUI);
		}
	}

	// private void cheatListener(ItemEvent e) {// 上面出发后弹出的选项卡的触发事件
	// String select = e.getItem().toString();
+19 −0
Original line number Diff line number Diff line
package GameUI;

import javax.swing.JOptionPane;

public class OpinionPanel extends JOptionPane {
    private int flag;

    OpinionPanel(String word, String title, int buttonType) {
        flag = showConfirmDialog(null, word, title, buttonType);
    }

    public boolean clickYes() {
        if (flag == JOptionPane.YES_OPTION)
            return true;
        else
            return false;
    }

}
 No newline at end of file
+2 −2
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ public class StartMenuUI extends JPanel {

			// ---- label1 ----
			label1.setText("Othello");
			label1.setFont(new Font("Sitka Banner", Font.BOLD, 60));
			label1.setFont(new Font("Sitka Banner", Font.BOLD, 50));
			label1.setHorizontalAlignment(SwingConstants.CENTER);
			label1.setEnabled(false);
			label1.setVisible(false);
@@ -141,6 +141,6 @@ public class StartMenuUI extends JPanel {
	private JLabel label4;
	private JPanel panel6;
	private JButton exitButton;
	Font buttonsStandard = new Font("\u6977\u4f53", Font.PLAIN, 20);
	Font buttonsStandard = new Font("\u6977\u4f53", Font.PLAIN, 12);
	// JFormDesigner - End of variables declaration //GEN-END:variables
}
Loading