feat: ui remove cell content
All checks were successful
Linux arm64 / Build (push) Successful in 4m7s
All checks were successful
Linux arm64 / Build (push) Successful in 4m7s
This commit is contained in:
@@ -37,16 +37,24 @@ public class SudokuRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void renderPopup() {
|
private void renderPopup() {
|
||||||
|
final ImVec2 buttonSize = new ImVec2(50, 50);
|
||||||
if (ImGui.beginPopup("editPopup")) {
|
if (ImGui.beginPopup("editPopup")) {
|
||||||
Block block = currentCell.getBlock();
|
Block block = currentCell.getBlock();
|
||||||
int symbolCount = block.getCells().size();
|
int symbolCount = block.getCells().size();
|
||||||
for (int i = 1; i < symbolCount + 1; i++) {
|
for (int i = 0; i < symbolCount; i++) {
|
||||||
if (i % (int) (Math.sqrt(symbolCount)) != 1)
|
if ((i + 1) % (int) (Math.sqrt(symbolCount)) != 1)
|
||||||
ImGui.sameLine();
|
ImGui.sameLine();
|
||||||
if (ImGui.button(Integer.toString(i), new ImVec2(50, 50))) {
|
if (currentCell.getSymbolIndex() == i) {
|
||||||
this.doku.setCellValue(currentCell, i - 1);
|
if (ImGui.button("X", buttonSize)) {
|
||||||
|
currentCell.setSymbolIndex(Cell.NOSYMBOL);
|
||||||
ImGui.closeCurrentPopup();
|
ImGui.closeCurrentPopup();
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
|
if (ImGui.button(Integer.toString(i + 1), buttonSize)) {
|
||||||
|
this.doku.setCellValue(currentCell, i);
|
||||||
|
ImGui.closeCurrentPopup();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ImGui.endPopup();
|
ImGui.endPopup();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,8 @@ public class SoloMenu extends BaseView {
|
|||||||
level += sudoku.getSize() * sudoku.getSize() / 10 * 3;
|
level += sudoku.getSize() * sudoku.getSize() / 10 * 3;
|
||||||
}
|
}
|
||||||
Solver.solve(doku);
|
Solver.solve(doku);
|
||||||
SudokuFactory.newDokuFromFilledOne(doku, level - 1);
|
level = (level - 1) / doku.getNbSubGrids();
|
||||||
|
SudokuFactory.newDokuFromFilledOne(doku, level);
|
||||||
for (Sudoku sudoku : doku.getSubGrids()) {
|
for (Sudoku sudoku : doku.getSubGrids()) {
|
||||||
for (Cell cell : sudoku.getCells()) {
|
for (Cell cell : sudoku.getCells()) {
|
||||||
if (cell.getSymbolIndex() != Cell.NOSYMBOL) {
|
if (cell.getSymbolIndex() != Cell.NOSYMBOL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user