Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 39e2475983 | |||
| 7dd3f198db | |||
| 11a246adfd |
@@ -9,6 +9,14 @@ Une application de génération et résolution de MultiDoku.
|
|||||||
- Sudoku saves
|
- Sudoku saves
|
||||||
- Multiplayer
|
- Multiplayer
|
||||||
|
|
||||||
|
## Screenshots 🖼
|
||||||
|
|
||||||
|
[[screenshots/menu.png]]
|
||||||
|
|
||||||
|
[[screenshots/solo.png]]
|
||||||
|
|
||||||
|
[[screenshots/multi.png]]
|
||||||
|
|
||||||
## Develop ☝🤓
|
## Develop ☝🤓
|
||||||
|
|
||||||
**Pour plus de détails sur la conception et autres, regarder le 👉 [wiki](https://git.ale-pri.com/Ryuk/Sudoku/wiki)** 👈
|
**Pour plus de détails sur la conception et autres, regarder le 👉 [wiki](https://git.ale-pri.com/Ryuk/Sudoku/wiki)** 👈
|
||||||
|
|||||||
@@ -71,24 +71,28 @@ public class SudokuRenderer {
|
|||||||
|
|
||||||
private void renderPopup() {
|
private void renderPopup() {
|
||||||
if (ImGui.beginPopup("editPopup")) {
|
if (ImGui.beginPopup("editPopup")) {
|
||||||
Block block = currentCell.getBlock();
|
if (currentCell == null)
|
||||||
int symbolCount = block.getCells().size();
|
ImGui.closeCurrentPopup();
|
||||||
for (int i = 0; i < symbolCount; i++) {
|
else {
|
||||||
if ((i + 1) % (int) (Math.sqrt(symbolCount)) != 1)
|
Block block = currentCell.getBlock();
|
||||||
ImGui.sameLine();
|
int symbolCount = block.getCells().size();
|
||||||
if (currentCell.getSymbolIndex() == i) {
|
for (int i = 0; i < symbolCount; i++) {
|
||||||
if (ImGui.button("X", cellSize)) {
|
if ((i + 1) % (int) (Math.sqrt(symbolCount)) != 1)
|
||||||
currentCell.setSymbolIndex(Cell.NOSYMBOL);
|
ImGui.sameLine();
|
||||||
this.onCellChange.emit(currentCell);
|
if (currentCell.getSymbolIndex() == i) {
|
||||||
ImGui.closeCurrentPopup();
|
if (ImGui.button("X", cellSize)) {
|
||||||
}
|
currentCell.setSymbolIndex(Cell.NOSYMBOL);
|
||||||
} else {
|
this.onCellChange.emit(currentCell);
|
||||||
if (ImGui.button(Options.Symboles.getSymbols().get(i), cellSize)) {
|
ImGui.closeCurrentPopup();
|
||||||
currentCell.setSymbolIndex(i);
|
}
|
||||||
this.onCellChange.emit(currentCell);
|
} else {
|
||||||
if (this.doku.getDoku().isSolved())
|
if (ImGui.button(Options.Symboles.getSymbols().get(i), cellSize)) {
|
||||||
this.onResolve.emit();
|
currentCell.setSymbolIndex(i);
|
||||||
ImGui.closeCurrentPopup();
|
this.onCellChange.emit(currentCell);
|
||||||
|
if (this.doku.getDoku().isSolved())
|
||||||
|
this.onResolve.emit();
|
||||||
|
ImGui.closeCurrentPopup();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ public class SudokuSelector {
|
|||||||
|
|
||||||
private final SmoothProgressBar genProgressBar;
|
private final SmoothProgressBar genProgressBar;
|
||||||
|
|
||||||
|
private volatile boolean genDone = false;
|
||||||
|
|
||||||
public SudokuSelector(boolean canGenEmptyGrid, String confirmMessage) {
|
public SudokuSelector(boolean canGenEmptyGrid, String confirmMessage) {
|
||||||
this.canGenEmptyGrid = canGenEmptyGrid;
|
this.canGenEmptyGrid = canGenEmptyGrid;
|
||||||
this.confirmMessage = confirmMessage;
|
this.confirmMessage = confirmMessage;
|
||||||
@@ -74,6 +76,8 @@ public class SudokuSelector {
|
|||||||
int filled = this.doku.getFilledCells().size();
|
int filled = this.doku.getFilledCells().size();
|
||||||
int total = this.doku.getCells().size();
|
int total = this.doku.getCells().size();
|
||||||
this.genProgressBar.render(filled / (float) total);
|
this.genProgressBar.render(filled / (float) total);
|
||||||
|
if (genDone)
|
||||||
|
ImGui.closeCurrentPopup();
|
||||||
ImGui.endPopup();
|
ImGui.endPopup();
|
||||||
} else {
|
} else {
|
||||||
stopGenThread();
|
stopGenThread();
|
||||||
@@ -82,12 +86,14 @@ public class SudokuSelector {
|
|||||||
|
|
||||||
private void selectSudoku(MultiDoku doku, boolean empty) {
|
private void selectSudoku(MultiDoku doku, boolean empty) {
|
||||||
this.doku = doku;
|
this.doku = doku;
|
||||||
|
this.genDone = false;
|
||||||
ImGui.openPopup("genProgress");
|
ImGui.openPopup("genProgress");
|
||||||
this.genThread = new Thread(() -> {
|
this.genThread = new Thread(() -> {
|
||||||
try {
|
try {
|
||||||
if (!empty) {
|
if (!empty) {
|
||||||
SudokuFactory.fillDoku(doku, Difficulty.values()[difficulty.get()]);
|
SudokuFactory.fillDoku(doku, Difficulty.values()[difficulty.get()]);
|
||||||
}
|
}
|
||||||
|
this.genDone = true;
|
||||||
this.onSelect.emit(this.doku);
|
this.onSelect.emit(this.doku);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
BIN
screenshots/menu.png
Normal file
BIN
screenshots/menu.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 204 KiB |
BIN
screenshots/multi.png
Normal file
BIN
screenshots/multi.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 236 KiB |
BIN
screenshots/solo.png
Normal file
BIN
screenshots/solo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 242 KiB |
Reference in New Issue
Block a user