use of com.talosvfx.talos.editor.widgets.propertyWidgets.PropertyWidget in project talos by rockbite.
the class ParticleComponent method getListOfProperties.
@Override
public Array<PropertyWidget> getListOfProperties() {
Array<PropertyWidget> properties = new Array<>();
AssetSelectWidget descriptorWidget = new AssetSelectWidget("Effect", "p", new Supplier<String>() {
@Override
public String get() {
FileHandle fileHandle = Gdx.files.absolute(path);
return fileHandle.path();
}
}, new PropertyWidget.ValueChanged<String>() {
@Override
public void report(String value) {
path = value;
reloadDescriptor();
}
});
ButtonPropertyWidget<String> linkedToWidget = new ButtonPropertyWidget<String>("Effect Project", "Edit", new ButtonPropertyWidget.ButtonListener<String>() {
@Override
public void clicked(ButtonPropertyWidget<String> widget) {
String link = widget.getValue();
if (link.isEmpty()) {
FileHandle sample = Gdx.files.internal("addons/scene/missing/sample.tls");
FileHandle thisEffect = AssetImporter.get(path);
FileHandle destination;
if (!path.isEmpty() && thisEffect.exists()) {
// idk which scenario is this
} else {
String projectPath = SceneEditorAddon.get().workspace.getProjectPath();
destination = AssetImporter.attemptToImport(sample);
FileHandle pHandle = AssetImporter.makeSimilar(destination, "p");
FileHandle texture = Gdx.files.internal("addons/scene/missing/white.png");
FileHandle textureDst = Gdx.files.absolute(projectPath + File.separator + "assets/white.png");
texture.copyTo(textureDst);
path = pHandle.path();
linkedTo = destination.path();
Notifications.fireEvent(Notifications.obtainEvent(ComponentUpdated.class).set(ParticleComponent.this, false));
TalosMain.Instance().ProjectController().setProject(ProjectController.TLS);
TalosMain.Instance().ProjectController().loadProject(destination);
}
} else {
FileHandle fileHandle = AssetImporter.get(link);
TalosMain.Instance().ProjectController().setProject(ProjectController.TLS);
TalosMain.Instance().ProjectController().loadProject(fileHandle);
}
}
}, new Supplier<String>() {
@Override
public String get() {
return linkedTo;
}
}, new PropertyWidget.ValueChanged<String>() {
@Override
public void report(String value) {
linkedTo = value;
}
});
properties.add(descriptorWidget);
properties.add(linkedToWidget);
properties.addAll(super.getListOfProperties());
return properties;
}
use of com.talosvfx.talos.editor.widgets.propertyWidgets.PropertyWidget in project talos by rockbite.
the class SpineRendererComponent method getListOfProperties.
@Override
public Array<PropertyWidget> getListOfProperties() {
Array<PropertyWidget> properties = new Array<>();
AssetSelectWidget atlasWidget = new AssetSelectWidget("Atlas", "atlas", new Supplier<String>() {
@Override
public String get() {
return path;
}
}, new PropertyWidget.ValueChanged<String>() {
@Override
public void report(String value) {
path = value;
reloadAtlas();
}
});
properties.add(atlasWidget);
Array<PropertyWidget> superList = super.getListOfProperties();
properties.addAll(superList);
return properties;
}
use of com.talosvfx.talos.editor.widgets.propertyWidgets.PropertyWidget in project talos by rockbite.
the class FilePropertyProvider method getListOfProperties.
@Override
public Array<PropertyWidget> getListOfProperties() {
Array<PropertyWidget> properties = new Array<>();
LabelWidget nameWidget = new LabelWidget("Name", new Supplier<String>() {
@Override
public String get() {
return fileHandle.name();
}
});
ButtonPropertyWidget<String> actionWidget = new ButtonPropertyWidget<String>("action", "Open", new ButtonPropertyWidget.ButtonListener<String>() {
@Override
public void clicked(ButtonPropertyWidget<String> widget) {
AssetImporter.fileOpen(fileHandle);
}
});
properties.add(nameWidget);
properties.add(actionWidget);
return properties;
}
use of com.talosvfx.talos.editor.widgets.propertyWidgets.PropertyWidget in project talos by rockbite.
the class SpineMetadata method getListOfProperties.
@Override
public Array<PropertyWidget> getListOfProperties() {
Array<PropertyWidget> propertyWidgets = new Array<>();
propertyWidgets.add(WidgetFactory.generate(this, "scale", "Scale"));
AssetSelectWidget atlasWidget = new AssetSelectWidget("Atlas", "atlas", new Supplier<String>() {
@Override
public String get() {
return atlasPath;
}
}, new PropertyWidget.ValueChanged<String>() {
@Override
public void report(String value) {
atlasPath = value;
}
});
propertyWidgets.add(atlasWidget);
return propertyWidgets;
}
Aggregations