i forgor secondary

This commit is contained in:
Chayapak 2023-05-10 18:00:24 +07:00
parent 18fb46c008
commit 005cb0d3a4
5 changed files with 15 additions and 15 deletions

View file

@ -93,7 +93,7 @@ public class HelpCommand {
usages.add( usages.add(
Component Component
.text(node.getName()) .text(node.getName())
.color(TextColor.fromHexString("#c95367")) .color(TextColor.fromHexString(config.color().secondary()))
.append(Component.space()) .append(Component.space())
.append( .append(
Component Component

View file

@ -44,7 +44,7 @@ public class InfoCommand {
.append(Component.text(" - A utility bot for free-operator servers with minimal or no restrictions", NamedTextColor.GRAY)) .append(Component.text(" - A utility bot for free-operator servers with minimal or no restrictions", NamedTextColor.GRAY))
.append(Component.newline()) .append(Component.newline())
.append(Component.text("Made by ", NamedTextColor.GRAY)) .append(Component.text("Made by ", NamedTextColor.GRAY))
.append(Component.text("_ChipMC_", TextColor.fromHexString("#c95367"))) .append(Component.text("_ChipMC_", TextColor.fromHexString(client.config().color().secondary())))
.append(Component.text(" and contributors", NamedTextColor.GRAY)) .append(Component.text(" and contributors", NamedTextColor.GRAY))
.append(Component.newline()) .append(Component.newline())
.append(Component.text("Original Repository: ", NamedTextColor.GRAY)) .append(Component.text("Original Repository: ", NamedTextColor.GRAY))
@ -107,7 +107,7 @@ public class InfoCommand {
return Component.translatable( return Component.translatable(
"%s: %s", "%s: %s",
key.color(TextColor.fromHexString(client.config().color().primary())), key.color(TextColor.fromHexString(client.config().color().primary())),
value.color(TextColor.fromHexString("#c95367")) value.color(TextColor.fromHexString(client.config().color().secondary()))
); );
} }

View file

@ -158,7 +158,7 @@ public class MusicCommand {
final File file = new File(directory, filename); final File file = new File(directory, filename);
if (!file.isDirectory()) continue; if (!file.isDirectory()) continue;
final TextColor color = (i++ & 1) == 0 ? TextColor.fromHexString("#c95367") : TextColor.fromHexString(client.config().color().primary()); final TextColor color = (i++ & 1) == 0 ? TextColor.fromHexString(client.config().color().secondary()) : TextColor.fromHexString(client.config().color().primary());
final Path relativeFilepath = Path.of(relativePath, filename); final Path relativeFilepath = Path.of(relativePath, filename);
final String escapedPath = escapePath(relativeFilepath.toString()); final String escapedPath = escapePath(relativeFilepath.toString());
@ -174,7 +174,7 @@ public class MusicCommand {
final File file = new File(directory, filename); final File file = new File(directory, filename);
if (file.isDirectory()) continue; if (file.isDirectory()) continue;
final TextColor color = (i++ & 1) == 0 ? TextColor.fromHexString("#c95367") : TextColor.fromHexString(client.config().color().primary()); final TextColor color = (i++ & 1) == 0 ? TextColor.fromHexString(client.config().color().secondary()) : TextColor.fromHexString(client.config().color().primary());
final Path relativeFilepath = Path.of(relativePath, filename); final Path relativeFilepath = Path.of(relativePath, filename);
final String escapedPath = escapePath(relativeFilepath.toString()); final String escapedPath = escapePath(relativeFilepath.toString());

View file

@ -37,7 +37,7 @@ public class NetMsgCommand {
final Component message = Component.translatable( final Component message = Component.translatable(
"[%s] %s \u203a %s", "[%s] %s \u203a %s",
Component.text(client.session().getHost() + ":" + client.session().getPort(), NamedTextColor.GRAY), Component.text(client.session().getHost() + ":" + client.session().getPort(), NamedTextColor.GRAY),
Component.empty().color(TextColor.fromHexString("#c95367")).append(source.displayName()), Component.empty().color(TextColor.fromHexString(client.config().color().secondary())).append(source.displayName()),
Component.text(input, NamedTextColor.GRAY) Component.text(input, NamedTextColor.GRAY)
).color(NamedTextColor.DARK_GRAY); ).color(NamedTextColor.DARK_GRAY);

View file

@ -55,7 +55,7 @@ public class SongPlayer extends SessionAdapter {
try { try {
final SongLoaderThread _loaderThread = new SongLoaderThread(location); final SongLoaderThread _loaderThread = new SongLoaderThread(location);
client.chat().tellraw(Component.translatable("Loading %s", Component.text(location.getFileName().toString(), TextColor.fromHexString("#c95367"))).color(TextColor.fromHexString(client.config().color().primary()))); client.chat().tellraw(Component.translatable("Loading %s", Component.text(location.getFileName().toString(), TextColor.fromHexString(client.config().color().secondary()))).color(TextColor.fromHexString(client.config().color().primary())));
_loaderThread.start(); _loaderThread.start();
loaderThread = _loaderThread; loaderThread = _loaderThread;
} catch (SongLoaderException e) { } catch (SongLoaderException e) {
@ -72,7 +72,7 @@ public class SongPlayer extends SessionAdapter {
try { try {
final SongLoaderThread _loaderThread = new SongLoaderThread(location); final SongLoaderThread _loaderThread = new SongLoaderThread(location);
client.chat().tellraw(Component.translatable("Loading %s", Component.text(location.toString(), TextColor.fromHexString("#c95367"))).color(TextColor.fromHexString(client.config().color().primary()))); client.chat().tellraw(Component.translatable("Loading %s", Component.text(location.toString(), TextColor.fromHexString(client.config().color().secondary()))).color(TextColor.fromHexString(client.config().color().primary())));
_loaderThread.start(); _loaderThread.start();
loaderThread = _loaderThread; loaderThread = _loaderThread;
} catch (SongLoaderException e) { } catch (SongLoaderException e) {
@ -93,7 +93,7 @@ public class SongPlayer extends SessionAdapter {
client.chat().tellraw(Component.translatable("Failed to load song: %s", loaderThread.exception.message()).color(NamedTextColor.RED)); client.chat().tellraw(Component.translatable("Failed to load song: %s", loaderThread.exception.message()).color(NamedTextColor.RED));
} else { } else {
songQueue.add(loaderThread.song); songQueue.add(loaderThread.song);
client.chat().tellraw(Component.translatable("Added %s to the song queue", Component.empty().append(loaderThread.song.name).color(TextColor.fromHexString("#c95367"))).color(TextColor.fromHexString(client.config().color().primary()))); client.chat().tellraw(Component.translatable("Added %s to the song queue", Component.empty().append(loaderThread.song.name).color(TextColor.fromHexString(client.config().color().secondary()))).color(TextColor.fromHexString(client.config().color().primary())));
} }
loaderThread = null; loaderThread = null;
} }
@ -102,7 +102,7 @@ public class SongPlayer extends SessionAdapter {
if (songQueue.size() == 0) return; if (songQueue.size() == 0) return;
currentSong = songQueue.poll(); currentSong = songQueue.poll();
client.chat().tellraw(Component.translatable("Now playing %s", Component.empty().append(currentSong.name).color(TextColor.fromHexString("#c95367"))).color(TextColor.fromHexString(client.config().color().primary()))); client.chat().tellraw(Component.translatable("Now playing %s", Component.empty().append(currentSong.name).color(TextColor.fromHexString(client.config().color().secondary()))).color(TextColor.fromHexString(client.config().color().primary())));
currentSong.play(); currentSong.play();
} }
@ -116,14 +116,14 @@ public class SongPlayer extends SessionAdapter {
handlePlaying(); handlePlaying();
if (currentSong.finished()) { if (currentSong.finished()) {
client.chat().tellraw(Component.translatable("Finished playing %s", Component.empty().append(currentSong.name).color(TextColor.fromHexString("#c95367"))).color(TextColor.fromHexString(client.config().color().primary()))); client.chat().tellraw(Component.translatable("Finished playing %s", Component.empty().append(currentSong.name).color(TextColor.fromHexString(client.config().color().secondary()))).color(TextColor.fromHexString(client.config().color().primary())));
currentSong = null; currentSong = null;
} }
} }
public Component generateActionbar () { public Component generateActionbar () {
Component component = Component.empty() Component component = Component.empty()
.append(Component.translatable("Now playing %s", Component.empty().append(currentSong.name).color(TextColor.fromHexString("#c95367"))).color(TextColor.fromHexString(client.config().color().primary()))) .append(Component.translatable("Now playing %s", Component.empty().append(currentSong.name).color(TextColor.fromHexString(client.config().color().secondary()))).color(TextColor.fromHexString(client.config().color().primary())))
.append(Component.translatable(" | ", NamedTextColor.DARK_GRAY)) .append(Component.translatable(" | ", NamedTextColor.DARK_GRAY))
.append(Component.translatable("%s / %s", formatTime(currentSong.time).color(TextColor.fromHexString(client.config().color().primary())), formatTime(currentSong.length).color(TextColor.fromHexString(client.config().color().primary()))).color(NamedTextColor.GRAY)) .append(Component.translatable("%s / %s", formatTime(currentSong.time).color(TextColor.fromHexString(client.config().color().primary())), formatTime(currentSong.length).color(TextColor.fromHexString(client.config().color().primary()))).color(NamedTextColor.GRAY))
.append(Component.translatable(" | ", NamedTextColor.DARK_GRAY)) .append(Component.translatable(" | ", NamedTextColor.DARK_GRAY))
@ -132,19 +132,19 @@ public class SongPlayer extends SessionAdapter {
if (currentSong.paused) { if (currentSong.paused) {
return component return component
.append(Component.translatable(" | ", NamedTextColor.DARK_GRAY)) .append(Component.translatable(" | ", NamedTextColor.DARK_GRAY))
.append(Component.translatable("Paused", TextColor.fromHexString("#c95367"))); .append(Component.translatable("Paused", TextColor.fromHexString(client.config().color().secondary())));
} }
if (currentSong.looping) { if (currentSong.looping) {
if (currentSong.loopCount > 0) { if (currentSong.loopCount > 0) {
return component return component
.append(Component.translatable(" | ", NamedTextColor.DARK_GRAY)) .append(Component.translatable(" | ", NamedTextColor.DARK_GRAY))
.append(Component.translatable("Looping (%s/%s)", Component.text(currentSong.currentLoop), Component.text(currentSong.loopCount)).color(TextColor.fromHexString("#c95367"))); .append(Component.translatable("Looping (%s/%s)", Component.text(currentSong.currentLoop), Component.text(currentSong.loopCount)).color(TextColor.fromHexString(client.config().color().secondary())));
} }
return component return component
.append(Component.translatable(" | ", NamedTextColor.DARK_GRAY)) .append(Component.translatable(" | ", NamedTextColor.DARK_GRAY))
.append(Component.translatable("Looping", TextColor.fromHexString("#c95367"))); .append(Component.translatable("Looping", TextColor.fromHexString(client.config().color().secondary())));
} }
return component; return component;