@@ -5,6 +5,7 @@ import com.lambda.Lambda.mc
55import com.lambda.command.LambdaCommand
66import com.lambda.module.Module
77import com.lambda.threading.runSafe
8+ import com.lambda.util.StringUtils.capitalize
89import com.lambda.util.text.*
910import net.minecraft.client.toast.SystemToast
1011import net.minecraft.text.Text
@@ -53,48 +54,50 @@ object Communication {
5354 }
5455 }
5556
56- private fun Any.source (logLevel : LogLevel , color : Color = Color .GREY ) = buildText {
57+ private fun Any.source (
58+ logLevel : LogLevel ,
59+ color : Color = Color .GREY
60+ ) = buildText {
5761 text(logLevel.prefix())
5862
59- if (this @source is LambdaCommand ) {
60- styled(color, italic = true ) {
61- literal(" Command " )
62- }
63- }
64-
65- if (this @source is Module ) {
66- styled(color, italic = true ) {
67- literal(" Module " )
68- }
69- }
70-
71- // ToDo: HUD elements
72-
63+ // if (this@source is LambdaCommand) {
64+ // styled(color, italic = true) {
65+ // literal("Command ")
66+ // }
67+ // }
68+ //
69+ // if (this@source is Module) {
70+ // styled(color, italic = true) {
71+ // literal("Module ")
72+ // }
73+ // }
74+ //
75+ // // ToDo: HUD elements
76+ //
7377 if (this @source is Nameable ) {
74- styled(color, italic = true , underlined = true ) {
75- literal(name.replaceFirstChar( Char ::titlecase) )
78+ styled(color, italic = true ) {
79+ literal(" ${ name.capitalize()} " )
7680 }
7781 }
78-
79- styled(color, italic = true ) {
80- literal(" \$ " )
81- }
8282 }
8383
8484 private fun LogLevel.prefix () =
8585 buildText {
86- literal(" " )
8786 styled(logoColor) {
8887 literal(Lambda .SYMBOL )
8988 }
9089 literal(" " )
9190 }
9291
93- enum class LogLevel (val logoColor : Color , val messageColor : Color , val type : SystemToast .Type ) {
92+ enum class LogLevel (
93+ val logoColor : Color ,
94+ private val messageColor : Color ,
95+ val type : SystemToast .Type
96+ ) {
9497 DEBUG (Color .WHITE , Color .WHITE , SystemToast .Type .WORLD_BACKUP ),
9598 INFO (Color .GREEN , Color .WHITE , SystemToast .Type .NARRATOR_TOGGLE ),
9699 WARN (Color .YELLOW , Color .YELLOW , SystemToast .Type .WORLD_ACCESS_FAILURE ),
97- ERROR (Color .RED , Color .YELLOW , SystemToast .Type .WORLD_ACCESS_FAILURE );
100+ ERROR (Color .RED , Color .RED , SystemToast .Type .WORLD_ACCESS_FAILURE );
98101
99102 fun toast (title : Text , message : Text ): SystemToast =
100103 SystemToast .create(mc, type, title, message)
0 commit comments