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

152 lines
5.5 KiB
Java
Raw Normal View History

2022-01-31 01:12:29 +01:00
package love.distributedrebirth.demo4d.screen;
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ʸᴰ;
2022-01-31 01:12:29 +01:00
import love.distributedrebirth.demo4d.Demo4DMain;
import love.distributedrebirth.demo4d.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 = "©Δ∞ 仙上主天")
2022-01-31 01:12:29 +01:00
public class BasePartRenderer extends ImGuiRendererMain {
private ImInt selectedBasePart = new ImInt();
2022-01-31 01:12:29 +01:00
public BasePartRenderer(Demo4DMain main) {
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-02 15:54:59 +01:00
ImGui.text("Base:");
ImGui.sameLine();
2022-02-02 19:24:31 +01:00
ImGui.text(baseParts[0].BãßClassNaam());
2022-02-02 15:54:59 +01:00
ImGui.sameLine();
ImGui.combo("Type", selectedBasePart, items);
2022-01-31 01:12:29 +01:00
int flags = ImGuiTableFlags.ScrollX | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersOuter | ImGuiTableFlags.BordersV;
2022-02-03 13:21:40 +01:00
ImGui.beginTable("base-part", 23, 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("10Ben");
ImGui.tableSetupColumn("16Tone");
ImGui.tableSetupColumn("16Kor");
ImGui.tableSetupColumn("16LatB");
ImGui.tableSetupColumn("16Gre");
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-02 19:24:31 +01:00
ImGui.text(part.BȍőnIdentifierTone());
2022-01-31 01:12:29 +01:00
ImGui.tableNextColumn();
2022-02-03 13:21:40 +01:00
ImGui.text(part.BȍőnGlyphSetNumber10(BaseGlyphSet.TONE_LETTER));
ImGui.tableNextColumn();
ImGui.text(part.BȍőnGlyphSetNumber10(BaseGlyphSet.KOREAN));
ImGui.tableNextColumn();
ImGui.text(part.BȍőnGlyphSetNumber10(BaseGlyphSet.LATIN_DTMF));
ImGui.tableNextColumn();
ImGui.text(part.BȍőnGlyphSetNumber10(BaseGlyphSet.BENGALI));
ImGui.tableNextColumn();
ImGui.text(part.BȍőnGlyphSetNumber16(BaseGlyphSet.TONE_LETTER));
ImGui.tableNextColumn();
ImGui.text(part.BȍőnGlyphSetNumber16(BaseGlyphSet.KOREAN));
ImGui.tableNextColumn();
2022-02-03 01:27:55 +01:00
ImGui.text(part.BȍőnGlyphSetNumber16(BaseGlyphSet.LATIN_BASIC));
2022-02-03 00:28:30 +01:00
ImGui.tableNextColumn();
2022-02-03 01:27:55 +01:00
ImGui.text(part.BȍőnGlyphSetNumber16(BaseGlyphSet.GREEK));
2022-02-03 00:28:30 +01:00
ImGui.tableNextColumn();
2022-02-03 13:21:40 +01:00
ImGui.text(part.BȍőnGlyphSetNumber36(BaseGlyphSet.TONE_LETTER));
ImGui.tableNextColumn();
ImGui.text(part.BȍőnGlyphSetNumber36(BaseGlyphSet.KOREAN));
2022-02-03 00:28:30 +01:00
ImGui.tableNextColumn();
2022-02-03 01:27:55 +01:00
ImGui.text(part.BȍőnGlyphSetNumber36(BaseGlyphSet.LATIN_BASIC));
2022-02-03 00:28:30 +01:00
ImGui.tableNextColumn();
2022-02-03 01:27:55 +01:00
ImGui.text(part.BȍőnGlyphSetNumber36(BaseGlyphSet.GREEK));
2022-02-03 00:28:30 +01:00
ImGui.tableNextColumn();
2022-02-03 01:27:55 +01:00
ImGui.text(part.BȍőnGlyphSetNumber36(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();
}
}