Skip to content

Commit

Permalink
fix: Smol fix
Browse files Browse the repository at this point in the history
  • Loading branch information
phinner committed Sep 24, 2024
1 parent a6e96e1 commit f1425a3
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,17 @@ class MapSearchCommand(instances: InstanceManager) : ImperiumApplication.Listene
Button.success(MAP_SEARCH_FIRST_BUTTON, "First").withDisabled(state.page == 0),
Button.success(MAP_SEARCH_LAST_BUTTON, "Last").withDisabled(state.page == pages))

val entries = (MindustryGamemode.entries + null)
components +=
ActionRow.of(
StringSelectMenu.create(MAP_SEARCH_GAMEMODE_SELECT)
.setPlaceholder("Gamemode")
.setMinValues(0)
.setMaxValues(MindustryGamemode.entries.size)
.setMaxValues(entries.size)
.setDefaultValues(state.gamemodes.map { it?.name ?: NONE_GAMEMODE })
.apply {
val options =
(MindustryGamemode.entries + null).associateWith {
entries.associateWith {
val name = it?.name ?: NONE_GAMEMODE
SelectOption.of(name.lowercase().replace("_", " "), name)
}
Expand Down

0 comments on commit f1425a3

Please sign in to comment.