1
0
mirror of https://gitlab.com/Deukhoofd/BattleSim.git synced 2025-10-29 02:30:05 +00:00

Added /timer command for enabling the timer after battle has started

This commit is contained in:
Deukhoofd
2016-04-12 19:45:15 +02:00
parent cd9ea965bb
commit 9ca2a8746c
13 changed files with 298 additions and 114 deletions

View File

@@ -58,13 +58,17 @@ class @challengePaneObject
format = defaultformat()
# Toggle state when you press the button.
if !$button.hasClass('disabled')
team = getSelectedTeam()
unless team
alert("You need to create a team using the Teambuilder before you can battle.")
PokeBattle.navigation.showTeambuilder()
return
disableButtons()
teamJSON = team.toNonNullJSON().pokemon
if $eventName is "findBattleRandom"
teamJSON = []
disableButtons()
else
team = getSelectedTeam()
unless team
alert("You need to create a team using the Teambuilder before you can battle.")
PokeBattle.navigation.showTeambuilder()
return
disableButtons()
teamJSON = team.toNonNullJSON().pokemon
# Send the event
PokeBattle.primus.send($eventName, format, teamJSON, options.selectedAlt)
$button.addClass('disabled').trigger('challenge')