Improved code style

This commit is contained in:
Willem Cazander 2022-02-11 13:48:55 +01:00
parent b52cc50c45
commit dc978272b4
4 changed files with 27 additions and 38 deletions

View file

@ -6,6 +6,7 @@ import imgui.ImFontConfig;
import imgui.ImFontGlyphRangesBuilder;
import imgui.ImGui;
import imgui.ImGuiIO;
import imgui.ImGuiStyle;
import imgui.gl3.ImGuiImplGl3;
import imgui.glfw.ImGuiImplGlfw;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@ -31,8 +32,14 @@ public class ImGuiSetup {
imGuiImp.init(windowHandle, true);
imGuiGlImp.init("#version 140");
ImGui.init();
ImGui.styleColorsLight();
initStyle();
}
private static void initStyle() {
ImGui.styleColorsDark();
ImGuiStyle style = ImGui.getStyle();
style.setWindowRounding(6f);
style.setScrollbarSize(22f);
}
private static void initFonts(final ImGuiIO io) {
@ -40,10 +47,10 @@ public class ImGuiSetup {
ImFontGlyphRangesBuilder fontBuilder = new ImFontGlyphRangesBuilder();
addRangeUnicodePlane0(fontBuilder);
final short[] glyphRanges = fontBuilder.buildRanges();
io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/code2000.ttf").readBytes(), 24, fontConfig, glyphRanges);
io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/code2000.ttf").readBytes(), 22, fontConfig, glyphRanges);
fontConfig.setMergeMode(true);
// note: merges 148 chars, just for 3 sub chars for SUBHEX, but still missing 2 chars from T12 alt1 clock
io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/free-sans.ttf").readBytes(), 24, fontConfig, glyphRanges);
io.getFonts().addFontFromMemoryTTF(Gdx.files.internal("font/free-sans.ttf").readBytes(), 22, fontConfig, glyphRanges);
fontConfig.destroy();
}

View file

@ -24,7 +24,7 @@ public class SystemBaseGlyphRenderer extends ImGuiRendererMain {
int flags = ImGuiTableFlags.ScrollX | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersOuter | ImGuiTableFlags.BordersV;
ImGui.beginTable("base-part", 3, flags);
ImGui.tableSetupColumn("Language");
ImGui.tableSetupColumn("Script");
ImGui.tableSetupColumn("10Numbers");
ImGui.tableSetupColumn("16Numbers");
ImGui.tableHeadersRow();

View file

@ -92,19 +92,19 @@ public class SystemBasePartRenderer extends ImGuiRendererMain {
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber10(BaseGlyphSet.TONE_SCRIPT));
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber10(BaseGlyphSet.KOREAN_HEX));
ImGui.text(part.BȍőnPrintGlyphSetNumber10(BaseGlyphSet.KOREAN));
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber10(BaseGlyphSet.LATIN_DTMF));
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber16(BaseGlyphSet.TONE_SCRIPT));
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber16(BaseGlyphSet.KOREAN_HEX));
ImGui.text(part.BȍőnPrintGlyphSetNumber16(BaseGlyphSet.KOREAN));
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber10(BaseGlyphSet.LATIN_BASIC));
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber36(BaseGlyphSet.TONE_SCRIPT));
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber36(BaseGlyphSet.KOREAN_HEX));
ImGui.text(part.BȍőnPrintGlyphSetNumber36(BaseGlyphSet.KOREAN));
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber36(BaseGlyphSet.LATIN_BASIC));
ImGui.tableNextColumn();