Added option for base27

This commit is contained in:
Willem Cazander 2022-02-13 21:30:44 +01:00
parent a8b3d955c8
commit 7d5cc14564

View file

@ -2,6 +2,7 @@ package love.distributedrebirth.gdxapp.desktop.apps;
import imgui.ImGui; import imgui.ImGui;
import imgui.flag.ImGuiTableFlags; import imgui.flag.ImGuiTableFlags;
import imgui.type.ImBoolean;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp.desktop.DefaultDeskApp; import love.distributedrebirth.gdxapp.desktop.DefaultDeskApp;
import love.distributedrebirth.gdxapp.desktop.DeskAppContourSection; import love.distributedrebirth.gdxapp.desktop.DeskAppContourSection;
@ -11,17 +12,24 @@ import love.distributedrebirth.numberxd.glyph.BaseGlyphSet;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class SystemBaseGlyphApp extends DefaultDeskApp { public class SystemBaseGlyphApp extends DefaultDeskApp {
private final ImBoolean showBase27 = new ImBoolean(false);
public SystemBaseGlyphApp() { public SystemBaseGlyphApp() {
super("Base Glyph Set", ""); super("Base Glyph Set", "");
getContours().registrateContour(DeskAppContourSection.MAIN, new DeskAppRenderer() { getContours().registrateContour(DeskAppContourSection.MAIN, new DeskAppRenderer() {
@Override @Override
public void render() { public void render() {
int flags = ImGuiTableFlags.ScrollX | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersOuter | ImGuiTableFlags.BordersV; ImGui.checkbox("Show base27", showBase27);
int flags = ImGuiTableFlags.ScrollX | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersOuter | ImGuiTableFlags.BordersV | ImGuiTableFlags.Resizable;
ImGui.beginTable("base-part", 3, flags); ImGui.beginTable("base-part", 3, flags);
ImGui.tableSetupColumn("Script"); ImGui.tableSetupColumn("Script");
ImGui.tableSetupColumn("10Numbers"); ImGui.tableSetupColumn("10Numbers");
ImGui.tableSetupColumn("16Numbers"); if (showBase27.get()) {
ImGui.tableSetupColumn("27Numbers");
} else {
ImGui.tableSetupColumn("16Numbers");
}
ImGui.tableHeadersRow(); ImGui.tableHeadersRow();
for (BaseGlyphSet set:BaseGlyphSet.values()) { for (BaseGlyphSet set:BaseGlyphSet.values()) {
ImGui.tableNextRow(); ImGui.tableNextRow();
@ -30,7 +38,11 @@ public class SystemBaseGlyphApp extends DefaultDeskApp {
ImGui.tableNextColumn(); ImGui.tableNextColumn();
ImGui.text(print10Numbers(set)); ImGui.text(print10Numbers(set));
ImGui.tableNextColumn(); ImGui.tableNextColumn();
ImGui.text(print16Numbers(set)); if (showBase27.get()) {
ImGui.text(print27Numbers(set));
} else {
ImGui.text(print16Numbers(set));
}
} }
ImGui.endTable(); ImGui.endTable();
} }
@ -42,6 +54,7 @@ public class SystemBaseGlyphApp extends DefaultDeskApp {
for (int i=0;i<10;i++) { for (int i=0;i<10;i++) {
buf.append(set.BȍőnNumber10().BȍőnCharFor(i)); buf.append(set.BȍőnNumber10().BȍőnCharFor(i));
buf.append(set.BȍőnNumber10().BȍőnCharSeperator()); buf.append(set.BȍőnNumber10().BȍőnCharSeperator());
buf.append(" ");
} }
return buf.toString(); return buf.toString();
} }
@ -51,9 +64,23 @@ public class SystemBaseGlyphApp extends DefaultDeskApp {
int x=240; int x=240;
for (int i=0;i<16;i++) { for (int i=0;i<16;i++) {
buf.append(set.BȍőnPrintNumber16(i + x, 99)); buf.append(set.BȍőnPrintNumber16(i + x, 99));
buf.append(set.BȍőnNumber16().BȍőnCharSeperator());
buf.append(" "); buf.append(" ");
x = x - 16; x = x - 16;
} }
return buf.toString(); return buf.toString();
} }
private String print27Numbers(BaseGlyphSet set) {
StringBuilder buf = new StringBuilder();
if (set.BȍőnNumber27() == null) {
return buf.toString();
}
for (int i=0;i<33;i++) {
buf.append(set.BȍőnPrintNumber27(i, 99));
buf.append(set.BȍőnNumber27().BȍőnCharSeperator());
buf.append(" ");
}
return buf.toString();
}
} }