gdxapp4d/demo4d-gdxapp/src/main/love/distributedrebirth/gdxapp/screen/SystemBasePartRenderer.java

150 lines
5.3 KiB
Java
Raw Normal View History

package love.distributedrebirth.gdxapp.screen;
2022-01-31 01:12:29 +01:00
import java.util.ArrayList;
2022-01-31 01:12:29 +01:00
import java.util.List;
import imgui.ImGui;
import imgui.flag.ImGuiCond;
import imgui.flag.ImGuiTableFlags;
import imgui.type.ImBoolean;
import imgui.type.ImInt;
2022-02-04 14:39:25 +01:00
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.gdxapp.Demo4DMain;
import love.distributedrebirth.gdxapp.ImGuiRendererMain;
import love.distributedrebirth.numberxd.base2t.BasePartFactory;
2022-02-03 01:27:55 +01:00
import love.distributedrebirth.numberxd.base2t.glyph.BaseGlyphSet;
2022-02-02 18:32:23 +01:00
import love.distributedrebirth.numberxd.base2t.part.BãßBȍőnPartAlt1ʸᴰ;
import love.distributedrebirth.numberxd.base2t.part.BãßBȍőnPartAlt2ʸᴰ;
import love.distributedrebirth.numberxd.base2t.part.BãßBȍőnPartAlt3ʸᴰ;
import love.distributedrebirth.numberxd.base2t.part.BãßBȍőnPartAlt4ʸᴰ;
import love.distributedrebirth.numberxd.base2t.part.BãßBȍőnPartʸᴰ;
2022-01-31 01:12:29 +01:00
2022-02-04 14:39:25 +01:00
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class SystemBasePartRenderer extends ImGuiRendererMain {
2022-01-31 01:12:29 +01:00
private ImInt selectedBasePart = new ImInt();
public SystemBasePartRenderer(Demo4DMain main) {
2022-01-31 01:12:29 +01:00
super(main);
}
@Override
public void render(ImBoolean widgetOpen) {
ImGui.setNextWindowPos(200, 200, ImGuiCond.FirstUseEver);
ImGui.setNextWindowSize(640, 480, ImGuiCond.FirstUseEver);
ImGui.begin("Base part", widgetOpen);
List<String> bases = new ArrayList<>();
2022-02-02 18:55:21 +01:00
for (int base:BasePartFactory.INSTANCE.BãßBases()) {
bases.add(Integer.toString(base));
}
String[] items = new String[bases.size()];
2022-02-02 15:54:59 +01:00
items = bases.toArray(items);
String selectedItem = items[selectedBasePart.get()];
Integer baseNumber = Integer.valueOf(selectedItem);
2022-02-02 18:55:21 +01:00
BãßBȍőnPartʸᴰ<?>[] baseParts = BasePartFactory.INSTANCE.BãßBuildPartsByBase(baseNumber);
2022-02-05 20:43:41 +01:00
ImGui.combo("Base", selectedBasePart, items);
ImGui.text("Name:");
2022-02-02 15:54:59 +01:00
ImGui.sameLine();
2022-02-02 19:24:31 +01:00
ImGui.text(baseParts[0].BãßClassNaam());
2022-02-05 20:43:41 +01:00
ImGui.text("Purpose:");
2022-02-02 15:54:59 +01:00
ImGui.sameLine();
2022-02-05 20:43:41 +01:00
ImGui.text(baseParts[0].BãßClassPurpose());
2022-02-02 15:54:59 +01:00
2022-01-31 01:12:29 +01:00
int flags = ImGuiTableFlags.ScrollX | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersOuter | ImGuiTableFlags.BordersV;
ImGui.beginTable("base-part", 21, flags);
2022-02-03 00:28:30 +01:00
ImGui.tableSetupColumn("BȍőnNaam");
ImGui.tableSetupColumn("TelNul");
ImGui.tableSetupColumn("TelEen");
ImGui.tableSetupColumn("Tone");
2022-02-03 13:21:40 +01:00
ImGui.tableSetupColumn("10Tone");
ImGui.tableSetupColumn("10Kor");
ImGui.tableSetupColumn("10DTMF");
ImGui.tableSetupColumn("16Tone");
ImGui.tableSetupColumn("16Kor");
ImGui.tableSetupColumn("16LatB");
ImGui.tableSetupColumn("36Tone");
ImGui.tableSetupColumn("36Kor");
ImGui.tableSetupColumn("36LatB");
ImGui.tableSetupColumn("36Gre");
ImGui.tableSetupColumn("36Heb");
ImGui.tableSetupColumn("prcK");
ImGui.tableSetupColumn("prcV");
ImGui.tableSetupColumn("Alt1");
ImGui.tableSetupColumn("Alt2");
ImGui.tableSetupColumn("Alt3");
ImGui.tableSetupColumn("Alt4");
2022-01-31 01:12:29 +01:00
ImGui.tableHeadersRow();
2022-02-02 18:32:23 +01:00
for (BãßBȍőnPartʸᴰ<?> part:baseParts) {
2022-01-31 01:12:29 +01:00
ImGui.tableNextRow();
ImGui.tableNextColumn();
2022-02-03 00:28:30 +01:00
ImGui.text(part.BȍőnNaam());
2022-02-01 12:12:06 +01:00
ImGui.tableNextColumn();
2022-02-03 00:28:30 +01:00
ImGui.text(Integer.toString(part.BȍőnRangTelNul()));
ImGui.tableNextColumn();
ImGui.text(Integer.toString(part.BȍőnRangTelEen()));
2022-01-31 01:12:29 +01:00
ImGui.tableNextColumn();
2022-02-05 16:25:41 +01:00
ImGui.text(part.BȍőnDialTone());
2022-01-31 01:12:29 +01:00
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber10(BaseGlyphSet.TONE_LETTER));
2022-02-03 13:21:40 +01:00
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber10(BaseGlyphSet.KOREAN));
2022-02-03 13:21:40 +01:00
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber10(BaseGlyphSet.LATIN_DTMF));
2022-02-03 13:21:40 +01:00
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber16(BaseGlyphSet.TONE_LETTER));
2022-02-03 13:21:40 +01:00
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber16(BaseGlyphSet.KOREAN));
2022-02-03 13:21:40 +01:00
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber10(BaseGlyphSet.LATIN_BASIC));
2022-02-03 13:21:40 +01:00
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber36(BaseGlyphSet.TONE_LETTER));
2022-02-03 00:28:30 +01:00
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber36(BaseGlyphSet.KOREAN));
2022-02-03 00:28:30 +01:00
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber36(BaseGlyphSet.LATIN_BASIC));
2022-02-03 13:21:40 +01:00
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber36(BaseGlyphSet.GREEK));
2022-02-03 00:28:30 +01:00
ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber36(BaseGlyphSet.HEBREW));
2022-01-31 01:12:29 +01:00
ImGui.tableNextColumn();
2022-02-02 19:24:31 +01:00
ImGui.text(part.BȍőnChinaKey());
2022-01-31 01:12:29 +01:00
ImGui.tableNextColumn();
2022-02-02 19:24:31 +01:00
ImGui.text(part.BȍőnChinaValue());
ImGui.tableNextColumn();
2022-02-02 18:32:23 +01:00
if (part instanceof BãßBȍőnPartAlt1ʸᴰ) {
2022-02-02 19:24:31 +01:00
ImGui.text(BãßBȍőnPartAlt1ʸᴰ.class.cast(part).BȍőnAlt1Value());
} else {
ImGui.text("");
}
ImGui.tableNextColumn();
2022-02-02 18:32:23 +01:00
if (part instanceof BãßBȍőnPartAlt2ʸᴰ) {
2022-02-02 19:24:31 +01:00
ImGui.text(BãßBȍőnPartAlt2ʸᴰ.class.cast(part).BȍőnAlt2Value());
} else {
ImGui.text("");
}
ImGui.tableNextColumn();
2022-02-02 18:32:23 +01:00
if (part instanceof BãßBȍőnPartAlt3ʸᴰ) {
2022-02-02 19:24:31 +01:00
ImGui.text(BãßBȍőnPartAlt3ʸᴰ.class.cast(part).BȍőnAlt3Value());
} else {
ImGui.text("");
}
ImGui.tableNextColumn();
2022-02-02 18:32:23 +01:00
if (part instanceof BãßBȍőnPartAlt4ʸᴰ) {
2022-02-02 19:24:31 +01:00
ImGui.text(BãßBȍőnPartAlt4ʸᴰ.class.cast(part).BȍőnAlt4Value());
} else {
ImGui.text("");
}
2022-01-31 01:12:29 +01:00
}
2022-01-31 01:12:29 +01:00
ImGui.endTable();
ImGui.end();
}
}