Search in sources :

Example 1 with IPropertyProvider

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);
        }
    }
}
Also used : IPropertyProvider(com.talosvfx.talos.editor.widgets.propertyWidgets.IPropertyProvider) PropertyWidget(com.talosvfx.talos.editor.widgets.propertyWidgets.PropertyWidget)

Example 2 with IPropertyProvider

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;
}
Also used : Array(com.badlogic.gdx.utils.Array) FilePropertyProvider(com.talosvfx.talos.editor.addons.scene.utils.FilePropertyProvider) GameObject(com.talosvfx.talos.editor.addons.scene.logic.GameObject) IPropertyProvider(com.talosvfx.talos.editor.widgets.propertyWidgets.IPropertyProvider) Prefab(com.talosvfx.talos.editor.addons.scene.logic.Prefab)

Example 3 with IPropertyProvider

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();
    }
}
Also used : Array(com.badlogic.gdx.utils.Array) IPropertyProvider(com.talosvfx.talos.editor.widgets.propertyWidgets.IPropertyProvider)

Example 4 with IPropertyProvider

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);
    }
}
Also used : Array(com.badlogic.gdx.utils.Array) PropertiesPanel(com.talosvfx.talos.editor.addons.bvb.PropertiesPanel) IPropertyProvider(com.talosvfx.talos.editor.widgets.propertyWidgets.IPropertyProvider)

Example 5 with IPropertyProvider

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;
}
Also used : IPropertyProvider(com.talosvfx.talos.editor.widgets.propertyWidgets.IPropertyProvider)

Aggregations

IPropertyProvider (com.talosvfx.talos.editor.widgets.propertyWidgets.IPropertyProvider)7 Array (com.badlogic.gdx.utils.Array)4 PropertiesPanel (com.talosvfx.talos.editor.addons.bvb.PropertiesPanel)1 GameObject (com.talosvfx.talos.editor.addons.scene.logic.GameObject)1 Prefab (com.talosvfx.talos.editor.addons.scene.logic.Prefab)1 FilePropertyProvider (com.talosvfx.talos.editor.addons.scene.utils.FilePropertyProvider)1 PropertyWidget (com.talosvfx.talos.editor.widgets.propertyWidgets.PropertyWidget)1