7 Commits
1.0.0 ... 1.0.1

Author SHA1 Message Date
tyler :3
72f36b2fe1 remove broken conf in pom 2024-05-19 18:00:48 +01:00
tyler :3
46f3cb1386 Use nativerun with gluonfx 2024-05-19 16:34:03 +01:00
tyler :3
79a1f939e6 fix compiling on other systems 2024-05-19 15:25:40 +01:00
tyler :3
2592ca511f Merge branch 'master' of github.com:shrapnelnet/libremines 2024-05-19 12:34:52 +01:00
tyler :3
3e5e2e01ec Add readme 2024-05-19 12:34:30 +01:00
shr4pnel
21125ed895 Create maven-publish.yml 2024-05-19 12:33:35 +01:00
tyler :3
dddfb6f622 incorrect flag losses 2024-05-19 12:28:21 +01:00
4 changed files with 60 additions and 3 deletions

34
.github/workflows/maven-publish.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
name: Maven Package
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Publish to GitHub Packages Apache Maven
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
env:
GITHUB_TOKEN: ${{ github.token }}

1
README.md Normal file
View File

@@ -0,0 +1 @@
[![Maven Package](https://github.com/shrapnelnet/libremines/actions/workflows/maven-publish.yml/badge.svg?event=page_build)](https://github.com/shrapnelnet/libremines/actions/workflows/maven-publish.yml)

20
pom.xml
View File

@@ -35,6 +35,24 @@
<mainClass>libremines/com.shr4pnel.minesweeper.Main</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
</plugin>
<plugin>
<groupId>com.gluonhq</groupId>
<artifactId>gluonfx-maven-plugin</artifactId>
<version>1.0.22</version>
<configuration>
<mainClass>com.shr4pnel.minesweeper.Main</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-wrapper-plugin</artifactId>
<version>3.3.1</version>
</plugin>
</plugins>
</build>
</project>
</project>

View File

@@ -236,12 +236,17 @@ public class Controller {
private void showAllBombs(int clickedColumn, int clickedRow) {
for (Node node : grid.getChildren()) {
Button b = (Button) node;
String buttonURL = ((ImageView) b.getGraphic()).getImage().getUrl();
int column = GridPane.getColumnIndex(node);
int row = GridPane.getRowIndex(node);
if (!(column == clickedColumn && row == clickedRow) &&
wrapper.atColumn(column).atRow(row).isBomb()) {
setImage((Button) node, "img/bomb_revealed.png");
}
if (buttonURL.contains("flagged.png") && !wrapper.atColumn(column).atRow(row).isBomb()) {
setImage(b, "img/bomb_wrong.png");
}
}
}
@@ -269,7 +274,6 @@ public class Controller {
private void setAdjacentCount(Node tileClicked, int adjacentBombs) {
Button button = (Button) tileClicked;
URL imageURL = getClass().getResource("img/num_" + adjacentBombs + ".png");
button.setGraphic(new ImageView(new Image(String.valueOf(imageURL), 16, 16, true, false)));
setImage(button, "img/num_" + adjacentBombs + ".png");
}
}