Skip to content

Commit

Permalink
Merge pull request #142 from Nat1anWasTaken/feat-display-rework
Browse files Browse the repository at this point in the history
feat(lava/classes/player.py): update button styles and labels for con…
  • Loading branch information
Nat1anWasTaken authored Jun 12, 2024
2 parents afb99da + 4a0e25b commit cdde7a8
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 30 deletions.
73 changes: 44 additions & 29 deletions lava/classes/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,61 +162,76 @@ async def update_display(self,
else:
components = [
ActionRow(
Button(
style=ButtonStyle.green if self.shuffle else ButtonStyle.grey,
emoji=self.bot.get_icon('control.shuffle', "🔀"),
custom_id="control.shuffle"
),
Button(
style=ButtonStyle.blurple,
emoji=self.bot.get_icon('control.previous', "⏮️"),
custom_id="control.previous"
),
Button(
style=ButtonStyle.green,
emoji=self.bot.get_icon('control.pause', "⏸️"),
custom_id="control.pause"
custom_id="control.pause",
label=self.bot.get_text("display.control.pause", self.locale, "暫停")
) if not self.paused else Button(
style=ButtonStyle.red,
emoji=self.bot.get_icon('control.resume', "▶️"),
custom_id="control.resume"
custom_id="control.resume",
label=self.bot.get_text("display.control.resume", self.locale, "繼續")
),
Button(
style=ButtonStyle.blurple,
emoji=self.bot.get_icon('control.next', "⏭️"),
custom_id="control.next"
emoji=self.bot.get_icon('control.previous', "⏮️"),
custom_id="control.previous",
label=self.bot.get_text("display.control.previous", self.locale, "重新開始")
),
Button(
style=[ButtonStyle.grey, ButtonStyle.green, ButtonStyle.blurple][self.loop],
emoji=self.bot.get_icon('control.repeat', "🔁"),
custom_id="control.repeat"
style=ButtonStyle.blurple,
emoji=self.bot.get_icon('control.next', "⏭️"),
custom_id="control.next",
label=self.bot.get_text("display.control.next", self.locale, "跳過")
)
),
ActionRow(
Button(
style=ButtonStyle.green if self.autoplay else ButtonStyle.grey,
emoji=self.bot.get_icon('control.autoplay', "🔥"),
custom_id="control.autoplay"
style=ButtonStyle.red,
emoji=self.bot.get_icon('control.stop', "⏹️"),
custom_id="control.stop",
label=self.bot.get_text("display.control.stop", self.locale, "停止")
),
Button(
style=ButtonStyle.blurple,
emoji=self.bot.get_icon('control.rewind', "⏪"),
custom_id="control.rewind"
),
Button(
style=ButtonStyle.red,
emoji=self.bot.get_icon('control.stop', "⏹️"),
custom_id="control.stop"
custom_id="control.rewind",
label=self.bot.get_text("display.control.rewind", self.locale, "倒帶十秒")
),
Button(
style=ButtonStyle.blurple,
emoji=self.bot.get_icon('control.forward', "⏩"),
custom_id="control.forward"
custom_id="control.forward",
label=self.bot.get_text("display.control.forward", self.locale, "快進十秒")
)
),
ActionRow(
Button(
style=ButtonStyle.green if self.shuffle else ButtonStyle.grey,
emoji=self.bot.get_icon('control.shuffle', "🔀"),
custom_id="control.shuffle",
label=self.bot.get_text("display.control.shuffle", self.locale, "隨機播放")
),
Button(
style=[ButtonStyle.grey, ButtonStyle.green, ButtonStyle.blurple][self.loop],
emoji=self.bot.get_icon('control.repeat', "🔁"),
custom_id="control.repeat",
label=self.bot.get_text("display.control.repeat", self.locale, "重複播放")
)
),
ActionRow(
Button(
style=ButtonStyle.green if self.autoplay else ButtonStyle.grey,
emoji=self.bot.get_icon('control.autoplay', "🎶"),
custom_id="control.autoplay",
label=self.bot.get_text("display.control.autoplay", self.locale, "自動播放")
),
Button(
style=ButtonStyle.green if self.show_lyrics else ButtonStyle.grey,
emoji=self.bot.get_icon('lyrics', "💬"),
custom_id="control.lyrics"
emoji=self.bot.get_icon('control.lyrics', "🎤"),
custom_id="control.lyrics",
label=self.bot.get_text("display.control.lyrics", self.locale, "歌詞顯示")
)
)
]
Expand Down
13 changes: 12 additions & 1 deletion locale/zh_TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,16 @@
"display.disable": "關閉",
"display.footer": "如果你覺得音樂怪怪的,可以試著檢查看看效果器設定或是切換語音頻道地區",
"display.lyrics.title": "🎤 | 歌詞",
"display.lyrics.not_found": "*你得自己唱出這首歌的歌詞*"
"display.lyrics.not_found": "*你得自己唱出這首歌的歌詞*",
"display.control.pause": "暫停",
"display.control.resume": "繼續",
"display.control.previous": "重新開始",
"display.control.next": "跳過",
"display.control.stop": "停止",
"display.control.rewind": "倒帶十秒",
"display.control.forward": "快進十秒",
"display.control.shuffle": "隨機播放",
"display.control.repeat": "重複播放",
"display.control.autoplay": "自動播放",
"display.control.lyrics": "歌詞顯示"
}

0 comments on commit cdde7a8

Please sign in to comment.