add menu logic
Some checks failed
Linux arm64 / Build (push) Failing after 5m1s

This commit is contained in:
2025-01-23 12:50:00 +01:00
parent 48fc88d8ab
commit 749f5c831d
8 changed files with 145 additions and 15 deletions

View File

@@ -9,6 +9,7 @@ import imgui.ImGui;
import imgui.ImVec2;
import imgui.ImVec4;
import imgui.flag.ImGuiCol;
import imgui.flag.ImGuiStyleVar;
import sudoku.Block;
import sudoku.Cell;
import sudoku.Sudoku;
@@ -58,11 +59,16 @@ public class SudokuRenderer {
Cell cell = sudoku.getCell(x, y);
int symbol = cell.getSymbolIndex();
Color blockColor = colorPalette.get(cell.getBlock());
ImGui.pushStyleVar(ImGuiStyleVar.SelectableTextAlign, new ImVec2(0.5f, 0.5f));
ImGui.pushStyleColor(ImGuiCol.Header, new ImVec4(blockColor.r, blockColor.g, blockColor.b, 1.0f));
if (ImGui.selectable(Integer.toString(symbol + 1) + "##" + index, true, 0, new ImVec2(50, 50))) {
String cellText = "";
if (symbol != -1)
cellText += Integer.toString(symbol + 1);
if (ImGui.selectable(cellText + "##" + index, true, 0, new ImVec2(50, 50))) {
ImGui.openPopup("editPopup");
currentIndex = index;
}
ImGui.popStyleVar();
ImGui.popStyleColor();
}
}