This commit is contained in:
@@ -75,7 +75,7 @@ public class SudokuRenderer {
|
||||
ImGui.closeCurrentPopup();
|
||||
}
|
||||
} else {
|
||||
if (ImGui.button(Integer.toString(i + 1), cellSize)) {
|
||||
if (ImGui.button(Options.Symboles.getSymbols().get(i), cellSize)) {
|
||||
this.doku.setCellValue(currentCell, i);
|
||||
if (this.doku.isResolved())
|
||||
this.onResolve.emit();
|
||||
@@ -123,7 +123,7 @@ public class SudokuRenderer {
|
||||
ImGui.pushStyleColor(ImGuiCol.Button, new ImVec4(blockColor.r, blockColor.g, blockColor.b, 1.0f));
|
||||
String cellText = "";
|
||||
if (symbol != -1)
|
||||
cellText += Integer.toString(symbol + 1);
|
||||
cellText += Options.Symboles.getSymbols().get(cell.getSymbolIndex());
|
||||
if (ImGui.button(cellText + "##" + index, cellSize) && cell.isMutable()) {
|
||||
ImGui.openPopup("editPopup");
|
||||
currentCell = cell;
|
||||
|
||||
@@ -5,8 +5,8 @@ import java.util.List;
|
||||
|
||||
public enum Symbols {
|
||||
|
||||
Numbers("Nombres", getNumbers()),
|
||||
Letters("Lettres", getLetters()),
|
||||
Numbers("Nombres", getNumbers()),
|
||||
Letters("Lettres", getLetters()),
|
||||
Emojis("Emojis", getEmojis());
|
||||
|
||||
String displayName;
|
||||
@@ -17,6 +17,10 @@ public enum Symbols {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
public List<String> getSymbols() {
|
||||
return symbols;
|
||||
}
|
||||
@@ -50,8 +54,21 @@ public enum Symbols {
|
||||
for (int i = 0; i < 100; i++) {
|
||||
sym.add(new String(Character.toChars(0X1F600 + i)));
|
||||
}
|
||||
System.out.println(sym);
|
||||
return sym;
|
||||
}
|
||||
|
||||
private static final String[] symbolNames;
|
||||
|
||||
static {
|
||||
Symbols[] symbols = Symbols.values();
|
||||
symbolNames = new String[symbols.length];
|
||||
for (int i = 0; i < symbols.length; i++) {
|
||||
symbolNames[i] = symbols[i].getDisplayName();
|
||||
}
|
||||
}
|
||||
|
||||
public static String[] getSymbolsNames() {
|
||||
return symbolNames;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,17 +1,24 @@
|
||||
package gui.menu;
|
||||
|
||||
import gui.Options;
|
||||
import gui.Symbols;
|
||||
import imgui.ImGui;
|
||||
import imgui.type.ImInt;
|
||||
|
||||
public class OptionsMenu extends BaseView {
|
||||
|
||||
private ImInt currentValue = new ImInt();
|
||||
|
||||
public OptionsMenu(StateMachine stateMachine) {
|
||||
super(stateMachine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render() {
|
||||
// TODO Auto-generated method stub
|
||||
ImGui.text("Options");
|
||||
if(ImGui.combo("Jeu de symboles", currentValue, Symbols.getSymbolsNames())){
|
||||
Options.Symboles = Symbols.values()[currentValue.get()];
|
||||
}
|
||||
renderReturnButton();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user