This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user