Set default strings for macros in ConfigScreen

Signed-off-by: Username404-59 <w.iron.zombie@gmail.com>
This commit is contained in:
Username404-59 2026-02-22 03:24:27 +01:00
parent d8b37fc4ab
commit 630afa2e53
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1

View File

@ -5,6 +5,7 @@ import fr.username404.snowygui.gui.elements.ClickBox
import fr.username404.snowygui.gui.elements.ClickBox.Companion.sortAlphabetically
import fr.username404.snowygui.gui.feature.*
import fr.username404.snowygui.utils.FontUtil
import me.shedaniel.clothconfig2.gui.entries.StringListListEntry
import net.minecraft.client.gui.GuiGraphics
import net.minecraft.client.gui.screens.Screen
import net.minecraft.network.chat.Component
@ -74,7 +75,9 @@ val SnowyConfigScreen: Screen = object: Screen(translationComponent) {
}.build()).addEntry(startStrList(
Category.MACROS.box.name,
macrosButtons.getTitleCommand()
).setInsertInFront(false).setDefaultValue(Configuration.foundMacros.getTitleCommand()).setCellErrorSupplier { cell ->
).setCreateNewInstance {
entry -> StringListListEntry.StringListCell("ExampleMacro: say hello", entry)
}.setInsertInFront(false).setDefaultValue(Configuration.foundMacros.getTitleCommand()).setCellErrorSupplier { cell ->
with(cell.split(":")) {
supplyComponent(
when {