diff --git a/src/main/kotlin/dev/kikugie/soundboard/audio/download/Downloader.kt b/src/main/kotlin/dev/kikugie/soundboard/audio/download/Downloader.kt index bf31bb2..6a185ad 100644 --- a/src/main/kotlin/dev/kikugie/soundboard/audio/download/Downloader.kt +++ b/src/main/kotlin/dev/kikugie/soundboard/audio/download/Downloader.kt @@ -22,8 +22,8 @@ import java.nio.file.Path import kotlin.io.path.invariantSeparatorsPathString object Downloader { - private const val FAILURE = "soundboard.download.failure" - private const val SUCCESS = "soundboard.download.success" + private const val FAILURE = "soundboard.downloader.failure" + private const val SUCCESS = "soundboard.downloader.success" private val downloads: MutableMap> = mutableMapOf() fun isDownloading(path: Path) = path in downloads diff --git a/src/main/kotlin/dev/kikugie/soundboard/gui/screen/DownloadScreen.kt b/src/main/kotlin/dev/kikugie/soundboard/gui/screen/DownloadScreen.kt index eafaec7..bcf9dbb 100644 --- a/src/main/kotlin/dev/kikugie/soundboard/gui/screen/DownloadScreen.kt +++ b/src/main/kotlin/dev/kikugie/soundboard/gui/screen/DownloadScreen.kt @@ -36,6 +36,9 @@ class DownloadScreen : BaseOwoScreen() { const val URL = "soundboard.downloader.url" const val FOOTER = "soundboard.downloader.footer" + const val FILE_TOOLTIP = "soundboard.downloader.tooltip.path" + const val URL_TOOLTIP = "soundboard.downloader.tooltip.url" + const val DOWNLOAD = "soundboard.downloader.tooltip.download" const val OVERWRITE_PATH = "soundboard.downloader.tooltip.overwrite_path" const val DOWNLOADING_PATH = "soundboard.downloader.tooltip.downloading_path" @@ -60,7 +63,9 @@ class DownloadScreen : BaseOwoScreen() { root = component + setup() root.childById("container")!!.apply { gap = 2 - this += label(FILE_PATH.translation()) + this += label(FILE_PATH.translation()) { + tooltipText = FILE_TOOLTIP.translation() + } this += coloredTextBox { id = "path" maxLength = Short.MAX_VALUE.toInt() @@ -96,7 +101,9 @@ class DownloadScreen : BaseOwoScreen() { } this += fixedSpacer(4) - this += label(URL.translation()) + this += label(URL.translation()) { + tooltipText = URL_TOOLTIP.translation() + } this += horizontalFlow { gap = 2 verticalAlignment = VerticalAlignment.CENTER diff --git a/src/main/kotlin/dev/kikugie/soundboard/gui/widget/SidebarWidget.kt b/src/main/kotlin/dev/kikugie/soundboard/gui/widget/SidebarWidget.kt index 7ffc0e4..e56f8b4 100644 --- a/src/main/kotlin/dev/kikugie/soundboard/gui/widget/SidebarWidget.kt +++ b/src/main/kotlin/dev/kikugie/soundboard/gui/widget/SidebarWidget.kt @@ -3,8 +3,10 @@ package dev.kikugie.soundboard.gui.widget import com.mojang.blaze3d.systems.RenderSystem import dev.kikugie.kowoui.access.renderer import dev.kikugie.kowoui.access.sizing +import dev.kikugie.kowoui.access.tooltipText import dev.kikugie.kowoui.button import dev.kikugie.kowoui.experimental.plusAssign +import dev.kikugie.kowoui.translation import dev.kikugie.soundboard.gui.screen.DownloadScreen import dev.kikugie.soundboard.gui.screen.SoundBrowser import dev.kikugie.soundboard.util.currentScreen @@ -23,7 +25,7 @@ class SidebarWidget(private val current: Screen) : FlowLayout(fixed(16), content init { gap(2) - this += tab("sound-browser", 0) + this += tab("browser", 0) this += tab("downloader", 1) } @@ -32,6 +34,7 @@ class SidebarWidget(private val current: Screen) : FlowLayout(fixed(16), content sizing = fixed(16) renderer = texture(WIDGETS, index * 16, 0, 256, 256) active = current !is T + tooltipText = "soundboard.$name".translation() onPress { RenderSystem.recordRenderCall { currentScreen = T::class.createInstance() } } } } \ No newline at end of file diff --git a/src/main/resources/assets/soundboard/lang/en_us.yml b/src/main/resources/assets/soundboard/lang/en_us.yml index 5f46a4d..d2dd36c 100644 --- a/src/main/resources/assets/soundboard/lang/en_us.yml +++ b/src/main/resources/assets/soundboard/lang/en_us.yml @@ -13,6 +13,7 @@ soundboard: config: Open Soundboard config play: Play favourite sound (use with number keys) browser: + .: Sound browser tooltip: unavailable: Proximity chat muted or disconnected directory: Shift-click to open in your file manager @@ -26,11 +27,9 @@ soundboard: favourite: Add to favourites unfavourite: Remove from favourites downloader: - path: |- - Save location starting at '.minecraft/config/soundboard/'. - Files are saved as .wav - you don't need to type the extension. - url: |- - Source URL - check supported sources on the cobalt website. + .: Audio downloader + path: Save location + url: Source URL footer: - text: ⓘ color: gold @@ -48,13 +47,14 @@ soundboard: You're responsible for what you download, so be mindful when using the service. color: dark_gray bold: false - failure: - - text: Failed to save %s. Check the game log - color: red - success: - - text: Downloaded %s - color: green + failure: §4[Soundboard] Failed to save %s. Check the game log for more details + success: §a[Soundboard] Downloaded %s tooltip: + path: |- + Save location starting at '.minecraft/config/soundboard/'. + Files are saved as .wav - you don't need to type the extension. + url: |- + Video or audio link - check supported sources on the cobalt website. overwrite_path: File already exists and will be overwritten downloading_path: File is already being downloaded and will be overwritten invalid_path: Provided path is invalid