aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/commands
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2024-09-24 10:28:06 +0200
committerGitHub <noreply@github.com>2024-09-24 10:28:06 +0200
commitcc8a3dba69e8f1474a33a7e47b32d452f11735fd (patch)
tree14d9ddc21d47f7bbeffc1f3f6acf9ae9bf083741 /src/main/java/at/hannibal2/skyhanni/features/commands
parent1e9764d1d1209177d4a939a9b812931a7d49a926 (diff)
downloadskyhanni-cc8a3dba69e8f1474a33a7e47b32d452f11735fd.tar.gz
skyhanni-cc8a3dba69e8f1474a33a7e47b32d452f11735fd.tar.bz2
skyhanni-cc8a3dba69e8f1474a33a7e47b32d452f11735fd.zip
Feature: /shnavigate (#2575)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/commands')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/commands/HelpCommand.kt14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/commands/HelpCommand.kt b/src/main/java/at/hannibal2/skyhanni/features/commands/HelpCommand.kt
index 1890c6293..0f07c47f8 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/commands/HelpCommand.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/commands/HelpCommand.kt
@@ -5,13 +5,10 @@ import at.hannibal2.skyhanni.utils.StringUtils.splitLines
import at.hannibal2.skyhanni.utils.chat.Text
import at.hannibal2.skyhanni.utils.chat.Text.asComponent
import at.hannibal2.skyhanni.utils.chat.Text.center
-import at.hannibal2.skyhanni.utils.chat.Text.fitToChat
import at.hannibal2.skyhanni.utils.chat.Text.hover
import at.hannibal2.skyhanni.utils.chat.Text.onClick
import at.hannibal2.skyhanni.utils.chat.Text.send
-import at.hannibal2.skyhanni.utils.chat.Text.style
import at.hannibal2.skyhanni.utils.chat.Text.suggest
-import net.minecraft.util.EnumChatFormatting
import net.minecraft.util.IChatComponent
import kotlin.math.ceil
@@ -20,11 +17,6 @@ object HelpCommand {
private const val COMMANDS_PER_PAGE = 15
private const val HELP_ID = -6457563
- private fun createDivider() = Text.HYPHEN.fitToChat().style {
- strikethrough = true
- color = EnumChatFormatting.BLUE
- }
-
private fun createCommandEntry(command: Commands.CommandInfo): IChatComponent {
val category = command.category
val color = category.color
@@ -60,7 +52,7 @@ object HelpCommand {
val text = mutableListOf<IChatComponent>()
- text.add(createDivider())
+ text.add(Text.createDivider())
text.add(title.asComponent().center())
text.add(
Text.join(
@@ -77,7 +69,7 @@ object HelpCommand {
} else null,
).center(),
)
- text.add(createDivider())
+ text.add(Text.createDivider())
if (filtered.isEmpty()) {
text.add(Text.EMPTY)
@@ -91,7 +83,7 @@ object HelpCommand {
}
}
- text.add(createDivider())
+ text.add(Text.createDivider())
Text.multiline(text).send(HELP_ID)
}