From 5ef159e1b5d03914d52accde6e75d7cf954768af Mon Sep 17 00:00:00 2001 From: MattMX Date: Mon, 15 Jul 2024 12:23:31 +0100 Subject: [PATCH] added another root placeholder dsl --- api/src/main/kotlin/com/mattmx/ktgui/papi/dsl.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/api/src/main/kotlin/com/mattmx/ktgui/papi/dsl.kt b/api/src/main/kotlin/com/mattmx/ktgui/papi/dsl.kt index 38a3456..50ae31d 100644 --- a/api/src/main/kotlin/com/mattmx/ktgui/papi/dsl.kt +++ b/api/src/main/kotlin/com/mattmx/ktgui/papi/dsl.kt @@ -17,4 +17,11 @@ fun PlaceholderExpansionWrapper.placeholder(string: String, supplier: Placeholde Placeholder(this, ChainCommandBuilder(string), supplier).apply { registerPlaceholder(this) } fun PlaceholderExpansionWrapper.placeholder(chain: ChainCommandBuilder, supplier: PlaceholderParseContext.() -> Any?) = - Placeholder(this, chain, supplier).apply { registerPlaceholder(this) } \ No newline at end of file + Placeholder(this, chain, supplier).apply { registerPlaceholder(this) } + +fun PlaceholderExpansionWrapper.placeholder(argument: Argument<*>, supplier: PlaceholderParseContext.() -> Any?) = + Placeholder( + this, + Placeholder.emptyCommandBuilder().argument(argument), + supplier + ).apply { registerPlaceholder(this) } \ No newline at end of file