mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-10-16 06:13:45 -04:00
Added new SUIWindow methods: addTableDataSource, addTableColumn, addTableRow, minor GuildMember variable additions
This commit is contained in:
@@ -40,6 +40,7 @@ public class SUIWindow {
|
||||
private Map<Integer, PyObject> callbacks = new ConcurrentHashMap<Integer, PyObject>();
|
||||
private Map<Integer, SUICallback> javaCallbacks = new ConcurrentHashMap<Integer, SUICallback>();
|
||||
private Vector<SUIListBoxItem> menuItems = new Vector<SUIListBoxItem>();
|
||||
private Vector<SUITableItem> tableItems = new Vector<SUITableItem>();
|
||||
|
||||
public SUIWindow(String script, SWGObject owner, int windowId, SWGObject rangeObject, float maxDistance) {
|
||||
|
||||
@@ -154,6 +155,21 @@ public class SUIWindow {
|
||||
|
||||
}
|
||||
|
||||
public void addTableDataSource(String name, String value) {
|
||||
|
||||
SUIWindowComponent component = new SUIWindowComponent();
|
||||
component.setType((byte) 8); // using 6 (addDataSource) doesn't allow setting of column titles in tables
|
||||
|
||||
for(String str : name.split(":")) {
|
||||
component.getNarrowParams().add(str);
|
||||
}
|
||||
|
||||
component.getWideParams().add(value);
|
||||
|
||||
components.add(component);
|
||||
|
||||
}
|
||||
|
||||
public void addListBoxMenuItem(String itemName, long objectId) {
|
||||
SUIListBoxItem menuItem = new SUIListBoxItem(itemName, objectId);
|
||||
|
||||
@@ -164,8 +180,28 @@ public class SUIWindow {
|
||||
|
||||
menuItems.add(menuItem);
|
||||
}
|
||||
|
||||
public void addTableColumn(String itemName, String type) {
|
||||
int index = tableItems.size();
|
||||
SUITableItem item = new SUITableItem(itemName, index);
|
||||
|
||||
|
||||
addTableDataSource("comp.TablePage.dataTable:Name", String.valueOf(index));
|
||||
setProperty("comp.TablePage.dataTable." + index + ":Label", itemName);
|
||||
setProperty("comp.TablePage.dataTable." + index + ":Type", type);
|
||||
|
||||
tableItems.add(item);
|
||||
}
|
||||
|
||||
public void addTableRow(String itemName) {
|
||||
tableItems.forEach(column -> {
|
||||
int index = column.getIndex();
|
||||
SUITableItem item = new SUITableItem(itemName, index);
|
||||
addDataItem("comp.TablePage.dataTable." + index + ":Name", "data" + index);
|
||||
setProperty("comp.TablePage.dataTable." + index + ".data" + index + ":Value", itemName);
|
||||
column.getChildren().add(item);
|
||||
});
|
||||
}
|
||||
|
||||
public int getWindowId() {
|
||||
return windowId;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user