Skip to content

Commit

Permalink
Minor Patches
Browse files Browse the repository at this point in the history
- Removed permission requirement to use the /achievements command.
- Added aliases "/ach" and "/achievement" to open the achievement menu.
- Modified the color scheme of the achievement menu to use darker colors for menu titles.
  • Loading branch information
Mew2K authored and chatasma committed Mar 27, 2024
1 parent d3de5b6 commit bb2d5f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class AchievementMenu(player: Player) : Listener {

// Creates and opens a main-menu GUI, which contains the six categories of achievements.
fun openMainMenu(): GUI {
return gui("${ChatColor.GOLD}${ChatColor.BOLD}Achievements", 1) {
return gui("${ChatColor.DARK_RED}${ChatColor.BOLD}Achievements", 1) {
val categories = listOf("Kills", "Losses", "Wins", "Deaths", "Objectives", "Misc")
for ((index, category) in categories.withIndex()) {
slot(index) {
Expand All @@ -45,7 +45,7 @@ class AchievementMenu(player: Player) : Listener {

// Creates and opens a category GUI, which contains all achievements of the specified category.
private fun openCategory(categoryName: String, page: Int = 1): GUI {
return gui("${ChatColor.AQUA}${ChatColor.BOLD}$categoryName", 6) {
return gui("${ChatColor.DARK_AQUA}${ChatColor.BOLD}$categoryName", 6) {
val achievements = getAchievementsForCategory(categoryName)
val categories = getCategoriesFromAchievements(achievements)

Expand Down Expand Up @@ -96,7 +96,7 @@ class AchievementMenu(player: Player) : Listener {

// Creates and opens an achievement details GUI, which contains all achievements of a specified category.
private fun openAchievementDetails(category: AchievementCategory, achievements: List<Achievement>, page: Int = 1): GUI {
return gui("${ChatColor.GREEN}${ChatColor.BOLD}${category.displayName}", 6) {
return gui("${ChatColor.DARK_GREEN}${ChatColor.BOLD}${category.displayName}", 6) {
val matchingAchievements = filterAchievementsWithCategory(category, achievements)

val (nonEdgeStart, nonEdgeEnd) = calculateNonEdgeIndices(matchingAchievements.size, page)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,8 @@ class MiscCommands {
}

@Command(
aliases = ["achievements"],
desc = "Open the achievements menu",
perms = ["mars.achievements"]
aliases = ["ach", "achievement", "achievements"],
desc = "Open the achievements menu"
)
fun onAchievementMenuRequest(
@Sender sender: Player,
Expand Down

0 comments on commit bb2d5f4

Please sign in to comment.