Add chars_per_player setting

This commit is contained in:
Tim Van Baak 2020-01-30 23:28:57 -08:00
parent 92e12ae83c
commit c6bbccb6c3
3 changed files with 8 additions and 0 deletions

View File

@ -20,6 +20,7 @@
"open": false, "open": false,
"password": null, "password": null,
"max_players": 4, "max_players": 4,
"chars_per_player": 1,
"joined": [] "joined": []
}, },
"publish": { "publish": {

View File

@ -70,6 +70,10 @@ class LexiconConfigForm(FlaskForm):
"Maximum number of players", "Maximum number of players",
widget=NumberInput(), widget=NumberInput(),
validators=[DataRequired()]) validators=[DataRequired()])
joinCharsPerPlayer = IntegerField(
"Characters per player",
widget=NumberInput(),
validators=[DataRequired()])
# Publish # Publish
publishNotifyEditorOnReady = BooleanField( publishNotifyEditorOnReady = BooleanField(
"Notify the editor when a player marks an article as ready") "Notify the editor when a player marks an article as ready")
@ -137,6 +141,7 @@ class LexiconConfigForm(FlaskForm):
self.joinOpen.data = lexicon.join.open self.joinOpen.data = lexicon.join.open
self.joinPassword.data = lexicon.join.password self.joinPassword.data = lexicon.join.password
self.joinMaxPlayers.data = lexicon.join.max_players self.joinMaxPlayers.data = lexicon.join.max_players
self.joinCharsPerPlayer.data = lexicon.join.chars_per_player
self.publishNotifyEditorOnReady.data = lexicon.publish.notify.editor_on_ready self.publishNotifyEditorOnReady.data = lexicon.publish.notify.editor_on_ready
self.publishNotifyPlayerOnReject.data = lexicon.publish.notify.player_on_reject self.publishNotifyPlayerOnReject.data = lexicon.publish.notify.player_on_reject
self.publishNotifyPlayerOnAccept.data = lexicon.publish.notify.player_on_accept self.publishNotifyPlayerOnAccept.data = lexicon.publish.notify.player_on_accept
@ -171,6 +176,7 @@ class LexiconConfigForm(FlaskForm):
l.join.open = self.joinOpen.data l.join.open = self.joinOpen.data
l.join.password = self.joinPassword.data l.join.password = self.joinPassword.data
l.join.max_players = self.joinMaxPlayers.data l.join.max_players = self.joinMaxPlayers.data
l.join.chars_per_player = self.joinCharsPerPlayer.data
l.publish.notify.editor_on_ready = self.publishNotifyEditorOnReady.data l.publish.notify.editor_on_ready = self.publishNotifyEditorOnReady.data
l.publish.notify.player_on_reject = self.publishNotifyPlayerOnReject.data l.publish.notify.player_on_reject = self.publishNotifyPlayerOnReject.data
l.publish.notify.player_on_accept = self.publishNotifyPlayerOnAccept.data l.publish.notify.player_on_accept = self.publishNotifyPlayerOnAccept.data

View File

@ -71,6 +71,7 @@
{{ form.joinPassword(autocomplete="off") }} {{ form.joinPassword(autocomplete="off") }}
{{ form.joinPassword.label }}<br> {{ form.joinPassword.label }}<br>
{{ number_setting(form.joinMaxPlayers) }} {{ number_setting(form.joinMaxPlayers) }}
{{ number_setting(form.joinCharsPerPlayer) }}
</p> </p>
<h3>Turn Publishing</h3> <h3>Turn Publishing</h3>