Added part name to renderer

This commit is contained in:
Willem Cazander 2022-02-02 15:54:59 +01:00
parent f29b1d76a5
commit e998603843

View file

@ -36,20 +36,22 @@ public class BasePartRenderer extends ImGuiRendererMain {
ImGui.setNextWindowSize(640, 480, ImGuiCond.FirstUseEver); ImGui.setNextWindowSize(640, 480, ImGuiCond.FirstUseEver);
ImGui.begin("Base part", widgetOpen); ImGui.begin("Base part", widgetOpen);
ImGui.text("Current Part");
ImGui.sameLine();
List<String> bases = new ArrayList<>(); List<String> bases = new ArrayList<>();
for (int base:BasePartFactory.getSupportedBases()) { for (int base:BasePartFactory.getSupportedBases()) {
bases.add(Integer.toString(base)); bases.add(Integer.toString(base));
} }
String[] items = new String[bases.size()]; String[] items = new String[bases.size()];
items = bases.toArray(items);
ImGui.combo("Type", selectedBasePart, bases.toArray(items));
String selectedItem = items[selectedBasePart.get()]; String selectedItem = items[selectedBasePart.get()];
Integer baseNumber = Integer.valueOf(selectedItem); Integer baseNumber = Integer.valueOf(selectedItem);
BassBone<?>[] baseParts = BasePartFactory.buildBassBonesByBase(baseNumber); BassBone<?>[] baseParts = BasePartFactory.buildBassBonesByBase(baseNumber);
ImGui.text("Base:");
ImGui.sameLine();
ImGui.text(baseParts[0].staticBoneNaam());
ImGui.sameLine();
ImGui.combo("Type", selectedBasePart, items);
int flags = ImGuiTableFlags.ScrollX | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersOuter | ImGuiTableFlags.BordersV; int flags = ImGuiTableFlags.ScrollX | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersOuter | ImGuiTableFlags.BordersV;
ImGui.beginTable("base-part", 10, flags); ImGui.beginTable("base-part", 10, flags);
ImGui.tableSetupColumn("Name"); ImGui.tableSetupColumn("Name");