From 0ec79c5a46a99fefc01ec16132c421431d17781a Mon Sep 17 00:00:00 2001 From: Waffle <151867877+Wafflr450@users.noreply.github.com> Date: Sat, 13 Jul 2024 19:47:05 +0200 Subject: [PATCH 01/27] Create birdflop-presets.kt --- src/main/kotlin/birdflop-presets.kt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/main/kotlin/birdflop-presets.kt diff --git a/src/main/kotlin/birdflop-presets.kt b/src/main/kotlin/birdflop-presets.kt new file mode 100644 index 0000000..23a35bf --- /dev/null +++ b/src/main/kotlin/birdflop-presets.kt @@ -0,0 +1,14 @@ +// This file adds the rgb.birdflop.com presets + +package chattore + +val birdflopGradients = mapOf( + "birdflop" to arrayOf( + "##084CFB", + "#ADF3FD" + ), +) + +val birdflopPresets = birdflopGradients.mapValues { (_, colors) -> + "" + }.toSortedMap() From ca97aa420edc07e07ecacdc7643a14fc14a2d2c4 Mon Sep 17 00:00:00 2001 From: Waffle <151867877+Wafflr450@users.noreply.github.com> Date: Sun, 14 Jul 2024 10:40:46 +0200 Subject: [PATCH 02/27] Add all presets --- src/main/kotlin/birdflop-presets.kt | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/main/kotlin/birdflop-presets.kt b/src/main/kotlin/birdflop-presets.kt index 23a35bf..dc9bcfe 100644 --- a/src/main/kotlin/birdflop-presets.kt +++ b/src/main/kotlin/birdflop-presets.kt @@ -7,6 +7,42 @@ val birdflopGradients = mapOf( "##084CFB", "#ADF3FD" ), + "SimplyMC" to arrrayOF ( + "#084CFB", + "#ADF3FD" + ), + "Rainbow" to arrrayOF ( + "#FF0000", + "#FF7F00", + "#FFFF00", + "#00FF00", + "#0000FF", + "#EAE4AA" + ), + "Skyline" to arrrayOF ( + "#1488CC", + "#2B32B2" + ), + "Mango" to arrrayOF ( + "#1488CC", + "2B32B2" + ), + "Waffle" to arrrayOF ( + "#1488CC", + "#2B32B2" + ), + "Dawn" to arrrayOF ( + "#1488CC", + "#2B32B2" + ), + "Rose" to arrrayOF ( + "#1488CC", + "#2B32B2" + ), + "Firewatch" to arrrayOF ( + "#1488CC", + "#2B32B2" + ), ) val birdflopPresets = birdflopGradients.mapValues { (_, colors) -> From ac71c8088c740fc07c6db819a57c485039ce31f6 Mon Sep 17 00:00:00 2001 From: Waffle <151867877+Wafflr450@users.noreply.github.com> Date: Sun, 14 Jul 2024 10:55:49 +0200 Subject: [PATCH 03/27] Update ChattORESpec.kt --- src/main/kotlin/entity/ChattORESpec.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/entity/ChattORESpec.kt b/src/main/kotlin/entity/ChattORESpec.kt index fa0d3c8..ba03976 100644 --- a/src/main/kotlin/entity/ChattORESpec.kt +++ b/src/main/kotlin/entity/ChattORESpec.kt @@ -2,6 +2,7 @@ package chattore.entity import com.uchuhimo.konf.ConfigSpec import chattore.pridePresets +import chattore.birdflopPresets object ChattORESpec : ConfigSpec("") { @@ -46,5 +47,5 @@ object ChattORESpec : ConfigSpec("") { val leaveDiscord by optional("** has left the network**") } - val nicknamePresets by optional(pridePresets) + val nicknamePresets by optional(pridePresets + birdflopPresets) } From b3e1b8fac0d6171b03866853a5e830c751d2dadb Mon Sep 17 00:00:00 2001 From: Waffle <151867877+Wafflr450@users.noreply.github.com> Date: Sun, 14 Jul 2024 11:02:43 +0200 Subject: [PATCH 04/27] Update ChattORESpec.kt --- src/main/kotlin/entity/ChattORESpec.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/entity/ChattORESpec.kt b/src/main/kotlin/entity/ChattORESpec.kt index ba03976..d965bb5 100644 --- a/src/main/kotlin/entity/ChattORESpec.kt +++ b/src/main/kotlin/entity/ChattORESpec.kt @@ -3,6 +3,7 @@ package chattore.entity import com.uchuhimo.konf.ConfigSpec import chattore.pridePresets import chattore.birdflopPresets +import chattore.playerPresets object ChattORESpec : ConfigSpec("") { @@ -47,5 +48,8 @@ object ChattORESpec : ConfigSpec("") { val leaveDiscord by optional("** has left the network**") } - val nicknamePresets by optional(pridePresets + birdflopPresets) + val nicknamePresetsPride by optional(pridePresets) + val nicknamePresetsBirdflop by optional(birdflopPresets) + val nicknamePresetsPlayers by optional(playerPresets) + } From 16b93b0aae14b32e9eeef40b664abaebc62a79a9 Mon Sep 17 00:00:00 2001 From: Waffle <151867877+Wafflr450@users.noreply.github.com> Date: Sun, 14 Jul 2024 11:04:30 +0200 Subject: [PATCH 05/27] Update birdflop-presets.kt --- src/main/kotlin/birdflop-presets.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/birdflop-presets.kt b/src/main/kotlin/birdflop-presets.kt index dc9bcfe..8c992dc 100644 --- a/src/main/kotlin/birdflop-presets.kt +++ b/src/main/kotlin/birdflop-presets.kt @@ -27,7 +27,7 @@ val birdflopGradients = mapOf( "#1488CC", "2B32B2" ), - "Waffle" to arrrayOF ( + "Vice City" to arrrayOF ( "#1488CC", "#2B32B2" ), From 5e388234f809d920d830bd01c0365cde1987c6ad Mon Sep 17 00:00:00 2001 From: Waffle <151867877+Wafflr450@users.noreply.github.com> Date: Sun, 14 Jul 2024 11:05:22 +0200 Subject: [PATCH 06/27] Create player-presets.kt --- src/main/kotlin/player-presets.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/main/kotlin/player-presets.kt diff --git a/src/main/kotlin/player-presets.kt b/src/main/kotlin/player-presets.kt new file mode 100644 index 0000000..5f39e48 --- /dev/null +++ b/src/main/kotlin/player-presets.kt @@ -0,0 +1,13 @@ +// This file adds famous Player's presets + +package chattore +val playerColors = mapOf( + "Waffle" to arrrayOF ( + "#1488CC", + "#2B32B2" + ), +) + +val playerPresets = playerColors.mapValues { (_, colors) -> + "" + }.toSortedMap() From 23792f608cf29920382a639a77432b5cd15a010e Mon Sep 17 00:00:00 2001 From: Waffle <151867877+Wafflr450@users.noreply.github.com> Date: Sun, 14 Jul 2024 11:05:38 +0200 Subject: [PATCH 07/27] Rename Pride.kt to pride-presets.kt --- src/main/kotlin/{Pride.kt => pride-presets.kt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/main/kotlin/{Pride.kt => pride-presets.kt} (100%) diff --git a/src/main/kotlin/Pride.kt b/src/main/kotlin/pride-presets.kt similarity index 100% rename from src/main/kotlin/Pride.kt rename to src/main/kotlin/pride-presets.kt From 44f282c0338e8dbef043b05e4f5341d5718b9caf Mon Sep 17 00:00:00 2001 From: Waffle <151867877+Wafflr450@users.noreply.github.com> Date: Sun, 14 Jul 2024 11:09:55 +0200 Subject: [PATCH 08/27] Update Nick.kt --- src/main/kotlin/commands/Nick.kt | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/commands/Nick.kt b/src/main/kotlin/commands/Nick.kt index f586ee8..f53e250 100644 --- a/src/main/kotlin/commands/Nick.kt +++ b/src/main/kotlin/commands/Nick.kt @@ -89,10 +89,17 @@ class Nick(private val chattORE: ChattORE) : BaseCommand() { @Subcommand("presets") @CommandPermission("chattore.nick.preset") - @CommandCompletion("@username") - fun presets(player: Player, @Optional shownText: String?) { + @CommandCompletion("pride|birdflop|players") + fun presets(player: Player, @Optional shownText: String?, @Optional type: String?) { + val presets = when (type?.lowercase()) { + "pride" -> pridePresets + "birdflop" -> birdflopPresets + "players" -> playerPresets + else -> mapOf() + } + val renderedPresets = ArrayList() - for ((presetName, preset) in chattORE.config[ChattORESpec.nicknamePresets]) { + for ((presetName, preset) in presets) { val applyPreset: (String) -> Component = { preset.render(mapOf( "username" to Component.text(it) @@ -114,7 +121,7 @@ class Nick(private val chattORE: ChattORE) : BaseCommand() { } renderedPresets.add(rendered) } - + val response = chattORE.config[ChattORESpec.format.chattore].render( "Available presets: ".render( Component.join(JoinConfiguration.commas(true), renderedPresets) From 86cef786580a603962fb38d7379e73dc00315f83 Mon Sep 17 00:00:00 2001 From: Waffle <151867877+Wafflr450@users.noreply.github.com> Date: Sun, 14 Jul 2024 11:13:53 +0200 Subject: [PATCH 09/27] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 36cd226..7b3cfb0 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Because we want to have a chat system that actually wOREks for us. | `/profile about ` | `chattore.profile.about` | Set your about | `/playerprofile` | | `/profile setabout ` | `chattore.profile.about.others` | Set another player's about | `/playerprofile` | | `/nick color +` | `chattore.nick` | Set your nickname with at least one color (up to three) | No aliases | -| `/nick presets` | `chattore.nick.preset` | View available presets | No aliases | +| `/nick presets ` | `chattore.nick.preset` | View available presets | No aliases | | `/nick preset ` | `chattore.nick.preset` | Apply a nickname preset | No aliases | | `/nick nick ` | `chattore.nick.others` | Set a player's nickname | No aliases | | `/nick remove ` | `chattore.nick.remove` | Remove a player's nickname | No aliases | From ad119268416789a9908685edbe5532e8a058c269 Mon Sep 17 00:00:00 2001 From: Waffle <151867877+Wafflr450@users.noreply.github.com> Date: Sun, 14 Jul 2024 11:18:54 +0200 Subject: [PATCH 10/27] Update README.md --- README.md | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 7b3cfb0..8117067 100644 --- a/README.md +++ b/README.md @@ -4,24 +4,24 @@ Because we want to have a chat system that actually wOREks for us. ## Commands -| Command | Permission | Description | Aliases | -|---------------------------------------|---------------------------------|----------------------------------------------------------|----------------------------------------------------| -| `/chattore version` | `chattore.manage` | View the version of Chattore | No aliases | -| `/chattore reload` | `chattore.manage` | Reload Chattore configuration | No aliases | -| `/emoji +` | `chattore.emoji` | View multiple emojis | No aliases | -| `/ac ` | `chattore.helpop` | Message ORE Staff | No aliases | -| `/mail mailbox` | `chattore.mail` | Manage your mailbox | `/mailbox\|/mail` | -| `/mail send ` | `chattore.mail` | Send a mail message | No aliases | -| `/mail read ` | `chattore.mail` | Read a mail message (Designed for usage with `/mailbox`) | No aliases | -| `/me ` | `chattore.me` | Have a thought in chat | No aliases | -| `/message ` | `chattore.message` | Send a message to a player | `/m\|/pm\|/msg\|/vmsg\|/vmessage\|/whisper\|/tell` | -| `/reply ` | `chattore.message` | Reply to a message | `/playerprofile` | -| `/profile info ` | `chattore.profile` | View a player's profile | `/playerprofile` | -| `/profile about ` | `chattore.profile.about` | Set your about | `/playerprofile` | -| `/profile setabout ` | `chattore.profile.about.others` | Set another player's about | `/playerprofile` | -| `/nick color +` | `chattore.nick` | Set your nickname with at least one color (up to three) | No aliases | -| `/nick presets ` | `chattore.nick.preset` | View available presets | No aliases | -| `/nick preset ` | `chattore.nick.preset` | Apply a nickname preset | No aliases | -| `/nick nick ` | `chattore.nick.others` | Set a player's nickname | No aliases | -| `/nick remove ` | `chattore.nick.remove` | Remove a player's nickname | No aliases | -| `/nick setgradient +` | `chattore.nick.setgradient` | Set a gradient for a user | No aliases | +| Command | Permission | Description | Aliases | +|------------------------------------------|---------------------------------|----------------------------------------------------------|----------------------------------------------------| +| `/chattore version` | `chattore.manage` | View the version of Chattore | No aliases | +| `/chattore reload` | `chattore.manage` | Reload Chattore configuration | No aliases | +| `/emoji +` | `chattore.emoji` | View multiple emojis | No aliases | +| `/ac ` | `chattore.helpop` | Message ORE Staff | No aliases | +| `/mail mailbox` | `chattore.mail` | Manage your mailbox | `/mailbox\|/mail` | +| `/mail send ` | `chattore.mail` | Send a mail message | No aliases | +| `/mail read ` | `chattore.mail` | Read a mail message (Designed for usage with `/mailbox`) | No aliases | +| `/me ` | `chattore.me` | Have a thought in chat | No aliases | +| `/message ` | `chattore.message` | Send a message to a player | `/m\|/pm\|/msg\|/vmsg\|/vmessage\|/whisper\|/tell` | +| `/reply ` | `chattore.message` | Reply to a message | `/playerprofile` | +| `/profile info ` | `chattore.profile` | View a player's profile | `/playerprofile` | +| `/profile about ` | `chattore.profile.about` | Set your about | `/playerprofile` | +| `/profile setabout ` | `chattore.profile.about.others` | Set another player's about | `/playerprofile` | +| `/nick color +` | `chattore.nick` | Set your nickname with at least one color (up to three) | No aliases | +| `/nick presets ` | `chattore.nick.preset` | View available presets | No aliases | +| `/nick preset ` | `chattore.nick.preset` | Apply a nickname preset | No aliases | +| `/nick nick ` | `chattore.nick.others` | Set a player's nickname | No aliases | +| `/nick remove ` | `chattore.nick.remove` | Remove a player's nickname | No aliases | +| `/nick setgradient +` | `chattore.nick.setgradient` | Set a gradient for a user | No aliases | From 7366f6ce76dbbba936fecc34050ee13ef19814ba Mon Sep 17 00:00:00 2001 From: Waffle <151867877+Wafflr450@users.noreply.github.com> Date: Sun, 14 Jul 2024 11:20:23 +0200 Subject: [PATCH 11/27] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8117067..919d14c 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Because we want to have a chat system that actually wOREks for us. | `/profile about ` | `chattore.profile.about` | Set your about | `/playerprofile` | | `/profile setabout ` | `chattore.profile.about.others` | Set another player's about | `/playerprofile` | | `/nick color +` | `chattore.nick` | Set your nickname with at least one color (up to three) | No aliases | -| `/nick presets ` | `chattore.nick.preset` | View available presets | No aliases | +| `/nick presets ` | `chattore.nick.preset` | View available presets | No aliases | | `/nick preset ` | `chattore.nick.preset` | Apply a nickname preset | No aliases | | `/nick nick ` | `chattore.nick.others` | Set a player's nickname | No aliases | | `/nick remove ` | `chattore.nick.remove` | Remove a player's nickname | No aliases | From a80b4e763ba97b2523a1ac0b6886e72db140c016 Mon Sep 17 00:00:00 2001 From: Waffle <151867877+Wafflr450@users.noreply.github.com> Date: Sun, 14 Jul 2024 11:20:47 +0200 Subject: [PATCH 12/27] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 919d14c..2c3e1cb 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Because we want to have a chat system that actually wOREks for us. | `/profile about ` | `chattore.profile.about` | Set your about | `/playerprofile` | | `/profile setabout ` | `chattore.profile.about.others` | Set another player's about | `/playerprofile` | | `/nick color +` | `chattore.nick` | Set your nickname with at least one color (up to three) | No aliases | -| `/nick presets ` | `chattore.nick.preset` | View available presets | No aliases | +| `/nick presets ` | `chattore.nick.preset` | View available presets | No aliases | | `/nick preset ` | `chattore.nick.preset` | Apply a nickname preset | No aliases | | `/nick nick ` | `chattore.nick.others` | Set a player's nickname | No aliases | | `/nick remove ` | `chattore.nick.remove` | Remove a player's nickname | No aliases | From 6756a972a38e21f854d70f277f91bfe23ee61c0d Mon Sep 17 00:00:00 2001 From: Waffle <151867877+Wafflr450@users.noreply.github.com> Date: Sun, 14 Jul 2024 23:43:50 +0200 Subject: [PATCH 13/27] Update birdflop-presets.kt --- src/main/kotlin/birdflop-presets.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/birdflop-presets.kt b/src/main/kotlin/birdflop-presets.kt index 8c992dc..c190ad4 100644 --- a/src/main/kotlin/birdflop-presets.kt +++ b/src/main/kotlin/birdflop-presets.kt @@ -4,7 +4,7 @@ package chattore val birdflopGradients = mapOf( "birdflop" to arrayOf( - "##084CFB", + "#084CFB", "#ADF3FD" ), "SimplyMC" to arrrayOF ( From 19714aefd9e0ba01c59a4755b77bca9e870fa511 Mon Sep 17 00:00:00 2001 From: Waffle <151867877+Wafflr450@users.noreply.github.com> Date: Sun, 14 Jul 2024 23:44:41 +0200 Subject: [PATCH 14/27] Update birdflop-presets.kt --- src/main/kotlin/birdflop-presets.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/birdflop-presets.kt b/src/main/kotlin/birdflop-presets.kt index c190ad4..06f8507 100644 --- a/src/main/kotlin/birdflop-presets.kt +++ b/src/main/kotlin/birdflop-presets.kt @@ -25,7 +25,7 @@ val birdflopGradients = mapOf( ), "Mango" to arrrayOF ( "#1488CC", - "2B32B2" + "#2B32B2" ), "Vice City" to arrrayOF ( "#1488CC", From c312816c8748ddb63f9c35a8accd33319a09ae43 Mon Sep 17 00:00:00 2001 From: Waffle <151867877+Wafflr450@users.noreply.github.com> Date: Mon, 15 Jul 2024 17:53:06 +0200 Subject: [PATCH 15/27] Update Nick.kt --- src/main/kotlin/commands/Nick.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/commands/Nick.kt b/src/main/kotlin/commands/Nick.kt index f53e250..6b96bfd 100644 --- a/src/main/kotlin/commands/Nick.kt +++ b/src/main/kotlin/commands/Nick.kt @@ -90,16 +90,18 @@ class Nick(private val chattORE: ChattORE) : BaseCommand() { @Subcommand("presets") @CommandPermission("chattore.nick.preset") @CommandCompletion("pride|birdflop|players") - fun presets(player: Player, @Optional shownText: String?, @Optional type: String?) { - val presets = when (type?.lowercase()) { + fun presets(player: Player, @Optional shownText: String?, @Optional type: String?) { + val additionalPresets = when (type?.lowercase()) { "pride" -> pridePresets "birdflop" -> birdflopPresets "players" -> playerPresets else -> mapOf() } + val combinedPresets = chattORE.config[ChattORESpec.nicknamePresets] + additionalPresets + val renderedPresets = ArrayList() - for ((presetName, preset) in presets) { + for ((presetName, preset) in combinedPresets) { val applyPreset: (String) -> Component = { preset.render(mapOf( "username" to Component.text(it) From a81a23b3a3dcb4c47437d6e01fd1dd2c060fac5d Mon Sep 17 00:00:00 2001 From: Waffle <151867877+Wafflr450@users.noreply.github.com> Date: Mon, 15 Jul 2024 17:56:24 +0200 Subject: [PATCH 16/27] Different structure --- src/main/kotlin/entity/ChattORESpec.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/kotlin/entity/ChattORESpec.kt b/src/main/kotlin/entity/ChattORESpec.kt index d965bb5..f7147f9 100644 --- a/src/main/kotlin/entity/ChattORESpec.kt +++ b/src/main/kotlin/entity/ChattORESpec.kt @@ -47,9 +47,6 @@ object ChattORESpec : ConfigSpec("") { val joinDiscord by optional("** has joined the network**") val leaveDiscord by optional("** has left the network**") } - - val nicknamePresetsPride by optional(pridePresets) - val nicknamePresetsBirdflop by optional(birdflopPresets) - val nicknamePresetsPlayers by optional(playerPresets) + val nicknamePresets by optional(pridePresets + birdflopPresets + playerPresets) } From 0efdbe4b2481adabfc827063ecba57977bf65ce6 Mon Sep 17 00:00:00 2001 From: Waffle <151867877+Wafflr450@users.noreply.github.com> Date: Mon, 15 Jul 2024 17:59:10 +0200 Subject: [PATCH 17/27] Update Config --- src/main/kotlin/entity/ChattORESpec.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/entity/ChattORESpec.kt b/src/main/kotlin/entity/ChattORESpec.kt index f7147f9..be9bf05 100644 --- a/src/main/kotlin/entity/ChattORESpec.kt +++ b/src/main/kotlin/entity/ChattORESpec.kt @@ -47,6 +47,10 @@ object ChattORESpec : ConfigSpec("") { val joinDiscord by optional("** has joined the network**") val leaveDiscord by optional("** has left the network**") } - val nicknamePresets by optional(pridePresets + birdflopPresets + playerPresets) + object nicknamePresets : ConfigSpec() { + val pride by optional(pridePresets) + val birdflop by optional(birdflopPresets) + val players by optional(playerPresets) + } } From 729ebaf0026bf95cda03c5942249cd673f10ecf5 Mon Sep 17 00:00:00 2001 From: Waffle <151867877+Wafflr450@users.noreply.github.com> Date: Mon, 15 Jul 2024 18:00:48 +0200 Subject: [PATCH 18/27] Added support for config --- src/main/kotlin/commands/Nick.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/commands/Nick.kt b/src/main/kotlin/commands/Nick.kt index 6b96bfd..2626e7e 100644 --- a/src/main/kotlin/commands/Nick.kt +++ b/src/main/kotlin/commands/Nick.kt @@ -92,9 +92,9 @@ class Nick(private val chattORE: ChattORE) : BaseCommand() { @CommandCompletion("pride|birdflop|players") fun presets(player: Player, @Optional shownText: String?, @Optional type: String?) { val additionalPresets = when (type?.lowercase()) { - "pride" -> pridePresets - "birdflop" -> birdflopPresets - "players" -> playerPresets + "pride" -> chattORE.config[ChattORESpec.nicknamePresets.pride] + "birdflop" -> chattORE.config[ChattORESpec.nicknamePresets.birdflop] + "players" -> chattORE.config[ChattORESpec.nicknamePresets.players] else -> mapOf() } From 8e0fe608f8d0a82a460ea7cfe433bd4e46f7ddbe Mon Sep 17 00:00:00 2001 From: Waffle <151867877+Wafflr450@users.noreply.github.com> Date: Fri, 19 Jul 2024 08:54:32 +0200 Subject: [PATCH 19/27] Fixed arrayOf --- src/main/kotlin/birdflop-presets.kt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/kotlin/birdflop-presets.kt b/src/main/kotlin/birdflop-presets.kt index 06f8507..8a4071f 100644 --- a/src/main/kotlin/birdflop-presets.kt +++ b/src/main/kotlin/birdflop-presets.kt @@ -7,11 +7,11 @@ val birdflopGradients = mapOf( "#084CFB", "#ADF3FD" ), - "SimplyMC" to arrrayOF ( + "SimplyMC" to arrrayOf ( "#084CFB", "#ADF3FD" ), - "Rainbow" to arrrayOF ( + "Rainbow" to arrrayOf ( "#FF0000", "#FF7F00", "#FFFF00", @@ -19,27 +19,27 @@ val birdflopGradients = mapOf( "#0000FF", "#EAE4AA" ), - "Skyline" to arrrayOF ( + "Skyline" to arrrayOf ( "#1488CC", "#2B32B2" ), - "Mango" to arrrayOF ( + "Mango" to arrrayOf ( "#1488CC", "#2B32B2" ), - "Vice City" to arrrayOF ( + "Vice City" to arrrayOf ( "#1488CC", "#2B32B2" ), - "Dawn" to arrrayOF ( + "Dawn" to arrrayOf ( "#1488CC", "#2B32B2" ), - "Rose" to arrrayOF ( + "Rose" to arrrayOf ( "#1488CC", "#2B32B2" ), - "Firewatch" to arrrayOF ( + "Firewatch" to arrrayOf ( "#1488CC", "#2B32B2" ), From 32ddbd64016e5486c5b958f23c848788a9a64fdc Mon Sep 17 00:00:00 2001 From: Waffle <151867877+Wafflr450@users.noreply.github.com> Date: Fri, 19 Jul 2024 08:55:43 +0200 Subject: [PATCH 20/27] Fixed arrayOf --- src/main/kotlin/player-presets.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/player-presets.kt b/src/main/kotlin/player-presets.kt index 5f39e48..9b46a05 100644 --- a/src/main/kotlin/player-presets.kt +++ b/src/main/kotlin/player-presets.kt @@ -2,7 +2,7 @@ package chattore val playerColors = mapOf( - "Waffle" to arrrayOF ( + "Waffle" to arrrayOf ( "#1488CC", "#2B32B2" ), From 49b1c680f7d85b16c22958f1fee351226015fedb Mon Sep 17 00:00:00 2001 From: Waffle <151867877+Wafflr450@users.noreply.github.com> Date: Fri, 19 Jul 2024 08:02:07 +0000 Subject: [PATCH 21/27] Cleaned up the mess and the duplicated things --- src/main/kotlin/birdflop-presets.kt | 50 ---------------- src/main/kotlin/player-presets.kt | 13 ---- .../kotlin/{pride-presets.kt => presets.kt} | 59 +++++++++++++++++-- 3 files changed, 55 insertions(+), 67 deletions(-) delete mode 100644 src/main/kotlin/birdflop-presets.kt delete mode 100644 src/main/kotlin/player-presets.kt rename src/main/kotlin/{pride-presets.kt => presets.kt} (88%) diff --git a/src/main/kotlin/birdflop-presets.kt b/src/main/kotlin/birdflop-presets.kt deleted file mode 100644 index 8a4071f..0000000 --- a/src/main/kotlin/birdflop-presets.kt +++ /dev/null @@ -1,50 +0,0 @@ -// This file adds the rgb.birdflop.com presets - -package chattore - -val birdflopGradients = mapOf( - "birdflop" to arrayOf( - "#084CFB", - "#ADF3FD" - ), - "SimplyMC" to arrrayOf ( - "#084CFB", - "#ADF3FD" - ), - "Rainbow" to arrrayOf ( - "#FF0000", - "#FF7F00", - "#FFFF00", - "#00FF00", - "#0000FF", - "#EAE4AA" - ), - "Skyline" to arrrayOf ( - "#1488CC", - "#2B32B2" - ), - "Mango" to arrrayOf ( - "#1488CC", - "#2B32B2" - ), - "Vice City" to arrrayOf ( - "#1488CC", - "#2B32B2" - ), - "Dawn" to arrrayOf ( - "#1488CC", - "#2B32B2" - ), - "Rose" to arrrayOf ( - "#1488CC", - "#2B32B2" - ), - "Firewatch" to arrrayOf ( - "#1488CC", - "#2B32B2" - ), -) - -val birdflopPresets = birdflopGradients.mapValues { (_, colors) -> - "" - }.toSortedMap() diff --git a/src/main/kotlin/player-presets.kt b/src/main/kotlin/player-presets.kt deleted file mode 100644 index 9b46a05..0000000 --- a/src/main/kotlin/player-presets.kt +++ /dev/null @@ -1,13 +0,0 @@ -// This file adds famous Player's presets - -package chattore -val playerColors = mapOf( - "Waffle" to arrrayOf ( - "#1488CC", - "#2B32B2" - ), -) - -val playerPresets = playerColors.mapValues { (_, colors) -> - "" - }.toSortedMap() diff --git a/src/main/kotlin/pride-presets.kt b/src/main/kotlin/presets.kt similarity index 88% rename from src/main/kotlin/pride-presets.kt rename to src/main/kotlin/presets.kt index eeffe22..5291805 100644 --- a/src/main/kotlin/pride-presets.kt +++ b/src/main/kotlin/presets.kt @@ -1,6 +1,7 @@ -// This file is based on hyfetch, and was last updated 2024-06-12 +// This file adds presets. PridePresets are based on hyfetch, and were last updated 2024-06-12 // https://github.com/hykilpikonna/hyfetch/blob/7534371b05ee877cd3c4c3733b13d7c41d09c3e/hyfetch/presets.py + package chattore fun weighted(vararg colors: Pair): Array = @@ -519,6 +520,56 @@ val prideColors = mapOf( ), ) -val pridePresets = prideColors.mapValues { (_, colors) -> - "" - }.toSortedMap() +val birdflopColors = mapOf( + "birdflop" to arrayOf( + "#084CFB", + "#ADF3FD" + ), + "SimplyMC" to arrrayOf ( + "#084CFB", + "#ADF3FD" + ), + "Rainbow" to arrrayOf ( + "#FF0000", + "#FF7F00", + "#FFFF00", + "#00FF00", + "#0000FF", + "#EAE4AA" + ), + "Skyline" to arrrayOf ( + "#1488CC", + "#2B32B2" + ), + "Mango" to arrrayOf ( + "#1488CC", + "#2B32B2" + ), + "Vice City" to arrrayOf ( + "#1488CC", + "#2B32B2" + ), + "Dawn" to arrrayOf ( + "#1488CC", + "#2B32B2" + ), + "Rose" to arrrayOf ( + "#1488CC", + "#2B32B2" + ), + "Firewatch" to arrrayOf ( + "#1488CC", + "#2B32B2" + ), +) + +val playerColors = mapOf( + "Waffle" to arrrayOf ( + "#1488CC", + "#2B32B2" + ), +) + +val pridePresets = prideColors.toGradientMinimessage() +val birdflopPresets = birdflopColors.toGradientMinimessage() +val playerPresets = playerColors.toGradientMinimessage() From e0440e493b1c8871c7183eea4bf3b27d963967ba Mon Sep 17 00:00:00 2001 From: Waffle <151867877+Wafflr450@users.noreply.github.com> Date: Fri, 19 Jul 2024 08:03:51 +0000 Subject: [PATCH 22/27] Changed nicknamePresets in config --- src/main/kotlin/entity/ChattORESpec.kt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/entity/ChattORESpec.kt b/src/main/kotlin/entity/ChattORESpec.kt index be9bf05..8f66359 100644 --- a/src/main/kotlin/entity/ChattORESpec.kt +++ b/src/main/kotlin/entity/ChattORESpec.kt @@ -47,10 +47,12 @@ object ChattORESpec : ConfigSpec("") { val joinDiscord by optional("** has joined the network**") val leaveDiscord by optional("** has left the network**") } - object nicknamePresets : ConfigSpec() { - val pride by optional(pridePresets) - val birdflop by optional(birdflopPresets) - val players by optional(playerPresets) - } + val nicknamePresets by optional( + mapOf( + "pride" to prideColors.toGradientMinimessage(), + "birdflop" to birdflopColors.toGradientMinimessage(), + "players" to playerColors.toGradientMinimessage() + ) + ) } From e1f60339ae941aec48855ed843df19c6c89a5b12 Mon Sep 17 00:00:00 2001 From: Waffle <151867877+Wafflr450@users.noreply.github.com> Date: Fri, 19 Jul 2024 08:08:32 +0000 Subject: [PATCH 23/27] Fixed Nick.kt preset loading --- src/main/kotlin/commands/Nick.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/commands/Nick.kt b/src/main/kotlin/commands/Nick.kt index 2626e7e..49e099f 100644 --- a/src/main/kotlin/commands/Nick.kt +++ b/src/main/kotlin/commands/Nick.kt @@ -90,16 +90,16 @@ class Nick(private val chattORE: ChattORE) : BaseCommand() { @Subcommand("presets") @CommandPermission("chattore.nick.preset") @CommandCompletion("pride|birdflop|players") - fun presets(player: Player, @Optional shownText: String?, @Optional type: String?) { + fun presets(player: Player, @Optional shownText: String?, @Optional type: String?) { val additionalPresets = when (type?.lowercase()) { - "pride" -> chattORE.config[ChattORESpec.nicknamePresets.pride] - "birdflop" -> chattORE.config[ChattORESpec.nicknamePresets.birdflop] - "players" -> chattORE.config[ChattORESpec.nicknamePresets.players] + "pride" -> chattORE.config[ChattORESpec.nicknamePresets]["pride"] ?: mapOf() + "birdflop" -> chattORE.config[ChattORESpec.nicknamePresets]["birdflop"] ?: mapOf() + "players" -> chattORE.config[ChattORESpec.nicknamePresets]["players"] ?: mapOf() else -> mapOf() } val combinedPresets = chattORE.config[ChattORESpec.nicknamePresets] + additionalPresets - + val renderedPresets = ArrayList() for ((presetName, preset) in combinedPresets) { val applyPreset: (String) -> Component = { From 05f3994bcd995c806341159cdd427b8a6147df2b Mon Sep 17 00:00:00 2001 From: Waffle <151867877+Wafflr450@users.noreply.github.com> Date: Fri, 19 Jul 2024 12:18:36 +0200 Subject: [PATCH 24/27] =?UTF-8?q?Update=20presets.kt=20=F0=9F=87=A9?= =?UTF-8?q?=F0=9F=87=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit how did I write arrrayOF i wasnt even drunk or smth Yes ik beautiful commit message --- src/main/kotlin/presets.kt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/kotlin/presets.kt b/src/main/kotlin/presets.kt index 5291805..209e433 100644 --- a/src/main/kotlin/presets.kt +++ b/src/main/kotlin/presets.kt @@ -525,11 +525,11 @@ val birdflopColors = mapOf( "#084CFB", "#ADF3FD" ), - "SimplyMC" to arrrayOf ( + "SimplyMC" to arrayOf ( "#084CFB", "#ADF3FD" ), - "Rainbow" to arrrayOf ( + "Rainbow" to arrayOf ( "#FF0000", "#FF7F00", "#FFFF00", @@ -537,34 +537,34 @@ val birdflopColors = mapOf( "#0000FF", "#EAE4AA" ), - "Skyline" to arrrayOf ( + "Skyline" to arrayOf ( "#1488CC", "#2B32B2" ), - "Mango" to arrrayOf ( + "Mango" to arrayOf ( "#1488CC", "#2B32B2" ), - "Vice City" to arrrayOf ( + "Vice City" to arrayOf ( "#1488CC", "#2B32B2" ), - "Dawn" to arrrayOf ( + "Dawn" to arrayOf ( "#1488CC", "#2B32B2" ), - "Rose" to arrrayOf ( + "Rose" to arrayOf ( "#1488CC", "#2B32B2" ), - "Firewatch" to arrrayOf ( + "Firewatch" to arrayOf ( "#1488CC", "#2B32B2" ), ) val playerColors = mapOf( - "Waffle" to arrrayOf ( + "Waffle" to arrayOf ( "#1488CC", "#2B32B2" ), From 23038b8b01de6441dcd079a06b1309b14f6015ff Mon Sep 17 00:00:00 2001 From: Waffle <151867877+Wueffi@users.noreply.github.com> Date: Mon, 2 Sep 2024 17:36:36 +0200 Subject: [PATCH 25/27] spel fix --- src/main/kotlin/{presets.kt => Presets.kt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/main/kotlin/{presets.kt => Presets.kt} (100%) diff --git a/src/main/kotlin/presets.kt b/src/main/kotlin/Presets.kt similarity index 100% rename from src/main/kotlin/presets.kt rename to src/main/kotlin/Presets.kt From a394d6c62cc1577423748dd24df1d10686115510 Mon Sep 17 00:00:00 2001 From: Waffle <151867877+Wueffi@users.noreply.github.com> Date: Mon, 2 Sep 2024 17:39:59 +0200 Subject: [PATCH 26/27] fix presets then colors --- src/main/kotlin/entity/ChattORESpec.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/entity/ChattORESpec.kt b/src/main/kotlin/entity/ChattORESpec.kt index 8f66359..e544ded 100644 --- a/src/main/kotlin/entity/ChattORESpec.kt +++ b/src/main/kotlin/entity/ChattORESpec.kt @@ -49,9 +49,9 @@ object ChattORESpec : ConfigSpec("") { } val nicknamePresets by optional( mapOf( - "pride" to prideColors.toGradientMinimessage(), - "birdflop" to birdflopColors.toGradientMinimessage(), - "players" to playerColors.toGradientMinimessage() + "pride" to pridePresets.toGradientMinimessage(), + "birdflop" to birdflopPresets.toGradientMinimessage(), + "players" to playerPresets.toGradientMinimessage() ) ) From 92e773c94225d3940dd617dade85c1818c41b999 Mon Sep 17 00:00:00 2001 From: Waffle <151867877+Wueffi@users.noreply.github.com> Date: Mon, 2 Sep 2024 17:51:09 +0200 Subject: [PATCH 27/27] decalred a function in config :skull: --- src/main/kotlin/entity/ChattORESpec.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/kotlin/entity/ChattORESpec.kt b/src/main/kotlin/entity/ChattORESpec.kt index e544ded..838ffcc 100644 --- a/src/main/kotlin/entity/ChattORESpec.kt +++ b/src/main/kotlin/entity/ChattORESpec.kt @@ -47,6 +47,14 @@ object ChattORESpec : ConfigSpec("") { val joinDiscord by optional("** has joined the network**") val leaveDiscord by optional("** has left the network**") } + + fun Map>.toGradientMinimessage(): Map { + return this.mapValues { (_, colors) -> + "" + } + } + + val nicknamePresets by optional( mapOf( "pride" to pridePresets.toGradientMinimessage(),