Skip to content

Commit

Permalink
Disable search button when in no queues
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheikah45 committed Apr 23, 2023
1 parent 2cb56a7 commit 4c85e71
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,19 @@ public class TeamMatchmakingService implements InitializingBean {
public void afterPropertiesSet() throws Exception {
inQueue.bind(Bindings.createBooleanBinding(() -> queues.stream()
.map(MatchmakerQueueBean::getMatchingStatus)
.anyMatch(MatchingStatus.SEARCHING::equals), queues).or(searching));
.anyMatch(MatchingStatus.SEARCHING::equals), queues));

inQueue.addListener(((observable, oldValue, newValue) -> {
if (newValue) {
searching.set(true);
gameService.startSearchMatchmaker();
}

if (!newValue && !matchFoundAndWaitingForGameLaunch.get()) {
gameService.stopSearchMatchmaker();
if (!newValue) {
searching.set(false);
if (!matchFoundAndWaitingForGameLaunch.get()) {
gameService.stopSearchMatchmaker();
}
}
}));

Expand Down
7 changes: 4 additions & 3 deletions src/main/resources/i18n/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ teammatchmaking.notification.notPartyOwner.message=You cannot join or leave matc
teammatchmaking.playerTitle=Playing matchmaking as\:
teammatchmaking.partyTitle=Your party\:
teammatchmaking.searchButton=Play Forged Alliance Forever
teammatchmaking.searchButton.noQueueSelected=Select a queue to play
teammatchmaking.searchButton.noQueueSelected=Select one or more queues to play
teammatchmaking.searchButton.inGame=Can't join matchmaking while you are in a game
teammatchmaking.searchButton.memberInGame=Can't join matchmaking while someone is in a game
teammatchmaking.searchButton.inParty=The party leader will start matchmaking
Expand All @@ -988,8 +988,9 @@ review.delete.error=This review could not be deleted
review.save.error = This review could not be saved
settings.general.debugLog = Enable DEBUG logging
settings.general.debugLog.description = Increase the log level to DEBUG for troubleshooting.
settings.general.debugLog.button = Start
leaderboard.tmm_2v2.name = 2v2
settings.general.debugLog.button=Start
leaderboard.tmm_3v3.name=3v3
leaderboard.tmm_2v2.name=2v2
leaderboard.ladder_1v1.name = 1v1
leaderboard.global.name = Global
leaderboard.gamesPlayed = {0} Games Played\: {1,number,#}
Expand Down

0 comments on commit 4c85e71

Please sign in to comment.