feat: copy chat messages (#155)
Co-authored-by: Linnea Gräf <nea@nea.moe>
This commit is contained in:
25
src/main/kotlin/features/chat/CopyChat.kt
Normal file
25
src/main/kotlin/features/chat/CopyChat.kt
Normal file
@@ -0,0 +1,25 @@
|
||||
package moe.nea.firmament.features.chat
|
||||
|
||||
import net.minecraft.text.OrderedText
|
||||
import moe.nea.firmament.features.FirmamentFeature
|
||||
import moe.nea.firmament.gui.config.ManagedConfig
|
||||
import moe.nea.firmament.util.reconstitute
|
||||
|
||||
|
||||
object CopyChat : FirmamentFeature {
|
||||
override val identifier: String
|
||||
get() = "copy-chat"
|
||||
|
||||
object TConfig : ManagedConfig(identifier, Category.CHAT) {
|
||||
val copyChat by toggle("copy-chat") { false }
|
||||
}
|
||||
|
||||
override val config: ManagedConfig?
|
||||
get() = TConfig
|
||||
|
||||
fun orderedTextToString(orderedText: OrderedText): String {
|
||||
return orderedText.reconstitute().string
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user