[orx-parameters, orx-property-watchers, orx-file-watcher, orx-gui] Add @PathParameter, file watcher delegates and property delegates

This commit is contained in:
Edwin Jakobs
2023-03-18 20:32:43 +01:00
parent bab525cd92
commit 84e623c3e8
20 changed files with 553 additions and 143 deletions

View File

@@ -31,6 +31,10 @@ fun Any.listParameters(): List<Parameter> {
var vectorRange = Pair(Vector2(-1.0, -1.0), Vector2(1.0, 1.0))
var invertY: Boolean? = null
var showVector: Boolean? = null
var absolutePath: Boolean? = null
var pathContext: String? = null
var pathExtensions: Array<String>? = null
var pathIsDirectory: Boolean? = null
for (it in annotations) {
type = ParameterType.forParameterAnnotationClass(it)
@@ -95,6 +99,13 @@ fun Any.listParameters(): List<Parameter> {
label = it.label
order = it.order
}
is PathParameter -> {
label = it.label
absolutePath = it.absolute
pathContext = it.context
pathExtensions = it.extensions
pathIsDirectory = it.directory
}
}
}
Parameter(
@@ -109,7 +120,12 @@ fun Any.listParameters(): List<Parameter> {
precision = precision,
showVector = showVector,
invertY = invertY,
order = order
absolutePath = absolutePath,
pathContext = pathContext,
pathExtensions = pathExtensions,
pathIsDirectory = pathIsDirectory,
order = order,
)
} + this::class.declaredMemberFunctions.filter {
it.findAnnotation<ActionParameter>() != null
@@ -130,6 +146,10 @@ fun Any.listParameters(): List<Parameter> {
precision = null,
showVector = null,
invertY = null,
absolutePath = null,
pathContext = null,
pathExtensions = null,
pathIsDirectory = null,
order = order
)
}).sortedBy { it.order }