Skip to content

Commit

Permalink
Ship number warning added
Browse files Browse the repository at this point in the history
  • Loading branch information
Patschke committed Mar 22, 2019
1 parent 5a7d0ed commit daf4af9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions coffeescripts/cards-de.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ exportObj.translations.Deutsch =
'.unreleased-content-used .translated': 'Diese Staffel verwendet nicht veröffentlicheten Inhalt!'
'.loading-failed-container .translated': 'Du scheinst einem defekten Link gefolgt zu sein. Es konnte kein Squad geladen werden!'
'.collection-invalid .translated': 'Du kannst diese Staffel nicht mit deiner Sammlung aufstellen!'
'.ship-number-invalid-container .translated': 'Eine Turnierlegale Staffel muss 2-8 Schiffe haben!'
# Type selector
'.game-type-selector option[value="standard"]': 'Standard'
'.game-type-selector option[value="hyperspace"]': 'Hyperspace'
Expand Down
1 change: 1 addition & 0 deletions coffeescripts/cards-en.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ exportObj.translations.English =
'.unreleased-content-used .translated': 'This squad uses unreleased content!'
'.loading-failed-container .translated': 'It appears that you followed a broken link. No squad could be loaded!'
'.collection-invalid .translated': 'You cannot field this list with your collection!'
'.ship-number-invalid-container .translated': 'A tournament legal squad must contain 2-8 ships!'
# Type selector
'.game-type-selector option[value="standard"]': 'Extended'
'.game-type-selector option[value="hyperspace"]': 'Hyperspace'
Expand Down
4 changes: 4 additions & 0 deletions coffeescripts/xwing.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ class exportObj.SquadBuilder
<span class="content-warning unreleased-content-used hidden"><br /><i class="fa fa-exclamation-circle"></i>&nbsp;<span class="translated"></span></span>
<span class="content-warning loading-failed-container hidden"><br /><i class="fa fa-exclamation-circle"></i>&nbsp;<span class="translated"></span></span>
<span class="content-warning collection-invalid hidden"><br /><i class="fa fa-exclamation-circle"></i>&nbsp;<span class="translated"></span></span>
<span class="content-warning ship-number-invalid-container hidden"><br /><i class="fa fa-exclamation-circle"></i>&nbsp;<span class="translated"></span></span>
</div>
<div class="span5 pull-right button-container">
<div class="btn-group pull-right">
Expand Down Expand Up @@ -582,6 +583,7 @@ class exportObj.SquadBuilder
@points_remaining_container = $ @points_container.find('.points-remaining-container')
@unreleased_content_used_container = $ @points_container.find('.unreleased-content-used')
@loading_failed_container = $ @points_container.find('.loading-failed-container')
@ship_number_invalid_container = $ @points_container.find('.ship-number-invalid-container')
@collection_invalid_container = $ @points_container.find('.collection-invalid')
@view_list_button = $ @status_container.find('div.button-container button.view-as-text')
@randomize_button = $ @status_container.find('div.button-container button.randomize')
Expand Down Expand Up @@ -1533,6 +1535,7 @@ class exportObj.SquadBuilder
builder: this
container: @ship_container
@ships.push new_ship
@ship_number_invalid_container.toggleClass 'hidden', (@ships.length < 10 and @ships.length > 2) # bounds are 2..10 as we always have a "empty" ship at the bottom
new_ship


Expand All @@ -1542,6 +1545,7 @@ class exportObj.SquadBuilder
await @container.trigger 'xwing:pointsUpdated', defer()
@current_squad.dirty = true
@container.trigger 'xwing-backend:squadDirtinessChanged'
@ship_number_invalid_container.toggleClass 'hidden', (@ships.length < 10 and @ships.length > 2)
cb()

matcher: (item, term) ->
Expand Down

0 comments on commit daf4af9

Please sign in to comment.