use of com.talosvfx.talos.editor.widgets.propertyWidgets.IPropertyProvider in project talos by rockbite.
the class PropertiesPanel method reconstruct.
private void reconstruct() {
propertyGroup.clear();
propertyWidgets.clear();
propertyGroup.top().left();
Table propertyTable = new Table();
propertyGroup.add(propertyTable).growX().padRight(5);
for (IPropertyProvider currentPropertyPanel : currentPropertyPanels) {
Array<PropertyWidget> listOfProperties = currentPropertyPanel.getListOfProperties();
if (listOfProperties != null) {
for (PropertyWidget propertyWidget : listOfProperties) {
propertyWidgets.add(propertyWidget);
propertyWidget.updateValue();
propertyTable.add(propertyWidget).growX().pad(5f).padBottom(0);
propertyTable.row();
}
propertyTable.add().height(5);
}
}
}
use of com.talosvfx.talos.editor.widgets.propertyWidgets.IPropertyProvider in project talos by rockbite.
the class PrefabMetadata method getPropertyProviders.
@Override
public Iterable<IPropertyProvider> getPropertyProviders() {
Array<IPropertyProvider> propertyProviders = new Array<>();
propertyProviders.add(new FilePropertyProvider(currentFile));
Prefab prefab = new Prefab();
prefab.path = currentFile.path();
prefab.loadFromPath();
GameObject root = prefab.root;
Iterable<IPropertyProvider> rootProviders = root.getPropertyProviders();
for (IPropertyProvider provider : rootProviders) {
propertyProviders.add(provider);
}
return propertyProviders;
}
use of com.talosvfx.talos.editor.widgets.propertyWidgets.IPropertyProvider in project talos by rockbite.
the class MultiPropertyHolder method generateLists.
private void generateLists() {
mainMap = new ObjectMap<>();
Array<Class<? extends IPropertyProvider>> allowList = new Array<>();
Iterable<IPropertyProvider> firstProviders = holderArray.first().getPropertyProviders();
for (IPropertyProvider provider : firstProviders) {
allowList.add(provider.getClass());
}
for (IPropertyHolder holder : holderArray) {
Iterable<IPropertyProvider> propertyProviders = holder.getPropertyProviders();
for (IPropertyProvider provider : propertyProviders) {
if (allowList.contains(provider.getClass(), true)) {
if (mainMap.get(provider.getClass()) == null) {
mainMap.put(provider.getClass(), new MultiPropertyProvider());
}
mainMap.get(provider.getClass()).addProvider(provider);
}
}
}
for (MultiPropertyProvider provider : mainMap.values()) {
provider.initWidgets();
}
}
use of com.talosvfx.talos.editor.widgets.propertyWidgets.IPropertyProvider in project talos by rockbite.
the class PropertyPanel method build.
public void build() {
container.clear();
Array<IPropertyProvider> list = new Array<>();
for (IPropertyProvider provider : providerSet.values()) {
list.add(provider);
}
list.sort(new Comparator<IPropertyProvider>() {
@Override
public int compare(IPropertyProvider o1, IPropertyProvider o2) {
return o1.getPriority() - o2.getPriority();
}
});
panelList.clear();
providerPanelMap.clear();
for (IPropertyProvider provider : list) {
PropertiesPanel panel = new PropertiesPanel(provider, getSkin());
container.add(panel).growX().top().padBottom(5);
container.row();
panelList.add(panel);
providerPanelMap.put(provider, panel);
}
}
use of com.talosvfx.talos.editor.widgets.propertyWidgets.IPropertyProvider in project talos by rockbite.
the class PropertyPanel method showPanel.
public void showPanel(IPropertyHolder target, Iterable<IPropertyProvider> propertyProviders) {
providerSet.clear();
for (IPropertyProvider propertyProvider : propertyProviders) {
if (propertyProvider.getType() == null)
continue;
providerSet.put(propertyProvider.getType(), propertyProvider);
}
build();
currentPropertyHolder = target;
}
Aggregations