File tree Expand file tree Collapse file tree
src/main/kotlin/dev/isxander/yacl3/dsl Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -125,6 +125,9 @@ interface GroupDsl : Buildable<OptionGroup> {
125125 fun descriptionBuilder (block : OptionDescription .Builder .() -> Unit )
126126 fun OptionDescription.Builder.addDefaultText (lines : Int? = null) =
127127 addDefaultText(" $groupKey .description" , lines)
128+
129+ fun collapsed (collapsed : Boolean )
130+ var collapsed: Boolean
128131}
129132
130133interface OptionDsl <T > : Option .Builder <T >, Buildable <Option <T >> {
Original file line number Diff line number Diff line change @@ -168,8 +168,15 @@ class GroupDslImpl(
168168 private val optionFutures = mutableMapOf<String , CompletableFuture <Option <* >>>()
169169 private fun createOptionFuture (id : String ) = optionFutures.computeIfAbsent(id) { CompletableFuture () }
170170
171+ override var collapsed: Boolean = false
172+ set(value) {
173+ field = value
174+ builder.collapsed(value)
175+ }
176+
171177 init {
172178 builder.name(Component .translatable(groupKey))
179+ collapsed = false
173180 }
174181
175182 override val options: OptionRegistrar = OptionRegistrarImpl (
@@ -196,6 +203,10 @@ class GroupDslImpl(
196203 addDefaultText(" $groupKey .description" , lines)
197204 }
198205
206+ override fun collapsed (collapsed : Boolean ) {
207+ this .collapsed = collapsed
208+ }
209+
199210 override fun build (): OptionGroup =
200211 builder.build().also {
201212 thisGroup.complete(it)
You can’t perform that action at this time.
0 commit comments